lua-users home
lua-l archive

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



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 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 :-(

As for the 'switch' statement I find the 'if elseif else end' construct a bit difficult to deal with, but the use of a table with functions a cool idea and much more compact if you use this switch statement in a lot of places. I would not want to add a 'switch' statement change to Lua, but use the other language constructs.

I too do not want to create Lua in 'C' likeness, but sometimes a little likeness is a good thing :-)

Thanks
--Keith

Enrico Colombini wrote:
On Wednesday 25 January 2006 20:49, Chris Marrin wrote:
Can we all at least agree that, if Lua were to have any small changes to
make it look like any other language, C/C++ makes the most sense for
what language it should look like? No, I don't suppose we can :-)

You're right, we can't :-)
I like C, I've used C for more than 20 years, and I had no problem at all coding in Lua. It's just a question of getting used to mindframe switching, as with all the other languages. Small visual differences like "--" can actually help in avoiding confusion.

  Enric