Words of Lugforth
The words of the Linux build (out/posix/lugforth) and of
the web build (out/web/lugforth.js), as the interpreters
themselves list them.
Generated by tools/words_reference.py, which asks the
interpreters for their words, so nothing here can be missing (run it
again after adding words: see docs/dev/PITFALLS.md). The descriptions
come, in this order, from the reference pages
attic/oldsite/*.html, from short notes in
tools/words_notes.py, and from the stack comments and
bindings in the Forth sources. A word of the ANS Forth standard that the
project does not describe is marked ANS: it does what the
standard says (see the links below).
The columns: Word, Stack effect, What it does, and where the word exists: P Linux (POSIX) build, W web build.
Other places to read about the words
- The Lugforth site,
and the original uEforth it comes from (the
reference pages of
attic/oldsite/are the source of many descriptions here). - ESP32forth glossary, a spreadsheet kept by the community, and the v7.5 list of words, which repeats the reference pages.
- esp32.arduino-forth.com, in French: a glossary and a lexicon per version (for example v7.0712), with a help page for each word. It follows ESP32forth, the same language on the ESP32, so it also covers hardware words that this build does not have.
- ANS Forth standard, for the standard words.
- The SDL2 words are in docs/SDL2-words.md.
The forth vocabulary
511 words. 62 are described by the reference pages, 162 by the notes, 155 are standard words the project leaves to the standard, 132 have only a stack comment or binding, 0 have no description yet.
Arguments
| Word | Stack | What it does | P W |
|---|---|---|---|
argc |
( -- n ) |
The number of command line arguments. | P - |
argv |
( n -- a n ) |
Command line argument number n, as a string (0 is the program, 1 the script). | P - |
Assembler
| Word | Stack | What it does | P W |
|---|---|---|---|
asm |
( -- ) |
Vocabulary of the inline assembler for the native CPU. See
common/assembler.fs. |
P W |
Blocks
| Word | Stack | What it does | P W |
|---|---|---|---|
block |
( n -- a ) |
ANS. Get a 1024 byte block | P - |
block-fid |
( -- n ) |
Value. The file handle of the file that holds the blocks, -1 if none. | P - |
block-id |
( -- n ) |
Value. The number of the block now in the block buffer, -1 if none. | P - |
buffer |
( n -- a ) |
ANS. Get a 1024 byte block without regard to old contents | P - |
copy |
( from to -- ) |
Copies a block to another block. | P - |
default-use |
( -- ) |
Deferred word run to open the default block file,
blocks.fb. |
P - |
editor |
( -- ) |
Vocabulary of the block editor. | P - |
empty-buffers |
( -- ) |
ANS. Empty all buffers | P - |
flush |
( -- ) |
ANS. Save and empty all buffers | P - |
list |
( n -- ) |
ANS. List a block | P - |
load |
( n -- ) |
ANS. Evaluate a block | P - |
open-blocks |
( a n -- ) |
Open a file as the block file | P - |
save-buffers |
( -- ) |
ANS. Save all buffers | P - |
scr |
( -- a ) |
ANS. Pointer to last listed block | P - |
thru |
( a b -- ) |
ANS. Load blocks a thru b | P - |
update |
( -- ) |
ANS. Mark the last block modified | P - |
use |
( "name" -- ) |
Use "name" as the blockfile, e.g. USE /spiffs/foo | P - |
Boot and system
| Word | Stack | What it does | P W |
|---|---|---|---|
#! |
( -- ) |
Skips the rest of the line, so a script can start with
#! /usr/bin/env lugforth. Immediate. |
P W |
aft |
( -- ) |
eForth loop word: in n for A aft B then C next, A runs
only the first time round, B every other time, C every time. |
P W |
binary |
( -- ) |
Sets the number base to 2. | P W |
echo |
( -- a ) |
Variable. Typed characters are echoed while it is true. | P W |
extract |
( n base -- n2 c ) |
Pictured numeric output: splits off the last digit of n. | P W |
for |
( n -- ) |
eForth counted loop: n for ... next runs the body n+1
times, r@ gives the count from n down to 0. |
P W |
fp0 |
( -- a ) |
The float stack pointer at the start. | P W |
help |
( -- ) |
Same as info. |
P W |
hld |
( -- a ) |
Variable. The position in the pictured numeric output buffer. | P W |
info |
( -- ) |
Prints the version, the revision and the date of the build, the free dictionary, the stacks and a few hints. | P W |
K |
( -- n ) |
The index of the third enclosing do loop, after
i and j. |
P W |
n. |
( n -- ) |
Prints a number without a trailing space. | P W |
next |
( -- ) |
Ends a for loop. |
P W |
octal |
( -- ) |
Sets the number base to 8. | P W |
postpone, |
( xt -- ) |
Compiles a word the way postpone would. |
P W |
prompt |
( -- ) |
Deferred word that prints the input prompt. | P W |
rp0 |
( -- a ) |
The return stack pointer at the start. | P W |
r~ |
( "string~" -- a n ) |
Raw string ending with ~, on several lines if needed:
r~ text with | bars ~. Like r" and
r|, it needs no escapes. |
P W |
script-bye |
( -- ) |
Ends a script: leaves the program when it ran from a file, and does nothing at the prompt. | P W |
sp0 |
( -- a ) |
The data stack pointer at the start. | P W |
str |
( n -- a u ) |
Converts a signed number to a string in the current base. | P W |
structures |
( -- ) |
Vocabulary for building C-style structures. | P W |
tib |
( -- a ) |
The address of the terminal input buffer. | P W |
used |
( -- n ) |
The number of bytes of the dictionary in use. | P W |
Desktop
| Word | Stack | What it does | P W |
|---|---|---|---|
graphics |
( -- ) |
Lazy loaded generic graphics interface (a window and a back buffer,
on X11 or the web). See common/graphics.fs. |
P - |
Dictionary Images and Startup
| Word | Stack | What it does | P W |
|---|---|---|---|
remember |
( -- ) |
Save a snapshot to the default file (./myforth or /spiffs/myforth on ESP32). | P - |
reset |
( -- ) |
Delete the default filename. | P - |
restore |
( "name" -- ) |
Restore a snapshot from a file. | P - |
revive |
( -- ) |
Restore the default filename. | P - |
save |
( "name" -- ) |
Saves a snapshot of the current dictionary to a file. | P - |
startup: |
( "name" -- ) |
Save a snapshot to the default file arranging for "name" to be run on startup. | P - |
Dictionary entries
| Word | Stack | What it does | P W |
|---|---|---|---|
>flags |
( xt -- n ) |
The flag byte of a definition (bit 0 is set for immediate words). | P W |
>flags& |
( xt -- a ) |
The address of the flag byte of a definition. | P W |
>link |
( xt -- xt2 ) |
The definition that comes before this one in its vocabulary. | P W |
>link& |
( xt -- a ) |
The address of the link field of a definition. | P W |
>name |
( xt -- a n ) |
The name of a definition, as a string. | P W |
>params |
( xt -- n ) |
The number of parameter cells a definition keeps in its header. | P W |
>size |
( xt -- n ) |
The size in bytes of a definition header: name, flags, link and its parameter cells. | P W |
Files
| Word | Stack | What it does | P W |
|---|---|---|---|
BIN |
( fh -- fh ) |
ANS. | P - |
CLOSE-DIR |
( dh -- ior ) |
Closes a directory opened with open-dir. |
P - |
CLOSE-FILE |
( fh -- ior ) |
ANS. | P - |
CREATE-FILE |
( a n fam -- fh ior ) |
ANS. | P - |
DELETE-FILE |
( a n -- ior ) |
ANS. | P - |
file-exists? |
( a n -- f ) |
True if the named file can be opened. | P - |
FILE-POSITION |
( fh -- n ior ) |
ANS. | P - |
FILE-SIZE |
( fh -- n ior ) |
ANS. | P - |
included? |
( a n -- f ) |
True if the file was already included. | P - |
needs |
( "name" -- ) |
Includes a file unless it was already included. | P - |
NON-BLOCK |
( fh -- ior ) |
Puts an open file or socket in non-blocking mode. | P - |
OPEN-DIR |
( a n -- dh ior ) |
Opens a directory by name. | P - |
OPEN-FILE |
( a n fam -- fh ior ) |
ANS. | P - |
R/O |
( -- mode ) |
ANS. | P - |
R/W |
( -- mode ) |
ANS. | P - |
READ-DIR |
( dh -- a n ) |
The name of the next entry of an open directory, or 0 at the end. | P - |
READ-FILE |
( a n fh -- n ior ) |
ANS. | P - |
REPOSITION-FILE |
( n fh -- ior ) |
ANS. | P - |
streams |
( -- ) |
Vocabulary of byte streams (ring buffers). | P - |
visual |
( -- ) |
Lazy loaded visual (full screen) editor. | P - |
W/O |
( -- mode ) |
ANS. | P - |
WRITE-FILE |
( a n fh -- ior ) |
ANS. | P - |
Floating-Point
| Word | Stack | What it does | P W |
|---|---|---|---|
#fs |
( r -- ) |
Pictured numeric output for a float: adds its digits (and a minus
sign) to the number being built. Used by f.. |
P W |
1/F |
( r -- r2 ) |
The inverse of a float, 1/r. | P W |
afliteral |
( r -- ) |
Compiles a float as a literal. Immediate. | P W |
F* |
( r r -- r ) |
ANS. Primitive defined in C. | P W |
F+ |
( r r -- r ) |
ANS. Primitive defined in C. | P W |
F- |
( r r -- r ) |
ANS. Primitive defined in C. | P W |
f.s |
( -- ) |
Print float stack. | P W |
F/ |
( r r -- r ) |
ANS. Primitive defined in C. | P W |
F0< |
( r -- f ) |
ANS. Primitive defined in C. | P W |
F0= |
( r -- f ) |
ANS. Primitive defined in C. | P W |
F< |
( r r -- f ) |
ANS. Primitive defined in C. | P W |
F<= |
( r1 r2 -- f ) |
True if r1 is less than or equal to r2. | P W |
F<> |
( r1 r2 -- f ) |
True if r1 and r2 are different. | P W |
F= |
( r1 r2 -- f ) |
True if r1 and r2 are equal. | P W |
F> |
( r1 r2 -- f ) |
True if r1 is greater than r2. | P W |
F>= |
( r1 r2 -- f ) |
True if r1 is greater than or equal to r2. | P W |
F>S |
( r -- n ) |
ANS. Primitive defined in C. | P W |
fconstant |
( r "name" ) |
ANS. | P W |
FDROP |
( r -- ) |
ANS. Primitive defined in C. | P W |
FDUP |
( r -- r r ) |
ANS. Primitive defined in C. | P W |
fliteral |
( r -- ) |
ANS. IMMEDIATE | P W |
FNIP |
( ra rb -- rb ) |
Drops the float below the top of the float stack. | P W |
FOVER |
( ra rb -- ra rb ra ) |
ANS. Primitive defined in C. | P W |
FP! |
( a -- ) |
Sets the float stack pointer. | P W |
FP@ |
( -- a ) |
The float stack pointer. | P W |
FSQRT |
( r -- r ) |
ANS. Primitive defined in C. | P W |
FSWAP |
( ra rb -- rb ra ) |
ANS. Primitive defined in C. | P W |
fvariable |
( "name" ) |
ANS. | P W |
PI |
( -- r ) |
The constant pi. | P W |
S>F |
( n -- r ) |
ANS. Primitive defined in C. | P W |
SF! |
( r a -- ) |
ANS. Single precision store | P W |
sf, |
( r -- ) |
Compiles a float into the dictionary. | P W |
SF@ |
( a -- r ) |
ANS. Single precision load | P W |
SFLOAT |
( -- 4 ) |
Constant, the size in bytes of a float (single precision). | P W |
SFLOAT+ |
( a -- a+4 ) |
ANS. Primitive defined in C. | P W |
SFLOATS |
( n -- n*4 ) |
ANS. Primitive defined in C. | P W |
Interpret Time Conditions
| Word | Stack | What it does | P W |
|---|---|---|---|
[ELSE] |
( -- ) |
ANS. Interpret time ELSE. | P W |
[IF] |
( f -- ) |
ANS. Conditionally interpret the text the follows. | P W |
[THEN] |
( -- ) |
ANS. Interpret time THEN. | P W |
DEFINED? |
( "name" -- xt|0 ) |
Check if a word exists (works at compile time too). | P W |
Linux Opcodes
| Word | Stack | What it does | P W |
|---|---|---|---|
DLSYM |
( module name-z -- fn ) |
C dlsym: the address of a symbol in a shared library,
or of the main program's symbols when module is 0. |
P - |
Locals
| Word | Stack | What it does | P W |
|---|---|---|---|
+to |
( n "name" -- ) |
Adds n to a value or a local:
1 +to count. |
P W |
{ |
( "names" -- ) |
Declares locals: { a b -- c }. The values are taken
from the stack; what follows -- is only a comment. |
P W |
Null Terminated Strings
| Word | Stack | What it does | P W |
|---|---|---|---|
s>z |
( a n -- z ) |
Conver a counted string string to null terminated (copies string to heap) | P W |
z" |
( "string" -- z ) |
Creates a null terminated string on the heap | P W |
z>s |
( z -- a n ) |
Convert a null terminated string to a counted string | P W |
Primitives
| Word | Stack | What it does | P W |
|---|---|---|---|
-rot |
( a b c -- c a b ) |
The reverse of rot. |
P W |
3dup |
( a b c -- a b c a b c ) |
Duplicates the top three cells. | P W |
4* |
( n -- n*4 ) |
Multiplies by 4. | P W |
4/ |
( n -- n/4 ) |
Divides by 4 with an arithmetic shift. | P W |
<= |
( a b -- f ) |
True if a is less than or equal to b. | P W |
>= |
( a b -- f ) |
True if a is greater than or equal to b. | P W |
ARSHIFT |
( n u -- n2 ) |
Shifts n right by u bits, keeping the sign. | P W |
CELL |
( -- n ) |
The size of a cell in bytes. | P W |
cell/ |
( n -- n2 ) |
Divides a size in bytes by the size of a cell. | P W |
context |
( -- a ) |
The address of the top of the search order. | P W |
current |
( -- a ) |
The address of the variable that says which vocabulary
definitions go to. |
P W |
L! |
( n a -- ) |
Stores the low 32 bits of n at address a. | P W |
latestxt |
( -- xt ) |
The execution token of the word defined last. | P W |
nl |
( -- n ) |
The newline character, 10. | P W |
rdrop |
( r: n n -- ) |
Primitive defined in C. | P W |
RP! |
( a -- ) |
Sets the return stack pointer. | P W |
RP@ |
( -- a ) |
The return stack pointer. | P W |
SL@ |
( a -- n ) |
Fetches a signed 32 bit number. | P W |
SP! |
( a -- ) |
Sets the data stack pointer. | P W |
SP@ |
( -- a ) |
The data stack pointer. | P W |
SW@ |
( a -- n ) |
Fetches a signed 16 bit number. | P W |
U/MOD |
( u u2 -- rem quot ) |
Unsigned division with the remainder. | P W |
UL@ |
( a -- u ) |
Fetches an unsigned 32 bit number. | P W |
UW@ |
( a -- u ) |
Fetches an unsigned 16 bit number. | P W |
W! |
( n a -- ) |
Stores the low 16 bits of n at address a. | P W |
Raw Strings
| Word | Stack | What it does | P W |
|---|---|---|---|
r" |
( "string" -- a n ) |
Creates a temporary counted string | P W |
r| |
( string| -- a n ) |
Creates a temporary counted string ending with | | P W |
Shell Utilities
| Word | Stack | What it does | P W |
|---|---|---|---|
cat |
( "path" -- ) |
Print contents of "path" file. | P - |
cd |
( "path" -- ) |
Change director to "path". | P - |
cp |
( "src" "dst" -- ) |
Copy "src" file to "dst". | P - |
ls |
( "path" -- ) |
List files or directories in "path". | P - |
mkdir |
( "path" -- ) |
Create directory "path". | P - |
mv |
( "src" "dst" -- ) |
Rename "src" file to "dst". | P - |
pwd |
( -- ) |
Print current directory. | P - |
rm |
( "path" -- ) |
Remove "path" file. | P - |
rmdir |
( "path" -- ) |
Remove directory "path". | P - |
touch |
( "path" -- ) |
Create "path" file if it doesn't exist. | P - |
System
| Word | Stack | What it does | P W |
|---|---|---|---|
ms |
( n -- ) |
ANS. Pause for some number of milliseconds. | P W |
ms-ticks |
( -- n ) |
Time since start in milliseconds. | P W |
terminate |
( n -- ) |
Call system exit. | P W |
Tasks
| Word | Stack | What it does | P W |
|---|---|---|---|
pause |
( -- ) |
Yield to other tasks. | P W |
pause? |
( -- f ) |
True if another task is waiting to run. | P W |
start-task |
( task -- ) |
Activate a task. | P W |
task |
( xt dsz rsz "name" -- ) |
Create a new task with dsz size data stack and rsz size return stack running xt. | P W |
tasks |
( -- ) |
Vocabulary of the cooperative tasks. | P W |
Terminal colors
| Word | Stack | What it does | P W |
|---|---|---|---|
ansi |
( -- ) |
Vocabulary of terminal escape sequences: colors, cursor, screen. | P W |
bg |
( n -- ) |
Sets the terminal background color, 0 to 255 (ANSI escape sequence). | P W |
fg |
( n -- ) |
Sets the terminal text color, 0 to 255 (ANSI escape sequence). | P W |
normal |
( -- ) |
Resets the terminal colors and attributes. | P W |
set-title |
( a n -- ) |
Sets the title of the terminal window. | P W |
Utilities
| Word | Stack | What it does | P W |
|---|---|---|---|
assert |
( f -- ) |
Testing framework: throws if the flag is false. See
common/testing.fs. |
P W |
dump |
( a n -- ) |
ANS. Dump a memory region | P W |
dump-file |
( data data# fn fn# -- ) |
Write contents of a file throws on error. | P - |
remaining |
( -- n ) |
Bytes remaining in Forth heap. | P W |
see |
( "name" -- ) |
ANS. Attempt to decompile a word | P W |
startswith? |
( a n a2 n2 -- f ) |
True if the first string starts with the second. | P W |
str= |
( a n a2 n2 -- f ) |
True if two strings are equal. | P W |
Vocabularies
| Word | Stack | What it does | P W |
|---|---|---|---|
also |
( -- ) |
ANS. Duplicate the vocabulary at the top of the vocabulary stack | P W |
definitions |
( -- ) |
ANS. Make the context vocabulary the current vocabulary | P W |
FORTH |
( -- ) |
ANS. Make the FORTH vocabulary the context vocabulary | P W |
internals |
( -- ) |
Vocabulary of the inner workings of the system. | P W |
only |
( -- ) |
ANS. Reset context stack to one item, the FORTH dictionary Non-standard, as there's no distinct ONLY vocabulary | P W |
order |
( -- ) |
ANS. Print the vocabulary search order | P W |
previous |
( -- ) |
ANS. Drop the vocabulary at the top of the vocabulary stack | P W |
recognizers |
( -- ) |
Vocabulary of the recognizers, which decide what to do with a word that is not found. | P W |
sealed |
( -- ) |
Alter the last vocabulary defined so it doesn't chain | P W |
transfer |
( "name" ) |
Move a word from its current dictionary to the current vocabulary Useful for "hiding" built-in words | P W |
transfer{ |
( -- ) |
Starts a list of names to copy into the current vocabulary, ended by
}transfer: transfer{ dup drop }transfer. |
P W |
vlist |
( -- ) |
List the words in the context vocabulary (not chains) | P W |
vocabulary |
( "name" ) |
Create a vocabulary with the current vocabulary as parent | P W |
words |
( -- ) |
ANS. List the words in the context vocabulary (including chains) | P W |
}transfer |
( -- ) |
Ends a transfer{ list. |
P W |
µEforth Internals
| Word | Stack | What it does | P W |
|---|---|---|---|
CREATE |
( "name" -- ) |
ANS. Primitive defined in C. | P W |
FIND |
( a n -- xt | 0 ) |
ANS. Primitive defined in C. | P W |
PARSE |
( ch -- a n ) |
ANS. Primitive defined in C. | P W |
Standard words
| Word | Stack | What it does | P W |
|---|---|---|---|
! |
ANS. Primitive defined in C. | P W | |
# |
( u -- u ) |
ANS. | P W |
#> |
( w -- b u ) |
ANS. | P W |
#s |
( u -- 0 ) |
ANS. | P W |
#tib |
ANS. Primitive defined in C. | P W | |
' |
ANS. | P W | |
( |
ANS. | P W | |
(local) |
( a n -- ) |
ANS. | P W |
* |
( n n -- n ) |
ANS. Primitive defined in C. | P W |
*/ |
( n n n -- n ) |
ANS. | P W |
*/MOD |
ANS. Primitive defined in C. | P W | |
+ |
ANS. Primitive defined in C. | P W | |
+! |
( n a -- ) |
ANS. Primitive defined in C. | P W |
+loop |
( n -- ) |
ANS. | P W |
, |
( n -- ) |
ANS. | P W |
- |
( n n -- n ) |
ANS. Primitive defined in C. | P W |
. |
( w -- ) |
ANS. | P W |
." |
ANS. | P W | |
.( |
( -- ) |
ANS. | P W |
.r |
( n width -- ) |
ANS. | P W |
.s |
ANS. | P W | |
/ |
( n n -- n ) |
ANS. Primitive defined in C. | P W |
/mod |
( n n -- n n ) |
ANS. Primitive defined in C. | P W |
/string |
( a n k -- a n ) |
ANS. | P W |
0< |
ANS. Primitive defined in C. | P W | |
0<> |
( n -- n ) |
ANS. Primitive defined in C. | P W |
0= |
ANS. Primitive defined in C. | P W | |
0> |
( n -- f ) |
ANS. | P W |
1+ |
ANS. Primitive defined in C. | P W | |
1- |
ANS. Primitive defined in C. | P W | |
2! |
( lo hi a -- ) |
ANS. Primitive defined in C. | P W |
2* |
ANS. Primitive defined in C. | P W | |
2/ |
ANS. Primitive defined in C. | P W | |
2>r |
( a b -- ) |
ANS. | P W |
2@ |
( a -- lo hi ) |
ANS. Primitive defined in C. | P W |
2constant |
( a b "name" -- ) |
ANS. | P W |
2drop |
( n n -- ) |
ANS. Primitive defined in C. | P W |
2dup |
( a b -- a b a b ) |
ANS. Primitive defined in C. | P W |
2literal |
( a b -- ) |
ANS. | P W |
2over |
( a b c d -- a b c d a b ) |
ANS. | P W |
2r> |
( -- a b ) |
ANS. | P W |
2r@ |
( -- a b ) |
ANS. | P W |
2swap |
( a b c d -- c d a b ) |
ANS. | P W |
2variable |
( "name" -- ) |
ANS. | P W |
: |
ANS. Primitive defined in C. | P W | |
:noname |
( -- xt ) |
ANS. | P W |
; |
ANS. | P W | |
< |
( a b -- a<b ) |
ANS. Primitive defined in C. | P W |
<# |
( -- ) |
ANS. | P W |
<> |
( a b -- a!=b ) |
ANS. Primitive defined in C. | P W |
= |
( a b -- a!=b ) |
ANS. Primitive defined in C. | P W |
> |
( a b -- a>b ) |
ANS. Primitive defined in C. | P W |
>BODY |
ANS. Primitive defined in C. | P W | |
>in |
( c -- ) |
ANS. Primitive defined in C. | P W |
>number |
( lo hi a n -- lo hi a n ) |
ANS. | P W |
>R |
ANS. Primitive defined in C. | P W | |
? |
( a -- ) |
ANS. | P W |
?do |
( n n -- n n f .. ) |
ANS. | P W |
?dup |
ANS. Primitive defined in C. | P W | |
@ |
ANS. Primitive defined in C. | P W | |
[ |
ANS. | P W | |
['] |
ANS. | P W | |
[char] |
ANS. | P W | |
[compile] |
( "name" -- ) |
ANS. | P W |
\ |
ANS. | P W | |
] |
ANS. | P W | |
abort |
ANS. | P W | |
abort" |
ANS. | P W | |
abs |
( n -- +n ) |
ANS. Primitive defined in C. | P W |
accept |
( a n -- n ) |
ANS. | P W |
again |
ANS. | P W | |
ahead |
ANS. | P W | |
align |
ANS. Primitive defined in C. | P W | |
aligned |
( a -- a ) |
ANS. Primitive defined in C. | P W |
allocate |
( n -- a ior ) |
ANS. | P - |
allot |
( n -- ) |
ANS. Primitive defined in C. | P W |
AND |
ANS. Primitive defined in C. | P W | |
at-xy |
( x y -- ) |
ANS. | P W |
base |
ANS. Primitive defined in C. | P W | |
begin |
ANS. | P W | |
bl |
ANS. Primitive defined in C. | P W | |
blank |
ANS. Primitive defined in C. | P W | |
bye |
ANS. | P W | |
C! |
ANS. Primitive defined in C. | P W | |
c, |
( ch -- ) |
ANS. | P W |
C@ |
ANS. Primitive defined in C. | P W | |
CASE |
( n -- ) |
ANS. | P W |
catch |
( xt -- n ) |
ANS. | P W |
cell+ |
( n -- n ) |
ANS. Primitive defined in C. | P W |
cells |
( n -- n ) |
ANS. Primitive defined in C. | P W |
char |
ANS. | P W | |
char+ |
( a -- a ) |
ANS. | P W |
chars |
( n -- n ) |
ANS. | P W |
cmove |
( a a n -- ) |
ANS. Primitive defined in C. | P W |
cmove> |
( a a n -- ) |
ANS. Primitive defined in C. | P W |
compare |
( a1 n1 a2 n2 -- -1|0|1 ) |
ANS. | P W |
compile, |
( xt -- ) |
ANS. | P W |
CONSTANT |
ANS. Primitive defined in C. | P W | |
count |
( a -- a n ) |
ANS. | P W |
cr |
ANS. | P W | |
d+ |
( lo1 hi1 lo2 hi2 -- lo hi ) |
ANS. | P W |
d- |
( d d -- d ) |
ANS. | P W |
d. |
( d -- ) |
ANS. | P W |
d0< |
( d -- f ) |
ANS. | P W |
d0= |
( d -- f ) |
ANS. | P W |
d2* |
( lo hi -- lo hi ) |
ANS. | P W |
d2/ |
( lo hi -- lo hi ) |
ANS. | P W |
d< |
( lo1 hi1 lo2 hi2 -- f ) |
ANS. | P W |
d= |
( lo1 hi1 lo2 hi2 -- f ) |
ANS. | P W |
d>s |
( d -- n ) |
ANS. | P W |
dabs |
( d -- d ) |
ANS. | P W |
decimal |
( -- ) |
ANS. | P W |
defer |
( "name" -- ) |
ANS. | P W |
depth |
( -- n ) |
ANS. | P W |
dnegate |
( d -- d ) |
ANS. | P W |
do |
( n n -- .. ) |
ANS. | P W |
DOES> |
ANS. Primitive defined in C. | P W | |
DROP |
ANS. Primitive defined in C. | P W | |
du< |
( lo1 hi1 lo2 hi2 -- f ) |
ANS. | P W |
DUP |
ANS. Primitive defined in C. | P W | |
else |
ANS. | P W | |
emit |
( n -- ) |
ANS. | P W |
ENDCASE |
ANS. | P W | |
ENDOF |
ANS. | P W | |
environment? |
( a n -- 0 | val -1 ) |
ANS. | P W |
erase |
( a n -- ) |
ANS. Primitive defined in C. | P W |
evaluate |
( a n -- ) |
ANS. | P W |
EXECUTE |
ANS. Primitive defined in C. | P W | |
exit |
ANS. Primitive defined in C. | P W | |
F** |
ANS. Primitive defined in C. | P W | |
f. |
( r -- ) |
ANS. | P W |
FABS |
ANS. Primitive defined in C. | P W | |
false |
ANS. Constant, 0. | P W | |
FATAN2 |
ANS. Primitive defined in C. | P W | |
FCOS |
ANS. Primitive defined in C. | P W | |
fdepth |
( -- n ) |
ANS. | P W |
FEXP |
ANS. Primitive defined in C. | P W | |
fill |
( a n ch -- ) |
ANS. JavaScript function of the web page. | P W |
FLN |
ANS. Primitive defined in C. | P W | |
FLOOR |
ANS. Primitive defined in C. | P W | |
FLUSH-FILE |
( fh -- ior ) |
ANS. | P - |
fm/mod |
( lo hi n -- rem quot ) |
ANS. | P W |
FMAX |
ANS. Primitive defined in C. | P W | |
FMIN |
ANS. Primitive defined in C. | P W | |
FNEGATE |
ANS. Primitive defined in C. | P W | |
forget |
( "name" ) |
ANS. | P W |
free |
( a -- ior ) |
ANS. | P - |
FROT |
ANS. Primitive defined in C. | P W | |
FSIN |
ANS. Primitive defined in C. | P W | |
FSINCOS |
ANS. Primitive defined in C. | P W | |
here |
( -- a ) |
ANS. Primitive defined in C. | P W |
hex |
( -- ) |
ANS. | P W |
hold |
( c -- ) |
ANS. | P W |
I |
ANS. | P W | |
if |
ANS. | P W | |
IMMEDIATE |
ANS. Primitive defined in C. | P W | |
include |
( "name" -- ) |
ANS. | P - |
included |
( a n -- ) |
ANS. | P - |
invert |
( n -- ~n ) |
ANS. Primitive defined in C. | P W |
is |
( xt "name -- ) |
ANS. | P W |
J |
( -- n ) |
ANS. | P W |
key |
ANS. | P W | |
key? |
ANS. | P W | |
leave |
ANS. | P W | |
literal |
ANS. Primitive defined in C. | P W | |
loop |
ANS. | P W | |
LSHIFT |
ANS. Primitive defined in C. | P W | |
m* |
( n n -- d ) |
ANS. | P W |
m+ |
( d n -- d ) |
ANS. | P W |
marker |
( "name" -- ) |
ANS. | P W |
max |
ANS. Primitive defined in C. | P W | |
min |
ANS. Primitive defined in C. | P W | |
mod |
( n n -- n ) |
ANS. Primitive defined in C. | P W |
move |
( src dst n -- ) |
ANS. | P W |
negate |
( n -- -n ) |
ANS. Primitive defined in C. | P W |
nip |
( a b -- b ) |
ANS. Primitive defined in C. | P W |
OF |
( n -- ) |
ANS. | P W |
OR |
ANS. Primitive defined in C. | P W | |
OVER |
ANS. Primitive defined in C. | P W | |
pad |
( -- a ) |
ANS. | P W |
page |
ANS. | P W | |
pick |
( xu .. x0 u -- xu .. x0 xu ) |
ANS. | P W |
postpone |
( "name" -- ) |
ANS. | P W |
precision |
ANS. | P W | |
quit |
ANS. | P W | |
R> |
ANS. Primitive defined in C. | P W | |
R@ |
ANS. Primitive defined in C. | P W | |
recurse |
ANS. | P W | |
refill |
ANS. | P W | |
RENAME-FILE |
( a n a n -- ior ) |
ANS. | P - |
repeat |
ANS. | P W | |
required |
( a n -- ) |
ANS. | P - |
resize |
( a n -- a ior ) |
ANS. | P - |
RESIZE-FILE |
( n fh -- ior ) |
ANS. | P - |
roll |
( xu .. x0 u -- xu-1 .. x0 xu ) |
ANS. | P W |
rot |
( a b c -- c a b ) |
ANS. Primitive defined in C. | P W |
RSHIFT |
ANS. Primitive defined in C. | P W | |
s" |
ANS. | P W | |
s>d |
( n -- d ) |
ANS. | P W |
search |
( a1 n1 a2 n2 -- a3 n3 f ) |
ANS. | P W |
set-precision |
( n -- ) |
ANS. | P W |
sign |
( n -- ) |
ANS. | P W |
sm/rem |
( lo hi n -- rem quot ) |
ANS. | P W |
source |
( -- a n ) |
ANS. | P W |
space |
ANS. | P W | |
spaces |
( n -- ) |
ANS. | P W |
state |
ANS. Primitive defined in C. | P W | |
SWAP |
ANS. Primitive defined in C. | P W | |
then |
ANS. | P W | |
throw |
( n -- ) |
ANS. | P W |
to |
( n -- ) |
ANS. | P W |
true |
ANS. Constant, -1. | P W | |
tuck |
( a b -- b a b ) |
ANS. | P W |
type |
ANS. | P W | |
u. |
( u -- ) |
ANS. | P W |
u.r |
( u width -- ) |
ANS. | P W |
U< |
ANS. Primitive defined in C. | P W | |
u> |
( u u -- f ) |
ANS. | P W |
um* |
( u u -- ud ) |
ANS. | P W |
um/mod |
( lo hi u -- rem quot ) |
ANS. | P W |
UNLOOP |
ANS. | P W | |
until |
ANS. | P W | |
value |
( n -- ) |
ANS. | P W |
VARIABLE |
ANS. Primitive defined in C. | P W | |
while |
ANS. | P W | |
within |
( n lo hi -- f ) |
ANS. | P W |
word |
( ch -- a ) |
ANS. | P W |
XOR |
ANS. Primitive defined in C. | P W |
Other
| Word | Stack | What it does | P W |
|---|---|---|---|
2+ |
( n -- n ) |
Adds 2 to a number. | P W |
2- |
( n -- n ) |
Subtracts 2 from a number. | P W |
>name-length |
( xt -- n ) |
The length in bytes of the name of a definition. | - W |
[defined] |
( "name" -- f ) |
True when the next word is found in the dictionary. Mostly used with [if]: [defined] foo [if] ... [then]. | P W |
[undefined] |
( "name" -- f ) |
True when the next word is not found in the dictionary: the reverse of [defined]. | P W |
alpha |
( a -- ) |
Sets the opacity of the drawing color, 0 to 255 (after
color, which resets it). |
- W |
anew |
( "name" -- ) |
Like marker, but first forgets the word of that name and everything after it if it exists, so a file can be loaded again without piling up its words. | P W |
black |
( -- $rrggbb ) |
The color black, $000000: black color. |
- W |
blue |
( -- $rrggbb ) |
The color blue, $0000ff: blue color. |
- W |
box |
( x y w h -- ) |
Fills a rectangle. At the web prompt it opens the drawing area first. | - W |
brown |
( -- $rrggbb ) |
The color brown, $804000: brown color. |
- W |
CALL |
( xt -- ) |
Calls a foreign function through the FFI. Used by
sofunc, sysfunc (POSIX) and
JSWORD: (web). |
- W |
cell- |
( a -- a ) |
The address of the previous cell: a minus the size of a cell (8 bytes). | P W |
circle |
( cx cy r -- ) |
Draws the outline of a circle. | - W |
cls |
( -- ) |
Clears the drawing area to black. | - W |
color |
( $rrggbb -- ) |
Sets the drawing color: red color,
$ff8000 color. |
- W |
colors |
( -- ) |
Web build: prints all 256 terminal colors, to see what
fg and bg give. |
- W |
cyan |
( -- $rrggbb ) |
The color cyan, $00ffff: cyan color. |
- W |
d> |
( d d -- f ) |
True when the signed double d1 is greater than d2. | P W |
default-key |
( -- c ) |
The standard input key of the platform, what
key does by default. |
P - |
default-type |
( a n -- ) |
The standard output type of the platform, what
type does by default. |
P - |
disc |
( cx cy r -- ) |
Fills a disc. | - W |
dot |
( x y -- ) |
Draws a pixel. At the web prompt it opens the drawing area first. | - W |
ed |
( "file" -- ) |
The text editor written in Forth. See the manual. | P - |
ed-arg |
ed-arg, ed-arg-n: the file name typed after ed (a buffer and its length). | P - | |
ed-arg-n |
( -- n ) |
Length of the file name kept in ed-arg (the name typed
after ed or writhdeck). |
P - |
ed-go |
Runs the editor on the file a n. Set to ed-main when ed-src is compiled. | P - | |
ed-loaded |
Flag: the code of ed (the string ed-src) has been compiled. | P - | |
ed-src |
The source of the editor ed, a string compiled the first time ed is used. | P - | |
eval-copy |
( a n -- ) |
Evaluates the string a n after copying it to the heap, then restores the input source. Used for code kept as a string that evaluating would overwrite (the code of ed, writhdeck and the console window). | P - |
fill32 |
( a n v ) |
Primitive defined in C. | - W |
form |
( -- h w ) |
The height and width of the terminal, in characters. | P - |
forth-builtins |
( -- ) |
The vocabulary at the bottom of forth, holding the
words defined in C. They are moved into forth when the
system starts. |
P W |
frame |
( x y w h -- ) |
Draws the outline of a rectangle. | - W |
graphic |
( -- ) |
Loads sdl2 and makes the drawing words
(line, box, color,
cls...) work at the prompt: in the console window under the
text, on the web page in a drawing area above it. |
- W |
gray |
( -- $rrggbb ) |
The color gray, $808080: gray color. |
- W |
green |
( -- $rrggbb ) |
The color green, $00c000: green color. |
- W |
gui-load |
( -- ) |
Compiles the code of the console window (gui-src) if it
is not yet. |
P - |
gui-src |
( -- a n ) |
The source of the console window (lugforth --gui), a
string compiled when the window is first opened. |
P - |
gui-ttf-src |
( -- a n ) |
The source of the TrueType font part of the console window, compiled only when a font is asked for. | P - |
gui-tty? |
( -- f ) |
True when standard input is a terminal (then the window is not needed). | P - |
hline |
( x y w -- ) |
Draws a horizontal line of w pixels. | - W |
httpd |
( -- ) |
Lazy loaded HTTP server. See
attic/oldsite/posix_common.html. |
P - |
ink |
( n -- ) |
Sets the drawing color by number, 0 to 15 (0 black, 1 red, 2 green, 3 yellow, 4 blue, 5 magenta, 6 cyan, 7 white...). | - W |
line |
( x1 y1 x2 y2 -- ) |
Draws a line in the current color. Typed at the web prompt before
graphic, it opens the drawing area first. |
- W |
magenta |
( -- $rrggbb ) |
The color magenta, $ff00ff: magenta color. |
- W |
noop |
( -- ) |
Does nothing. Handy as the default of a defer. | P W |
not |
( f -- f ) |
Flag inversion (same as 0=): 0 gives -1 (true), any other value gives 0 (false). | P W |
ok |
( -- ) |
Prints the ok after a line is interpreted. |
P W |
orange |
( -- $rrggbb ) |
The color orange, $ff8000: orange color. |
- W |
pager-off |
( -- ) |
Turns the pager off. | P - |
pager-on |
( -- ) |
Stops the output at each screenful at the prompt (space, Enter or q). | P - |
pink |
( -- $rrggbb ) |
The color pink, $ff80c0: pink color. |
- W |
place |
( a n dst -- ) |
Copies the string a n to dst as a counted string: the length in the first byte, then the characters. | P W |
plot |
( x y -- ) |
Alias of dot (sdl2 short words): draws one pixel. See
docs/SDL2-words.md. |
- W |
posix |
( -- ) |
Vocabulary of the system calls and constants of Linux and macOS. | P - |
purple |
( -- $rrggbb ) |
The color purple, $800080: purple color. |
- W |
rand-seed |
The seed of random (a linear congruential generator). Change it to get another sequence: ms-ticks 1 or rand-seed ! | P W | |
random |
( n -- r ) |
JavaScript function of the web page. | P W |
red |
( -- $rrggbb ) |
The color red, $ff0000: red color. |
- W |
rgb |
( r g b -- ) |
Sets the drawing color from its three components, 0 to 255. | - W |
rgba |
( r g b a -- ) |
Same as rgb, with the alpha (opacity). |
- W |
scan |
( a n ch -- a n ) |
Skips characters of the string a n until the first ch. Leaves the rest, starting at that character (n is 0 if ch is not found). | P W |
sdl2 |
( -- ) |
Lazy loaded SDL2 short words for games. See
docs/SDL2.md. |
P W |
sdl2-abc |
( -- ) |
Lazy loaded reader and player of tunes in ABC notation. See
docs/SDL2.md. |
P W |
sdl2-image |
( -- ) |
Lazy loaded SDL2_image sprites. See docs/SDL2.md. |
P W |
sdl2-mixer |
( -- ) |
Lazy loaded SDL2_mixer sound, music and soundfont. See
docs/SDL2.md. |
P W |
sdl2-ttf |
( -- ) |
Lazy loaded SDL2_ttf text. See docs/SDL2.md. |
P - |
skip |
( a n ch -- a n ) |
Skips the leading characters ch of the string a n. Leaves the rest, starting at the first character that is not ch. | P W |
sockets |
( -- ) |
Lazy loaded BSD sockets. | P - |
telnetd |
( -- ) |
Lazy loaded telnet server. | P - |
termios |
( -- ) |
Vocabulary of terminal handling. | P - |
ud. |
( ud -- ) |
Prints an unsigned double number followed by a space. | P W |
wd-go |
Runs writhdeck on the file a n. Set to wd-main when wd-src is compiled. | P - | |
wd-loaded |
Flag: the code of writhdeck (the string wd-src) has been compiled. | P - | |
wd-src |
The source of writhdeck, a string compiled the first time writhdeck is used. | P - | |
web |
( -- ) |
Web build: the vocabulary of the words specific to the browser (the
JS interpreter, JSWORD:...). |
- W |
web-interface |
( -- ) |
Lazy loaded web UI server. | P - |
white |
( -- $rrggbb ) |
The color white, $ffffff: white color. |
- W |
writhdeck |
( "file" -- ) |
The writing editor (port of WrithDeck) built on ed,
with a file browser when called alone. See the manual. |
P - |
x11 |
( -- ) |
Lazy loaded X11 bindings. | P - |
yellow |
( -- $rrggbb ) |
The color yellow, $ffff00: yellow color. |
- W |
The internals
vocabulary (Linux)
Words of the inner workings: the interpreter loop, the dictionary,
system variables. Use internals words, or put
internals in the search order with
also internals.
| Word | Stack | What it does | P |
|---|---|---|---|
#f+s |
( r -- ) |
P | |
$@ |
P | ||
$place |
( a n -- ) |
P | |
'argc |
P | ||
'argv |
P | ||
'boot |
P | ||
'boot-size |
P | ||
'builtins |
P | ||
'cold |
( -- a ) |
Address of the word that will be run on startup. | P |
'context |
P | ||
'heap |
P | ||
'heap-size |
P | ||
'heap-start |
P | ||
'latestxt |
P | ||
'notfound |
P | ||
'runner |
P | ||
'stack-cells |
P | ||
'SYS |
P | ||
'throw-handler |
P | ||
'tib |
P | ||
(+to) |
( xt -- ) |
P | |
(search) |
( a1 n1 a2 n2 a0 n0 -- a n f ) |
Helper of search: looks for the string a2 n2 in a1 n1,
starting at a0 n0. |
P |
(to) |
( xt -- ) |
P | |
(um*) |
( a b lo hi ah -- lo hi ) |
Helper of um*: one step of the unsigned multiplication
of two cells into a double. |
P |
)leaving |
P | ||
*emit |
( n -- ) |
P | |
*key |
( -- n ) |
P | |
+evaluate1 |
P | ||
+TAB |
Constant, 32. | P | |
--? |
( a n -- ) |
P | |
-1 |
P | ||
-TAB |
Constant, 64. | P | |
0 |
P | ||
0BRANCH |
Primitive defined in C. | P | |
1 |
P | ||
<>locals |
P | ||
>digit |
( ch -- n|-1 ) |
P | |
>vocnext |
( xt -- xt ) |
P | |
?arrow. |
P | ||
?echo |
( n -- ) |
P | |
?ins. |
( xt -- xt ) |
P | |
?room |
P | ||
?see-flags |
P | ||
?stack |
P | ||
@line |
( n -- ) |
P | |
[SKIP] |
P | ||
[SKIP]' |
P | ||
abc-parser |
( -- ) |
The source of the reader of ABC notation (common/abc.fs), a string
compiled when sdl2-abc or abc is first
used. |
P |
ALITERAL |
Primitive defined in C. | P | |
ARGS_MARK |
Constant, 128. | P | |
arrow |
P | ||
autoexec |
P | ||
block-data |
P | ||
block-dirty |
P | ||
boot-prompt |
P | ||
boot-set-title |
P | ||
BRANCH |
Primitive defined in C. | P | |
BUILTIN_FORK |
Constant, 4. | P | |
BUILTIN_MARK |
Constant, 8. | P | |
ca@ |
( a -- n ) |
P | |
CALL0 |
( fn -- n ) |
P | |
CALL1 |
( n fn -- n ) |
P | |
CALL10 |
( n n n n n n n n n n fn -- n ) |
P | |
CALL11 |
P | ||
CALL12 |
P | ||
CALL13 |
P | ||
CALL14 |
P | ||
CALL15 |
P | ||
CALL2 |
( n n fn -- n ) |
P | |
CALL3 |
( n n n fn -- n ) |
P | |
CALL4 |
( n n n n fn -- n ) |
P | |
CALL5 |
( n n n n n fn -- n ) |
P | |
CALL6 |
( n n n n n n fn -- n ) |
P | |
CALL7 |
( n n n n n n n n fn -- n ) |
P | |
CALL8 |
P | ||
CALL9 |
( n n n n n n n n n fn -- n ) |
P | |
CALLCODE |
P | ||
cand |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
cases |
P | ||
cat-loop |
( fh -- ) |
Helper of cat: copies the open file fh to the terminal
until its end. |
P |
cb |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
cell-base |
( a -- a ) |
P | |
cell-mask |
P | ||
cell-shift |
( a -- a ) |
P | |
cfirst |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
cl |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
clobber |
( a -- ) |
P | |
clobber-line |
( a -- a' ) |
P | |
close-throw |
( n ior -- ) |
Throws the first error of the two (n from the work, ior from closing the file), else does nothing. | P |
cn |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
common-default-use |
P | ||
cremit |
( ch -- ) |
P | |
crtype |
( a n -- ) |
P | |
ctl-abort |
( -- ) |
an error left an unnamed word half built | P |
ctl-add |
( delta xt -- ) |
P | |
ctl-buf |
the unnamed word is compiled here, so the dictionary is untouched | P | |
ctl-compile |
( xt -- ) |
in the unnamed word: the structure word runs, and the depth follows | P |
ctl-delta |
( xt -- delta -1 | 0 ) |
2 starts a temporary word, 1 opens, -1 closes | P |
ctl-depth |
structures opened and not yet closed | P | |
ctl-finish |
( -- ) |
P | |
ctl-heap |
the real heap pointer, while the unnamed word is built in ctl-buf | P | |
ctl-install |
( -- ) |
Asked before the others (the stack of recognizers is read from its bottom) | P |
ctl-latest |
the last dictionary entry before the unnamed word | P | |
ctl-live? |
( -- f ) |
a temporary word is the one being compiled | P |
ctl-n |
P | ||
ctl-open |
( xt -- ) |
if, do... met outside a definition | P |
ctl-restore |
( -- ) |
back to the real dictionary | P |
ctl-size |
Constant, 8192. | P | |
ctl-table |
pairs: xt, delta | P | |
ctl-xt |
the unnamed word being compiled, 0 when none | P | |
ctl: |
( delta "name" -- ) |
P | |
cuniq |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
da |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
dbuf |
( -- a ) |
Buffer of 80 characters where ud>s builds the
digits. |
P |
default-fprompt |
P | ||
default-prompt |
P | ||
default-remember-filename |
P | ||
digit |
( u -- c ) |
P | |
digit-at |
( a n -- d -1 | 0 ) |
P | |
digit-char |
( n -- ch ) |
The character of a digit 0 to 35: 0-9 then A-Z. | P |
dirname |
( a n -- ) |
P | |
dl |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
dn |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
do-local |
( n -- ) |
P | |
do-notfound |
( a n -- ) |
P | |
DOCOL |
Primitive defined in C. | P | |
DOCON |
Primitive defined in C. | P | |
DOCREATE |
Primitive defined in C. | P | |
DODOES |
Primitive defined in C. | P | |
DOFLIT |
( --- ) |
Puts a float from the next cell onto float stack. | P |
DOLIT |
Primitive defined in C. | P | |
DONEXT |
Primitive defined in C. | P | |
DOSET |
Primitive defined in C. | P | |
DOVAR |
Primitive defined in C. | P | |
dpath |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
dpos |
( -- a ) |
Variable: the position in dbuf of the digits being
built. |
P |
dump-line |
( a -- a ) |
P | |
e' |
( n -- ) |
P | |
ea |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
eat-till-cr |
P | ||
edit-accept |
( -- ) |
Deferred word: the line input used by the prompt. Set to
accept by default, to the line editor when it is
loaded. |
P |
el |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
en |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
ends/ |
( a n -- f ) |
P | |
ep |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
errno |
( -- err ) |
-- ESP32 only as of v7.0.7.2 | P |
evaluate&fill |
P | ||
evaluate-buffer |
P | ||
EVALUATE1 |
( -- ) |
Primitive defined in C. | P |
fdir |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
fill32 |
( a n v ) |
Primitive defined in C. | P |
fl |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
fmode |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
fname |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
forth-wordlist |
P | ||
free. |
( nf nu -- ) |
P | |
grow-blocks |
( n -- ) |
P | |
gui-open |
( -- ) |
Opens the console window (--gui): loads its code and
runs console. |
P |
gui-restore |
( -- ) |
Puts the search order back as the interpreter had it before the console window. | P |
gui-start |
( -- ) |
Starts the console window at boot for lugforth --gui;
prints a message and ends when the build has no window
(lugforth-mini). |
P |
ha |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
handler |
P | ||
hist |
Internal state or helper of the history of typed lines (common/lineedit.fs). Not meant to be used. | P | |
hist-add |
( a n -- ) |
Internal state or helper of the history of typed lines (common/lineedit.fs). Not meant to be used. | P |
hist-avail |
( -- n ) |
Internal state or helper of the history of typed lines (common/lineedit.fs). Not meant to be used. | P |
hist-i |
Internal state or helper of the history of typed lines (common/lineedit.fs). Not meant to be used. | P | |
hist-max |
Constant, 64. | P | |
hist-n |
Internal state or helper of the history of typed lines (common/lineedit.fs). Not meant to be used. | P | |
hist-save |
Internal state or helper of the history of typed lines (common/lineedit.fs). Not meant to be used. | P | |
hist-slot |
( k -- a ) |
Internal state or helper of the history of typed lines (common/lineedit.fs). Not meant to be used. | P |
hist@ |
( k -- a n ) |
Internal state or helper of the history of typed lines (common/lineedit.fs). Not meant to be used. | P |
hl |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
icr |
P | ||
immediate? |
( xt -- f ) |
P | |
IMMEDIATE_MARK |
Constant, 1. | P | |
include+ |
P | ||
include-file |
( fh -- ) |
Standard word, see the ANS Forth standard. | P |
included-files |
P | ||
indent |
P | ||
indent+! |
( n -- ) |
P | |
input-buffer |
P | ||
input-limit |
Constant, 200. | P | |
ins. |
( n xt -- n ) |
P | |
internalized |
P | ||
internals-builtins |
P | ||
interpret0 |
P | ||
la |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
last-vocabulary |
P | ||
le-accept |
( a n -- n ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-back |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-bs |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-cand |
( a n -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-clear-eol |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-clear-screen |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-cmp |
( p q -- -1|0|1 ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-collect |
( -- ) |
send each candidate to sink | P |
le-common |
( a n -- c ) |
length in common with cand | P |
le-complete |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-complete1 |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-cr |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-del |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-down |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-dpath |
( a n -- ) |
the directory typed, ~ expanded, "." when empty | P |
le-each |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-emit |
( c -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-end |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-entry |
( ent -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-esc[ |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-escape |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-filectx? |
( a n -- f ) |
a word that takes a file name | P |
le-files |
( dir-a dir-n -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-final |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-fold |
( c -- c' ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-force |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-forward |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-getenv |
C function getenv, 1 argument. |
P | |
le-goto |
( p -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-hidden? |
( a n -- f ) |
a dot file, not wanted unless the typed name starts with a dot | P |
le-home |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-ieq |
( a b n -- f ) |
same text, ignoring case | P |
le-ins |
( xt -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-insert |
( c -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-insert-str |
( a n -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-is? |
( a n b m -- f ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-key |
( c -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-kill-bol |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-kill-eol |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-lc |
( c -- c' ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-left |
( n -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-line |
( -- a n ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-list |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-match? |
( a n -- f ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-n. |
( n -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-pathy? |
( -- f ) |
looks like a path: starts with . or ~, or has a / | P |
le-pool |
( a n -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-prevword |
( -- a n ) |
the word before it | P |
le-print |
( a n -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-quoter? |
( a n -- f ) |
s" z" r| r~ | P |
le-redraw |
( oldpos -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-right |
( n -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-set |
( a n -- ) |
replace the whole line | P |
le-sort |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-space |
a space after a completed word; if one follows already, step over it | P | |
le-split |
( -- dir-a dir-n ) |
the word is dir/name: pa pl get the name | P |
le-tty? |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-type |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-uc |
( c -- C ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-up |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
le-upper? |
( a n -- f ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-vins |
( voc -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-word-cb |
( xt -- ) |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P |
le-wstart |
( -- n ) |
start of the word before the cursor | P |
leaving |
P | ||
leaving( |
P | ||
leaving, |
P | ||
lf |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
line-pos |
P | ||
line-width |
P | ||
local! |
( n -- ) |
P | |
local+! |
( n -- ) |
P | |
local-op |
P | ||
local@ |
( n -- ) |
P | |
locals-area |
P | ||
locals-capacity |
Constant, 1024. | P | |
locals-gap |
P | ||
locals-here |
P | ||
LONG-SIZE |
P | ||
lowc |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
lp |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
ls-loop |
( dh -- ) |
Helper of ls: prints the entries of the open directory
dh. |
P |
lup |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
mem= |
( a a n -- f ) |
P | |
nest-depth |
P | ||
NONAMED |
Constant, 16. | P | |
nonvoc? |
( xt -- f ) |
P | |
NOP |
Primitive defined in C. | P | |
notfound |
( a n n -- ) |
P | |
onlines |
( xt -- xt ) |
P | |
pa |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
park-forth |
( -- a ) |
P | |
park-heap |
( -- a ) |
P | |
parse-quote |
( -- a n ) |
P | |
path-join |
( a a# b b# -- a n ) |
P | |
pg-active? |
( -- f ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-emit |
( c -- ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-enabled |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-esc[ |
( -- ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-f |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-height |
( -- rows ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-install |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-k |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-key |
( -- c ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-key? |
( -- f ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-limit |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-lines |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-old-key |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-old-key? |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-old-prompt |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-old-type |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P | |
pg-pause |
( -- ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-prompt |
( -- ) |
the screen height, asked once per prompt | P |
pg-raw |
( a n -- ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-scan |
( a n -- k f ) |
k characters up to and including the first newline, f: found | P |
pg-type |
( a n -- ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pg-wait |
( -- c ) |
Internal helper of the pager (common/pager.fs), which stops the output of a typed line at each screenful. Not meant to be called. | P |
pl |
( a n -- ) |
Prints the text a n on the next row of the outline in writhdeck. | P |
pool |
Internal state or helper of the list of candidate words kept by the Tab completion (common/lineedit.fs). | P | |
pool-cnt |
Internal state or helper of the list of candidate words kept by the Tab completion (common/lineedit.fs). | P | |
pool-max |
Internal state or helper of the list of candidate words kept by the Tab completion (common/lineedit.fs). | P | |
pool-ptr |
Internal state or helper of the list of candidate words kept by the Tab completion (common/lineedit.fs). | P | |
pool-size |
Constant, 8192. | P | |
pool-used |
Internal state or helper of the list of candidate words kept by the Tab completion (common/lineedit.fs). | P | |
pool@ |
( p -- a n ) |
Internal state or helper of the list of candidate words kept by the Tab completion (common/lineedit.fs). | P |
r-copy |
( -- a ) |
Variable: set at the end of the boot, from then r",
r| and r~ copy their text as s"
does. |
P |
r-lit |
( a n -- a n | ) |
P | |
raw-included |
( a n -- ) |
P | |
raw-ok |
P | ||
raw.s |
P | ||
rawf.s |
P | ||
rec-ctl |
( a n -- xt rectype | rectype-none ) |
P | |
RECTYPE-CTL |
P | ||
remember-filename |
( -- a n ) |
Deferred word specifying the platform specific default snapshot filename. | P |
restore-name |
( a n -- ) |
Restore a snapshot from a file. | P |
S>FLOAT? |
P | ||
S>NUMBER? |
( a n -- n f | 0 ) |
P | |
save-name |
( a n -- ) |
Save a snapshot if the current vocabulary to a file. | P |
saving-base |
P | ||
scope |
P | ||
scope-clear |
P | ||
scope-create |
( a n -- ) |
P | |
scope-depth |
P | ||
scope-exit |
P | ||
see-all |
P | ||
see-loop |
P | ||
see-one |
( xt -- xt+1 ) |
P | |
see-vocabulary |
( voc ) |
P | |
see-xt |
( xt -- ) |
P | |
see. |
( xt -- ) |
P | |
setup-saving-base |
P | ||
sink |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
size-all |
P | ||
size-vocabulary |
( voc ) |
P | |
sj |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
sk |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
SMUDGE |
Constant, 2. | P | |
sourcedirname |
( -- a n ) |
P | |
sourcefilename |
( -- a n ) |
P | |
sourcefilename! |
( a n -- ) |
P | |
sourcefilename# |
P | ||
sourcefilename& |
P | ||
sp-limit |
P | ||
src-ref |
( -- a ) |
Variable: set when a string literal points into the text being read
(see include-file). |
P |
starts../ |
( a n -- f ) |
P | |
starts./ |
( a n -- f ) |
P | |
thrown |
( -- a ) |
Variable: the last value passed to throw, kept for the
prompt. |
P |
tib-setup |
P | ||
ud/base |
( lo hi -- rem lo hi ) |
divide by the current base | P |
ud>s |
( lo hi -- a n ) |
Converts an unsigned double to a string in the current base, in a buffer of 80 characters. | P |
upc |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
use?! |
P | ||
value-bind |
( xt-val xt ) |
P | |
vins. |
( voc -- ) |
P | |
voc-stack-end |
( -- a ) |
P | |
voc. |
( voc -- ) |
P | |
voclist |
P | ||
voclist-from |
( voc -- ) |
P | |
vocs. |
( voc -- ) |
P | |
wascr |
P | ||
wbuf |
( -- a ) |
Buffer of 256 characters used by compare and
search. |
P |
wlen |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
wsv |
Internal helper of the line editor (common/lineedit.fs): history, cursor moves and Tab completion of the line typed at the prompt. Not meant to be called. | P | |
xt-find& |
( xt -- xt& ) |
P | |
xt-hide |
( xt -- ) |
P | |
xt-transfer |
( xt -- ) |
P | |
YIELD |
Primitive defined in C. | P | |
zplace |
( a n -- ) |
P | |
}? |
( a n -- ) |
P |
The posix vocabulary
(Linux)
System calls and constants of Linux and macOS, reached with
sysfunc. also posix puts them in the search
order.
| Word | Stack | What it does | P |
|---|---|---|---|
'dlopen |
P | ||
.d_name |
( a -- z ) |
P | |
.d_type |
( a -- n ) |
P | |
0777 |
P | ||
0<ior |
( n -- ior ) |
P | |
0=ior |
( n -- ior ) |
P | |
calls |
P | ||
chdir |
C function chdir, 1 argument. |
P | |
CLOCK_BOOTTIME |
Constant, 7. | P | |
CLOCK_BOOTTIME_ALARM |
Constant, 9. | P | |
clock_gettime |
C function clock_gettime, 2 arguments. |
P | |
CLOCK_MONOTONIC |
Constant, 1. | P | |
CLOCK_MONOTONIC_COARSE |
Constant, 6. | P | |
CLOCK_MONOTONIC_RAW |
Constant, 4. | P | |
CLOCK_PROCESS_CPUTIME_ID |
Constant, 2. | P | |
CLOCK_REALTIME |
Constant, 0. | P | |
CLOCK_REALTIME_ALARM |
Constant, 8. | P | |
CLOCK_REALTIME_COARSE |
Constant, 5. | P | |
CLOCK_THREAD_CPUTIME_ID |
Constant, 3. | P | |
close |
C function close, 1 argument. |
P | |
closedir |
C function closedir, 1 argument. |
P | |
creat |
C function creat, 2 arguments. |
P | |
d0<ior |
( n -- n ior ) |
P | |
d0=ior |
( n -- n ior ) |
P | |
dlopen |
( z n -- a ) |
P | |
dup2 |
C function dup2, 2 arguments. |
P | |
EAGAIN |
Constant, 11. | P | |
EPIPE |
Constant, 32. | P | |
errno |
( -- err ) |
-- ESP32 only as of v7.0.7.2 | P |
execvp |
C function execvp, 2 arguments. |
P | |
F_SETFL |
Constant, 4. | P | |
fcntl |
C function fcntl, 3 arguments. |
P | |
FNDELAY |
Constant, 2048. | P | |
fork |
C function fork, 0 arguments. |
P | |
fsync |
C function fsync, 1 argument. |
P | |
ftruncate |
C function ftruncate, 2 arguments. |
P | |
getcwd |
C function getcwd, 2 arguments. |
P | |
isatty |
C function isatty, 1 argument. |
P | |
lseek |
C function lseek, 3 arguments. |
P | |
malloc |
( n -- a | 0 ) |
System malloc | P |
MAP_ANONYMOUS |
Constant, $20. | P | |
MAP_FIXED |
Constant, $10. | P | |
MAP_PRIVATE |
Constant, $2. | P | |
mmap |
C function mmap, 6 arguments. |
P | |
mprotect |
C function mprotect, 3 arguments. |
P | |
munmap |
C function munmap, 2 arguments. |
P | |
O_APPEND |
Constant, 2000. | P | |
O_CREAT |
Constant, 100. | P | |
O_EXCL |
Constant, 200. | P | |
O_NONBLOCK |
Constant, 4000. | P | |
O_RDONLY |
Constant, 0. | P | |
O_RDWR |
Constant, 2. | P | |
O_TRUNC |
Constant, 1000. | P | |
O_WRONLY |
Constant, 1. | P | |
open |
C function open, 3 arguments. |
P | |
opendir |
C function opendir, 1 argument. |
P | |
pipe |
C function pipe, 1 argument. |
P | |
PROT_EXEC |
Constant, 4. | P | |
PROT_NONE |
Constant, 0. | P | |
PROT_READ |
Constant, 1. | P | |
PROT_WRITE |
Constant, 2. | P | |
read |
C function read, 3 arguments. |
P | |
readdir |
C function readdir, 1 argument. |
P | |
realloc |
( a n -- a | 0 ) |
System realloc | P |
rename |
C function rename, 2 arguments. |
P | |
RTLD_LAZY |
Constant, 1. | P | |
RTLD_NOW |
Constant, 2. | P | |
SEEK_CUR |
Constant, 1. | P | |
SEEK_END |
Constant, 2. | P | |
SEEK_SET |
Constant, 0. | P | |
shared-library |
( z "name" -- ) |
P | |
SIG_DFL |
Constant, 0. | P | |
SIG_IGN |
Constant, 1. | P | |
SIGBUS |
Constant, 7. | P | |
SIGHUP |
Constant, 1. | P | |
SIGINT |
Constant, 2. | P | |
SIGKILL |
Constant, 9. | P | |
sign-extend |
( n -- n ) |
P | |
signal |
C function signal, 2 arguments. |
P | |
SIGPIPE |
Constant, 13. | P | |
sofunc |
( z n a "name" -- ) |
P | |
stderr |
Constant, 2. | P | |
stdin |
Constant, 0. | P | |
stdin-key |
( -- n ) |
P | |
stdout |
Constant, 1. | P | |
stdout-write |
( a n -- ) |
P | |
sysexit |
C function exit, 1 argument. |
P | |
sysfree |
( a -- ) |
System free | P |
sysfunc |
( z n "name" -- ) |
P | |
timespec |
( "name" ) |
P | |
unlink |
C function unlink, 1 argument. |
P | |
usleep |
( us -- n ) |
C function usleep, 1 argument. |
P |
wait |
C function wait, 1 argument. |
P | |
waitpid |
C function waitpid, 3 arguments. |
P | |
write |
C function write, 3 arguments. |
P |
The structures
vocabulary (Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
!field |
( n "name" -- ) |
P | |
@field |
( "name" -- n ) |
P | |
align-by |
( a n -- a ) |
P | |
field |
( n "name" ) |
P | |
field-op |
( n "name" -- ) |
P | |
i16 |
P | ||
i32 |
P | ||
i64 |
P | ||
i8 |
P | ||
last-align |
P | ||
last-struct |
P | ||
last-typer |
P | ||
long |
P | ||
max! |
( n a -- ) |
P | |
ptr |
P | ||
sc@ |
( a -- c ) |
P | |
struct |
( "name" ) |
P | |
struct-align |
( n -- ) |
P | |
typer |
( xt@ xt! sz "name" -- ) |
P | |
u16 |
P | ||
u32 |
P | ||
u8 |
P |
The streams
vocabulary (Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
>offset |
( n st -- a ) |
P | |
>read |
P | ||
>stream |
( a n st -- ) |
P | |
>write |
( st -- wr ) |
P | |
ch>stream |
( ch st -- ) |
P | |
empty? |
( st -- f ) |
P | |
full? |
( st -- f ) |
P | |
stream |
( n "name" ) |
P | |
stream# |
( sz -- n ) |
P | |
stream> |
( a n st -- ) |
P | |
stream>ch |
( st -- ch ) |
P | |
wait-read |
( st -- ) |
P | |
wait-write |
( st -- ) |
P |
The tasks vocabulary
(Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
.tasks |
( -- ) |
List running tasks. | P |
main-task |
P | ||
task-list |
P |
The ansi vocabulary
(Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
bel |
P | ||
clear-to-eol |
P | ||
esc |
P | ||
hide |
P | ||
scroll-down |
P | ||
scroll-up |
P | ||
show |
P | ||
terminal-restore |
P | ||
terminal-save |
P |
The editor vocabulary
(Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
a |
( n "text" -- ) |
Add (insert) a line in the current block | P |
d |
( n -- ) |
Delete a line in the current block | P |
e |
( n -- ) |
Clear a line in the current block | P |
l |
( -- ) |
List the current block | P |
n |
( -- ) |
Move to the next block | P |
p |
( -- ) |
Move to the previous block | P |
r |
( n "text" -- ) |
Replace a line in the current block | P |
wipe |
( -- ) |
Blank out the current block | P |
The sockets
vocabulary (Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
->addr! |
( n a -- ) |
set big-endian address in sockaddr | P |
->addr@ |
( a -- n ) |
get big-endian address from sockaddr | P |
->h_addr |
( hostent -- n ) |
P | |
->port! |
( n a -- ) |
set port in sockaddr | P |
->port@ |
( a -- n ) |
get port from sockaddr | P |
AF_INET |
Constant, 2. | P | |
bind |
( sock addr addrlen -- 0/err ) |
C function bind, 3 arguments. |
P |
bs, |
( n -- ) |
P | |
connect |
( sock addr addrlen -- 0/err ) |
C function connect, 3 arguments. |
P |
gethostbyname |
( hostnamez -- hostent/0 ) |
C function gethostbyname, 1 argument. |
P |
ip# |
( n -- n ) |
P | |
ip. |
( n -- ) |
Print address as x.y.z.w IP address. | P |
l, |
( n -- ) |
P | |
listen |
( sock connections -- 0/err ) |
C function listen, 2 arguments. |
P |
poll |
( pollfds n timeout -- fd/err ) |
C function poll, 3 arguments. |
P |
recv |
( sock a n flags -- n/err ) |
C function recv, 4 arguments. |
P |
recvfrom |
( sock a n flags addr addrlen -- n/err ) |
C function recvfrom, 6 arguments. |
P |
recvmsg |
( sock msg flags -- n/err ) |
C function recvmsg, 3 arguments. |
P |
s, |
( n -- ) |
P | |
send |
( a n -- ) |
C function send, 4 arguments. |
P |
sendmsg |
( sock msg flags -- n/err ) |
C function sendmsg, 3 arguments. |
P |
sendto |
( sock a n flags addr addrlen -- n/err ) |
C function sendto, 6 arguments. |
P |
setsockopt |
( sock level optname optval optlen -- 0/err ) |
C function setsockopt, 5 arguments. |
P |
sizeof(sockaddr_in) |
Constant, 16. | P | |
SO_REUSEADDR |
Constant, 2. | P | |
SOCK_DGRAM |
Constant, 2. | P | |
SOCK_RAW |
Constant, 3. | P | |
SOCK_STREAM |
Constant, 1. | P | |
sockaccept |
( sock addr addrlen -- sock/err ) |
-- varies from bsd socks | P |
sockaccept |
( sock addr addrlen -- sock/err ) |
-- varies from bsd socks | P |
sockaddr |
( "name" -- ) |
creates a sockaddr structure | P |
socket |
( domain type protocol -- sock/err ) |
C function socket, 3 arguments. |
P |
SOL_SOCKET |
Constant, 1. | P |
The x11 vocabulary
(Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
bool |
P | ||
Button1MotionMask |
P | ||
Button2MotionMask |
P | ||
Button3MotionMask |
P | ||
Button4MotionMask |
P | ||
Button5MotionMask |
P | ||
ButtonMotionMask |
P | ||
ButtonPress |
P | ||
ButtonPressMask |
P | ||
ButtonRelease |
P | ||
ButtonReleaseMask |
P | ||
CirculateNotify |
P | ||
CirculateRequest |
P | ||
ClientMessage |
P | ||
ColormapChangeMask |
P | ||
ColormapNotify |
P | ||
ConfigureNotify |
P | ||
ConfigureRequest |
P | ||
CreateNotify |
P | ||
DestroyNotify |
P | ||
EnterNotify |
P | ||
EnterWindowMask |
P | ||
Expose |
P | ||
ExposureMask |
P | ||
FocusChangeMask |
P | ||
FocusIn |
P | ||
FocusOut |
P | ||
GenericEvent |
P | ||
GraphicsExpose |
P | ||
GravityNotify |
P | ||
KeymapNotify |
P | ||
KeymapStateMask |
P | ||
KeyPress |
P | ||
KeyPressMask |
P | ||
KeyRelease |
P | ||
KeyReleaseMask |
P | ||
LeaveNotify |
P | ||
LeaveWindowMask |
P | ||
MapNotify |
P | ||
MappingNotify |
P | ||
MapRequest |
P | ||
MotionNotify |
P | ||
NoEventMask |
Constant, 0. | P | |
NoExpose |
P | ||
NULL |
Constant, 0. | P | |
OwnerGrabButtonMask |
P | ||
PointerMotionHintMask |
P | ||
PointerMotionMask |
P | ||
PropertyChangeMask |
P | ||
PropertyNotify |
P | ||
ReparentNotify |
P | ||
ResizeRedirectMask |
P | ||
ResizeRequest |
P | ||
SelectionClear |
P | ||
SelectionNotify |
P | ||
SelectionRequest |
P | ||
StructureNotifyMask |
P | ||
SubstructureNotifyMask |
P | ||
SubstructureRedirectMask |
P | ||
time |
P | ||
UnmapNotify |
P | ||
VisibilityChangeMask |
P | ||
VisibilityNotify |
P | ||
win |
P | ||
xany |
P | ||
XBlackPixel |
P | ||
xbutton |
P | ||
XCheckMaskEvent |
P | ||
xconfigure |
P | ||
XCreateGC |
P | ||
XCreateImage |
P | ||
XCreateSimpleWindow |
P | ||
XDefaultColormap |
P | ||
XDefaultDepth |
P | ||
XDefaultScreen |
P | ||
XDefaultVisual |
P | ||
XDestroyImage |
P | ||
XDisplayOfScreen |
P | ||
XDrawString |
P | ||
xevent# |
P | ||
xevent-size |
P | ||
xexposure |
P | ||
XFillRectangle |
P | ||
XFlush |
P | ||
xkey |
P | ||
xlib |
P | ||
XLookupString |
P | ||
XMapWindow |
P | ||
xmask |
P | ||
xmotion |
P | ||
XNextEvent |
P | ||
XOpenDisplay |
P | ||
XPutImage |
P | ||
XRootWindow |
P | ||
XScreenOfDisplay |
P | ||
XSelectInput |
P | ||
XSetBackground |
P | ||
XSetForeground |
P | ||
XWhitePixel |
P | ||
XYBitmap |
Constant, 0. | P | |
XYPixmap |
Constant, 1. | P | |
ZPixmap |
Constant, 2. | P |
The graphics
vocabulary (Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
box |
( x y w h -- ) |
Fills a rectangle. At the web prompt it opens the drawing area first. | P |
color |
( $rrggbb -- ) |
Sets the drawing color: red color,
$ff8000 color. |
P |
event |
P | ||
EXPOSED |
Constant, 2. | P | |
FINISHED |
Constant, 7. | P | |
g{ |
P | ||
heart |
P | ||
height |
P | ||
IDLE |
Constant, 0. | P | |
last-char |
P | ||
last-key |
P | ||
LEFT-BUTTON |
Constant, 255. | P | |
MIDDLE-BUTTON |
Constant, 254. | P | |
MOTION |
Constant, 3. | P | |
mouse-x |
P | ||
mouse-y |
P | ||
pixel |
( w h -- a ) |
P | |
PRESSED |
Constant, 4. | P | |
pressed? |
( k -- f ) |
P | |
RELEASED |
Constant, 5. | P | |
RESIZED |
Constant, 1. | P | |
RIGHT-BUTTON |
Constant, 253. | P | |
scale |
( nx dx ny dy -- ) |
JavaScript function of the web page. | P |
screen>g |
( x y -- x' y' ) |
P | |
translate |
( x y -- ) |
JavaScript function of the web page. | P |
TYPED |
Constant, 6. | P | |
vertical-flip |
P | ||
viewport |
P | ||
width |
P | ||
window |
( w h ) |
JavaScript function of the web page. | P |
}g |
P |
The httpd vocabulary
(Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
bad-response |
( -- ) |
Response with HTTP 400 Bad request. | P |
body |
( -- a n ) |
Rquest body. | P |
body-1st-read |
P | ||
body-chunk |
P | ||
body-chunk-size |
Constant, 256. | P | |
body-read |
P | ||
chunk |
P | ||
chunk-filled |
P | ||
chunk-size |
Constant, 2048. | P | |
client |
P | ||
client-cr |
P | ||
client-emit |
( ch -- ) |
P | |
client-len |
P | ||
client-read |
( -- n ) |
P | |
client-type |
( a n -- ) |
P | |
clientfd |
P | ||
completed? |
( -- f ) |
P | |
content-length |
( -- n ) |
P | |
crnl= |
( n -- f ) |
P | |
eat |
( n ch -- n a n ) |
P | |
end< |
( n -- f ) |
P | |
goal |
P | ||
goal# |
P | ||
handleClient |
( -- ) |
Get next request. | P |
hasHeader |
( a n -- f ) |
P | |
header |
( a n -- a n ) |
Contents of header (or empty string). | P |
httpd-port |
P | ||
in@<> |
( n ch -- f ) |
P | |
max-connections |
Constant, 1. | P | |
method |
( -- a n ) |
Request method, e.g. GET | P |
notfound-response |
( -- ) |
Response with HTTP 404 Not found. | P |
ok-response |
( mime mime# ) |
Response with a HTTP 200. | P |
path |
( -- a n ) |
Request path, e.g. /foo | P |
read-headers |
P | ||
response |
( mime mime# result result# status -- ) |
Respond with a particular mime type result and status. | P |
send |
( a n -- ) |
C function send, 4 arguments. |
P |
server |
( port -- ) |
Start telnet daemon on port. | P |
skipover |
( n ch -- n ) |
P | |
skipto |
( n ch -- n ) |
P | |
sockfd |
P | ||
strcase= |
( a n a n -- f ) |
P | |
upper |
( ch -- ch ) |
P |
The telnetd
vocabulary (Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
broker |
P | ||
broker-connection |
P | ||
client |
P | ||
client-len |
P | ||
clientfd |
P | ||
connection |
( n -- ) |
P | |
server |
( port -- ) |
Start telnet daemon on port. | P |
sockfd |
P | ||
telnet-emit |
( ch -- ) |
P | |
telnet-key |
( -- n ) |
P | |
telnet-port |
P | ||
telnet-type |
( a n -- ) |
P | |
wait-for-connection |
P |
The
web-interface vocabulary (Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
do-serve |
P | ||
handle-index |
P | ||
handle-input |
P | ||
handle1 |
P | ||
index-html |
P | ||
index-html# |
P | ||
input-stream |
P | ||
out-size |
Constant, 2000. | P | |
out-string |
P | ||
output-stream |
P | ||
serve-key |
( -- n ) |
P | |
serve-type |
( a n -- ) |
P | |
server |
( port -- ) |
Start telnet daemon on port. | P |
webserver |
P | ||
webserver-task |
P |
The termios
vocabulary (Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
.c_cc[] |
P | ||
.c_lflag |
P | ||
_ECHO |
Constant, 8. | P | |
delay-mode |
P | ||
form-hook |
( -- xt|0 ) |
Value: 0, or the xt of a word giving the size ( h w ) of a console
that is not the tty (the console window sets it), used by
form. |
P |
ICANON |
Constant, 2. | P | |
ioctl |
C function ioctl, 3 arguments. |
P | |
new-termios |
P | ||
nodelay-mode |
P | ||
normal-mode |
P | ||
old-termios |
P | ||
pending |
P | ||
raw-mode |
P | ||
sizeof(termios) |
P | ||
sizeof(winsize) |
P | ||
tcgetattr |
C function tcgetattr, 2 arguments. |
P | |
TCSAFLUSH |
Constant, 2. | P | |
tcsetattr |
C function tcsetattr, 3 arguments. |
P | |
termios! |
( a -- ) |
P | |
termios-key |
( -- n ) |
P | |
termios-key? |
( -- f ) |
P | |
termios-terminate |
( n -- ) |
P | |
termios@ |
( a -- ) |
P | |
TIOCGWINSZ |
Constant, $5413. | P | |
VMIN |
Constant, 6. | P | |
VTIME |
Constant, 5. | P | |
winsize |
P |
The visual vocabulary
(Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
edit |
( <filename> ) |
P | |
insides |
P |
The recognizers
vocabulary (Linux)
| Word | Stack | What it does | P |
|---|---|---|---|
+RECOGNIZER |
( xt -- ) |
P | |
-RECOGNIZER |
( -- ) |
P | |
GET-RECOGNIZERS |
( -- xtn..xt1 n ) |
P | |
REC-FIND |
( c-addr len -- xt addr1 | addr2 ) |
P | |
REC-FNUM |
( c-addr len -- f addr1 | addr2 ) |
P | |
REC-NUM |
( c-addr len -- n addr1 | addr2 ) |
P | |
RECOGNIZE |
( c-addr len addr1 -- i*x addr2 ) |
P | |
RECSTACK |
P | ||
RECTYPE-IMM |
P | ||
RECTYPE-NONE |
P | ||
RECTYPE-NUM |
P | ||
RECTYPE-WORD |
P | ||
RECTYPE: |
( xt-interpret xt-compile xt-postpone "name" -- ) |
P | |
SET-RECOGNIZERS |
( xtn..xt1 n -- ) |
P |
The web vocabulary
(web only)
| Word | Stack | What it does | W |
|---|---|---|---|
beginPath |
( ) |
JavaScript function of the web page. | W |
button |
( -- b ) |
JavaScript function of the web page. | W |
cat |
( "path" -- ) |
Print contents of "path" file. | W |
clearItems |
( session ) |
JavaScript function of the web page. | W |
color! |
( c ) |
JavaScript function of the web page. | W |
download |
( "filename" ) |
W | |
fillText |
( a n x y -- ) |
JavaScript function of the web page. | W |
font |
( a n -- ) |
JavaScript function of the web page. | W |
getItem |
( dst dst_limit key key_len session -- n ) |
JavaScript function of the web page. | W |
getKey |
( key key_limit index session -- n ) |
JavaScript function of the web page. | W |
gpop |
( ) |
JavaScript function of the web page. | W |
gpush |
( ) |
JavaScript function of the web page. | W |
gr |
W | ||
grmode |
( mode ) |
JavaScript function of the web page. | W |
http-download |
( url url_n name name_n session done -- ) |
JavaScript function of the web page. | W |
import |
W | ||
importScripts |
( dst dst_limit -- n ) |
JavaScript function of the web page. | W |
include-file |
( fh -- ) |
Standard word, see the ANS Forth standard. | W |
jseval |
( a n ) |
JavaScript function of the web page. | W |
jseval! |
( a n index -- ) |
W | |
jsslot |
W | ||
JSWORD: |
( "args.." ) |
W | |
keyCount |
( session -- n ) |
JavaScript function of the web page. | W |
keys-height |
( -- n ) |
JavaScript function of the web page. | W |
lineTo |
( x y ) |
JavaScript function of the web page. | W |
lineWidth |
( w -- ) |
JavaScript function of the web page. | W |
log |
( a n -- ) |
JavaScript function of the web page. | W |
ls |
( "path" -- ) |
List files or directories in "path". | W |
mobile |
( -- f ) |
JavaScript function of the web page. | W |
mouse |
( -- x y ) |
JavaScript function of the web page. | W |
moveTo |
( x y ) |
JavaScript function of the web page. | W |
pairserial |
( -- ) |
JavaScript function of the web page. | W |
raw-download |
( data data_n mime mime_n filename filename_n -- ) |
JavaScript function of the web page. | W |
raw-http-upload |
( data data_n url url_n done -- ) |
JavaScript function of the web page. | W |
release |
( handle ) |
JavaScript function of the web page. | W |
removeItem |
( key key_len session ) |
JavaScript function of the web page. | W |
rm |
( "path" -- ) |
Remove "path" file. | W |
rotate |
( angle div ) |
JavaScript function of the web page. | W |
scale |
( nx dx ny dy -- ) |
JavaScript function of the web page. | W |
scripts |
W | ||
scripts# |
W | ||
serial |
W | ||
serial-key-raw |
( -- n ) |
JavaScript function of the web page. | W |
serial-type |
( a n -- ) |
JavaScript function of the web page. | W |
session? |
W | ||
setItem |
( value value_len key key_len session ) |
JavaScript function of the web page. | W |
shouldEcho? |
( -- f ) |
JavaScript function of the web page. | W |
show-text |
( f -- ) |
W | |
silence |
W | ||
smooth |
( f ) |
JavaScript function of the web page. | W |
stroke |
( ) |
JavaScript function of the web page. | W |
text |
W | ||
text-size! |
( n -- ) |
JavaScript function of the web page. | W |
textRatios |
( tf mp ) |
JavaScript function of the web page. | W |
textWidth |
( a n -- w ) |
JavaScript function of the web page. | W |
tone |
( pitch volume channel -- ) |
JavaScript function of the web page. | W |
translate |
( x y -- ) |
JavaScript function of the web page. | W |
upload |
( "filename" ) |
W | |
upload-done? |
( -- f ) |
JavaScript function of the web page. | W |
upload-file |
( a n -- ) |
W | |
upload-start |
( filename n ) |
JavaScript function of the web page. | W |
upload-success? |
( -- f ) |
JavaScript function of the web page. | W |
viewport@ |
( -- w h ) |
JavaScript function of the web page. | W |
web-key |
( -- n ) |
W | |
web-key-raw |
( -- n ) |
JavaScript function of the web page. | W |
web-key? |
( -- f ) |
W | |
web-key?-raw |
( -- f ) |
JavaScript function of the web page. | W |
web-terminate |
( retval ) |
JavaScript function of the web page. | W |
web-type |
( a n -- ) |
W | |
web-type-raw |
( a n -- yld ) |
JavaScript function of the web page. | W |
window |
( w h ) |
JavaScript function of the web page. | W |
yielding |
W | ||
yielding-task |
W |