Re: [elixir-core:5671] Add boolean methods for different unicode character groups (String.alphanumeric?, etc)

2016-05-05 Thread Tallak Tveide
I did such an optimization in my library, but interestingly there was no improvement in performance and compiled size. I am guessing the compiler does a better job by default than my optimizations. :-P i believe the optimizations are still in the version history of codepagex -- You received th

[elixir-core:6001] Proposal: Rename lhs and rhs

2016-06-28 Thread Tallak Tveide
Actually this was thoroughly discussed when lhs rhs was sertled upon. so the current naming was not chosen by accudent, and at the time found the superior option. I still personally think lhs and rhs is fine, and being shown in the terminal, also quite a few characters less. This may prevent w

Re: [elixir-core:6089] Maybe Add A Warning For Including Commas In ~w List

2016-07-12 Thread Tallak Tveide
I wouldnt emit a warning here as adding commas should be perfectly valid. How would we deal with the use case where you wanted to include the commas? -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop re

[elixir-core:6386] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Tallak Tveide
You have my vote. Never used single tick lists much, and they were confusing to me, much due to baggage from Ruby/Perl where they are all strings. Making the syntax more explicit makes sense. Tallak -- You received this message because you are subscribed to the Google Groups "elixir-lang-cor

Re: [elixir-core:6593] Flow.chunk ?

2016-11-14 Thread Tallak Tveide
Hi! I guess I might make a stab at analyzing this. The code will create a list of the short sequences of length k that occur more than `t` times inside one of the longer sequences of length `l`. The order of these sequences is i undefined. What I read from Jose's reply was that the use of Flo

[elixir-core:6597] Proposal: Enum.reject for Enum.compact

