lua-users home
lua-l archive

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


On 8/27/05, Gavin Wraith <gavin@wra1th.plus.com> wrote:
I quite like the modest tincture of redundancy in
Lua's syntax. In fact I have a habit of decorating
the one-serves-all 'end' with a comment:
end -- if, end -- while, end -- function, end -- do.
I would not have objected if each kind of 'end' had
been given its own token, or would that have been
too reminiscent of prim old Pascal?

The `end-sth' property is present in Ada, Dylan and other
languages.  In some of them the additional word is not
mandatory.
Another option is the ending word being the reverse of
the opening one: if -- fi, do -- od etc.  Example is Algol 68.

As for Pascal, it has neither of these.  There, the body of
a control statement is just another statement, simple or
compound (begin -- end).  An exception of this rule
(which introduces a bit of inconsistency in the language)
is the repeat -- end loop.