-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.txt
56 lines (32 loc) · 1.56 KB
/
types.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
the motion types system
Types, like everything else, are motes.
Every mote has both a type and a prototype.
The type is a TYPE mote which is used for coercion and argument filtering.
The prototype is the perl package name of the type, for use in method
resolution and inheritance.
At coercion time, both the mote and the type have a chance to do coercion.
The operand goes first, with the ->become(TYPE) method. Then the
type must ->accept the result of the ->become operation.
Arguments to sequences and other ops specify a type, and provided
arguments must either match that type or have a defined conversion
to that type otherwise the operation fails.
In the default lexicon, which may be limited or changed in application
environments, these are the predefined types:
MOTE the base object type, the default default prototype
AA "Associative Array"
LEXICON an AA with an "outer" reference, for scoping
TYPE the base type type
OP Operator. Consumes zero or more arguments and produces one result. Can temporarily replace the engine's parser.
STREAM a stream of characters, for either reading or writing or both, a
file handle.
ENGINE takes two stream arguments, reads from the first, writes to the second
PARSER
STRING
NUMBER
BOOLEAN
LIST
ANYTHING: a degenerate type name that accepts anything
Names of types can be used as instance constructors, or as constants,
or as operators, depending on the definition of the type.
The final step before an engine writes to the output stream could
be considered a conversion to an implicit ephemeral stream-of-characters type.