The Story of ALTER
Alter is a mezzanine function that is a shortcut for alternating between insert and remove of a value.
Alter looks to see if a specified value is already part of a collection (in block). If not, it adds it. Otherwise, it removes it.
Here is an example:
>> flags: []
>> alter flags 'resize
>> flags
== [resize]
>> alter flags 'maximize
>> flags
== [resize maximize]
>> alter flags 'resize
>> flags
== [maximize]
Alter came about during the creation of VID(2), where we wanted to add or remove flag values from various blocks of flags.
Some users have suggested that the function is not worthwhile and should be removed from REBOL.
Should it be removed?
11 Comments
|