lua-users home
lua-l archive

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


i think what you need is a lambda  :D

On Wed, Nov 24, 2010 at 12:34 AM, Drake Wilson <drake@begriffli.ch> wrote:
> Quoth steve donovan <steve.j.donovan@gmail.com>, on 2010-11-23 18:22:20 +0200:
>> String lambdas to the rescue!
> [...]
>> The irritating thing is that 'hero' would have to be a global or at
>> least a field in the environment you use to compile the lambdas; they
>> cannot be _closures_.
>
> Which is dreadful, and even the parts that can be gotten right are
> easy to get wrong and easy to break.  Passing code around as strings
> like that is one of those constructions that moves invisible coin
> blocks into your path when you're not looking.  It's more befitting of
> Tcl or PHP than the clean (if dusty and cratered) surface of Lua.
>
> (My local token filter uses « » and $1, $2, … for short expr funs and
> their arguments, but I gather many people might not like the non-ASCII
> bit.  << and >> are synonymous.)
>
>> steve d.
>
>   ---> Drake Wilson
>
>



-- 
welcom to gtalk me
http://hi.baidu.com/jyf1987