Transparancy

Alex Blewitt alex.blewitt at gmail.com
Wed Jul 7 12:59:30 PDT 2010


On 7 Jul 2010, at 20:47, Neal Gafter <neal at gafter.com> wrote:

>> Another very huge - probably even bigger, actually -
>> group with "foreign lambda background" would be JavaScript developers,
>> and they also tend to think of a lambda as some kind of function.
> 
> In Javascript, the meaning of "this" can be either lexical at the point of
> definition of the lambda or inherited from an object to which it is
> attached.  That's confusing enough that I don't think it is something to
> emulate.

But the point is that return is as expected, i.e. it returns from the lambda, right?

> 
>>  The only one I can think of right off the bat is
>> Smalltalk, and also Ruby to some extent (as it has different kinds of
>> lambdas, with both local and non-local returns).
> 
> Besides the two you named I'd add Scala.

Scala has difficulties in even being compatible with itself. It's hardly an example of how to design (or extend) a mature language.

It's worth pointing out that Objective-C's blocks, which arguably has a much wider following than Smalltalk ever did, treats blocks as syntactic sugar around a block object and yet still permits return to come out of the block and not any enclosing scope. You can still achieve non-local returns using #define macros if you really want - but all of the major APIs are now becoming oak focussed. 

Alex


More information about the lambda-dev mailing list