"SETS" Set operations
Fingerprint ID: | 0x53455453 |
New in version 0.5-rc2.
This fingerprint, from RC/Funge-98, implements set operations. It provides the following commands:
- A : setA value — (set∪{value})A
- Adds value to the set. If there is value in the set, it will do nothing.
- C : setA — setA len
- Pushes the size of the set.
- D : setA — setA setA
- Duplicates the set.
- G : deltav sourcev — setA
- Reads the set from the Funge space, starting from source with given delta. The set is retrieved in the stack order: the cell at source should contain the number of items. Reflects if the stored set is invalid.
- I : aA bA — (a∩b)A
- Pushes the intersection of two sets a and b.
- M : setA value — result
- Pushes 1 if value is in the set, or 0 otherwise.
- P : setA — setA
- Prints the set to the standard output.
- R : setA value — (set-{value})A
- Removes value from the set. If there is no value in the set, it will do nothing.
- S : aA bA — (a-b)A
- Pushes the difference of two sets a and b.
- U : aA bA — (a∪b)A
- Pushes the union of two sets a and b.
- W : setA deltav destv — setA
- Writes the set to the Funge space, starting from dest with given delta. The set is stored in the stack order: the cell at dest will contain the number of items.
- X : aA bA — bA aA
- Exchanges two sets a and b in the top of the stack.
- Z : setA —
- Pops and discards the set in the top of the stack.
All commands reflect if given set is invalid: stack underflow has been occurred, the size of set is negative, or there is duplicates in the set.