[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Scripting language takes a silicon turn
- From: Michael Abbott <mabster@...>
- Date: Fri, 27 Jan 2006 17:06:39 +1100
On Thu, 2006-01-26 at 15:23 +0000, David Given wrote:
> Incidentally, C-like languages have:
>
> if (expression) statement else statement
> where { statementlist } is a statement.
>
> Lua has:
>
> if expression then statementlist else statementlist end
> where begin statementlist end is a statement.
>
> The then...else...end in an if is a completely different syntactic concept
> from begin...end --- Lua's if *inherently* can cope with multiple statements,
> where C's if can't.
Not to mention avoiding the old 'else' ambiguity:
if (a) if (b) c(); else d();
"Is the else attached to the a or b if?"
- Mab