lua-users home
lua-l archive

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


Tomas Guisasola Gorham <tomas@tecgraf.puc-rio.br> writes:

> 	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])...

[...]

It would appear that Lua's clean syntax appeals to language improvers
like a clean wall to graffiti sprayers.

-- 
David Kastrup