lua-users home
lua-l archive

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


On Fri, 2010-02-05 at 15:30 +0100, Michal Kolodziejczyk wrote:

> Because it is ambiguous. Use parentheses or tonumber().
> 

No, it's not ambiguous. Regular programming languages use a 'longest
valid match' rule for lexical scanners. You don't expect Lua to parse

	locale = 3

as
	local e = 3

That's why 1...e should be tokenized as 1. followed by .. followed by e,
because those are the longest matches. For expediency or efficiency the
Lua authors have taken a shortcut, which produces strange results in
some corner cases.

Gé

> Regards,
> 	miko


-- 
Gé Weijers <ge@weijers.org>