[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: What's up with token filters (Re: New operators?)
- From: "John Calsbeek" <nexuapex@...>
- Date: Fri, 13 Apr 2007 17:18:55 -0500
I'm probably beating a dead horse here, but…
- lua's multi-assignation does not interact very well with += and friends
Only when there are more expressions on the right-hand side than there
are variables on the left-hand. That would seem to indicate a logic
error anyway—is that an issue? I would expect x, y += 1 to do whatever
doing y + nil currently does…
- all these operators have in-place modification and atomicity semantics
that do not go very well with lua either. ':' is already more complex
in that area than one would think at first glance.
Even using some mutable string object, I would expect buffer += "some
string" to change buffer. It has a plus sign, for concatenation, and
an equals sign, for assignment. If a statement with an equals sign
ever didn't assign, I would be worried. But maybe it's just me, and
for most people += is about mutation.
Is the only thing setting this apart from the colon the
multiple-assignment and mutation semantics? Neither are pure syntactic
sugar… foo.bar:baz() isn't the same as foo.bar.baz(foo.bar), and
foo.bar += 1 isn't the same as foo.bar.baz = foo.bar.baz + 1.
- References:
- RE: New operators?, Jerome Vuarand
- Re: New operators?, Glenn Maynard
- What's up with token filters (Re: New operators?), Asko Kauppi
- Re: What's up with token filters (Re: New operators?), Glenn Maynard
- Re: What's up with token filters (Re: New operators?), David Given
- Re: What's up with token filters (Re: New operators?), Glenn Maynard
- Re: What's up with token filters (Re: New operators?), Daniel Silverstone
- Re: What's up with token filters (Re: New operators?), Greg Falcon
- Re: What's up with token filters (Re: New operators?), Olivier Delannoy
- Re: What's up with token filters (Re: New operators?), Olivier Galibert