- iset-search iset element failure successprocedure
The iset is searched from lowest to highest value for element. If it is not found, then the failure procedure is tail-called with two continuation arguments, insert and ignore, and is expected to tail-call one of them. If element is found, then the success procedure is tail-called with the matching element of iset and two continuations, update and remove, and is expected to tail-call one of them.
The effects of the continuations are as follows (where obj is any Scheme object):
- Invoking (insert obj) causes element to be inserted into iset.
- Invoking (ignore obj) causes iset to remain unchanged.
- Invoking (update new-element obj) causes new-element to be inserted into iset in place of element.
- Invoking (remove obj) causes the matching element of iset to be removed from it.
In all cases, two values are returned: a newly allocated iset and obj.