f5ab204483
FossilOrigin-Name: 7e915652801f48ebac0fefaf29fcdfe530968d8e300a8735b9d192cece2c4689
39 KiB
39 KiB
1 | * | nn-n | - | - | Multiply `n1` by `n2` and return the result. | class:primitive | {n/a} | {n/a} | global | all | |||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2 | + | nn-n | - | - | Add `n1` to `n2` and return the result. | class:primitive | {n/a} | {n/a} | global | all | |||
3 | , | n- | - | - | Store the specified value into the memory at `here` and increment `Heap` by 1. | class:word | {n/a} | {n/a} | global | all | |||
4 | - | nn-n | - | - | Subtract `n1` from `n2` and return the difference. | class:primitive | {n/a} | {n/a} | global | all | |||
5 | ---reveal--- | - | - | - | Switch to the exposed (public) portion of a lexical namespace. | class:word | {n/a} | {n/a} | global | all | |||
6 | -eq? | nn-f | - | - | Compare two values for inequality. Returns `TRUE` if they are not equal or `FALSE` otherwise. | class:primitive | {n/a} | {n/a} | global | all | |||
7 | -if | fq- | - | - | Execute the quotation if the flag is `FALSE`. | class:word | {n/a} | {n/a} | global | all | |||
8 | / | mn-o | - | - | Divide `m` by `n` and return the result. | class:word | {n/a} | {n/a} | global | all | |||
9 | /mod | nm-op | - | - | Divide `n` by `m` and return the result and remainder. | class:primitive | {n/a} | {n/a} | global | all | |||
10 | 0; | n-n || n- | - | - | If `n` is zero, drop `n` and exit the current word. If non-zero, leave `n` alone and allow execution to continue. | {n/a} | {n/a} | {n/a} | global | all | |||
11 | ; | - | - | - | End the current definition. | class:macro | {n/a} | {n/a} | global | all | |||
12 | ?dup | n-nn || n-n | - | - | Duplicate top value on stack if not zero. If zero, do nothing. | class:word | {n/a} | {n/a} | global | all | |||
13 | Compiler | -a | - | - | Variable. Holds the compiler state. If TRUE, the compiler is active. If FALSE, it is not. | class:data | {n/a} | {n/a} | global | all | |||
14 | Dictionary | -a | - | - | Variable. Holds a pointer to the most recent dictionary header. | class:data | {n/a} | {n/a} | global | all | |||
15 | EOM | -n | - | - | Constant. Returns the last addressable memory address. | class:word | {n/a} | {n/a} | global | all | |||
16 | FALSE | -n | - | - | Returns `0`, the value used to indicate a FALSE result. | class:word | {n/a} | {n/a} | global | all | |||
17 | FREE | -n | - | - | Returns the number of cells available to your application. This is the amount of memory, less the already consumed portion and buffers mapped for RETRO's internal use. | {n/a} | {n/a} | {n/a} | global | all | |||
18 | Heap | -a | - | - | Variable. Holds the address of the next available cell. | class:data | {n/a} | {n/a} | global | all | |||
19 | RewriteUnderscores | -a | - | - | Variable. When set to `TRUE`, RETRO will replace underscores in strings with spaces. When `FALSE`, RETRO does not. | class:data | {n/a} | {n/a} | global | all | |||
20 | STRINGS | -a | - | - | Return the address of the start of the temporary string pool. | class:word | {n/a} | {n/a} | global | all | |||
21 | ScopeList | -a | - | - | Variable. This holds some information used by `{{` and `}}`. | class:data | {n/a} | {n/a} | global | all | |||
22 | TRUE | -n | - | - | Returns `-1`, the value used to indicate a TRUE result. | class:word | {n/a} | {n/a} | global | all | |||
23 | TempStringMax | -a | - | - | Variable. Holds the maximum length of a temporary string. | class:data | {n/a} | {n/a} | global | all | |||
24 | TempStrings | -a | - | - | Variable. Holds the number of temporary strings. | class:data | {n/a} | {n/a} | global | all | |||
25 | Version | -a | - | - | Variable. This stores the version number. | class:data | {n/a} | {n/a} | global | all | |||
26 | [ | - | - | - | Begin a quotation. | class:macro | {n/a} | {n/a} | global | all | |||
27 | ] | - | - | - | End a quotation. | class:macro | {n/a} | {n/a} | global | all | |||
28 | again | - | - | - | Close an unconditional loop. Branches back to the prior `repeat`. | class:macro | {n/a} | {n/a} | global | all | |||
29 | allot | n- | - | - | Allocate the specified number of cells from the `Heap`. | class:word | {n/a} | {n/a} | global | all | |||
30 | and | nm-o | - | - | Perform a bitwise AND operation between the two provided values. | {n/a} | {n/a} | {n/a} | global | all | |||
31 | as{ | -f | - | - | Begin an assembly section. | class:macro | {n/a} | {n/a} | global | all | |||
32 | bi | xqq-? | - | - | Execute q1 against x, then execute q2 against a copy of x. | class:word | {n/a} | {n/a} | global | all | |||
33 | bi* | xyqq-? | - | - | Execute q1 against x and q2 against y. | class:word | {n/a} | {n/a} | global | all | |||
34 | bi@ | xyq-? | - | - | Execute q against x, then execute q against y. | class:word | {n/a} | {n/a} | global | all | |||
35 | call | a- | - | - | Call a function. | {n/a} | {n/a} | {n/a} | global | all | |||
36 | case | nmq- || nmq-n | - | - | If `n` is equal to `m`, drop both and execute the specified quote before exiting the calling word. If not equal, leave `n` on the stack and let execution continue. | class:word | {n/a} | {n/a} | global | all | |||
37 | choose | fqq- | - | - | Execute q1 if the flag is `TRUE` or q2 if it is not. | class:word | {n/a} | {n/a} | global | all | |||
38 | compiling? | -f | - | - | Return `TRUE` if compiler is on or `FALSE` otherwise. | class:word | {n/a} | {n/a} | global | all | |||
39 | const | ns- | - | - | Create a constant returning the specified value. | class:word | {n/a} | {n/a} | global | all | |||
40 | copy | sdl- | - | - | Copy `l` cells from memory at `s` to the memory at `d`. These should not overlap. | class:word | {n/a} | {n/a} | global | all | |||
41 | curry | nq-q | - | - | Bind a value to a function and return a new quote that calls the bound action. | class:word | {n/a} | {n/a} | global | all | |||
42 | d | n- | - | - | Inline a numeric value to the current assembly segment. | {n/a} | {n/a} | {n/a} | global | all | |||
43 | data | - | - | - | Change the class of the most recently defined word to `class:data`. | class:word | {n/a} | {n/a} | global | all | |||
44 | depth | -n | - | - | Return the number of items on the stack. | class:word | {n/a} | {n/a} | global | all | |||
45 | dip | nq-n | - | - | Temporarily remove n from the stack, execute the quotation, and then restore n to the stack. | class:word | {n/a} | {n/a} | global | all | |||
46 | does | q- | - | - | Attach an action to the most recently created word. This is used in a manner similar to CREATE/DOES> in traditional Forth. | class:word | {n/a} | {n/a} | global | all | |||
47 | drop | n- | - | - | Discard the top value on the stack. | class:primitive | {n/a} | {n/a} | global | all | |||
48 | drop-pair | nn- | - | - | Remove top two items on the stack. | class:word | {n/a} | {n/a} | global | all | |||
49 | dump-stack | - | - | - | Display the items on the data stack. | class:word | {n/a} | {n/a} | global | all | |||
50 | dup | n-nn | - | - | Duplicate the top item on the stack. | class:primitive | {n/a} | {n/a} | global | all | |||
51 | dup-pair | nm-nmnm | - | - | Duplicate the top two items on the stack. | class:word | {n/a} | {n/a} | global | all | |||
52 | eq? | nn-f | - | - | Compare two values for equality. Returns `TRUE` if they are equal or `FALSE` otherwise. | class:primitive | {n/a} | {n/a} | global | all | |||
53 | fetch | a-n | - | - | Fetch the value stored at the specified address. | class:primitive | {n/a} | {n/a} | global | all | |||
54 | fetch-next | a-an | - | - | Fetch the value stored at the specified address. Returns the next address and the value. | class:word | {n/a} | {n/a} | global | all | |||
55 | gt? | nn-f | - | - | Compare n1 and n2. Return `TRUE` if n1 is greater than n2, or `FALSE` otherwise. | class:primitive | {n/a} | {n/a} | global | all | |||
56 | gteq? | nn-f | - | - | Compare n1 and n2. Return `TRUE` if n1 is greater than or equal to n2, or `FALSE` otherwise. | class:word | {n/a} | {n/a} | global | all | |||
57 | here | -a | - | - | Return the next free address in memory. | class:word | {n/a} | {n/a} | global | all | |||
58 | i | s- | - | - | Assemble the instructions specified by the string into the current assembly scope. | class:word | {n/a} | {n/a} | global | all | |||
59 | if | fq- | - | - | Execute the quote if the flag is `TRUE`. | class:word | {n/a} | {n/a} | global | all | |||
60 | immediate | - | - | - | Change the class of the most recently defined word to `class:macro`. | class:word | {n/a} | {n/a} | global | all | |||
61 | interpret | s- | - | - | Interpret a single input token. | class:word | {n/a} | {n/a} | global | all | |||
62 | lt? | nn-f | - | - | Compare n1 and n2. Return `TRUE` if n1 is less than n2, or `FALSE` otherwise. | class:primitive | {n/a} | {n/a} | global | all | |||
63 | lteq? | nn-f | - | - | Compare n1 and n2. Return `TRUE` if n1 is less than or equal to n2, or `FALSE` otherwise. | class:word | {n/a} | {n/a} | global | all | |||
64 | mod | nm-o | - | - | Divide `n` by `m` and return the remainder. | class:word | {n/a} | {n/a} | global | all | |||
65 | nip | nm-m | - | - | Remove the second item from the stack. | class:word | {n/a} | {n/a} | global | all | |||
66 | nl | - | - | - | Display a newline. | class:word | {n/a} | {n/a} | global | all | |||
67 | not | n-m | - | - | Perform a logical NOT operation. | class:word | {n/a} | {n/a} | global | all | |||
68 | or | mn-o | - | - | Perform a bitwise OR between the provided values. | class:primitive | {n/a} | {n/a} | global | all | |||
69 | over | nm-nmn | - | - | Put a copy of n over m. | class:word | {n/a} | {n/a} | global | all | |||
70 | pop | -n | n- | - | Move a value from the return stack to the data stack. | {n/a} | {n/a} | {n/a} | global | all | |||
71 | push | n- | -n | - | Move a value from the data stack to the return stack. | {n/a} | {n/a} | {n/a} | global | all | |||
72 | putc | c- | - | - | Display a single character. | class:word | {n/a} | {n/a} | global | all | |||
73 | putn | n- | - | - | Display a number. | class:word | {n/a} | {n/a} | global | all | |||
74 | puts | s- | - | - | Display a string. | class:word | {n/a} | {n/a} | global | all | |||
75 | r | s- | - | - | Lookup a reference by name and inline its pointer to the current assembly segment. | class:word | {n/a} | {n/a} | global | all | |||
76 | reclass | a- | - | - | Change the class handler of the most recently defined word to the specified one. | class:word | {n/a} | {n/a} | global | all | |||
77 | reorder | ...ss-? | - | - | Restructure the order of items on the stack. | class:word | {n/a} | {n/a} | global | all | |||
78 | repeat | - | - | - | Begin an unconditional loop. | class:macro | {n/a} | {n/a} | global | all | |||
79 | reset | ...- | - | - | Remove all items from the stack. | class:word | {n/a} | {n/a} | global | all | |||
80 | rot | abc-bca | - | - | Rotate the top three values. | class:word | {n/a} | {n/a} | global | all | |||
81 | s, | s- | - | - | Compile the code needed to push a string pointer to the stack and inline the string data into the current definition. | class:word | {n/a} | {n/a} | global | all | |||
82 | shift | mn-o | - | - | Peform a bitwise shift of m by n bits. If n is positive, shift right. If negative, the shift will be to the left. | class:primitive | {n/a} | {n/a} | global | all | |||
83 | sip | nq-n | - | - | Run quote. After execution completes, put a copy of n back on top of the stack. | class:word | {n/a} | {n/a} | global | all | |||
84 | sp | - | - | - | Display a space (`ASCII:SPACE`) | class:word | {n/a} | {n/a} | global | all | |||
85 | store | na- | - | - | Store a value into the specified address. | class:primitive | {n/a} | {n/a} | global | all | |||
86 | store-next | na-a | - | - | Store a value into the specified address and return the next address. | class:word | {n/a} | {n/a} | global | all | |||
87 | swap | nm-mn | - | - | Exchange the position of the top two items on the stack | class:primitive | {n/a} | {n/a} | global | all | |||
88 | tab | - | - | - | Display a tab (`ASCII:HT`) | class:word | {n/a} | {n/a} | global | all | |||
89 | times | nq- | - | - | Run the specified quote the specified number of times. | class:word | {n/a} | {n/a} | global | all | |||
90 | tors | -n | - | - | Get a copy of the top item on the return stack. | class:word | {n/a} | {n/a} | global | all | |||
91 | tri | xqqq-? | - | - | Apply q1 against x, then q2 against a copy of x, and finally q3 against another copy of x. | class:word | {n/a} | {n/a} | global | all | |||
92 | tri* | xyzqqq-? | - | - | Apply q1 against x, q2 against y, and q3 against z. | class:word | {n/a} | {n/a} | global | all | |||
93 | tri@ | xyzq-? | - | - | Apply q against x, then against y, and finally against z. | class:word | {n/a} | {n/a} | global | all | |||
94 | tuck | nm-mnm | - | - | Put a copy of the top item on the stack under the second one. | class:word | {n/a} | {n/a} | global | all | |||
95 | until | q- | - | - | Execute quote repeatedly while the quote returns a value of `FALSE`. The quote must return a flag of either `TRUE` or `FALSE` to be used with this. | class:word | {n/a} | {n/a} | global | all | |||
96 | var | s- | - | - | Create a variable. The variable is initialized to 0. | class:word | {n/a} | {n/a} | global | all | |||
97 | var<n> | ns- | - | - | Create a variable with the specified initial value. | class:word | {n/a} | {n/a} | global | all | |||
98 | while | q- | - | - | Execute quote repeatedly while the quote returns a value of `TRUE`. The quote must return a flag of either `TRUE` or `FALSE` to be used with this. | class:word | {n/a} | {n/a} | global | all | |||
99 | words | - | - | - | Display a list of all named items in the `Dictionary`. | class:word | {n/a} | {n/a} | global | all | |||
100 | xor | mn-o | - | - | Perform a bitwise XOR operation. | class:primitive | {n/a} | {n/a} | global | all | |||
101 | {{ | - | - | - | Begin a lexically scoped area. | class:word | {n/a} | {n/a} | global | all | |||
102 | }as | f- | - | - | End an assembly section | class:macro | {n/a} | {n/a} | global | all | |||
103 | }} | - | - | - | End a lexically scoped area. | class:word | {n/a} | {n/a} | global | all | |||
104 | getc | -c | - | - | Read a single keypress. | class:word | {n/a} | {n/a} | global | rre | |||
105 | putf | - | - | F- | Display a floating point number. | class:word | {n/a} | {n/a} | global | rre | |||
106 | ASCII:ACK | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
107 | ASCII:BEL | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
108 | ASCII:BS | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
109 | ASCII:CAN | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
110 | ASCII:CR | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
111 | ASCII:DC1 | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
112 | ASCII:DC2 | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
113 | ASCII:DC3 | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
114 | ASCII:DC4 | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
115 | ASCII:DEL | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
116 | ASCII:DLE | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
117 | ASCII:EM | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
118 | ASCII:ENQ | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
119 | ASCII:EOT | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
120 | ASCII:ESC | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
121 | ASCII:ETB | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
122 | ASCII:ETX | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
123 | ASCII:FF | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
124 | ASCII:FS | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
125 | ASCII:GS | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
126 | ASCII:HT | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
127 | ASCII:LF | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
128 | ASCII:NAK | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
129 | ASCII:NUL | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
130 | ASCII:RS | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
131 | ASCII:SI | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
132 | ASCII:SO | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
133 | ASCII:SOH | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
134 | ASCII:SPACE | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
135 | ASCII:STX | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
136 | ASCII:SUB | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
137 | ASCII:SYN | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
138 | ASCII:US | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
139 | ASCII:VT | -n | - | - | Constant. Refers to specific ASCII code. | class:data | {n/a} | {n/a} | ASCII | all | |||
140 | buffer:add | n- | - | - | Append a value to the current buffer. | class:word | {n/a} | {n/a} | buffer | all | |||
141 | buffer:empty | - | - | - | Reset the current buffer to an empty state. | class:word | {n/a} | {n/a} | buffer | all | |||
142 | buffer:end | -a | - | - | Return a pointer to the current end of the active buffer. | class:word | {n/a} | {n/a} | buffer | all | |||
143 | buffer:get | -n | - | - | Remove the last value from the current buffer. | class:word | {n/a} | {n/a} | buffer | all | |||
144 | buffer:preserve | q- | - | - | Save and restore the current buffer before and after executing the specified quote. | class:word | {n/a} | {n/a} | buffer | all | |||
145 | buffer:set | a- | - | - | Assign a new buffer as the current one. | class:word | {n/a} | {n/a} | buffer | all | |||
146 | buffer:size | -n | - | - | Return the number of cells in the buffer. | class:word | {n/a} | {n/a} | buffer | all | |||
147 | buffer:start | -a | - | - | Return the start address of the current buffer. | class:word | {n/a} | {n/a} | buffer | all | |||
148 | c:-consonant? | c-f | - | - | Return TRUE if character is a not consonant or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
149 | c:-digit? | c-f | - | - | Return TRUE if character is a not numeric digit or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
150 | c:-lowercase? | c-f | - | - | Return TRUE if character is not lowercase or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
151 | c:-uppercase? | c-f | - | - | Return TRUE if character is not uppercase or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
152 | c:-visible? | c-f | - | - | Return TRUE if character is not printable or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
153 | c:-vowel? | c-f | - | - | Return TRUE if character is not a vowel or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
154 | c:-whitespace? | c-f | - | - | Return TRUE if character is not whitespace, or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
155 | c:consonant? | c-f | - | - | Return TRUE if character is a consonant or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
156 | c:digit? | c-f | - | - | Return TRUE if character is a numeric digit or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
157 | c:letter? | c-f | - | - | Return TRUE if character is an ASCII letter or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
158 | c:lowercase? | c-f | - | - | Return TRUE if character is lowercase or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
159 | c:to-lower | c-c | - | - | Convert character to lowercase equivalent. | class:word | {n/a} | {n/a} | c | all | |||
160 | c:to-string | c-s | - | - | Convert character into a string. | class:word | {n/a} | {n/a} | c | all | |||
161 | c:to-upper | c-c | - | - | Convert character to uppercase equivalent. | class:word | {n/a} | {n/a} | c | all | |||
162 | c:toggle-case | c-c | - | - | Convert an ASCII character to the opposite case. | class:word | {n/a} | {n/a} | c | all | |||
163 | c:uppercase? | c-f | - | - | Return TRUE if character is uppercase or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
164 | c:visible? | c-f | - | - | Return TRUE if character is printable or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
165 | c:vowel? | c-f | - | - | Return TRUE if character is a vowel or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
166 | c:whitespace? | c-f | - | - | Return TRUE if character is whitespace, or FALSE otherwise. | class:word | {n/a} | {n/a} | c | all | |||
167 | class:data | n- || n-n | - | - | Class handler for data structures. | Keep the address or value on the stack. | Compile the value or address as a literal into the current definition. | {n/a} | {n/a} | {n/a} | class | all | |
168 | class:macro | a- | - | - | Class handler for compiler macros (immediate words) | Execute the function at the provided address. | Execute the function at the provided address. | {n/a} | {n/a} | {n/a} | class | all | |
169 | class:primitive | a- | - | - | Class handler for primitive words (words which map to Nga instructions) | Execute the function. | Compile the machine code in the definiton into the current definition. | {n/a} | {n/a} | {n/a} | class | all | |
170 | class:word | a- | - | - | Class handler for normal words. | Execute the function at the provided address. | Compile a call to the specified address into the current definition. | {n/a} | {n/a} | {n/a} | class | all | |
171 | compile:call | a- | - | - | Compile a call to the specified address into the current definition. | class:word | {n/a} | {n/a} | compile | all | |||
172 | compile:jump | a- | - | - | Compile a jump to the specified address into the current definition. | class:word | {n/a} | {n/a} | compile | all | |||
173 | compile:lit | n- | - | - | Compile the code to push a number to the stack into the current definition. | class:word | {n/a} | {n/a} | compile | all | |||
174 | compile:ret | - | - | - | Compile a return instruction into the current definition. | class:word | {n/a} | {n/a} | compile | all | |||
175 | d:add-header | saa- | - | - | Create a header. Provide a string (s) for the name, a pointer to the class handler (a1) and a pointer to the word definition (a2) Generally this won't be used directly. | class:word | {n/a} | {n/a} | d | all | |||
176 | d:class | d-a | - | - | Given a dictionary header, return the class field. | class:word | {n/a} | {n/a} | d | all | |||
177 | d:create | s- | - | - | Create a new dictionary header named the specified string. The new header will point to `here` and have a class of `class:data`. | class:word | {n/a} | {n/a} | d | all | |||
178 | d:for-each | q- | - | - | Execute the specified quote once for each header in the dictionary. Before running the quote, this also pushes a pointer to the header onto the stack. | class:word | {n/a} | {n/a} | d | all | |||
179 | d:last | -d | - | - | Return the most recent dictionary header. | class:word | {n/a} | {n/a} | d | all | |||
180 | d:last<class> | -a | - | - | Return a pointer to the class field of the most recent dictionary header. | class:word | {n/a} | {n/a} | d | all | |||
181 | d:last<name> | -s | - | - | Return a pointer to the name field of the most recent dictionary header. | class:word | {n/a} | {n/a} | d | all | |||
182 | d:last<xt> | -a | - | - | Return a pointer to the xt field of the most recent dictionary header. | class:word | {n/a} | {n/a} | d | all | |||
183 | d:link | d-a | - | - | Given a dictionary header, return the link field. | class:word | {n/a} | {n/a} | d | all | |||
184 | d:lookup | s-d | - | - | Lookup the specified name in the dictionary and return a pointer to its dictionary header. This returns zero if the word is not found. | class:word | {n/a} | {n/a} | d | all | |||
185 | d:lookup-xt | a-d | - | - | Lookup the specified address in the dictionary and return a pointer to its dictionary header. This returns zero if the word is not found. | class:word | {n/a} | {n/a} | d | all | |||
186 | d:name | d-s | - | - | Given a dictionary header, return the name field. | class:word | {n/a} | {n/a} | d | all | |||
187 | d:xt | d-a | - | - | Given a dictionary header, return the xt field. | class:word | {n/a} | {n/a} | d | all | |||
188 | err:notfound | - | - | - | Error handler. Called when a word is not found by `interpret`. | class:word | {n/a} | {n/a} | err | all | |||
189 | f:* | - | - | FF-F | Multiply two floating point numbers, returning the result. | class:word | {n/a} | {n/a} | f | rre | |||
190 | f:+ | - | - | FF-F | Add two floating point numbers, returning the result. | class:word | {n/a} | {n/a} | f | rre | |||
191 | f:- | - | - | FF-F | Subtract F2 from F1 returing the result. | class:word | {n/a} | {n/a} | f | rre | |||
192 | f:-eq? | -f | - | FF- | Compare two floating point values for inequality. Returns `TRUE` if they are not equal or `FALSE` otherwise. | class:word | {n/a} | {n/a} | f | rre | |||
193 | f:/ | - | - | FF-F | Divide floating point value F1 by F2. | class:word | {n/a} | {n/a} | f | rre | |||
194 | f:abs | - | - | F-F | Return the absolute value for a floating point value. | class:word | {n/a} | {n/a} | f | rre | |||
195 | f:depth | -n | - | - | Return the number of items on the floating point stack. | class:word | {n/a} | {n/a} | f | rre | |||
196 | f:drop | - | - | F- | Discard the top item on the floating point stack. | class:word | {n/a} | {n/a} | f | rre | |||
197 | f:dup | - | - | F-FF | Duplicate the top item on the floating point stack. | class:word | {n/a} | {n/a} | f | rre | |||
198 | f:eq? | -f | - | FF- | Compare two floating point values for equality. Returns `TRUE` if they are equal or `FALSE` otherwise. | class:word | {n/a} | {n/a} | f | rre | |||
199 | f:floor | - | - | F-F | Perform a mathmatical floor operation on the floating point value. | class:word | {n/a} | {n/a} | f | rre | |||
200 | f:gt? | -f | - | FF- | Compare two floating point values for greater than. | class:word | {n/a} | {n/a} | f | rre | |||
201 | f:log | - | - | FF-F | Return log(F1) for base F2 for floating point values. | class:word | {n/a} | {n/a} | f | rre | |||
202 | f:lt? | -f | - | FF- | Compare two floating point values for less than. | class:word | {n/a} | {n/a} | f | rre | |||
203 | f:negate | - | - | F-F | Invert the sign of the floating point value. | class:word | {n/a} | {n/a} | f | rre | |||
204 | f:negative? | -f | - | F- | Return `TRUE` if floating point value is negative or `FALSE` if not. | class:word | {n/a} | {n/a} | f | rre | |||
205 | f:over | - | - | FG-FGF | Put a copy of the second floating point value over the top one. | class:word | {n/a} | {n/a} | f | rre | |||
206 | f:positive? | -f | - | F- | Return `TRUE` if floating point value is positive or `FALSE` otherwise. | class:word | {n/a} | {n/a} | f | rre | |||
207 | f:power | - | - | FF-F | Return F1^F2 for floating point values. | class:word | {n/a} | {n/a} | f | rre | |||
208 | f:swap | - | - | FG-GF | Exchange the top and second items on the floating point stack. | class:word | {n/a} | {n/a} | f | rre | |||
209 | f:to-number | -n | - | F- | Convert a floating point value into a number. | class:word | {n/a} | {n/a} | f | rre | |||
210 | f:to-string | -s | - | F- | Convert a floating point value into a string. | class:word | {n/a} | {n/a} | f | rre | |||
211 | f:tuck | - | - | FG-GFG | Tuck a copy of the top floating point value under the second one. | class:word | {n/a} | {n/a} | f | rre | |||
212 | file:A | -n | - | - | Constant for opening a file in APPEND mode. | class:data | {n/a} | {n/a} | file | rre | |||
213 | file:R | -n | - | - | Constant for opening a file in READ mode. | class:data | {n/a} | {n/a} | file | rre | |||
214 | file:R+ | -n | - | - | Constant for opening a file in READ & WRITE mode. | class:data | {n/a} | {n/a} | file | rre | |||
215 | file:W | -n | - | - | Constant for opening a file in WRITE mode. | class:data | {n/a} | {n/a} | file | rre | |||
216 | file:close | h- | - | - | Given a file handle, close the file. | class:word | {n/a} | {n/a} | file | rre | |||
217 | file:delete | s- | - | - | Delete the named file. | class:word | {n/a} | {n/a} | file | rre | |||
218 | file:exists? | s-f | - | - | Given a file name, return `TRUE` if it exists or `FALSE` if it does not. | class:word | {n/a} | {n/a} | file | rre | |||
219 | file:flush | h- | - | - | Given a file handle, flush any pending writes to disk. | class:word | {n/a} | {n/a} | file | rre | |||
220 | file:for-each-line | sq- | - | - | Given a file name, open it and run the quote once for each line in the file. | class:word | {n/a} | {n/a} | file | rre | |||
221 | file:open | sm-h | - | - | Open a named file (s) with the given mode (m). Returns a handle identifying the file. | class:word | {n/a} | {n/a} | file | rre | |||
222 | file:read | h-c | - | - | Given a file handle, read and return the next character in it. | class:word | {n/a} | {n/a} | file | rre | |||
223 | file:read-line | f-s | - | - | Given a file handle, read a line and return a pointer to it. | class:word | {n/a} | {n/a} | file | rre | |||
224 | file:seek | nh- | - | - | Move the current offset into a file to the specified one. | class:word | {n/a} | {n/a} | file | rre | |||
225 | file:size | h-n | - | - | Given a file handle, return the size of the file (in bytes). | class:word | {n/a} | {n/a} | file | rre | |||
226 | file:slurp | as- | - | - | Given an address and a file name, read the file contents into memory starting at the address. | class:word | {n/a} | {n/a} | file | rre | |||
227 | file:spew | ss- | - | - | Given a string (s1) and a file name (s2), write the string into the file, replacing any existing cotent. | class:word | {n/a} | {n/a} | file | rre | |||
228 | file:tell | h-n | - | - | Given a file handle, return the current offset in the file. | class:word | {n/a} | {n/a} | file | rre | |||
229 | file:write | ch- | - | - | Write a character to the file represented by the handle. | class:word | {n/a} | {n/a} | file | rre | |||
230 | gopher:get | asns-n | - | - | Takes an address, a server, a port, and a selector. Fetch the resource and store it at address. Return the number of bytes received. | class:word | {n/a} | {n/a} | gopher | rre | |||
231 | n:-zero? | n-f | - | - | Return `TRUE` if number is not zero, or `FALSE` otherwise. | class:word | {n/a} | {n/a} | n | all | |||
232 | n:MAX | -n | - | - | Return the maximum value that will fit in a cell. | class:word | {n/a} | {n/a} | n | all | |||
233 | n:MIN | -n | - | - | Return the minimum value that will fit in a cell. | class:word | {n/a} | {n/a} | n | all | |||
234 | n:abs | n-n | - | - | Return the absolute value of a number. | class:word | {n/a} | {n/a} | n | all | |||
235 | n:between? | nlu-f | - | - | Return TRUE if number is between the lower (l) and upper (u) bounds. If not, return FALSE. This is inclusive of the limits. | class:word | {n/a} | {n/a} | n | all | |||
236 | n:dec | n-m | - | - | Decrement n by one. | class:word | {n/a} | {n/a} | n | all | |||
237 | n:even? | n-f | - | - | Return `TRUE` if number is even, or `FALSE` if not. | class:word | {n/a} | {n/a} | n | all | |||
238 | n:inc | n-m | - | - | Increment n by one. | class:word | {n/a} | {n/a} | n | all | |||
239 | n:limit | nlu-m | - | - | Return n if it is within the lower (l) and upper (u) bounds. If outside the bounds, return the closes boundary value. | class:word | {n/a} | {n/a} | n | all | |||
240 | n:max | mn-o | - | - | Return the greater of two values. | class:word | {n/a} | {n/a} | n | all | |||
241 | n:min | mn-o | - | - | Return the lesser of two values. | class:word | {n/a} | {n/a} | n | all | |||
242 | n:negate | n-n | - | - | Invert the sign of a number. | class:word | {n/a} | {n/a} | n | all | |||
243 | n:negative? | n-f | - | - | Return `TRUE` if number is negative, or `FALSE` if not. | class:word | {n/a} | {n/a} | n | all | |||
244 | n:odd? | n-f | - | - | Return `TRUE` if number is odd, or `FALSE` if not. | class:word | {n/a} | {n/a} | n | all | |||
245 | n:positive? | n-f | - | - | Return `TRUE` if number is positive, or `FALSE` if not. | class:word | {n/a} | {n/a} | n | all | |||
246 | n:pow | bp-n | - | - | Return base (b) to power (p). | class:word | {n/a} | {n/a} | n | all | |||
247 | n:sqrt | n-m | - | - | Return the square root of a number. | class:word | {n/a} | {n/a} | n | all | |||
248 | n:square | n-m | - | - | Return the square of a number. | class:word | {n/a} | {n/a} | n | all | |||
249 | n:strictly-positive? | n-f | - | - | Return TRUE if number is greater than zero or FALSE if it is zero or less. | class:word | {n/a} | {n/a} | n | all | |||
250 | n:to-float | n- | - | -F | Convert a number into a floating point value. | class:word | {n/a} | {n/a} | n | rre | |||
251 | n:to-string | n-s | - | - | Convert a number into a string. | class:word | {n/a} | {n/a} | n | all | |||
252 | n:zero? | n-f | - | - | Return `TRUE` if number is zero, or `FALSE` otherwise. | class:word | {n/a} | {n/a} | n | all | |||
253 | prefix:! | ns- | - | - | Store a value into a variable. | Store a value into the named variable. | Compile the code to store a value into a named variable. | {n/a} | {n/a} | {n/a} | prefix | all | |
254 | prefix:# | s-n | - | - | Process token as a number. | Convert the string into a number and leave on the stack. | Convert the string into a number and compile into the current definition as a literal. | {n/a} | {n/a} | {n/a} | prefix | all | |
255 | prefix:$ | s-c | - | - | Process token as an ASCII character. | Fetch first character from string. Leave on stack. | Fetch first character from the string. Compile into the current definition as literal. | {n/a} | {n/a} | {n/a} | prefix | all | |
256 | prefix:& | s-a | - | - | Return a pointer to a named item. | Lookup name in dictionary, return contents of the xt field on the stack. | Lookup name in dictionary, compile code to push the contents of the xt field into the current definition. | {n/a} | {n/a} | {n/a} | prefix | all | |
257 | prefix:' | s-s | - | - | Process token as a string. | Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. | Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Then compile the string into the current definition. | {n/a} | {n/a} | {n/a} | prefix | all | |
258 | prefix:( | s- | - | - | Process token as a comment. | Discard the string. | Discard the string. | {n/a} | {n/a} | {n/a} | prefix | all | |
259 | prefix:: | s- | - | - | Process token as a new definition. | Create a header pointing to `here` with the provided string as the name. Sets class to `class:word`. | @Compiler | {n/a} | {n/a} | prefix | all | ||
260 | prefix:@ | s-n | - | - | Fetch from a stored variable. | Fetch a value from a named variable. | Compile the code to fetch a value from a named variable into the current definition. | {n/a} | {n/a} | {n/a} | prefix | all | |
261 | prefix:` | s- | - | - | Process token as a bytecode. | Discard the string. | Convert the string to a number and use `,` to inline it into the current definition. | {n/a} | {n/a} | {n/a} | prefix | all | |
262 | prefix:. | s- | - | -F | Interpret time: convert string to a floating point value.\nCompile time: convert string to a floating point value and compile code to push this value to the float stack. | {n/a} | {n/a} | {n/a} | prefix | rre | |||
263 | s:ASCII-LETTERS | -s | - | - | Constant. Returns a string of the ASCII letters (upper and lower case) | class:data | {n/a} | {n/a} | s | all | |||
264 | s:ASCII-LOWERCASE | -s | - | - | Constant. Returns a string of the ASCII letters in lowercase | class:data | {n/a} | {n/a} | s | all | |||
265 | s:ASCII-UPPERCASE | -s | - | - | Constant. Returns a string of the ASCII letters in uppercase | class:data | {n/a} | {n/a} | s | all | |||
266 | s:DIGITS | -s | - | - | Constant. Return a string of characters recognized as numeric digits. | class:data | {n/a} | {n/a} | s | all | |||
267 | s:PUNCTUATION | -s | - | - | Constant. Return a string of characters recognized as punctuation. | class:data | {n/a} | {n/a} | s | all | |||
268 | s:WHITESPACE | -s | - | - | Constant. Returns a string of characters recognized as whitespace. | class:data | {n/a} | {n/a} | s | all | |||
269 | s:append | ss-s | - | - | Return a new string consisting of s1 followed by s2. | class:word | {n/a} | {n/a} | s | all | |||
270 | s:case | sSq- || sSq-s | - | - | If the `s` matches `S`, discard `s` and run the quote before exiting the caller. If they do not match, discard the quote and leave `s` on the stack. | class:word | {n/a} | {n/a} | s | all | |||
271 | s:chop | s-s | - | - | Remove the last character from a string. | class:word | {n/a} | {n/a} | s | all | |||
272 | s:const | ss- | - | - | Create a constant named s2, returning a pointer to s1. This will use `s:keep` to preserve the original string. | class:word | {n/a} | {n/a} | s | all | |||
273 | s:contains-char? | sc-f | - | - | Return `TRUE` if the character is present in the string or `FALSE` otherwise. | class:word | {n/a} | {n/a} | s | all | |||
274 | s:contains-string? | ss-f | - | - | Return `TRUE` if the second string is present in the first string or `FALSE` otherwise. | class:word | {n/a} | {n/a} | s | all | |||
275 | s:copy | sa- | - | - | Copy a string (s) to a destination (a). This will include the terminator character when copying. | class:word | {n/a} | {n/a} | s | all | |||
276 | s:empty | -s | - | - | Return an empty string. | class:word | {n/a} | {n/a} | s | all | |||
277 | s:eq? | ss-f | - | - | Compare two strings for equality. Return `TRUE` if identical or `FALSE` if not. | class:word | {n/a} | {n/a} | s | all | |||
278 | s:evaluate | s-? | - | - | Evaluate string as if it was typed into the interpreter. | class:word | {n/a} | {n/a} | s | all | |||
279 | s:filter | sq-s | - | - | Execute the quote once for each value in the string. If the quote returns `TRUE`, append the value into a new string. If `FALSE` the value will be discarded. | class:word | {n/a} | {n/a} | s | all | |||
280 | s:for-each | sq- | - | - | Execute the quote once for each value in the string. | class:word | {n/a} | {n/a} | s | all | |||
281 | s:hash | s-n | - | - | Calculate a hash value for a string. This uses the djb2 algorithim. | class:word | {n/a} | {n/a} | s | all | |||
282 | s:index-of | sc-n | - | - | Return the location of the first instance of the specified character in the string. | class:word | {n/a} | {n/a} | s | all | |||
283 | s:index-of-string | ss-n | - | - | Return the location of the first instance of the specified substring (s2) in the string (s1). Returns -1 if not found. | class:word | {n/a} | {n/a} | s | all | |||
284 | s:keep | s-s | - | - | Store a string into the heap and return a pointer to the start of it. | class:word | {n/a} | {n/a} | s | all | |||
285 | s:left | sn-s | - | - | Return a new string containing the first `n` characters from the source string. | class:word | {n/a} | {n/a} | s | all | |||
286 | s:length | s-n | - | - | Return the number of characters in a string, excluding the NULL terminator. | class:word | {n/a} | {n/a} | s | all | |||
287 | s:map | sq-s | - | - | Execute the specified quote once for each character in the string. Builds a new string from the return value of the quote. The quote should return only one value. | class:word | {n/a} | {n/a} | s | all | |||
288 | s:prepend | ss-s | - | - | Return a new string consisting of s2 followed by s1. | class:word | {n/a} | {n/a} | s | all | |||
289 | s:reverse | s-s | - | - | Reverse the order of ASCII characters in a string. | class:word | {n/a} | {n/a} | s | all | |||
290 | s:right | sn-s | - | - | Return a new string containing the specified number of characters from the right side of the string. | class:word | {n/a} | {n/a} | s | all | |||
291 | s:skip | - | - | - | Internal helper function used to skip over a string in a definition. | class:word | {n/a} | {n/a} | s | all | |||
292 | s:split | sc-ss | - | - | Split a string on the first occurrance of the specified character. | class:word | {n/a} | {n/a} | s | all | |||
293 | s:split-on-string | ss-ss | - | - | Split a string on the first occurrance of the specified string. | class:word | {n/a} | {n/a} | s | all | |||
294 | s:replace | sss-s | - | - | Replace the first instance of s2 in s1 with s3. | class:word | {n/a} | {n/a} | s | all | |||
295 | s:substr | sfl-s | - | - | Extract a substring from the specified string. This will take the characters starting at `f` and extend `l` characters in length. | class:word | {n/a} | {n/a} | s | all | |||
296 | s:temp | s-s | - | - | Move a string into the temporary string buffers. | class:word | {n/a} | {n/a} | s | all | |||
297 | s:to-float | s- | - | -F | Convert a string representation into a floating point value. | class:word | {n/a} | {n/a} | s | rre | |||
298 | s:to-lower | s-s | - | - | Convert uppercase ASCII characters in a string to lowercase. | class:word | {n/a} | {n/a} | s | all | |||
299 | s:to-number | s-n | - | - | Convert a string to a number. | class:word | {n/a} | {n/a} | s | all | |||
300 | s:to-upper | s-s | - | - | Convert lowercase ASCII characters in a string to uppercase. | class:word | {n/a} | {n/a} | s | all | |||
301 | s:trim | s-s | - | - | Trim leading and trailing whitespace from a string. | class:word | {n/a} | {n/a} | s | all | |||
302 | s:trim-left | s-s | - | - | Trim leading whitespace from a string. | class:word | {n/a} | {n/a} | s | all | |||
303 | s:trim-right | s-s | - | - | Trim trailing whitespace from a string. | class:word | {n/a} | {n/a} | s | all | |||
304 | s:with-format | ...s-s | - | - | Construct a new string using the template passed and items from the stack. | class:word | {n/a} | {n/a} | s | all | |||
305 | set:contains-string? | sa-f | - | - | Return `TRUE` if the string value is in the set or`FALSE` otherwise. | class:word | {n/a} | {n/a} | set | all | |||
306 | set:contains? | na-f | - | - | Return `TRUE` if the value is in the set or `FALSE` otherwise. | class:word | {n/a} | {n/a} | set | all | |||
307 | set:dup | a-b | - | - | Make a copy of a set. Return the address of the copy. | class:word | {n/a} | {n/a} | set | all | |||
308 | set:filter | aq-b | - | - | For each item in the initial set, run the specified quote. If the quote returns `TRUE`, copy the item into a new set. If `FALSE`, discard it. Returns a pointer to the new set. | class:word | {n/a} | {n/a} | set | all | |||
309 | set:for-each | aq- | - | - | Execute the quote once for each item in the set. | class:word | {n/a} | {n/a} | set | all | |||
310 | set:from-results | q-a | - | - | Execute quote. Return a new set containing the values the quote leaves on the stack. | class:word | {n/a} | {n/a} | set | all | |||
311 | set:from-string | s-a | - | - | Create a new set with the characters in the source string. | class:word | {n/a} | {n/a} | set | all | |||
312 | set:length | a-n | - | - | Return the length of a set. | class:word | {n/a} | {n/a} | set | all | |||
313 | set:map | aq- | - | - | Execute quote once for each item in the set. Constructs a new set from the value returned by the quote. | class:word | {n/a} | {n/a} | set | all | |||
314 | set:nth | an-b | - | - | Return the actual address of the nth item in the set. | class:word | {n/a} | {n/a} | set | all | |||
315 | set:reduce | pnq-n | - | - | Takes a set, a starting value, and a quote. This will apply the quote to each item in the set; the quote should consume two values and return one. | class:word | {n/a} | {n/a} | set | all | |||
316 | set:reverse | a-b | - | - | Reverse the order of items in a set. This will return a new set. | class:word | {n/a} | {n/a} | set | all | |||
317 | sys:argc | -n | - | - | Return the number of arguments passed to the program. | class:word | {n/a} | {n/a} | sys | rre | |||
318 | sys:argv | n-s | - | - | Given an argument number, return the argument as a string. | class:word | {n/a} | {n/a} | sys | rre | |||
319 | v:dec | a- | - | - | Decrement the value stored at the specified address by 1. | class:word | {n/a} | {n/a} | v | all | |||
320 | v:dec-by | na- | - | - | Decrement the value stored at the specified address by the specified value. | class:word | {n/a} | {n/a} | v | all | |||
321 | v:inc | a- | - | - | Increment the value stored at the specified address by 1. | class:word | {n/a} | {n/a} | v | all | |||
322 | v:inc-by | na- | - | - | Increment the value stored at the specified address by the specified value. | class:word | {n/a} | {n/a} | v | all | |||
323 | v:limit | alu- | - | - | Fetch the value stored at the address, then run `n:limit` against it, using the specified lower and upper bounds. Then store the resulting value back to the original address. | class:word | {n/a} | {n/a} | v | all | |||
324 | v:off | a- | - | - | Set a variable to 0. | class:word | {n/a} | {n/a} | v | all | |||
325 | v:on | a- | - | - | Set a variable to -1. | class:word | {n/a} | {n/a} | v | all | |||
326 | v:preserve | aq- | - | - | Make a copy of the value at the address, then run the quote. Once the quote completes, restore the address to the specified value. | class:word | {n/a} | {n/a} | v | all | |||
327 | v:update-using | aq- | - | - | Fetch a value from the specified address, then run the quotation with this value on the stack. Afterwards, store the returned value at the original address. | class:word | {n/a} | {n/a} | v | all | |||
328 | unix:fork | -n | - | - | Fork the current process. Returns a PID. | class:word | {n/a} | {n/a} | unix | rre | |||
329 | unix:exec0 | s- | - | - | Execute a process by running the application specified by s. | class:word | {n/a} | {n/a} | unix | rre | |||
330 | unix:exec1 | ss- | - | - | Execute a process by running the application specified by s1. Pass s2 as an argument. | class:word | {n/a} | {n/a} | unix | rre | |||
331 | unix:exec2 | sss- | - | - | Execute a process by running the application specified by s1. Pass s2 and s3 as arguments. | class:word | {n/a} | {n/a} | unix | rre | |||
332 | unix:exec3 | ssss- | - | - | Execute a process by running the application specified by s1. Pass s2, s3, and s4 as arguments. | class:word | {n/a} | {n/a} | unix | rre | |||
333 | unix:popen | sn-n | - | - | Open a pipe. Takes a command to run, and a file mode (`file:R` or `file:W`; `file:R+` may work on some systems). Returns a file ID usable with words in the `file:` namespace. | class:word | {n/a} | {n/a} | unix | rre | |||
334 | unix:pclose | n- | - | - | Close a pipe. | class:word | {n/a} | {n/a} | unix | rre | |||
335 | unix:kill | nn- | - | - | Terminates a process. Takes a process and a signal to send. | class:word | {n/a} | {n/a} | unix | rre | |||
336 | unix:getpid | -n | - | - | Return the PID of the current process. | class:word | {n/a} | {n/a} | unix | rre | |||
337 | unix:system | s- | - | - | Runs another application using the system shell and returns after execution is completed. | class:word | {n/a} | {n/a} | unix | rre | |||
338 | unix:exit | n- | - | - | Exit the current process, returning the specified return code. | class:word | {n/a} | {n/a} | unix | rre | |||
339 | unix:wait | -n | - | - | Waits for a child process to complete. This maps to the wait() system call. | class:word | {n/a} | {n/a} | unix | rre | |||
340 | unix:chdir | s- | - | - | Change the current working directory to the specified one. | class:word | {n/a} | {n/a} | unix | rre | |||
341 | unix:getenv | sa- | - | - | Get an environment variable. Provide the name and an address to store it in. | class:word | {n/a} | {n/a} | unix | rre | |||
342 | unix:putenv | s- | - | - | Takes a string in the form `name=value` and sets an environment variable named `name` to `value`. | class:word | {n/a} | {n/a} | unix | rre | |||
343 | unix:write | sh- | - | - | Write a string to the specified file handle. | class:word | {n/a} | {n/a} | unix | rre |