Go to the first, previous, next, last section, table of contents.


getKey?

Function: getKey? { obj val -> tOrNil key }
file: job.t
package: muf
status: alpha

The getKey? function takes an object and a value, and returns the corresponding public key (or else nil), on top of a boolean flag recording whether such a value was present:

makeIndex --> o
Stack:
1 --> o["a"]   o 1 getKey?
Stack: t "a"

Note: Muq version -2.9.0 getKey? does not support searching of objects.

The getKey? function may also be used to search vectors and stacks for a given value, returning the corresponding key (offset). Vectors are searched starting at offset zero, stacks are searched starting at the top.

This function does nothing that could not be done equally easily in muf, but it puts the inner loop down in C, hence may run a couple of orders of magnitude faster.


Go to the first, previous, next, last section, table of contents.