2016-11-17 Thread Tallak Tveide
I assume you mean the default function should be ''' fn x -> !x end ''' To reject any falsey value. It does seem reasonable, but I dont think it is nearly as readable as 'compact', so I vote nay to this one... In fact, isn't this a better option? (Or equally good) ''' def filter(enum, fun \\ f

[elixir-core:6794] Pipeline-firendly variable assignment

2017-01-02 Thread Tallak Tveide
I had the same thought some time ago, with a code to prove the possibility. I have since decided it's a bad idea. There are many ways to extend Elixir 'irresponsbly' making code that is not clear and readable like core Elixir is. So by adding features like extended pipes and iteratable tuples

Re: [elixir-core:6893] Re: Sorting maps when inspecting

2017-02-15 Thread Tallak Tveide
I believe it would be useful to not sort if there are very many keys as well. A huge map would presumably be inspected in a short while, skipping keys after the first few. Inspecting a huge map could become cpu/memory intensive, which I would find surprising... anyways +1 from me -- You recei

Re: [elixir-core:6907] Re: Sorting maps when inspecting

2017-02-16 Thread Tallak Tveide
th cpu and memory to vuild sorted structure, and later would >>>> spend more cpu on its garbage collection. I don't like the idea of losing >>>> production performance only for development convenience. >>>> >>>> On 16 February 2017 07:25:51 GMT+1

Re: [elixir-core:6912] Any reason Enum.first and Enum.rest are not implemented?

2017-02-18 Thread Tallak Tveide
stream_split would do something like that. The tail is stored in a continuation function, so i'm not sure if this is 'good code', and i'd not vouch for putting something like that in stdlib without a thorough analysis (eg covering issues related to cleaning up the enumerable if the tail is not i

[elixir-core:7151] Re: Proposal: pipe and assign syntax

2017-05-20 Thread Tallak Tveide
Here's one way of solving this with macros: https://gist.github.com/tallakt/a6701b1e5c2808c85104 You don't need to modify the pipe operator.. keep it simple. And, please dont use my gist, just use `conn = ...` :) -- You received this message because you are subscribed to the Google Groups "

[elixir-core:7328] [Proposal] Control block with annotations and no commas

2017-07-24 Thread Tallak Tveide
I dont like it. Its too flexible. I believe the code becomes unwieldy as you can mix s lot of different stuff into the ctrl block. I believe this construct may promote complex code. Why do we need this? Elixir has excellent patten matching support that is lightyears ahead of the C class of la

[elixir-core:7333] Re: [Proposal] Control block with annotations and no commas

2017-07-25 Thread Tallak Tveide
Ok. Now I understand more. I believe the use of '|' is new? Tallak -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegrou

Re: [elixir-core:7441] Re: [Proposal] String.remove(subject, pattern)

2017-09-18 Thread Tallak Tveide
Hi. I think its a fine suggestion, and i agree that its more descriptiive than the alternatives. Even so, the amount of use it would see would perhaps not be so big that we could not equally well get by with using replace. Keeping the stdlib consise is a quite major issue, so I'd have to agree o

[elixir-core:7473] Maybe Map.replace should lazily evaluate the new value, or introduce Map.replace_lazy?

2017-10-03 Thread Tallak Tveide
https://hexdocs.pm/elixir/Map.html#get_and_update!/3 -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view t

[elixir-core:7499] Maybe Map.replace should lazily evaluate the new value, or introduce Map.replace_lazy?

2017-10-04 Thread Tallak Tveide
I agree the function is missing. The name shoul be different than your suggestion, maybe ‘update_existing(...)’? Still the alternatives, though not as efficient perhaps, should give not big practical problems. So adding this might be considered margin Perhaps even the get_and_update is the most

[elixir-core:7597] [Proposal] Introduce is_positive/1 and is_negative/1 macros

2017-11-20 Thread Tallak Tveide
I would say no to this one. I think using < is ok. No change necessary. Elixir isnt statically typed, so at least for me, in general, i dont bother with is_number -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this gr

[elixir-core:7600] Re: [Proposal] Introduce is_positive/1 and is_negative/1 macros

2017-11-21 Thread Tallak Tveide
I am still not convinced. Elixir is not a statically typed language. The guard you mention does add some checking, and I wouldnt mind seeing it in Elixir code, but there are so many of these kinds of bugs that still remain ‘unsolved’. The tool to deal with these kinds of bugs are unit tests and

Re: [elixir-core:7603] Re: [Proposal] Introduce is_positive/1 and is_negative/1 macros

2017-11-22 Thread Tallak Tveide
> > Sure, but saying "we'll never fix them all, so why even try?" is not a > good argument. Saying that the solution is unit tests is true for every > behaviour; moreover people who don't know this semantic wouldn't test for > it. > > > I'm arguing that I feel this direction is not what I woul

[elixir-core:7997] [Proposal] Crypto module wrapper

2018-05-14 Thread Tallak Tveide
Why shouldnt it start out as a library, then if it proves useful discuss whether to include in elixir core? My feeling is that this belongs outside a language, Erlang has too much stuff included. This was probably the right call back when Erlang didnt have package managers, but elixir has great

Re: [elixir-core:9297] [Proposal] identity function

2019-12-23 Thread Tallak Tveide
Three years later... https://groups.google.com/forum/m/#!search/tallak$20unity/elixir-lang-core/Q2eO8dRqrmA Happy about this too! -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails fro

[elixir-core:9642] [Proposal] Add Map.put_if/4

2020-07-25 Thread Tallak Tveide
You also have the pretty compact option: ’’’ map = (foo && Map.put(map, :foo, foo)) || map ’’’ You could make it pipeable by wrapping it in an anonymous function: ’’’ map |> &((foo && Map.put(&1, :foo, foo)) || &1).() ’’’ -- You received this message because you are subscribed to the Google G

Re: [elixir-core:9643] [Proposal] Add Map.put_if/4

2020-07-25 Thread Tallak Tveide
I think the proper name would be something like ``` transform_if(x, condition, fun) ``` -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+uns

Re: [elixir-core:10303] [Proposal] Strict matching comprehensions

2021-06-09 Thread Tallak Tveide
I would like to add a solution within the existing language: ```elixir > list = [{:ok, 1}, {:ok, 2}, {:error, :fail}, {:ok, 4}] > for el <- list, do: ({:ok, num} = el; num) ** (MatchError) no match of right hand side value: {:error, :fail} ``` I think this is reasonable. Acctually the built in f