lua-users home
lua-l archive

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


On Fri, Jul 1, 2011 at 7:16 AM, Lorenzo Donati
<lorenzodonatibz@interfree.it> wrote:
> What I wonder now is whether the possibility of delaying the evaluation of
> an expression would be useful also in other contexts.

Well, we already have such a mechanism - function() return
delayed_fun(something) end. Some have felt that this feels over-wordy,
so that ends up in the 'short function form' discussion meme[1].

Irrespective of actual notation, a closure is relatively cheap -
laziness can't be had for free.

Anything else requires major re-engineering, I suspect; how to
harmonize it with the rest of the language is probably the hardest
part.

steve d.

[1] things like |x| x^2 (GSL-shell and metalua) and \x(x^2) (LuaMacro)