lua-users home
lua-l archive

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



What would be the use of this - can you give any real-world example?

I've read (a long while back) mr. Stroustrup's book on evolution of C++. He refused to bring in any features that couldn't be proven to be required in real-world scenarios. Just because something is elegant doesn't mean it needs to be in there! Also, he first tried to find (as Luiz did) existing ways of fulfilling the requested behaviour. Only if this failed (and the need was real) was the new feature considered.

And even so, C++ has become somewhat overbloatet...

Every additional feature also adds to the learning curve, documentation pages, etc. etc. For this reason, I actually still like Lua 4.0 more than 5.0 beta. Lua 4.0 fits in my mind and stays there even the following day. :)

-ak


Benoit Germain kirjoittaa perjantaina, 21. helmikuuta 2003, kello 11:00:

Hello,

I know that 5.0 final is is feature freeze status, but then, the sooner
proposals are in the pipeline for the next version the better :-)

So, here it is:

Basically, passing a script or precompiled buffer to the parser results in a
lua closure left on the stack of the lua state. Actually doing what the
buffer defines is done by calling it. My suggestion is to enable argument passing, as is possible for any "regular" function call (currently it is possible to call the resulting function with arguments, but of course these are ignored because the chunk has no means to access them). Of course this
requires a syntax addition which could look like :
chunkparams <param list>
...

Most probably nothing but comments or empty lines can be allowed before the chunkparams statement, which acts just like the parameter list in a function declaration. As far as I can tell, this would not require any change in the virtual machine, but only in the parser, to modify the closure's prototype
and account for these variables during compilation.


Any thoughts about this ?


Benoit.