[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: parser hacking: conditional fields
- From: Miles Bader <miles@...>
- Date: Sat, 02 Mar 2013 09:53:19 +0900
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.