lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>From Mon Apr 14 19:17:01 1997
>It would be nice (IMO) to be able to declare blocks _and_ anonymous
>functions inline. I would like to be able to do the following:
>a_location = { x = 0, y = 0
>swap = function(self) 
>   self.x,self.y = self.y,self.x;
>end ,
>dup = function(self)
>   self.x = self.y;

I've proposed this exact syntax for anonymous functions:
	a=function(x,y,z) ... end
but right now this is hard to implement because we'd have to make the parser
and the lexer reentrant.
It's certainly within our design philosophy. So, it remains in our list for
future changes.