[erlang-questions] closures and list comprehensions
Sun Feb 17 23:05:51 CET 2008
I'm fairly new to Erlang, and I'm just starting to get the hang of it.
I have a question about using spawn/1, giving it a fun which is a
closure that contains a list comprehension. The example is like this:
Me = self(),
spawn(fun() -> Me ! do_something([X || X <- Rest, X < First]) end),
My question is, in which process is the list comprehension evaluated?
It seems to me that it should be evaluated in the spawned process but
I can't reason it out.
Thanks in advance,
More information about the erlang-questions