lua-users home
lua-l archive

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


> I'm wondering why this is necessary.  Most other languages with a REPL
> do not require the user to disambiguate expressions and statements.

It is not necessary. The Lua stock interpreter could try first
	return <user input>
and then, if that fails, try
	<user input>

This is almost what it does already, except that it only tries "return ..."
if the line starts with '='.

The problem with the automatic approach is that you'd get more noise.
For instance,
	io.write("Hello")
would output
	Hellotrue
as you can see by entering
	=io.write("Hello")