[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Syntactic sugar cravings
- From: Eric Tetz <erictetz@...>
- Date: Tue, 24 Jul 2001 15:18:03 -0700 (PDT)
--- Roberto Ierusalimschy <email@example.com> wrote:
> > Also, I think I'm going to implement the following in my interactive lua
> > command loops:
> > =2+2
> > is an abbreviation for
> > _EVAL_PRINT(2+2)
> This seems a nice (and simple) solution for those who use Lua as a calculator.
> The `=' is an easy key (no shifts involved ;-), and we do not need to change
> Lua (the core), only lua.c. We will consider it for 4.1 beta (alpha is almost
> out now).
As long as we're on the subject of syntactical sugar... I would like to see the 'then' following
'if' and 'elseif', and the 'do' following 'while' or 'for', be made optional. Those tokens are
totally superfluous - making them optional would have no impact on Lua's efficiency or on existing
Lua code. Besides saving keystrokes, it makes Lua code even cleaner and easier to read (IMO).
Now for the ulterior motive...
I used Lua to replace a scripting language in an in-house tool, which (believe it or not) had
virtually identical syntax to Lua (albeit a subset of Lua). Lua requires the superfluous tokens
mentioned above; the previous language did not. If those tokens can be made optional in the
official source, then I can finally call our in-house variation "Lua". ;)
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger