src/pmc/pair.pmc - Pair PMC


A Pair PMC represents one key => value mapping like a one element hash.

Functions ^

void init()

Initializes the instance.

PMC *instantiate(PMC *sig)

Class method to construct an Integer according to passed arguments.

void mark()

Marks the hash as live.

PMC *get_pmc_keyed_str(STRING *key)

PMC *get_pmc_keyed(PMC *key)

void set_pmc_keyed(PMC *key, PMC *value)

void set_pmc_keyed_str(STRING *key, PMC *value)

Set key and value. The key can only set once.

void assign_pmc(PMC *value)

Set the value of the Pair.

void set_pmc(PMC *pair)

Sets this pair to hold the value of another.

INTVAL is_equal(PMC *value)

The == operation.

Check if two Pairs hold the same keys and values.

void visit(visit_info *info)

Used during archiving to visit the elements in the pair.

void freeze(visit_info *info)

Used to archive the Pair.

void thaw(visit_info *info)

Used to unarchive the Pair.

Methods ^

METHOD key()

Return the key of the pair.

METHOD value()

Return the value of the pair.


Return a tuple of (key, value) for the pair.