lua-users home
lua-l archive

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


Sven Olsen <sven2718@gmail.com> writes:
> That's probably another good reason avoid turning '?' into a unary postfix
> operator -- doing so would badly confuse Ruby and CoffeeScript people :)

I agree that limiting this functionality to "?." and "?[" is probably
better.

A more general "?" operator might be _possible_, but doesn't actually
seem terribly _useful_.  [If someone has counterexamples to this --
cases where a "?" postfix operator that _isn't_ immediately followed
by "." or "[" is a significant convenience -- please post them!]

The more limited operators are also both probably more efficient (can
just generate a branch) and avoid problems like "how do I return a {}
that's really read-only...?"

-miles

-- 
Scriptures, n. The sacred books of our holy religion, as distinguished from
the false and profane writings on which all other faiths are based.