! " # $ & ' ( * + , - . / 0 1 2 3 5 7 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ~ 

!

!
n addr --
stores n at addr
example:
variable a
123 a !
!=
obj1 obj2 -- boolean
pushes true if obj1 is not equal obj2
see:
boolean

"

"
-- addr n
stores string at addr and puts addr and count on stack
trailing blanks after the quote are allowed and get consumed by the parser
use space and spaces if you need leading blanks before a text
or use the unicode character for a blank e.g. in the form " text"
word definitions may not start with "
example:
" text"
"too"
" leading blanks"
> "text"
> 4
> "too"
> 3
> " leading blanks"
> 18
--
see:
." bl chr space spaces

#

#
--
decimal formatting
see:
<#

#>
--
decimal formatting
see:
<#

#tib
-- len
not supported - use tib# instead
see:
tib#

$

$*
-- string[]
pushes an string array with the results of the last executed word
see:
$1 $2 $3 … $9

$.
n($) length -- ****n$
pads n or n$ with * in length where * may be any character with the exception of digits
--nope don't execute the word
-n
--verbose prints what would happen, when the word is executed
-v
--str pushes the output as string onto the stack instead of printing
-s
--out redirects the message to the given file
-o
--append appends the message to the given file
-a

$1
--
pushes the 1st result string of the last executed word
see:
$*

$2
--
pushes the 2nd result string of the last executed word
see:
$*

$3
--
pushes the 3rd result string of the last executed word
see:
$*

$4
--
pushes the 4th result string of the last executed word
see:
$*

$5
--
pushes the 5th result string of the last executed word
see:
$*

$6
--
pushes the 6th result string of the last executed word
see:
$*

$7
--
pushes the 7th result string of the last executed word
see:
$*

$8
--
pushes the 8th result string of the last executed word
see:
$*

$9
--
pushes the 9th result string of the last executed word
see:
$*

&

&#124;<!
obj arr --
takes object obj and inserts it after the last position of the array arr
see:
array-access

&#124;<@
arr from -- obj
extracts the last object from the array arr
see:
array-access

'

'
-- cfa
puts the cfa of the following word onto the stack - normally for later execution with execute
example:
' execute
see:
execute

'stream
-- fib/tib
fib or tib depending on the input source

