VocabularysyntaxSyntaxC: constructor class
Inputs and outputsWord descriptionDefine a constructor word for a tuple class which simply performs BOA (by order of arguments) construction using
boa.
ExamplesSuppose the following tuple has been defined:
TUPLE: color red green blue ;
The following two lines are equivalent:
C: <color> color
: <color> ( red green blue -- color ) color boa ;
In both cases, a word
<color> is defined, which reads three values from the stack and creates a
color instance having these values in the
red,
green and
blue slots, respectively.
Definition