lua-users home
lua-l archive

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


Wim Couwenberg wrote:
-  function environments (see (1) below)
(1) I hazard a guess that gunction environments are mainly used to "package" functions in some way (sandboxing and what not). This could also be realised with upvalues (global name lookup in an upvalue instead of fenv)

Wow, I think I'd be quite lost without fenv().  Global lookups from
an upvalue is an interesting idea but I'm not sure it'd all work
out simpler (either semantically or from an implementation pov) than
the current scheme in reality.

> -  coroutines (is there *anyone* at all who agrees??  :-)  )

They're fantastic (albeit not essential) as iterators.  Apart from
that I don't use them myself, as attractive as they are from a
'computer science' angle.

> -  mutable upvalues (see (2) below)

I rely on mutable closures for a few things.  I'd be sad if they
went away, but would survive.  Wouldn't it kill module-top-level
locals though, since these are treated as mutable upvalues
in functions that reference them?  Again, though, I'm really
not sure that making a closure a read-only copy of the var's
last value at the point it leaves scope would be *at all* simpler
to understand or implement than the current scheme.

> -  proxy constructions

What is meant by this?  __newindex etc?

> And some pluses:
>
> +  __pairs metamethod

Although this would be academically pleasing and the lack of
such a metamethod seems like an obvious hole in proxy tables
etc, in real life I seem to be living quite comfortably without.

> +  __settable, __gettable metamethods

Doing what exactly?

Regards,
--Adam
--
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3