lua-users home
lua-l archive

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


On Sun, Nov 14, 2004 at 09:21:56PM -0500, Jay Carlson wrote:

> The term "closure" is not used in R5RS, so that document itself isn't 
> going to be a good way to settle an argument over the term.  However, 
> Scheme clearly does have mutable state attached to procedures.  In ...

Excellent post, Jay, and you provided good examples too.

> OK, now that I'm done flaming, I have to admit a fascination with the 
> idea of a pure functional scripting language that integrates easily with 
> C code, and is easy to learn.

Well, I'm taking Roberto's appeal to heart, and not belabouring the point
further.  I might however post some Lua scripts to identify clearly what
"Lua closures" do and what they don't do, because after all PiL mentions
closures in the same sentence as functional programming, so highlighting
that they're not pure functional objects in Lua becomes imperative, if
you'll pardon the attrocious pun. ;-)

Maybe one day I'll also extend Lua with a "closure" keyword syntactically
identical to "function" but with pure closure semantics, for those occasions
where I want to inject a closure into a persistent world and not have to
worry about future semantic changes through side effects.  It could come in
handy for Lua applications in symbolic computation and other math fields too.

Rich Artym.
-- 
Existing media are so disconnected from reality that our policy debates
spin around a fantasy world in which the future looks far too much like
the past.   http://www.zyvex.com/nanotech/MITtecRvwSmlWrld/article.html