lua-users home
lua-l archive

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


On Wed, 3 Feb 2010, steve donovan wrote:
>
> Adding a new keyword once in a blue moon is not a great disaster, if
> it gives us such excellent convenience.

Douglas Crockford argues that programming languages should not have
reserved words. His idea is that if you happen to give a variable
the same name as a keyword, then that keyword becomes unusable in the
variable's lexical scope. If you use a keyword in a given scope then you
cannot subsequently declare a variable with the same name.

If you follow Crockford then adding keywords becomes much easier.

See the last couple of paragraphs in the "scope" section of
http://javascript.crockford.com/tdop/tdop.html

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/
GERMAN BIGHT HUMBER: SOUTHWEST 5 TO 7. MODERATE OR ROUGH. SQUALLY SHOWERS.
MODERATE OR GOOD.