lua-users home
lua-l archive

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


> At the risk of stirring things up, this is where the short-lambda form
> can be useful:
> 
> assertc (mob:isalive(), || "the mob "..mob.name.." must be alive")
> 
> function assertc(condn,fun)
>     if not condn then assert(false,fn()) end
> end
> 
> The cost? Lots of little closures.
> 
> Increasingly thinking that this is one of the few places where those
> unfashionable things, macros, are actually useful.

You actually presented two: asserts and short-lambda forms ;)

-- Roberto