[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: +=
- From: edrx@... (Eduardo Ochs)
- Date: Wed, 28 Mar 2001 14:31:48 -0300 (BRT)
About "+=", "while (foo(); x = bar()) ... end", etc:
What about resurrecting the yacc-based parser, adapting it to the new
syntax, and including it in Lua-4.1, even if the default would be to
not even compile it? Then it would be easier for users to experiment
with changes on the syntax...
Other ideas: one could load a library and replace the default "dofile"
and "dostring" functions on a certain Lua interpreter; one could write
in standard Lua a program that would work like the functions
"handle_argv" and "main" in src/lua/lua.c, but using a parser loaded
on the fly... etc, etc.
I think that Lua is a fantastic language, but its syntax is sometimes
too verbose for people (like me!) who would like to use it for
one-shot programs, not only for "serious stuff" or for (there's a lot
of irony here, of course) programs that have to be maintainable by
non-programmers later. I guess that one of the main reasons to keep it
so simple is to make it easier to construct metaprogramming tools, but
these aren't ready yet...
BTW, here's a link to a very interesting paper on metaprogramming:
"Building Source-Code Processors for Icon Programs", by Ralph E.