lua-users home
lua-l archive

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



On Sun, Nov 5, 2017 at 03:26 Ulrich Schmidt <u.sch.zw@gmx.de> wrote:

Am 04.11.2017 um 21:18 schrieb Soni L.:
 >
 >
 > On 2017-11-04 11:50 AM, Coda Highland wrote:
 >> On Sat, Nov 4, 2017 at 11:34 AM, Martin
<eden_martin_fuhrspam@gmx.de> wrote:
 >>> On 11/04/2017 01:23 PM, Soni L. wrote:
 >>>> I understand what you're saying, but ; is the identity function.
 >>>>
 >>>> ;(x) is x.
 >>>>
 >>> Really? f(;, {;=;})
 >>>
 >> No, not REALLY. He was suggesting a way to think about it.
 >>
 >> /s/ Adam
 >>
 >
 > They* but yes it was just a silly joke.
 >

Back to topic: Andreas asked how to improve his talk. He try to get
people intrested in lua, people who are doing her dayly job in languages
like c, c++, java, ...

 From my point of view there are 2 different kinds of lua users.

1. The users who grow with the lua language since version 1.
If i remember correctly. there was 1 statement per line and the
statement delimitter was the line end. There is nothing bad about that.
(I dont insert semicolons, when i write simple scripts to be executed
like batch files or shell scripts.)
But as lua grows, at some point, it was nesseary to implement a optional
statement delimitter. And there is nothing wrong with keeping old habits
not writing any staement delimitter until nessesary.

2. Lua users, like me, who lerned programming in other languages and
with lots of presumptions and habits in her head.
If you come from pascal, c, c++, .. you are trained to place statement
delimitters and you SEARCH automatically for statement delimitter in
sources you read.
For me ommiting semicolons in lua looks like basic. (I am not talking
about tiny lua shell scrips here)

As a member of Anderss's Auditorium and with a background like described
in 2.) it would be easier to me to read his examples if they contain
semicolons.

I am already happy, if you dont shoot me, when i use semicolons ;-)

Ulrich.

It may be good to mention the reason behind the design choice. I remember reading that semicolons are optional because it looks and works better in applications where Lua is used as a DSL or as a configuration language. 

It’s also true that most Lua code that I’ve read leaves it off and that there are no incompatiblities created when you mix the two styles in the same project. Therefore, while it is likely to offend your own preference, and unlike the situation created by mixing different object models, it matters not how which way you go.