Plan B User's Manual


Name

cast ­ Defines a type cast in the name space converter set.

Synopsis

#include <ulib.h>

void cast(char* k, char* match, char* conv)

Description

Cast installs a new entry in the converter set of the current name space to specify that the type k can be converted to the type match by means of the converter conv. After the call, when operating (e.g. copying) a box of type k with another of type match, both types are considered compatible types if conv is nil; if it was not nil, the system starts conv to operate the coverted data with the destination box.

Cast overwrittes any previous entry for the same k and match.

Source

/src/b/port/box.c and /src/b/port/kind.c.

See also

uncast(2) and (1).


Plan B User's Manual. First edition.