lua-users home
lua-l archive

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

On Tuesday 30 August 2005 10:17, Adrian Perez wrote:
> The Lua
> 'do...end' is only three extra letters, which I find acceptable, but
> for example Pascal "begin...end" blocks have _six_ extra letters...

It's all a matter of the way you think language semantics should work...

A statement like 'if', in an Algol-based language like Lua, works on statement 

if { expression } { list to execute if true } { list to execute if false }

You really need a way of delimiting the statement lists. Lua and Pascal 
believe that the syntax to do this belongs in the thing that is performing 
the action --- if...then...else...endif. C and Javascript believe that it's 
better to have seperate syntax for doing this; the thing that performs the 
action operates on a *single* statement --- but you can wrap up a statement 
list into a single statement.

Ultimately, this is purely a matter of personal preference, which means that 
the only opinion that matters is that of the Lua devs. (As its their 
language.) *My* personal preference is to go with the C-like style, but 
that's only because I grew up on C.

+- David Given --McQ-+ "A character is considered to be a letter if and
|    | only if it is a letter or digit (§20.5.16) but is
| ( | not a digit (§20.5.14)." --- SMSDN Java
+- --+ documentation

Attachment: pgpHTB6wLMjsc.pgp
Description: PGP signature