[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: "+="
- From: Gavin Wraith <gavin@...>
- Date: Tue, 11 Apr 2000 12:37:07 +0100 (BST)
If this topic has been aired previously on the Lua
list, my apologies.
Am I right in thinking that the Lua VM does two
lookups in executing something like
"a.b.c.d.e.f = a.b.c.d.e.f + 57" ?
If so, is there not a case for borrowing from C
its updating assignment operations, so that we
could write
"a.b.c.d.e.f += 57" , or if you prefer
"increase a.b.c.d.e.f by 57" ?
OK, one can always improve it by using a local
variable
"local x = a.b.c.d.e; x.f = x.f + 57"
but that is still not optimal.
This is presumably something which any language
must address which allows complex L-value
expressions. Any plans for this in a future
release?
--
Gavin Wraith (gavin@wraith.u-net.com) or (gavinw@sussex.ac.uk)
Home page: http://www.wraith.u-net.com/