[erlang-questions] Maps branch and disclaimers

Pierre Fenoll <>
Mon Oct 28 17:13:15 CET 2013


IMHO I would love to think of '<-' as a generic generator, which generates
elements out of its rhs without any regard to the type.
Otherwise '<-' would not be as not-type-specific as most (every?) other
operator is, in this dynamic language.
I mean, one could also think of tuple-comprehensions (though I don't see
why immediately, but I am not all-seeing).

Anthony, fcall()#{ k := new_val } for example? Modify a key's value just
after a call.

Regarding not skipping items in *-comprehensions: well, that's what
lists:map/2 is for.


Cheers,
-- 
Pierre Fenoll



On 28 October 2013 16:07, Jesper Louis Andersen <
> wrote:

>
> On Mon, Oct 28, 2013 at 5:05 PM, Anthony Ramine <> wrote:
>
>> I would avoid any ‘:’ character in the new operator because Jesper once
>> had the idea of introducing strict generators with ‘<:-‘ and ‘<:=‘, which
>> would not skip items that doesn’t match (e.g. "[ X || {ok, X} <:-
>> [{error,Reason}] ]" would crash).
>
>
> Yes. It is a problem I have encountered quite often, where the code throws
> away terms deliberately and you have no way to fix this but to use a
> standard lists:map/2 call.
>
>
> --
> J.
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20131028/ed05ab59/attachment.html>


More information about the erlang-questions mailing list