<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">- Even if funs/comprehensions behave differently from the rest their behaviour is quite logical within the erlang context. For a fun to *export* a variable would be completely crazy as it is defined in one place and executed in another; where and when would you see the exported value?</blockquote>
<div><br></div><div>Agreed. Languages like python and ruby change the context of where the function/lambda is defined, which introduces race conditions when the function is run in a thread. This is actually one of the ways such languages use to communicate between threads, *shrugs*.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For a comprehension which value of a variable should you see?<br></blockquote><div><br></div><div>Agreed as well, I wouldn't expect comprehensions to set a variable in the outer context. To add to your puzzle, if the list is empty, what is the value of the variable?</div>
</div>