On Tue, 12 Mar 2013 10:47:52 -0400, Vladimir Panteleev
<[email protected]> wrote:
On Tuesday, 12 March 2013 at 14:09:55 UTC, Steven Schveighoffer wrote:
Yes. That use of the "is" operator is mainly to allow updating the
value
you meant "in", not "is", right?
Yes. Sorry, the keys are right next to each other :)
without looking up the key twice. This behavior could be implemented
using a proxy object, but this is not what I was talking about. I
meant the specific case of "if (key in environment)".
I think Valdimir wants to have opIn_r return bool?
Returning the string (doing the same as ".get(key, null)") should have
the same effect in an if statement.
Yes that is true. Why doesn't .get work for your case again?
environment.get(key)
vs.
key in environment
Doesn't seem that different to me...
I suppose an opIn_r alias is not difficult to add, if it's just for syntax
sugar.
-Steve