[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Quaternary Operator
- From: James Graves <ansible@...>
- Date: Sun, 21 Nov 2010 05:08:00 -0600
On Sun, Nov 21, 2010 at 10:46:17AM +0100, Kristofer Karlsson wrote:
> >
> > And finally, as you don't need to press the shift key, the typing is
> > slightly faster.
> >
>
> Clearly this depends on which keyboard layout you're using, not all layouts
> have [ and ] mapped to single key presses.
Actually, the re-use of the square brackets is my biggest objection to
a quaternany operator.
One of the best things about Lua is that it doesn't re-use symbols
much. Every other lanugage I'm aware of (except the Lisp family) does
this, and I believe it makes learning those languages more difficult.
With Lua, it is real simple. This is easy for the user, and for the
lex / parse. You may scoff at the parsing advantage, but it also
makes syntax errors easier to decipher, because the compiler has a
clear idea of what it was expecting next.
Lua can get away with this because it has just one built in container.
Compare this to Python, which has three types of containers, and can
be confusing for the beginner.
Best regards,
James Graves