lua-users home
lua-l archive

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

On Wed, 2005-02-02 at 10:08, Mark Hamburg wrote:
> on 2/1/05 2:44 PM, skaller at wrote:

> That being said, given that setfenv makes functions mutable entities, 

This sounds dangerously close to dynamic scoping, first used in
Lisp 3 decades ago and now debunked. I haven't looked into
it deeply but setfenv is one of the things I'd be considering
throwing out of Lua.

The correct way to have a 'variable' environment for
a function is to pass it an argument. 

If you want to 'fix' the environment, you just curry
the function, the first argument could be a table ..

hmm .. you might think on that in context of your
'functions in table constructors' idea..

John Skaller,
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language