[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: idea of vision of blueprint of ROADMAP of Lua core
- From: Gunnar Zötl <gz@...>
- Date: Fri, 14 Jan 2005 17:52:59 +0100
ADM> Wim Couwenberg wrote:
>> - function environments (see (1) below)
I consider those to be a meta-mechanism, allowing to do some
interesting stuff by working around the lexical scoping. Lexical
scoping is a good_thing[tm], but as lua relies on meta-mechanisms, a
controlled way around that does help in implementing things that would
be tough to do without. The use for packages is an example.
>> - coroutines (is there *anyone* at all who agrees?? :-) )
ADM> They're fantastic (albeit not essential) as iterators. Apart from
ADM> that I don't use them myself, as attractive as they are from a
ADM> 'computer science' angle.
I do use them for all sorts of things. Maybe that's a consequence of
having worked on a system with only cooperative multitasking for quite some
time, subsequently getting used to that sort of thing. They are
excessively handy for implementing lightweight multitasking within an
>> - mutable upvalues (see (2) below)
ADM> I rely on mutable closures for a few things. I'd be sad if they
>> - proxy constructions
Did I miss something? I thought this proxy stuff was not part of the
language, but rather a common lua pattern.
>> And some pluses:
>> + __pairs metamethod
ADM> Although this would be academically pleasing and the lack of
ADM> such a metamethod seems like an obvious hole in proxy tables
ADM> etc, in real life I seem to be living quite comfortably without.
I'd like that. A need for iterating through all values accessible
through a table that inherits from another table by means of
metatables made me implement a __pairs metamethod myself. However, the
necessary modifications to the pairs() function can be done from
within lua, so there is not really a need for this. Still, I'm all in
favor of this.
>> + __settable, __gettable metamethods
ADM> Doing what exactly?
As I see it, those are meant to be counterparts to __index and
__newindex, with the difference that they intercept accesses to values
already defined in the table. With those one could get rid of the
proxy constructions. I have no opinion on that, as the proxy approach
works reasonably well for me.
have a nice day,