lua-users home
lua-l archive

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


In Lua 5.3 interpreter the expression "1 + 1 <enter>" works perfectly.

I even use it at the beginning of my course for beginners, "Programming for 21st Century", at PUC-Rio, instead of the usual "print ("Hello World")

"1 + 1" is the simplest computer program that exists.

"Print (" Hello World "), on the other hand, requires a novice programming student to understand what a function call is, how to pass a parameter, and know that a quoted phrase is a string.

If you want to teach Lua to someone who knows "C" or "C ++", great.

Now you try to teach programming to a lawyer, a student of literature or medicine, as we do ...




Em 2019-10-28 13:22, Pavel escreveu:
Why such an expression without assignment should result in syntax error? Even if it is meaningless for numbers, it could be a+b with metametatables
that does something else regardless the return value.




--
Sent from: http://lua.2524044.n2.nabble.com/Lua-l-f2524044.html

--
Fernando Jefferson
CCE-PUC-Rio - Professor
Projeto UpLua - Coordenador
Cel: +5521-99763-2135