lua-users home
lua-l archive

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


Keith Wiles wrote:
I too must confess I add code for // too and not just the != :-)

I am not asking for the removal of -- or ~=, but instead add a syntactical sugar for these two constructs. Moving back and forth from 'C/C++' to Lua is part of the reason, but if you are only coding in Lua then it becomes less of an issue.

I agree with Enrico, using these constructs, you know immediately you are reading a Lua code, not some C-derivated language.

I would guess most of the designs using Lua are not Lua only designs. In 'Vim' (the VI editor) the author talks about the muscle keys (or is it memory keys) which means what do your fingers automatically type and what is the expected behavior of those key strokes. The != and // are like muscle keys to me, which means I type them without knowing I had typed the wrong thing :-(

If your editor is smart enough, you can make it convert != and // to ~= and -- as soon as you type them. Otherwise, post-process your sources...

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --