"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 : setAsetA len
Pushes the size of the set.
D : setAsetA setA
Duplicates the set.
G : deltav sourcevsetA
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 valueresult
Pushes 1 if value is in the set, or 0 otherwise.
P : setAsetA
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 destvsetA
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 bAbA 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.

Previous topic

"SCKE" GLFunge98’s extension to SOCK

Next topic

"SOCK" TCP/IP socket extension

This Page

Quick search