lua-users home
lua-l archive

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


	Hi Eric

	I think this is not a good feature since it is not clear to the
caller whether the expressions will be both evaluated or not.  Michal
Kottman already provided a better example:
http://permalink.gmane.org/gmane.comp.lang.lua.general/68820

z = choose(y~=0, [x/y], [0])
IMO this is more clear than
z = choose(y~=0, || x/y, || 0)
	Well, I think both are cryptic.  We are used to associate
`t[i]' with the i-th element inside t, but this is just a convention.

But would it conflict with the array indexing operator i.e the brackets in "myarray[5]"?
	Yes, and since f"..." and f{...} are shortcuts for function calls,
one could wonder that f[x/y] become shortcut for f([x/y])...
	For the case of a function definition, I think the most important
is to make the body limits very clear.	However, since Lua does not
define these limits with single characters, but with words (end), the
solution will be incoherent with the rest of the language...  We can
think of a combination of characters such as \( and \) but I think it
would lead to more cumbersome and cryptic text...

	Regards,
		Tomás