[erlang-questions] Extensions to comprehensions eeps

Vlad Dumitrescu vladdu55@REDACTED
Thu Jul 31 09:59:27 CEST 2008

2008/7/31 Hynek Vychodil <vychodil.hynek@REDACTED>

> There is functional difference, between <- and <= is not functional
> difference.
> There is not reason why
> [X || <<X>> <- <<"abc">> ].
> should not return same result as
>  > [X || <<X>> <= <<"abc">> ].
> "abc"


I might be mistaken here, but I think the issue is that the compiler
generates completely different code for each case and when the generator
looks like X <- Y, i.e. the right side is not a constant, it has to know
which one to produce. The compiler can't guess from the source code, because
for example <<X>> <- L is a very normal list generator, one can't assume L
is a binary.

best regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080731/a066ad9a/attachment.htm>

More information about the erlang-questions mailing list