Re: anonymous functions

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: anonymous functions

Luiz Henrique de Figueiredo-2
>From [hidden email] 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;
>end
>}

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.
--lhf