[erlang-questions] List to proplist?

Richard O'Keefe <>
Mon Nov 3 05:06:47 CET 2008


On 1 Nov 2008, at 12:29 am, Andras Georgy Bekes wrote:

>> Between [E(X) || X (<-) F]
>> and [E(X) || X <- unfold(S, F')]
>> there is very little difference,
>> *provided* the compiler knows about unfold and treats it specially.
>
> What do you mean by "treats it specially"?

"Inlines the call to unfold/2."
>
>> I've been thinking that we wouldn't really need
>> syntax for iterating over the elements of a tuple
>> if the compiler knew how to handle
>> [E(X) || X <- tuple_to_list(T)].
> The compiler handles this just right. What do you mean?

No, the compiler does _not_ handle it just right.
The compiler generates code that will actually BUILD THE LIST.
We don't need that.

While it is true that tuples are usually small,
that _isn't_ true of the tuples one would want to map over.




More information about the erlang-questions mailing list