(

(
--
start of algebraic expression while not in compile mode - result is
pushed onto stack - otherwise start of comment when used in the form
(* *) or when describing the stack management in the form ( -- )
word definitions may not start with (
example:
(5+6*7)
(*comment*)
(n1 n2 -- n3)

*

*
n1 n2 -- n3
multiplies the two numbers n1 and n2 and pushes the result

*/
n1 n2 n3 -- n4
divides the product of n1 and n2 by n3

*/mod
n1 n2 n3 -- n4 n5
divides the product of n1 and n2 by n3 - pushes the modulo value
(remainder of the division) n4 and the result n5
of the division onto the stack

+

+
n1 n2 -- n3
adds the two numbers n1 and n2 and pushes the result

+!
n addr --
abbreviated instruction for convenience
example:
5 var +!
+loop
--
control structure
example:
: main
10 0
do
." x "
2
+loop
;
see:
do…loop/+loop control

,

,
obj --
compiles value
example:
create test 1 ,
see:
create

-

-
n1 n2 -- n3
subtracts n2 from n1 and pushes the result

-deletef
--
undeletes all files which where deleted with the last deletef or deletef?
-leading$
str -- str'
removes leading blanks and tabs

-origin
-- -x -y
puts the negative x y values of top left corner coordinates on the stack

-renamef
-- string[]
reverts a preceding renamef and puts a string array on the stack which contains the actual names of the files
if there was no preceding rename nothing is done and the string array is empty
the resulting new filenames are stored to $*
--nope don't execute the word
-n
--verbose prints what would happen, when the word is executed
-v
see:
renamef $*

-roll
n1 n2 n3 n4 4 -- n4 n1 n2 n3
the reversal functionality of roll
the TOS specifies the position, where the 2nd value is inserted at
see:
roll

-rot
n1 n2 n3 -- n3 n1 n2
the reversal functionality of rot
the TOS becomes the 3rd value
see:
rot

-trailing$
str -- str'
removes trailing blanks and tabs

.

.
n --
prints numerical value

."
--
prints string
trailing blanks after the quote are allowed and get consumed by the parser
use space and spaces if you need leading blanks before the text
word definitions may not start with ."
.(
--
prints string immediately - even while compiling
trailing blanks after the quote are allowed and get consumed by the parser
use space and spaces if you need leading blanks before the text
word definitions may not start with .(
via redirect:
--nope don't execute the word
-n
--verbose prints what would happen, when the word is executed
-v
--str pushes the output as string onto the stack instead of printing
-s
--out redirects the message to the given file
-o
--append appends the message to the given file
-a
example:
.( text)
text
see:
redirect ."
.rs
--
prints return stack
--nope don't execute the word
-n
--verbose prints what would happen, when the word is executed
-v
--str pushes the output as string onto the stack instead of printing
-s
--out redirects the message to the given file
-o
--append appends the message to the given file
-a

.s
--
prints the data stack
--nope don't execute the word
-n
--verbose prints what would happen, when the word is executed
-v
--str pushes the output as string onto the stack instead of printing
-s
--out redirects the message to the given file
-o
--append appends the message to the given file
-a

.us
--
prints the user stack
--nope don't execute the word
-n
--verbose prints what would happen, when the word is executed
-v
--str pushes the output as string onto the stack instead of printing
-s
--out redirects the message to the given file
-o
--append appends the message to the given file
-a

/

/
n1 n2 -- n3
divides n1 by n2 and pushes the result

//
--
str -- boolean

comments the rest of the line out
or if used in the form flags/pattern/ searches the pattern in str
for the description of flags see ///
example:
5 + // adds 5
"text" /ex/ ~~ (* finds the pattern in text and puts true on TOS *)
"text" /.ex./ =~ (* matches the pattern in text and puts true on TOS *)
see:
/// (

///
str -- boolean
used in the form flags/pattern/replacement/ searches the pattern in str and replaces it with replacement
puts true on TOS if pattern was found otherwise false
the resulting string of the replacement is stored to $1 ($*)
flags is optional:
m multiline ^ and $ only match at the beginning and the end of the entire input sequence
s dot all . matches the line terminator too
d unix lines only \n is recognized as line terminator
u unicode case case insensitiv matching complies Unicode Standard ( are matched)
c canon equal two characters will be considered to match if, and only if, their full canonical decompositions matches
x comments ignores whitespaces and # with the rest of the line
U unicode character class and unicode case
all matching - case sensitiv and case insensitiv - complies Unicode Standard
i case insensitive only characters in the US-ASCII charset are being matched ( not)
example:
"moo" /o/e/ (* substitute one o and puts true on TOS *)
"moo" /o/e/g (* sutstitute any o and puts true on TOS*)
see:
//

/mod
n1 n2 -- n3 n4
divides n1 by n2 and pushes the result n3
and the modulo (remainder of the division) n4

0

0<
n -- boolean
pushes true if n is lower than 0
see:
boolean

0=
n -- boolean
pushes true if n is 0
see:
boolean

0>
n -- boolean
pushes true if n is greater than 0
see:
boolean

1

1+
n -- n'
TOS is incremented by one

1-
n -- n'
TOS is decremented by one

1/x
n -- n'
replaces TOS with its reciprocal

10^x
n -- n'
replaces TOS with 10 raised to the power of TOS

2

2*
n -- n'
multiplies TOS by two

2+
n -- n'
adds 2 to TOS

2-
n -- n'
subtracts 2 from TOS

2/
n -- n'
divides TOS by 2

2drop
n1 n2 --
removes 2 numbers from the top of the stack

2dup
n1 n2 -- n1 n2 n1 n2
duplicates the 1st and 2nd number on the top of the stack

2over
n1 n2 n3 n4 -- n1 n2 n3 n4 n1 n2
picks the 3rd and 4th number on the top of the stack

2swap
n1 n2 n3 n4 -- n3 n4 n1 n2
the TOS and the 2nd value changes their places with 3rd and the 4th value

2under
n1 n2 n3 -- n1 n2 n1 n2 n3
copies the 2nd and 3rd entry of the stack under the top of stack

3

3drop
n1 n2 n3 --
removes 3 numbers from the top of the stack

3dup
n1 n2 n3 -- n1 n2 n3 n1 n2 n3
duplicates the 1st, 2nd and 3rd number on the top of the stack

3over
n1 n2 n3 n4 n5 n6 -- n1 n2 n3 n4 n5 n6 n1 n2 n3
picks the 4th, 5th and 6th number on the top of the stack

3swap
n1 n2 n3 n4 n5 n6 -- n3 n4 n5 n6 n1 n2 n3
the TOS, the 2nd and the 3rd value changes their places with 4th the 5th and the 6th value

5

5+
n -- n'
adds 5 to TOS

5-
n -- n'
subtracts 5 from TOS

7

7th
--
set context to 7th
7th is the first context and first defined word
see:
current

:

:
--
colon compiler
compiles a new word with the name following the colon
the compilation of the word is terminated with ;
example:
: hello ."

;

;
--
terminates the compilation of a word
see:
:

<

<
obj1 obj2 -- boolean
pushes true on TOS if obj1 is lower than than obj2
see:
boolean

<!
obj arr pos --
takes object obj and inserts it in the array at position pos
see:
array-access

<#
n --
0 shows zero - not allowed after #
# shows a digit - zero shows as absent
.
<=
obj1 obj2 -- boolean
pushes true on TOS if obj1 is lower than or equal obj2
see:
boolean

<=>
obj1 obj2 -- n
returns 0 if n1 is equal n2, -1 if n1 is lesser n2, 1 if n2 is greater n2

<@
arr from -- obj
extracts one object from the array arr beginning at position from
see:
array-access

<error>
addr -- obj
fetches value from addr

=

==
obj1 obj2 -- boolean
returns true if obj1 equals obj2
see:
boolean

===
obj1 obj2 -- boolean
returns true if obj1 is identical to obj2
means obj1 and obj2 are the same

=~
str pat -- boolean
returns true if pattern pat matches the string str
example:
"burbs" /bur.*/ =~
see:
~~

>

>
obj1 obj2 -- boolean
pushes true on TOS if obj1 is greater than obj2
see:
boolean

><
arr from to -- arr'
str from to -- str'

exchanges the contents in an array arr' or string str' at the position from with that at position to
the original array arr or string str remains untouched
see:
array-access xchg

>=
obj1 obj2 -- boolean
pushes true on TOS if obj1 is greater than or equal obj2
see:
boolean

>body
addr --
start of CFAs list
see:
>nfa >lfa >cfa >body

>carr
str -- carr
gets char array from str
see:
array

>cfa
addr --
code field address
see:
>nfa >lfa >cfa >body

>class
str --
gets class for name

>color
n -- Color
puts color object changed from integer
see:
>rgb

>complex
re im -- complex
pushes complex number created from real and imaginary part on TOS
to store re and im part from stack into a complex variable You must first change real and imaginary part to a complex number with >complex
example:
complex cplx
2 3 cplx !
>dbl
n -- d
puts the double value of number n on TOS
see:
asc number val >int

>deg
dms -- deg
changes degrees from hours minutes seconds representation to decimal degrees

>dms
deg -- dms
changes decimal degrees representation to hours minutes seconds

>im
cplx -- im
pushes imaginary part from complex number on TOS
see:
complex >complex >re,im >re >polar >phi abs

>in
-- pos
pushes pos in input stream on TOS

>int
n -- d
puts the integer value of number n on TOS
see:
asc number val >dbl

>lfa
addr -- addr'
link field address
see:
>nfa >lfa >cfa >body

>lines$
["ab", "c"] -- "ab\r\nc"
changes string array to lines

>n>!
obj1 obj2…objn n arr from --
takes n objects and stores them in the array arr
obj1 is stored in the array at the start index from
if the objects are numbers they are converted - if this is possible without loss of accuracy - to the type of the array
see:
n!
>nfa
addr -- addr'
name field address
see:
>nfa >lfa >cfa >body

>phi
complex -- phi
re im -- phi

pushes angle phi converted from complex number or from real and imaginary part on TOS

>polar
complex -- r phi
re im -- r phi

pushes polar coordinates - radian and angle phi - converted from complex number or from real and imaginary part on TOS
see:
complex >complex >re,im phi>im >phi abs

>r
obj --
pushes object on top of return stack
see:
r@ r>

>re
cplx -- re
puts real part from complex number
see:
complex >complex >re,im >im >polar >phi abs

>re,im
complex -- re im
r phi -- re im

pushes real and imaginary part from complex number or from changed polar coordinates - radian and angle phi on TOS
see:
complex >complex >re >im >polar >phi abs

>rgb
color -- n
puts the numeric rgb representation (without alpha channel) of the color object
see:
>rgba

>rgba
color -- n
puts the numeric rgba representation (including the alpha channel) of the color object
see:
>rgb

>rgn>!
src targ to cnt --
takes cnt objects from array src and stores them in the target array targ beginning at index to
if the objects are numbers they are converted - if this is possible without loss of accuracy - to the type of the array targ
see:
rgn!
>rhino
str --
sends a string for execution to the rhino engine

?

?
obj --
prints object
if object is number, number is printed as number to base 10
see:
type .
?@
addr -- obj
if TOS is an address the value is fetched otherwise nothing is done

?comp
--
throws exception if not in compile mode while execution

?dup
n -- n n
if TOS is a non 0 value dup is executed otherwise nothing is done

?stack
--
throws exception if stack is empty
see:
safety

?terminal
-- boolean
puts true if bytes can be read from input stream

@

@afterdot
path -- afterdot true
puts the pathpart extension without the dot if available and true otherwise false
see:
fileparts

@arg$
option -- argument
puts the argument for the option or an empty string if the option has no argument

@base
path -- base true
puts the pathpart base - this is the filename without extension - and true if available otherwise false
see:
fileparts

@drive
path -- drive: true
puts the pathpart drive including the trailing : if available and true otherwise false
see:
fileparts

@ext
path -- .ext true
puts the pathpart extension including the leading . if available and true otherwise false
see:
fileparts

@filepath
path -- path true
puts the complete filepath if available and true otherwise false
see:
fileparts

@fname
path -- filename.ext true
puts the pathpart filename - including the extension - and true if available otherwise false
see:
fileparts

@notnum
path -- not_numeric_base_part true
puts the not numeric base part - this is the leading part of the base not containing digits - and true if available otherwise false
see:
@num
path -- numeric_base_part true
puts the numeric base part - this is the trailing part of the base only containing digits - and true if available otherwise false
see:
@subpath
path -- /subpath/ true
puts the pathpart subpath - this is the filepath part starting after the : from the drive part and without the filename including leading and trailing slashes - and true if available otherwise false
see:
fileparts

A

a!
obj1 obj2 obj3…objn n -- addr
array store
stores as many entries from the stack to the array at addr as given by the size n
if the count of entries falls below the capacity (length) of the array, the remaining entries remain unchanged
see:
array-access

a>!
obj1 obj2 obj3…objn n -- addr
array store
stores as many entries from the stack to the array at addr as given by the size n like a!
a@
addr -- obj1 obj2 obj3…objn n
array fetch
fetches all entries of an array at addr and puts them and the array size n on the stack
see:
array-access

abort
--
terminates the program by throwing an abort exception

abort"
--
terminates the program by throwing an abort exception with a message

abs
--
returns the absolute value - that is the value for positive values and the negation for negative values
for complex numbers the magnitude is return - that is also the value on the TOS after executing >polar
see:
>polar

acos
n -- n'
pushes the arc cosine of TOS to stack
respects the current angular measurement settings
see:
sin cos tan asin atan
degrees grades radians

ahead$
--
returns the next command ahead as a string

aliceBlue
-- 0xf0f8ff
puts 0xf0f8ff on the stack

alloc
n --
makes space available to store values at the last word generated with create
to store values of the same type arrays are the better choice
see:
create int-array string-array

and
val1 val2 -- val
pushes the logical and value on TOS if val1 and val2 are boolean or otherwise val1 anded to val2

antiqueWhite
-- 0xfaebd7
puts 0xfaebd7 on the stack

append>
str --
appends str to the currently opened file
errors are reported by the onerr word
see:
appendf> openf appendf ensuref createf deletef deletef?
appendf
str --
opens the given path str for appending and for reading if it is allowed
if the file defined by path does not exists or other errors are reported by the onerr word
see:
append> appendf> openf ensuref createf onerr

appendf>
from to --
appends the contents of the given path from to the given path to
if the file defined by path does not exists or other errors are reported by the onerr word
see:
append> openf ensuref createf onerr

aqua
-- 0x00ffff
puts 0x00ffff on the stack

aquamarine
-- 0x7fffd4
puts 0x7fffd4 on the stack

array
n --
n is the size of the array to be created
the type of values to store in the array may be defined in the form <object>-array
where <object> could be int double char string complex…
the index - where to store an element to the array - is expected between the arrays name and the !
array-access
<@
a@
n<@
n@
rgn<@
rgn@
|<@
<!
asc
char -- n
pushes the numeric representation of a character on TOS
see:
number val >int >dbl

asin
n -- n'
pushes the arc sine of TOS to stack
respects the current angular measurement settings
see:
sin cos tan acos atan
degrees grades radians

at
cfa --
expects argument
shedules timer task
to execute aword starting at 12:00 a clock every hour type
example:
' aword at 12:00 every 3600
' aword at 01.08.2016, 12:00 every 3600
' aword at "01.08.2016 12:00" every 3600
see:
every cancel

atan
n -- n'
pushes the arc tangent of TOS to stack
respects the current angular measurement settings
see:
sin cos tan asin acos atan
degrees grades radians

azure
-- 0xf0ffff
puts 0xf0ffff on the stack

B

background
-- addr
gives the address of the variable background which is of type memory
example:
background @

Java side:
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName( "7th" );
System.err.println( engine.getBindings( ScriptContext.GLOBAL_SCOPE ).get( "BACKGROUND" ) );
see:
mem memory

base
-- addr
gives the address of the variable base that holds the base used for integer numbers
bases other than decimal 10 are show in the last line shown with .s
see:
.s convert inbase$

begin
--
control structure
see:
begin…while…repeat control

beige
-- 0xf5f5dc
puts 0xf5f5dc on the stack

bisque
-- 0xffe4c4
puts 0xffe4c4 on the stack

bl
-- ' '
pushes blank character on stack
see:
chr space spaces

black
-- 0x000000
puts 0x000000 on the stack

blanchedAlmond
-- 0xffebcd
puts 0xffebcd on the stack

blk
--
not supported - use scrfib instead
see:
scrfib

blue
-- 0x0000ff
puts 0x0000ff on the stack

blueViolet
-- 0x8a2be2
puts 0x8a2be2 on the stack

boolean
With the exception of the space ship operator <=> all comparison words are pushing a boolean value on the stack.
break
--
with break the control structures
begin…while…repeat
case…of…endof…endcase
do…+loop
do…loop
for…each
repeat…until
can be left immediately without satisfying the termination condition
see:
control leave quit

brown
-- 0xa52a2a
puts 0xa52a2a on the stack

burlyWood
-- 0xdeb887
puts 0xdeb887 on the stack

C

c!
--
example:
'x' "abcdef" 3 c!
c,
--
appends a character to a with create allocated space
example:
create store
store 'x' c, .s
> Variable…AllocatedCallSite$Allocation+["x"]<store>
see:
create

c@
--
example:
"abcdef" 3 c@ .s
> 'd'

cadetBlue
-- 0x5f9ea0
puts 0x5f9ea0 on the stack

caller
-- refobj
submit the calling java program as reference object to the 7th engine
this enables reading access to local variables and execution of functions
inside the calling java program
example:
in the calling java program:

Bindings bindings = engine.getBindings( ScriptContext.GLOBAL_SCOPE );
bindings.put( "CALLER", this );

see:
javav javax Java

calloc
addr n --
if addr is of type Allocation place for n characters is allocated at addr otherwise the place is allocated at the formerly allocated space
example:
create store
20 calloc
store .s
> Variable…AllocatedCallSite$Allocation+[" "]<store>

cancel
cfa --
terminates sheduled timer task
see:
every at

canvas
-- addr
puts the address of the currently used canvas on TOS

canvasheight
-- n
puts the height of the currently used canvas (visible part of the execution panel) on TOS

canvaswidth
-- n
puts the width of the currently used canvas (visible part of the execution panel) on TOS

case
--
control structure
see:
case…of…endof…endcase
caseobj control

caseobj
--
caseobj keeps the corresponding value for the currently executed of-branch
see:
case…of…endof…endcase

cat
--
expects argument
shows the contents of a file
-- str pushes the output of cat as string onto the stack
- s
-- out redirects the output to the given file
- o
--append appends the output to the given file
- a
--title surrounds the shown contents of the file with
-- filename -- at the beginning and
-- at the end
-t

cd
--
expects argument
changes the working directory to argument
without argument shows the current working directory
the current working directory can be retrieved using wd$ or setting debug on
see:
wd$

chartreuse
-- 0x7fff00
puts 0x7fff00 on the stack

chocolate
-- 0xd2691e
puts 0xd2691e on the stack

chr
n -- char
puts the corresponding unicode character for the number on the stack
example:
0x20 chr
see:
bl chr$ space spaces

chr$
--
puts a string containing the corresponding unicode character for the number on the stack
example:
0x20 chr
see:
bl chr space spaces

chs
n -- -n
not supported - use negate instead
if needed for compatibility reasons, You could define it like
example:
: chs negate ;
see:
negate

cleanup
--
closes all open files and writes dictionary to disk
see:
closeall

clear
--
calls first clst and afterwards cls
example:
: clear clst cls ;
see:
clst cls

clearPoint
g fn x y --
draws a point in the background color
see:
background

closeall
--
closes all open files
see:
cleanup

closef
str --
closes the given path
if the file defined by path does not exists the onerr word is executed

cls
--
clear screen
see:
clear clst

clst
--
clears (empties) the data stack
see:
clear cls

clust
--
clears (empties) the user stack

clx
--
clears X

cmove
str addr n --
moves the str to addr starting at position n
see:
smove

cmpf
str1 str2 -- boolean
compares two files and pushes true on TOS if they are equal

cnt>fn
arg1 arg2 arg3…argn n classobj -- classobj "fn" arg1 arg2 arg3…argn
convenience method to switch from the counted arguments form to the "fn" separated arguments form
mainly for the use of javax or javav
see:
javax javav

colonsplit
"a:b:c" -- ["a" "b" "c"]
puts an array on the stack, containing the entries separated with colons
see:
split csvsplit splitwith splitinc# splitlines ssvsplit tabsplit msgsplit enclose

color
-- addr
puts the address of the foreground color on TOS

colors
-- words[]
pushes an array of available color words

compare
obj1 obj2 -- -1/0/1
is being called from sort
example:
default implementation is
: compare
<=>
;
see:
sort <=>

compile
--
expects argument
compiles the word following compile on later execution of the word, where it is used in
the later must be immediate
example:
: dupcomp compile dup ; immediate
: test 123 dupcomp ;
ok> test .s
> 123
> 123
--

complex
--
creates a variable to hold a complex number with real and imaginary part
see:
>complex >re,im >re >im >polar >phi abs

concat$
obj1 obj2 -- str
concatenates obj1 and obj2 as strings and puts the result str on the TOS

console$
-- "console"
puts the string "console" on the TOS

consolecopy
-- addr
pushes the addr of CONSOLECOPY on TOS
if set to on all output is copied to console

constant
obj --
expects argument

contains
arr srch -- n
pushes true on TOS if srch is found in arr
where arr is either an array or a string
see:
indexof

context
--
vocabulary compiles a word, that changes context to that new vocabulary on execution
context is where words are searched for execution
current is where words are compiled to
definitions sets the value from current to context
see:
vocabulary context current definitions

control
--
control structures

begin…while…repeat
case…of…endof…endcase
do…+loop
do…loop
for…each
if…then
if…else…then
repeat…until

convert
straddr -- valaddr
converts the string at straddr according to the current base and pushes valaddr containing the numeric value in a newly allocated space
see:
base inbase$

copyf
from to --
copies the contents of the given path from to the given path to
if the file defined by path does not exists or other errors are reported by the onerr word

coral
-- 0xff7f50
puts 0xff7f50 on the stack

cornflower
-- 0x6495ed
puts 0x6495ed on the stack

cornsilk
-- 0xfff8dc
puts 0xfff8dc on the stack

cos
n -- n'
pushes the cosine of TOS to stack
respects the current angular measurement settings
see:
sin tan asin acos atan
degrees grades radians

cosh
n -- n'
pushes the hyperbolic cosine of TOS to stack
because the hyperbolic functions are rarely used, they are not predefined but You can define them yourself
example:
: cosh >dbl math fn rot prior cosh ;
see:
sinh tanh

cr
--
emits a newline caracter

create
--
expects argument

createf
str --
creates the given path, if it does not exist
otherwise an exception is thrown
see:
openf appendf ensuref deletef deletef?
crimson
-- 0xdc143c
puts 0xdc143c on the stack

csvsplit
--
puts an array on the stack, containing the entries separated with commas - comma separated values
see:
split splitwith splitinc# splitlines colonsplit ssvsplit tabsplit msgsplit enclose

current
--
vocabulary compiles a word, that changes context to that new vocabulary on execution
context is where words are searched for execution
current is where words are compiled to
definitions sets the value from current to context
example:
definitions hp
see:
vocabulary context current definitions

cyan
-- 0x00ffff
puts 0x00ffff on the stack

D

darkBlue
-- 0x00008b
puts 0x00008b on the stack

darkCyan
-- 0x008b8b
puts 0x008b8b on the stack

darkGoldenRod
-- 0xb8860b
puts 0xb8860b on the stack

darkGray
-- 0x404040
puts 0x404040 on the stack

darkGreen
-- 0x006400
puts 0x006400 on the stack

darkKhaki
-- 0xbdb76b
puts 0xbdb76b on the stack

darkMagenta
-- 0x8b008b
puts 0x8b008b on the stack

darkOliveGreen
-- 0x556b2f
puts 0x556b2f on the stack

darkOrange
-- 0xff8c00
puts 0xff8c00 on the stack

darkOrchid
-- 0x9932cc
puts 0x9932cc on the stack

darkRed
-- 0x8b0000
puts 0x8b0000 on the stack

darkSalmon
-- 0xe9967a
puts 0xe9967a on the stack

darkSeaGreen
-- 0x8fbc8b
puts 0x8fbc8b on the stack

darkSlateBlue
-- 0x483d8b
puts 0x483d8b on the stack

darkSlateGray
-- 0x2f4f4f
puts 0x2f4f4f on the stack

darkTurquoise
-- 0x00ced1
puts 0x00ced1 on the stack

darkViolet
-- 0x9400d3
puts 0x9400d3 on the stack

debug
-- switch
debug on/off opens the debugging window and starts/stops the debug output
note: if delay is 0 no output is written
see:
delay

decimal
--
sets base for integer numbers to 10
see:
base

decode$
chiffre passwd -- clear
decodes a chiffre string with the password with which the clear text was encoded before
see:
encode$ encodef

decodef
chiffre clear passwd -- crc32
decodes a chiffre file into a clear file with the password with which the clear file was encoded before
pushes the crc checksum of the clear file contents
see:
encodef encode$

deepPink
-- 0xff1493
puts 0xff1493 on the stack

deepSkyBlue
-- 0x00bfff
puts 0x00bfff on the stack

definitions
--
vocabulary compiles a word, that changes context to that new vocabulary on execution
context is where words are searched for execution
current is where words are compiled to
definitions sets the value from current to context
see:
vocabulary context current definitions

degrees
--
sets the angular unit of measurement to degrees
see:
grades radians

del
--
expects path
deletes the given path
if one of the files defined by path could not be deleted the onerr word is executed
see:
deletef

delay
n --
delay time in microseconds between outputs to the debug window
if delay is 0 no output takes place
see:
debug

deletef
str --
[str1, str2, …] --

deletes the given path or array of paths
if one of the files defined by path or array of paths could not be deleted the onerr word is executed
see:
-deletef

deletef?
str -- boolean
[str1, str2, …] -- boolean

deletes the given path or array of paths if it is allowed
if all of the files defined by path or array of paths could be deleted true is pushed on TOS otherwise false
see:
-deletef

depth
-- n
pushes the depth of the data stack

Dictionary - Class in Engine
 
Dictionary
 
digit?
char base -- n true
checks if char is a valid digit for the given base - if so puts the number representation and true on TOS
otherwise false

dim
array -- n
puts the dimension of array on TOS - 0 for non-array
example:
10 array example
example dim .s
> 1
see:
size

dimGray
-- 0x696969
puts 0x696969 on the stack

dir
--
expects argument
-- str pushes the output of dir as string onto the stack
- s
-- out redirects the output to the given file
- o
--append appends the output to the given file
- a
-- directory list directories only
- d
-- file list files only
- f
-- perms list only files with the given permission - only where supported by the Operating System
argument must be in numerical form - 4: r(ead), 2: w(rite), 1: x(ecute)
e.g. 446 others: r, group: r, user: rw
-p

div
n -- n'
integer division

do
--
control structure
see:
do…+loop
do…loop

dodgerBlue
-- 0x1e90ff
puts 0x1e90ff on the stack

does>
--
used in a definition word
compiles the runtime part when creating a new word with that definition word

drawChars
g fn carr [offset length] x y --
draws the characters from the array carr in the foreground color

drawPoint
g fn x y --
draws a point in the foreground color
example:
g fn 400 400 drawPoint

drawPolygon
g fn xarr yarr --
draws a sequence of lines (x0, y0), (x1, y1),… in the foreground color
in difference to drawPolyline a figure will automatically been closed
example:
g fn xarr yarr drawPolygon
see:
drawPolyline

drawPolyline
g fn xarr yarr --
draws a sequence of lines (x0, y0), (x1, y1),… in the foreground color
example:
g fn xarr yarr drawPolygon
see:
drawPolygone

drop
--

dup
obj -- obj obj
duplicates the 1st object on the top of the stack (= TOS)

E

e
--
puts the base of the natural logarithm e on TOS - 2,71828183…

e^x
--
exponential function
2,71828183… ^ x

e^x-1
--
exponential function
2,71828183… ^ x - 1

each
--
control structure
see:
for…each control

edit
--
opens editor window from commandline

editor
--
functions on the toolbar:
new opens a new workspace - the workspace will not be discarded when closing the editor
open opens a new file
save saves a file under its name - if the file is not yet named You will be asked for a name
save as ctrl S - saves a file and You will be asked for name
find finds and replaces
run reruns the main.7th file (main.7th is always executed on program start)
compile prepares a script for later execution - under construction
eval executes the currently opened workspace or file
undo undo the last typing
redo redo the last undo action

keyboard functions:
ctrl S save as - see above
ctrl D removes a full line
ctrl X cut
ctrl V paste
ctrl / comments / uncomments the selected range of lines or the single unselected line at cursor position
ctrl I indents the selected range of lines or the single unselected line at cursor position
ENTER indents the curent line
TAB shifts right the selected range of lines or the single unselected line at cursor position
SHIFT TAB shifts left the selected range of lines or the single unselected line at cursor position

else
--
control structure
see:
if…then
if…else…then control

emit
n --
prints the correspondig character for the numerical representation n

enclose
str c -- arr
splits a string containing a pair of delimiters into 3 parts
escaped delimiters are ignored
example:
"one|two\\||three" '|' enclose
> [one, two\|, three]
see:
split csvsplit splitwith splitinc# splitlines colonsplit ssvsplit tabsplit

encode$
clear passwd -- chiffre
encodes a clear string with the given password and pushes the chiffre
see:
decode$ decodef

encodef
clear chiffre passwd -- crc32
encodes a clear file into a chiffre file with the given password
pushes the crc checksum of the clear file contents
see:
decodef decode$

end$
s1 pos -- s2
pushes the string s2 which is the end of string s1 starting at the given position
see:
left$ mid$ right$ sub$

endcase
--
control structure
see:
case…of…endof…endcase control

endof
--
control structure
see:
case…of…endof…endcase control

eng
n --
engineering format
not more than n digits are shown after the decimal comma
if necessary the decimal number is shown in exponential format
the count of digits before the decimal comma may vary
example:
1234567.1234567
4 eng .
Engine - package Engine
 
ensuref
str --
similar to createf, but if the given path does not already exist - and it is allowed - the target file is created
see:
openf appendf createf deletef deletef?
eof
-- boolean
pushes a boolean value on the stack - true if the eof was seen

errors
--
You could try to circumvent errors like "file not found…" by ensuring that the file exists e.q. by opening the file with ensuref or must otherwise clean up the situation after an error if not
this is not possible for the following errors attributable to errors in the programming language - so hopefully never comes an AssertationError or InternalError into sight
see:
exceptions onerr

every
cfa --
expects argument
starts the recurring execution of a word with cfa every given time interval in seconds
eg. run aword every second
example:
' aword every 1
see:
at cancel

exceptions
--
if a word is running into an incorrect state an exception is thrown
the bulky in red writen error message should help to find the problem in Your word
the stack and the contents of all variables reamains unchanged after the exception
so it could be necessary to put everything back into an initial state before rerunning Your word
see:
errors

execute
cfa --
execute a word with the given cfa

existsf
str -- boolean
puts true on TOS if the file given with str exists

exit
--
terminates a word
execution is contined with the next word
see:
quit

expect
addr --
awaits input and repeats as long the input doesn't match the type of the variable at address
an empty input ends expect
--verbose shows the name of the variable and its contents
-v
see:
input span

F

fallthrough
--
used in compile mode between of and endof
executes the following case-of clause without testing its entry condition

false
-- false
Pushes the boolean value false.
fence
--
prevents the unintentional deletion of a word
no word bejond fence may removed from the context vocabulary with forget
example:
forget safety

fib
-- addr
puts the address of the file input buffer FIB on the TOS

fib#
-- addr
not supported - use line# instead
see:
line#

fibo$
n -- fibo
returns the n-th fibonacci number as string
the numeric value contained in the string is converted to the current base
see:
base

fibonacci
n -- fibo
recursive vs. iterative word
recursive is short and elegant but usually more slowly than the corresponding iterative word
for n > 79 fibo gets unexact…
for unlimited accurate Fibonacci numbers see the core word fibo$
example:
: fibo ( n -- fibo ) // recursive
dup 3 < if
drop 1
else
1.0 - dup fibo
swap 1.0 - fibo
+
then
;

: fibo ( n -- fibo ) // iterative
dup 2 < if
drop 1
else
1.0 0.0 0.0
4 roll 0 do
drop 2dup + (* fib = z + y *)
Y @ Z !
fileparts
addr -- flag cnt str
C:/Users/user/workspace/turtle123.7th
example:
fill
arr n obj --
addr n c --
addr n str --

expects the addr of an array or a string variable
this array is filled n times with the object obj or this string variable is filled n times with the character c or string str
example:
5 int-array nums
nums 5 -1 fill

string str
str 5 '#' fill

filler
-- addr
pushes the value of the internally used leading padding character for number formatting
default is the space character

findf
str -- patharr
pat -- patharr

two ways to specify a match pattern to find files
1. shell alike *.pdf
2. with regular expression .*\.pdf
find all pdf files in the current directory:
example:
"*.pdf" findf
/.*\.pdf/ findf

findstate
-- addr
internally used to hold the editor state of the find menue

firebrick
-- 0xb22222
puts 0xb22222 on the stack

fix
n --
fixed mode
always n digits are shown after the decimal comma
missing digits after the decimal comma are filled with zeros
example:
1234567.1234567
4 fix .
floralWhite
-- 0xfffaf0
puts 0xfffaf0 on the stack

fmt$
obj0 obj1 obj2… fmt -- str --
fmt contains placeholders how to build the str with the objects on the stack
the placeholders are in the style {n} where n is the index starting with 0 of the object to show
to the index a type and a style can be added to define how the object is parsed
index with types {0,time}, {0,date}
index with types and styles {0,number,#.##}, {0,number,integer}

fn
--
fn is a word to separate the parameters from the rest
of the stack for the use in a following word or function
do fn not confuse with a string "fn"
example:
fn 1 2 3
> "fn"
> 1
> 2
> 3
--
see:
fn>cnt fnparams fnturn

fn>cnt
fn obj1 obj2 … objn -- obj1 obj2 … objn cnt
transforms a fn started parameter list to a counted parameter list
example:
fn 1 2 3 fn>cnt
> 3
> 3
> 2
> 1
--
see:
fn fnparams fnturn

fnparams
fn obj1 obj2 … objn -- arr
transforms a fn separated parameter list to an object array
example:
fn 1 2 3 fnparams
> Create…Object[3]+[1, 2, 3]<>
see:
fn fn>cnt fnturn

fnturn
--
turns fn started parameter list in reverse order
example:
fn 1 2 3
fnturn
> "fn"
> 3
> 2
> 1
--
see:
fn fn>cnt fnparams

fold
--
not supported - use splitlines instead
see:
splitlines

fopen
--
no such word
see:
openf

for
--
control structure
see:
for…each
forobj control

forestGreen
-- 0x228b22
puts 0x228b22 on the stack

forget
--
expects argument
forgets word
fails silently if word is not found without option verbose
throws an exception when trying to forget a word below fence
--verbose throws exception if word to forget was not found
-v
example:
forget sample
see:
forget2core forget2fence fence

forget2core
--
forget function for convenience
all words above core are forgotten
see:
forget forget2fence fence

forget2fence
--
forget function for convenience
all words above fence are forgotten
see:
forget forget2core fence

forobj
--
forobj goes through every value from the given array
see:
for…each

fp
d -- f
puts the fraction part f from d on TOS

fuchsia
-- 0xff00ff
puts 0xff00ff on the stack

G

g
-- G
returns the pointer to the current graphic context
needed to invoke graphical functions
example:
g fn 100 100 500 500 drawLine

gainsboro
-- 0xdcdcdc
puts 0xdcdcdc on the stack

getcolor
-- COLOR
gets the address of COLOR containing the current drawing color
example:
getcolor
> java.awt.Color[r=0,g=0,b=0]
see:
g

getopts
str -- opt1 opt2 … optn cnt
str defines the allowed options for getopts
in the example aword may be called with the options a b and c where b may have an argument
getopts ends parsing if it sees --
example:
: aword "a b: c" getopts
0 swap do
." opt: " type cr
." arg: " type cr
loop
;
aword -b bla -c
see:
getoptsarr

getoptsarr
"-" "-abc" "--aber" "--" -- ["-", "a", "b", "c", "aber"]
puts an array on TOS containing all options following the currently executing word
see:
getopts

gettextbgcolor
-- color
pushes the current value of the text background color on TOS

gettextcolor
-- color
pushes the current value of the text color on TOS

ghostWhite
-- 0xf8f8ff
puts 0xf8f8ff on the stack

gold
-- 0xffd700
puts 0xffd700 on the stack

goldenRod
-- 0xdaa520
puts 0xdaa520 on the stack

gpio
--
raspberry wireing
instantiate a GpioController if the pi4j-core.jar library is installed

grades
--
sets the angular unit of measurement to grades
see:
degrees radians

gray
-- 0x808080
puts 0x808080 on the stack

green
-- 0x008000
puts 0x008000 on the stack

greenYellow
-- 0xadff2f
puts 0xadff2f on the stack

H

h.
n --
converts n to a hex number in the form 0x…
for base equals 10:
example:
100 h.
hasopts?
str -- boolean
pushes true on TOS if a word is called with one or more options given in str

height
--
puts the address of the currently used background BufferedImage height on TOS
see:
width

help
--
expects argument
shows a description of the given word argument
-- help shows the available options
-- str pushes this help message as string onto the stack
- s
-- out redirects the message to the given file
- o
--append appends the message to the given file
- a
example:
help dup
>- dup -
> obj -- obj obj
>duplicates the 1st object on the top of the stack (= TOS)

here
--

hex
--
sets base for integer numbers to decimal 16
numbers are recognized as hexadecimal with each base if the sequence has a 0x prefix
if base is decimal 16 and shorthex is on additionaly uppercase hexadecimal numbers without 0x prefix are recognized
example:
hex
0x2ABC (* valid *)
0x2abc (* valid *)
shorthex on
2ABC (* valid *)
2abc (* invalid *)
see:
base shorthex

hidden
data --
hides the contents when showing data with .s
cannot be reverted

histsize
-- addr
pushes the addr of the size of the history on TOS
the number of entries in the history is limited to histsize

honeydew
-- 0xf0fff0
puts 0xf0fff0 on the stack

hotPink
-- 0xff69b4
puts 0xff69b4 on the stack

I

i
--
inner counting loop index
see:
i' j

i'
--
inner end loop index

if
--
control structure
see:
if…then
if…else…then control

immediate
--
marks the latest word in the dictionary as immediate
which means that the word is not compiled when used inside a colon definition but executed immediately
.( is immediate ." is not
example:
: hello .( hello) ." aber hallo" ;
see:
latest

inbase$
int -- str
converts the value according to the current base and pushes str
see:
base

indexof
arr srch -- n
pushes the index of srch in arr on TOS
where arr is either an array or a string
see:
contains indicesof

indianRed
-- 0xcd5c5c
puts 0xcd5c5c on the stack

indicesof
arr srch -- [n1, n2,… n]
pushes the indices of all places where srch is found in arr on TOS
where arr is either an array or a string
see:
contains indicesof

indigo
-- 0x4b0082
puts 0x4b0082 on the stack

inject
str --
array --

takes the next word from stack instead from the input stream
example:
1 "dup" inject ' execute (* ' takes dup *)

input"
-- value
shows the following quoted input message and pushes the user input on the stack
sets span
redirect does not affect the input message
see:
expect span

intro
--
The 7th programming language is based on the work of Charles Henry Moore "A Problem Oriented Language".
ip
d -- i
puts the integer part i from d on TOS

isassigned?
addr -- boolean
pushes true on TOS if a value has been assigned to addr

isconstant?
addr -- boolean
pushes true on TOS if a value has been assigned to addr

iseven?
n -- boolean
pushes true on TOS if n is even
see:
isodd?
isodd?
n -- boolean
pushes true on TOS if n is odd
see:
iseven?
isparallel?
addr -- boolean
pushes true on TOS if word at addr is parallel
see:
parallel

ivory
-- 0xfffff0
puts 0xfffff0 on the stack

J

j
--
outer counting loop index

Java
--
7th is a scripting engine for Java
so it is possible to use 7th from Java and vice versa
in the example the 7th word "hello" is called from the Java class "Test" which is specified as the CALLER
and the 7th word "hello" calls the public "helloFromJava()" function defined in class "Test"
for security reasons only public functions from the calling class "Test" can be accessed from 7th
in most cases it should be sufficient to work with the return value of engine.eval(…) function which is the last evaluated value from 7th - TOS top of stack
example:
on Java side:

public Test() {
ScriptEngineManager manager = new ScriptEngineManager();
ScriptEngine engine = manager.getEngineByName( "7th" );
try {
engine.getBindings( ScriptContext.GLOBAL_SCOPE ).put( "CALLER", Test.this );
engine.eval( ": hello javax helloFromJava ; hello" );
}
catch( ScriptException ex ) {
ex.printStackTrace();
}
}

public void helloFromJava() {
System.err.println( "hello 7th…" );
}
see:
javax javav

javav
-- obj
puts the value of the variable defined in the calling Java class (CALLER) with the given varname e.g. beispiel
for security reasons only public variables from the calling Java class can be read from 7th
Java variables may not be changed directly from 7th
variable values exchange between Java and 7th is best with Java's ScriptContext.GLOBAL_SCOPE
You put Your variable analogous to the example under "help Java":
engine.getBindings( ScriptContext.GLOBAL_SCOPE ).put( "<Your variable name>", <Your Java class object> );
example:
javav beispiel

on Java side (CALLER):
public String beispiel = "some text";
see:
javax Java

javax
--
execute a public function contained in the calling class (CALLER) from 7th
pushes the return value of this function on the stack (TOS)
see:
javav Java

K

key
-- char
awaits one key press and puts the corresponding char on TOS

khaki
-- 0xf0e68c
puts 0xf0e68c on the stack

L

lastX
--
returns the last value that was removed from the stack

latest
--
puts the cfa of the newest word on TOS
see:
' execute

lavender
-- 0xe6e6fa
puts 0xe6e6fa on the stack

lavenderBlush
-- 0xfff0f5
puts 0xfff0f5 on the stack

lawnGreen
-- 0x7cfc00
puts 0x7cfc00 on the stack

leave
--
do…+loop
do…loop
completes and leaves the current loop
see:
break

left$
str n -- str'
extracts n characters from the left as new string

lemonChiffon
-- 0xfffacd
puts 0xfffacd on the stack

length
--
not supported - use size instead
see:
size

lightBlue
-- 0xadd8e6
puts 0xadd8e6 on the stack

lightCoral
-- 0xf08080
puts 0xf08080 on the stack

lightCyan
-- 0xe0ffff
puts 0xe0ffff on the stack

lightGoldenRod
-- 0xfafad2
puts 0xfafad2 on the stack

lightGray
-- 0xc0c0c0
puts 0xc0c0c0 on the stack

lightGreen
-- 0x90ee90
puts 0x90ee90 on the stack

lightPink
-- 0xffb6c1
puts 0xffb6c1 on the stack

lightSalmon
-- 0xffa07a
puts 0xffa07a on the stack

lightSeaGreen
-- 0x20b2aa
puts 0x20b2aa on the stack

lightSkyBlue
-- 0x87cefa
puts 0x87cefa on the stack

lightSlateGray
-- 0x778899
puts 0x778899 on the stack

lightSteelBlue
-- 0xb0c4de
puts 0xb0c4de on the stack

lightYellow
-- 0xffffe0
puts 0xffffe0 on the stack

lime
-- 0x00ff00
puts 0x00ff00 on the stack

limeGreen
-- 0x32cd32
puts 0x32cd32 on the stack

line#
-- n
puts the actual number of the line beeing parsed on TOS
see:
scrfib

linen
-- 0xfaf0e6
puts 0xfaf0e6 on the stack

listf
str --
shows the contents of the file named str

literal
--
not supported - unnecessary

ln
--

ln10
--

loadf
--
loads and executes a 7th file

loadoncef
--
loads and executes a 7th file one time

log(1+x)
--

log>
str --
writes the given str to the logfile when logging to a specific loglevel or above is enabled
see:
loglevel logfile

logfile
str --
defines the logfile with the filename given by str
see:
log> loglevel

loglevel
--
sets the loglevel from which a logging starts
see:
log> logfile

loop
--
control structure
example:
: main
10 0
do
." x "
loop
;
see:
do…loop
do…+loop
i i' j control

loopdepth
--
numerates nested do…loop/+loop structures starting to count with 0 for the outermost
1 for the next inner and so forth

loopindices
-- arr
pushes an array arr with all current counting loop indices
see:
i

lower$
str -- str'
char -- char'

returns an lowercase string for str or lowercase character for char
see:
upper$

lsh
n pos -- n'
shifts n by pos positions to the left
see:
rsh ror

M

magenta
-- 0xff00ff
puts 0xff00ff on the stack

maroon
-- 0x800000
puts 0x800000 on the stack

matcher
--

max
n1 n2 -- n
returns the greater of two numbers

mediumAquamarine
-- 0x66cdaa
puts 0x66cdaa on the stack

mediumBlue
-- 0x0000cd
puts 0x0000cd on the stack

mediumOrchid
-- 0xba55d3
puts 0xba55d3 on the stack

mediumPurple
-- 0x9370db
puts 0x9370db on the stack

mediumSeaGreen
-- 0x3cb371
puts 0x3cb371 on the stack

mediumSlateBlue
-- 0x7b68ee
puts 0x7b68ee on the stack

mediumSpringGreen
-- 0x00fa9a
puts 0x00fa9a on the stack

mediumTurquoise
-- 0x48d1cc
puts 0x48d1cc on the stack

mediumVioletRed
-- 0xc71585
puts 0xc71585 on the stack

mem
--
expects argument
creates a memory variable with the given name
you rarely need this
their are predefind memory variables which are shared between the Java and the 7th part
if the sharing is not needed a normal variable is the better joice because of its type safety - assignments are only allowed for values of the same type
see:
memory variable

memory
--
memory shared between Java and 7th that can accessed from both sides
reading and writing the contents of the variable background
example:
background @ (* read *)
red background !
mid$
str beg len -- str'
cuts out a part of a string starting with the character on position beg (first position is 0)
and beginning with this position a length of len
see:
ok> "01234567" 2 4 mid$ .s
> 4
> "2345"

midnightBlue
-- 0x191970
puts 0x191970 on the stack

min
n1 n2 -- n
returns the smaller of two numbers

mintCream
-- 0xf5fffa
puts 0xf5fffa on the stack

mistyRose
-- 0xffe4e1
puts 0xffe4e1 on the stack

moccasin
-- 0xffe4b5
puts 0xffe4b5 on the stack

mod
n1 n2 --
gives the remainder - modulo - of the division of n1 by n2
example:
ok> 40 7 mod .s
> 5
see:
/

msgsplit
str -- arr
word for convenience to split onerr messages
see:
split onerr csvsplit splitwith splitinc# splitlines colonsplit ssvsplit tabsplit enclose

N

n!
obj1 obj2 obj3…objn n arr from --
takes n objects and stores them in the array arr
obj1 is stored in the array at the start index from
example:
ok> 10 int-array arr
ok> 5 6 7 3 arr 5 n!
n+!
n1 n2 n3… cnt arr from --
takes cnt numbers and adds them into the array arr
n1 is added into the array at the start index from
example:
ok> 10 int-array arr
ok> 5 6 7 3 arr 5 n+!
n,
obj1 obj2…objn n --
allocates space for the counted n objects

n<!
obj1 obj2…objn n arr from --
takes n objects and inserts them in the array arr beginning with obj1 which is inserted at position from
see:
array-access

n<@
arr from cnt --
extracts cnt objects from the array arr beginning at position from
see:
array-access

n@
arr from cnt -- obj1 obj2…objn n
fetches from an array arr cnt elements starting at postion from and puts them on the stack
see:
array-access

nand
val1 val2 -- val
pushes the logical nand value on TOS if val1 and val2 are boolean or otherwise val1 nanded to val2

navajoWhite
-- 0xffdead
puts 0xffdead on the stack

navy
-- 0x000080
puts 0x000080 on the stack

nconcat$
str1 str2 str3… n -- str
concatenates a count of strings

ndrop
--
removes n values from the data stack

negate
n -- -n
toggles the sign

nip
n1 n2 n3 -- n1 n3
removes the value below the TOS

nope
--
where supported this option prevents the normal execution and only prints what would happen on normal execution

nor
val1 val2 -- val
pushes the logical nor value if val1 and val2 are boolean or otherwise val1 nored to val2

norm
--
normal mode
numbers are shown at full length
see:
. eng fix sci

not
val -- val'
pushes the logical complement if val is boolean or otherwise the bitwise complement

now$
--
pushes the current time stamp as string in the form "dd.mm.yy hh:mm" - day.month.year hour:minute

nrconcat
str1 str2 str3… n -- str
concatenates a count of strings in reverse order

nrdrop
n --
removes n values from the return stack

null
--
pushes the null word

null$
--
pushes the null string

num>txt$
n --
pushes the german textual representation of the given number n

number
obj -- n
ensures a number on the TOS
see:
asc val >int >dbl

O

of
--
control structure
see:
case…of…endof…endcase control

off
--
sets the value of a switch to false
see:
on toggle

oldLace
-- 0xfdf5e6
puts 0xfdf5e6 on the stack

olive
-- 0x808000
puts 0x808000 on the stack

oliveDrab
-- 0x6b8e23
puts 0x6b8e23 on the stack

on
--
sets the value of a switch to true
see:
off toggle

onerr
--
for every word e.g. honk You can define
the corresponding onerr word honk-onerr
both of them must reside in the same dictionary
if no special error handling is defined onerr is executed
onerr can be overridden
the default behavior of the core onerr is to throw an exception
example:
: onerr ."
openf
str --
opens the given path for reading if it is allowed and for writing if it is allowed
if the file defined by path does not exists the onerr word is executed
see:
appendf ensuref createf deletef deletef?
or
val1 val2 -- val
pushes the logical or value if val1 and val2 are boolean or otherwise val1 ored to val2

orange
-- 0xffa500
puts 0xffa500 on the stack

orangeRed
-- 0xff4500
puts 0xff4500 on the stack

orchid
-- 0xda70d6
puts 0xda70d6 on the stack

osx
--
-- str pushes the output of osx as string onto the stack
- s
-- out redirects the output to the given file
- o
--append appends the output to the given file
- a

over
n1 n2 -- n1 n2 n1

P

pad
-- addr
pad returns the addr of a global string space
useful to exchange strings between Java and 7th or temporarily store strings

paleGoldenRod
-- 0xeee8aa
puts 0xeee8aa on the stack

paleGreen
-- 0x98fb98
puts 0x98fb98 on the stack

paleTurquoise
-- 0xafeeee
puts 0xafeeee on the stack

paleVioletRed
-- 0xdb7093
puts 0xdb7093 on the stack

papayaWhip
-- 0xffefd5
puts 0xffefd5 on the stack

paperWhite
-- 0xfdfff8
puts 0xfdfff8 on the stack

parallel
--
marks a word as parallel at compile time so that it can be executed in a separate thread
example:
: aword parallel … ;
see:
isparallel?
peachPuff
-- 0xffdab9
puts 0xffdab9 on the stack

peek
-- obj
pushes the last entry from the user stack on TOS
see:
push pop pop=

permutation
arr 0 --
the example program generates all permutations on a given array arr and prints them out
example:
: perm ( arr from -- )
over size 1- over > if
over size over do
2dup i >< over
1+
perm
2drop
loop
else
over size 1- over == if
over println
then
then
;

peru
-- 0xcd853f
puts 0xcd853f on the stack

pi
-- 3,14159265358…
pushes on TOS

pick
n --
pushes the nth number on TOS

pink
-- 0xffafaf
puts 0xffafaf on the stack

plum
-- 0xdda0dd
puts 0xdda0dd on the stack

pop
-- obj
removes the last entry from the user stack and pushes it on TOS
see:
push pop= peek

pop=
-- boolean
removes the last entry from the user stack and compares it with TOS
see:
push pop peek

popcnt
n -- cnt
counts the 1-bits in n

powderBlue
-- 0xb0e0e6
puts 0xb0e0e6 on the stack

print
obj --
prints the TOS
see:
println type . cr

println
obj --
prints the TOS and a newline
see:
print type . cr

prior
--
allows to access a overridden word
prevents recursion when defining a word with the same name as a Java function as e.g. in sinh
see:
sinh

purple
-- 0x800080
puts 0x800080 on the stack

push
obj --
pushes the TOS on the user stack
see:
pop pop= peek

pwd$
str -- pwd
generates from a easy to remember str a strong password
--digit use only digit characters
--alpha use alpha and digit characters
--symbol use symbols, alpha and digit characters - the default without option
--umlaut use Umlaut (), alpha and digit characters in the generated password
*** caution ***
generated passwords are different in each installation of 7th
that means generated passwords will change after an update
digit alpha symbol umlaut

Q

query
--
reads a line of input and evaluates it

quit
--
terminates all execution
see:
exit

R

r>
-- obj
drops the top of return stack and pushes it on TOS
see:
r@ >r

r@
-- obj
copies the top of return stack on TOS
see:
>r r> rcopy

radians
--
sets the angular unit of measurement to radians
see:
degrees grades

random
max -- n
pushes an integer random value in the range from 0 (incl.) to max (excl.)
rcl
--
expects argument

rcopy
n -- obj
copies the nth value from return stack on TOS
1 rcopy is the same as r@
see:
r@

rdepth
-- n
pushes the depth of the return stack

rdn
obj -- obj obj
copies the TOS - hp word
see:
dup

readall$
-- str
pushes the contents of the current file as string str on TOS

readline$
-- str
pushes one line of the current file as string str on TOS

red
-- 0xff0000
puts 0xff0000 on the stack

redirect
--
see:
." .(

ren
--
shell alike form to rename files
expects a path "from" and "to"
renames a path "from" to the path "to"
the resulting new filenames are stored to $*
--nope don't execute the word
-n
--verbose prints what would happen, when the word is executed
-v
-- directory rename directories only
- d
-- file rename files only
- f
--str pushes the output as string onto the stack instead of printing
-s
--out redirects the message to the given file
-o
--append appends the message to the given file
-a
example:
ren xxx yyy
see:
renamef -renamef $*

renamef
from to --
renames a path "from" to the path "to"
the resulting new filenames are stored to $*
--nope don't execute the word
-n
--verbose prints what would happen, when the word is executed
-v
-- directory rename directories only
- d
-- file rename files only
- f
--str pushes the output as string onto the stack instead of printing
-s
--out redirects the message to the given file
-o
--append appends the message to the given file
-a
see:
-renamef $*

repaint
--
repaint the current canvas
see:
canvas

repeat
--
control structure
see:
begin…while…repeat
repeat…until control

reset
matcher --
resets a matcher by discarding its state information and setting the append position to 0
see:
=~ ~~

resettextbgcolor
--
sets the text background color to its initial value paperWhite
see:
paperWhite

resettextcolor
--
sets the text color to its initial value black
see:
black

rgn!
src targ to cnt --
takes cnt objects from array src and stores them in the array targ beginning at index to

rgn<!
src targ to cnt --
takes cnt objects from array src and inserts them in the target array targ beginning at index to
see:
array-access

rgn<@
arr pos cnt -- arr'
extracts from an array arr cnt elements starting at pos and pushes the resulting array arr' on TOS
the source array arr get changed
see:
array-access

rgn@
arr from cnt -- arr'
fetches from an array arr cnt elements starting at postion from and pushes the resulting array arr' on TOS
see:
array-access

right$
str n -- str'
extracts n characters from the right as new string

roll
--
the TOS specifies the number - not counting TOS - of the entry, which becomes the new TOS
see:
-roll

ror
n pos -- n'
rotates n by pos positions to the right
see:
lsh rsh

rosyBrown
-- 0xbc8f8f
puts 0xbc8f8f on the stack

rot
n1 n2 n3 -- n2 n3 n1
makes the 3rd entry to the new TOS
note: not to be confused with the complete turn of the order ( n1 n2 n3 -- n3 n2 n1 ) achieved by
3 turn (or alternatively: swap rot)
see:
-rot

royalBlue
-- 0x4169e1
puts 0x4169e1 on the stack

rsh
n pos -- n'
shifts n by pos positions to the right
see:
lsh ror

rup
obj --
drops the TOS - hp word
see:
drop

S

s!
str addr --
stores the string str at addr
see:
!
s0
-- S0
puts the list S0 containing the data stack on TOS

s<&
str addr -- addr
appends the string at addr to the string str and stores the concatenated string to addr

s=
str1 str2 -- boolean
returns true if str1 equals str2
see:
==

s>&
addr str -- addr
appends the string str to the string at addr and stores the concatenated string to addr

s@
addr -- str
fetches the string str at addr

saddleBrown
-- 0x8b4513
puts 0x8b4513 on the stack

safety
--
safety on - protects the stack including the TOS
after a safety on, none of the current elements on the stack may be changed or removed
but these elements may be read and new elements may be added onto the stack
a satety off makes the stack accessible again
see:
fence

salmon
-- 0xfa8072
puts 0xfa8072 on the stack

sandyBrown
-- 0xf4a460
puts 0xf4a460 on the stack

sci
--
scientific format
not more than n digits are shown after the decimal comma
if necessary the decimal number is shown in exponential format with one digit before the decimal comma
example:
1234567.1234567
4 sci .
scrfib
-- addr
puts the address of SCRFIB on the TOS which contains the actual number of the line beeing parsed
see:
line#

seaGreen
-- 0x2e8b57
puts 0x2e8b57 on the stack

seaShell
-- 0xfff5ee
puts 0xfff5ee on the stack

seek
fn startdir pattern --
seeks files starting from startdir with the pattern

selectf
path --
makes the path the current file for file operations

setbackground
color --
sets the background color
see:
background

setColor
--

setcolor
color --
sets the drawing color

setcolorred
--
sets the drawing color to red

settextbgcolor
color --
sets the text background color

settextcolor
color --
sets the text color

shorthex
--
allows uppercase hex numbers without leading 0x

shutdown
--
ends the 7th program

sienna
-- 0xa0522d
puts 0xa0522d on the stack

sign
n -- [1|0|-1]
short for signum
returns 1 for positive -1 for negative values and 0 for zero
see:
signum

signum
n -- [1|0|-1]
returns 1 for positive -1 for negative values and 0 for zero
see:
sign

silver
-- 0xc0c0c0
puts 0xc0c0c0 on the stack

sin
n -- n'
pushes the sine of TOS to stack
respects the current angular measurement settings
see:
cos tan asin acos atan
degrees grades radians

sinh
n -- n'
pushes the hyperbolic sine of TOS to stack
because the hyperbolic functions are rarely used, they are not predefined but You can define them yourself
example:
: sinh >dbl math fn rot prior sinh ;
see:
cosh tanh

size
addr -- n
puts the size (length) of an array or a string on TOS
example:
10 array example
example size .s
> 10
see:
dim

skyBlue
-- 0x87ceeb
puts 0x87ceeb on the stack

slateBlue
-- 0x6a5acd
puts 0x6a5acd on the stack

slateGray
-- 0x708090
puts 0x708090 on the stack

smove
str addr --
moves the str to addr starting at position 0
example:
"anytext" value astr
"foo" astr smove
astr .s
> String…SevString+"footext"<astr>
see:
cmove

smudge
--
not supported - unnecessary
see recursive fibonacci example
see:
fibonacci

snow
-- 0xfffafa
puts 0xfffafa on the stack

sort
array -- array'
sorts an array
sort executes/compiles the latest version of compare
see:
compare

space
--
emits
see:
bl chr spaces " ."
spaces
--
see:
bl chr space " ."
span
-- n
length of input entered in except
see:
except

split
--
puts an array on the stack, containing the entries separated with blanks
see:
csvsplit splitwith splitinc# splitlines colonsplit ssvsplit tabsplit msgsplit enclose

splitinc#
--
see:
split csvsplit splitwith splitlines colonsplit ssvsplit tabsplit msgsplit enclose

splitlines
str -- arr
splits the str at the line delimiters and stores the result into an array on the TOS
see:
unfold split onerr csvsplit splitwith splitinc# colonsplit ssvsplit tabsplit enclose

splitwith
str c --
str1 str2 --

puts an array on the stack, containing the entries separated with the char or string on TOS
see:
split csvsplit splitinc# splitlines colonsplit ssvsplit tabsplit msgsplit enclose

springGreen
-- 0x00ff7f
puts 0x00ff7f on the stack

sqrt
n -- n'
replaces the TOS with the correctly rounded positive square root from the TOS

ssvsplit
--
puts an array on the stack, containing the entries separated with semicolon - semicolon separated values
see:
split splitwith splitinc# splitlines colonsplit csvsplit tabsplit msgsplit enclose

star
-- 0x22C6
puts the numeric unicode representation for the star character on TOS

state
-- boolean
pushes true if state is executing otherwise false while compiling

std
--
same as norm - normal mode
numbers are shown at full length
see:
. norm eng fix sci

steelBlue
-- 0x4682b4
puts 0x4682b4 on the stack

sto
--
expects argument

str$
obj -- str
converts an object to a string
see:
val

string
--
expects argument
creates a variable with the given name to store strings
see:
variable value

structures
--
control structures
begin…while…repeat
case…of…endof…endcase
do…+loop
do…loop
for…each
if…then
if…else…then
repeat…until

sub$
str beg end -- str'
cuts out a part from str beginning with beg (incl.) and ending with end (excl.)
success
-- boolean
pushes true on TOS if the last file io was successfull

sum
n1 n2 … n cnt -- sum
adds cnt numbers on stack and pushes the result sum on TOS

suntan
-- 0xd2b48c
puts 0xd2b48c on the stack

swap
n1 n2 -- n2 n1
the values on TOS and the value on the before last position are changing places

switch
--
expects argument
creates a boolean value which can either be set with !

T

T
--
returns the address of the 4th last entry of the data stack

tabsplit
"a\tb\tc" -- ["a", "b", "c"]
>puts an array on the stack, containing the entries separated with tabs

talloc
class --
makes space available to store a value from type class at the last word generated with create

tan
n -- n'
pushes the tangent of TOS to stack
respects the current angular measurement settings
see:
sin cos asin acos atan
degrees grades radians

tanh
n -- n'
pushes the hyperbolic tangent of TOS to stack
because the hyperbolic functions are rarely used, they are not predefined but You can define them yourself
example:
: tanh >dbl math fn rot prior tanh ;
see:
cosh sinh

teal
-- 0x008080
puts 0x008080 on the stack

tempdir$
-- str
pushes the path on the stack where the operating system stores temporary files

textbgcolor
-- addr
pushes the addr where the text background color is stored

textcolor
-- addr
pushes the addr where the text color is stored

then
--
control structure
see:
if…then
if…else…then control

thistle
-- 0xd8bfd8
puts 0xd8bfd8 on the stack

tib
-- buf
puts the charbuffer of the TIB on TOS
see:
tib#

tib#
-- n
puts the length of the TIB on TOS
see:
tib

time
not supported - use now$ instead
see:
now$

to
--
expects argument
different method to store a value into a variable
example:
3.14 to avariable

toggle
--
sets the value of a switch to the opposite value
see:
on off

tomato
-- 0xff6347
puts 0xff6347 on the stack

TOS
--
short for Top Of Stack - that is the latest value pushed onto the data stack

touchf
--
changes the last modified time of the current file to now

translate
g fn x y --
sets the canvas origin to the new x y coordinates

true
-- true
Pushes the boolean value true.
tuck
n1 n2 -- n2 n1 n2
duplicates the TOS below the next to topmost entry

turn
n1 n2 … nm m -- nm … n2 n1
turns the m topmost entries on the stack

turquoise
-- 0x40e0d0
puts 0x40e0d0 on the stack

type
str --
prints str
see:
print

U

udepth
-- n
pushes the depth of the user stack

unfold$
str -- str'
replace each cr and nl in str with a blank character

until
--
control structure
see:
repeat…until control

upper$
str -- str'
char -- char'

returns an uppercase string for str or uppercase character for char
see:
lower$

V

val
str -- n
expects a string that can be converted to a number
see:
asc number str$ >int >dbl

value
--
expects argument
see:
variable

var
--
var is a word to tag the following argument as an external java variable
do var not confuse with a string "var"

variable
--
expects argument
creates a variable with the given name
once the variable was assigned to a value following assignments are only allowed for values of the same type
example:
variable xxx
123 xxx !
verbose
--
switches on/off enhanced failure messages on serialization exceptions
see:
debug on/off

version
--
prints version id from 7th program as number

violet
-- 0xee82ee
puts 0xee82ee on the stack

vocabulary
--
expects argument
vocabulary compiles a word, that changes context to that new vocabulary on execution
context is where words are searched for execution
current is where words are compiled to
definitions sets the value from current to context
see:
vocabulary context current definitions

W

wd$
--
retrieves the current working directory set using cd
see:
cd

wheat
-- 0xf5deb3
puts 0xf5deb3 on the stack

while
--
control structure
see:
begin…while…repeat control

white
-- 0xffffff
puts 0xffffff on the stack

whiteSmoke
-- 0xf5f5f5
puts 0xf5f5f5 on the stack

width
--
puts the address of the currently used background BufferedImage width on TOS
see:
height

word
str -- word
pushes the word with the name str or if no such word exists the null word

words
--
shows a list of all defined words found in context
-- str pushes the output of words as string onto the stack
- s
-- out redirects the output to the given file
- o
--append appends the output to the given file
- a
-- colors show no colors
-- cols
-- controls show no control words
-- ctrl
-- stack show no stack manipulating words
-+ colors show colors
-+ cols
-+ controls show control words
-+ ctrl
-+ stack show stack manipulating words
see:
vocabulary context

write>
str --
writes str to the curently opened file

X

X
--
returns the address of the 3rd last entry of the data stack

x<>y
--
the values of X and Y are changed
see:
swap

x=0?
-- boolean
pushes true if X is equals 0
see:
boolean

x^2
puhes x * x --

xchg
arr from to --
str from to --

exchanges the contents in an array arr or string str at the position from with that at position to
see:
array-access ><

xor
val1 val2 -- val
pushes the logical xor value if val1 and val2 are boolean or otherwise val1 xored to val2
see:
boolean

Y

Y
--
returns the address of the before last entry of the data stack

y^x
y x -- n
raises y by x and pushes the result on TOS

yellow
-- 0xffff00
puts 0xffff00 on the stack

yellowGreen
-- 0x9acd32
puts 0x9acd32 on the stack

Z

Z
--
returns the address of the last entry (top of stack) of the data stack

[

[
--
suspends the compile mode until ] is read

[']
--
compiles the address of the following word's CFA even if this is an immediate word

[char]
--
identifies the following input as a character in compilation mode
(characters in the form 'a' should always be preferred)

[compile]
--
expects argument
compiles the following word's CFA even if this is an immediate word

]

]
--
re-enters compilation mode again
(follows [)
see:
[

~

~~
str pattern -- boolean
puts true on TOS if pattern is found in str
example:
"zonk" /nk/ ~~ .s
> true
see:
=~

! " # $ & ' ( * + , - . / 0 1 2 3 5 7 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ ] ~