lua-users home
lua-l archive

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


On Sat, 09 Feb 2013 12:14:26 +0900
Miles Bader <miles@gnu.org> wrote:

> Adding a few very minor redundancies (like "!=") to fix historical
> quirks in Lua isn't "perl-ising."

"Historical quirks" is an interesting characterization. I cut my teeth
on Pascal, so to me, "!=" is a "historical quirk". Maybe Lua should use
"<>", which is *much* more obvious than "!=", which to me sounds more
like "emphatically equal" than "not equal".

Here's the point. Modifications to any program, including Lua, are both
precious and risky. Precious because there are many more potential
improvements than there are programmer-hours to do them. Risky because
every change can introduce bugs. A "redundancy" is more risky because
it's added code, not just changed code. Having two ways to do it will
cause trouble when newly written code is run on old versions of the
interpreter. For what? For something that's basically cosmetic.

Because changes are precious and risky, they must be prioritized. I
think there are a lot more important things than making Lua's "not
equal" the same as C's. Personally, I'd prioritize getting a good and
standard library together, like Perl and Python have done. Once upon a
time I prioritized a non-goto continue statement
(http://lua-users.org/lists/lua-l/2011-01/msg01377.html). That would
be much more useful, and less easy to work around, than a keyboard
without ~. Nevertheless, when it became clear that a non-goto continue
statement wasn't in the cards, I took an hour and built my own
"continue
iterator" (http://lua-users.org/lists/lua-l/2011-01/msg01309.html).

In the preceding paragraph I implied that ~= for those with keyboards
missing "~", and certainly for those having "~", is a minor thing. The
reason is, bunches of easy workarounds have been suggested right in
this thread, including:

* Vim mapping
* Switch keyboard defs
* cat program.bak | sed -e 's/!=/~=/g' > program.lua

On the Internet is material by Eric Raymond telling how to use
interrupts to intercept keyboard presses. I'm pretty sure it would be
easy to write a C program, maybe front-ended by Lua code, to intercept,
let's say Ctrl+comma and change it to ~. Or even ~=, so that you save
keystrokes. To me, even this is a whole lot better than cluttering up
Lua itself.

SteveT