The byond proc Remove serves the function of internally taking an element out of a list if possible and returning 1 or 0 if an object was actually removed. In every other way it is identical to the byond operator -=.
The byond operator |= can potentially add something to a list, or not add something to the list depending on whether the list already contains all/some/none of the elements.
It would be nice if, just as Remove can be used to tell your code if something was actually removed by -=, there was some kind of proc equivalent to that for the |= operator to tell if something was actually added to the list. It would either return 1 if any element was added, or 0 if no elements were added.
ID:1863987
Jun 2 2015, 2:39 am
|
|||||||
| |||||||
It's a bit more overhead and work that would be worthwhile though in most cases, so an addition like the one you're suggestion would definitely be nice.