##    
   ##    

.

Stack

'-

Description

Read and discard the next 62 characters. This is used in blocks to provide line width comments.

Examples

. Text to ignore

Notes

This is intended for use in blocks. If placed as the first word on a line, it will ignore the rest of the line.

As RetroForth does not track line lengths during evaluation, this can not be used to comment out the end of a line, only a full line.

Related

(


  #####  
 ##   ## 
##    ## 
##    ## 
##    ## 
##  #### 
## ## ## 
####  ## 
##   ##  
 #####   

0

Stack

'-

Description

Parse to end of line. Insert into text line 0

Examples

0 text for the top line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


    ##   
   ###   
  ####   
 ## ##   
    ##   
    ##   
    ##   
    ##   
    ##   
    ##   

1

Stack

'-

Description

Parse to end of line. Insert into text line 1

Examples

1 text for the second line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 2 3 4 5 6 7 8 9 10 11 12 13 14 15


  #####  
 ##   ## 
##    ## 
      ## 
     ##  
    ##   
   ##    
  ##     
 ##   ## 
######## 

2

Stack

'-

Description

Parse to end of line. Insert into text line 2

Examples

2 text for the third line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 3 4 5 6 7 8 9 10 11 12 13 14 15


######## 
##   ##  
    ##   
   ##    
  #####  
      ## 
      ## 
##    ## 
##   ##  
 #####   

3

Stack

'-

Description

Parse to end of line. Insert into text line 3

Examples

3 text for the fourth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 4 5 6 7 8 9 10 11 12 13 14 15


     ##  
    ###  
   ####  
  ## ##  
 ##  ##  
##   ### 
## ####  
#### ##  
     ##  
     ##  

4

Stack

'-

Description

Parse to end of line. Insert into text line 4

Examples

4 text for the fifth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 5 6 7 8 9 10 11 12 13 14 15


   ##### 
####     
##       
## ###   
#### ##  
      ## 
      ## 
##    ## 
##   ##  
 #####   

5

Stack

'-

Description

Parse to end of line. Insert into text line 5

Examples

5 text for the sixth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 6 7 8 9 10 11 12 13 14 15


  ####   
 ##  ##  
##   ##  
##       
## ###   
#### ##  
##   ##  
##   ##  
##  ##   
 ####    

6

Stack

'-

Description

Parse to end of line. Insert into text line 6

Examples

6 text for the seventh line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 7 8 9 10 11 12 13 14 15


######## 
##    ## 
     ##  
    ##   
    ##   
   ##    
   ##    
  ##     
  ##     
  ##     

7

Stack

'-

Description

Parse to end of line. Insert into text line 7

Examples

7 text for the eighth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 8 9 10 11 12 13 14 15


  ####   
 ##  ##  
##   ##  
 ## ##   
  #####  
 ##   ## 
##    ## 
##    ## 
##   ##  
 #####   

8

Stack

'-

Description

Parse to end of line. Insert into text line 8

Examples

8 text for the nineth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 7 9 10 11 12 13 14 15


  ####   
 ##  ##  
##   ##  
##   ##  
## ####  
 ### ##  
     ##  
##   ##  
##  ##   
 ####    

9

Stack

'-

Description

Parse to end of line. Insert into text line 9

Examples

9 text for the tenth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 7 8 10 11 12 13 14 15


    ##     #####  
   ###    ##   ## 
  ####   ##    ## 
 ## ##   ##    ## 
    ##   ##    ## 
    ##   ##  #### 
    ##   ## ## ## 
    ##   ####  ## 
    ##   ##   ##  
    ##    #####   

10

Stack

'-

Description

Parse to end of line. Insert into text line 10

Examples

10 text for the eleventh line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 7 8 9 11 12 13 14 15


    ##       ##   
   ###      ###   
  ####     ####   
 ## ##    ## ##   
    ##       ##   
    ##       ##   
    ##       ##   
    ##       ##   
    ##       ##   
    ##       ##   

11

Stack

'-

Description

Parse to end of line. Insert into text line 11

Examples

11 text for the twelveth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 7 8 9 10 12 13 14 15


    ##     #####  
   ###    ##   ## 
  ####   ##    ## 
 ## ##         ## 
    ##        ##  
    ##       ##   
    ##      ##    
    ##     ##     
    ##    ##   ## 
    ##   ######## 

12

Stack

'-

Description

Parse to end of line. Insert into text line 12

Examples

12 text for the thirteenth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 7 8 9 10 11 13 14 15


    ##   ######## 
   ###   ##   ##  
  ####       ##   
 ## ##      ##    
    ##     #####  
    ##         ## 
    ##         ## 
    ##   ##    ## 
    ##   ##   ##  
    ##    #####   

13

Stack

'-

Description

Parse to end of line. Insert into text line 13

Examples

13 text for the fourteenth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 7 8 9 10 11 12 14 15


    ##        ##  
   ###       ###  
  ####      ####  
 ## ##     ## ##  
    ##    ##  ##  
    ##   ##   ### 
    ##   ## ####  
    ##   #### ##  
    ##        ##  
    ##        ##  

14

Stack

'-

Description

Parse to end of line. Insert into text line 14

Examples

14 text for the fifteenth line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 7 8 9 10 11 12 13 15


    ##      ##### 
   ###   ####     
  ####   ##       
 ## ##   ## ###   
    ##   #### ##  
    ##         ## 
    ##         ## 
    ##   ##    ## 
    ##   ##   ##  
    ##    #####   

15

Stack

'-

Description

Parse to end of line. Insert into text line 15

Examples

15 text for the last line

Notes

The provided text will replace all text on the line.

This is one of a very few parsing words.

Related

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14


    ###      ###  
   ##       ##    
   ##       ##    
   ##       ##    
   ##       ##    
 ###      ###     
 ###      ###     
   ##       ##    
   ##       ##    
   ##       ##    
   ##       ##    
    ###      ###  

{{

Stack

-

Description

Begin a lexical scoped area. Starts the private portion.

Examples

{{
  'a var
  :set &a store ;
  :bump @a n:inc !a ;
---reveal---
  :foo (n-) set bump @n n:put nl
}}

Notes

Scoping is lexical. This works by unlinking the dictionary headers in between the {{ and ---reveal--- from the dictionary.

Related

---reveal--- }}


                                                                          ###                               
                                                                           ##                               
                                                                           ##                               
                           ##  ###    #####  ##    ##   #####    #####     ##                               
                           ## ## ##  ##   ## ##    ##  ##   ##  ##   ##    ##                               
 ######   ######   ######  ####  ## ##  ###  ##    ## ##  ###     #####    ##     ######   ######   ######  
                           ###      #####     ##  ##  #####     ###  ##    ##                               
                           ##       ##        ## ##   ##       ##    ##    ##                               
                           ##       ##    ##   ###    ##    ## ##  ####    ##                               
                           ##        ######     ##     ######   #### ##    ##                               

---reveal---

Stack

-

Description

Within lexical scoped area, switch to global scope area.

Examples

{{
  'a var
  :set &a store ;
  :bump @a n:inc !a ;
---reveal---
  :foo (n-) set bump @n n:put nl
}}

Notes

Scoping is lexical. This works by unlinking the dictionary headers in between the {{ and ---reveal--- from the dictionary.

Related

{{ }}


 ###      ###     
   ##       ##    
   ##       ##    
   ##       ##    
   ##       ##    
    ###      ###  
    ###      ###  
   ##       ##    
   ##       ##    
   ##       ##    
   ##       ##    
 ###      ###     

}}

Stack

-

Description

Close off lexical scoped area. Hides words in the private area.

Examples

{{
  'a var
  :set &a store ;
  :bump @a n:inc !a ;
---reveal---
  :foo (n-) set bump @n n:put nl
}}

Notes

Scoping is lexical. This works by unlinking the dictionary headers in between the {{ and ---reveal--- from the dictionary.

Related

{{ ---reveal---


  ##     
   ##    
    ##   
    ##   
     ##  
     ##  
     ##  
     ##  
    ##   
    ##   
   ##    
  ##     

)

Stack

-

Description

Ending for comments or visual grouping. Provided for readability purposes

Examples

( #2 #2 n:add )

Notes

This is provided as a readability aid. Since comments (made by the `(` sigil) are ignored, you can use this to help visually group phrases in your code.

Related

sigil:(


                             #####  
                            ##   ## 
                           ##   ##  
           #####   ###  ##     ##   
          ##   ## ## ## ##    ##    
 ######  ##  ###  ##  ####   ##     
         #####    ##   ###   ##     
         ##       ##    ##          
         ##    ##  ##   ##   ##     
          ######    ######   ##     
                        ##          
                        ##          
                        ##          

-eq?

Stack

nn-f

Description

Compare values for inequality

Examples

#100 #45 -eq?

Related

eq? lt? gt? lteq? gteq?


            ##       ####  
            ##      ##  ## 
                    ##     
            ##      ##     
            ##      ####   
 ######     ##    ####     
            ##      ##     
            ##      ##     
            ##      ##     
            ##      ##     

-if

Stack

fp-

Description

Execute p if flag is zero

Examples

#6 #100 eq? [ 'condition_not_met! s:put nl ] -if
#100 #100 eq? [ 'condition_not_met! s:put nl ] -if

Related

choose if


   ##    
   ##    
   ##    
   ##    
  ##     

;

Stack

-

Description

End a definition

Examples

:foo (-) ;

Related

Compiler sigil::


  #####      ##                              
 ##   ##     ##                              
##   ##                                      
    ##       ##   ##    ## ###  ##  ##  ###  
   ##        ##   ##    ## ## ## ## ## ## ## 
  ##         ##   ##    ## ## ## ## ####  ## 
  ##         ##   ##   ### ## ## ## ###   ## 
             ##   ##  #### ##    ## ##    ## 
  ##         ##   ## ## ## ##    ## ##   ##  
  ##         ##    ###  ## ##    ## ######   
         ##  ##                     ##       
         ##  ##                     ##       
          ####                      ##       

?jump

Stack

fp-

Description

Internal. If flag is non-zero, branch to p.

Examples

(used_internally)


   ####                                ##      ###                      
  ##  ##                               ##       ##                      
 ##                                             ##                      
##         #####  ###  ##  ##  ###     ##       ##      #####  ##  ###  
##        ##   ## ## ## ## ## ## ##    ##       ##     ##   ## ## ## ## 
##       ##    ## ## ## ## ####  ##    ##       ##    ##  ###  ####  ## 
##       ##    ## ## ## ## ###   ##    ##       ##    #####    ###      
##       ##    ## ##    ## ##    ##    ##       ##    ##       ##       
 ##   ## ##   ##  ##    ## ##   ##     ##       ##    ##    ## ##       
  #####   #####   ##    ## ######      ##       ##     ######  ##       
                           ##                                           
                           ##                                           
                           ##                                           

Compiler

Stack

-

Description

Data. Tracks compiler state

Examples

:compiling?
  @Compiler [ 'Compiler_active ] [ 'Interpreting ] choose
  s:put nl ; #-1 @Dictionary d:flags store

compiling?
[ compiling? ] drop

Notes

The `Compiler` state is changed by `[`, `sigil::`, `]`, and `;`. For checking state, `compiling?` is provided.

Related

compiling? sigil:: ;


######      ##                #        ##                                                 
##   ##     ##               ##        ##                                                 
##    ##                     ##                                                           
##    ##    ##       ####    ####      ##      #####  ##  ###    #####  ##  ###  ##    ## 
##    ##    ##      ##  ## ####        ##     ##   ## ## ## ##  ##   ## ## ## ## ##    ## 
##    ##    ##     ##        ##        ##    ##    ## ####  ##    ##### ####  ## ##    ## 
##    ##    ##    ##         ##        ##    ##    ## ###   ##  ###  ## ###      ##    ## 
##   ##     ##    ##         ## ##     ##    ##    ## ##    ## ##    ## ##       ##    ## 
## ###      ##    ##    ##   ####      ##    ##   ##  ##    ## ##  #### ##        ##  ##  
####        ##     ######     ##       ##     #####   ##    ##  #### ## ##         #####  
                                                                                     ##   
                                                                                 ## ##    
                                                                                  ###     

Dictionary

Stack

-

Description

Data. Pointer to most recent header in dictionary

Examples

(Get_address_of_most_recent_word)
@Dictionary d:address fetch n:put

Related

d:create sigil:: d:for-each


   ####                             
####                                
##                                  
##       ##  ###    #####    #####  
## ###   ## ## ##  ##   ##  ##   ## 
####     ####  ## ##  ###  ##  ###  
##       ###      #####    #####    
##       ##       ##       ##       
##       ##       ##    ## ##    ## 
##       ##        ######   ######  

Free

Stack

-

Description

Data. Pointer to next free addr

Examples

(Display_next_free_memory_address)
@Free n:put

Notes

The `Free` variable holds a pointer to the next free memory address. You can check this value by calling `here`. Various words will consume memory. The main ones are `comma` and `allot`. Dictionary headers as well as some array and string words will also consume memory at `here`.

Related

here allot gc


   ###   
  ###    
   ##    
   ##    
   ##    
   ##    
   ##    
   ##    
   ###   
  ###    

I

Stack

-n

Description

Access the loop index for the current loop. (For loops made using indexed-times)

Examples

#10 [ I n:put ] indexed-times

Related

J K indexed-times


      ## 
      ## 
      ## 
      ## 
      ## 
      ## 
##    ## 
##    ## 
 ##   ## 
  #####  

J

Stack

-n

Description

Access the parent loop index for the current loop. (For loops made using indexed-times)

Examples

:inner [ I n:put $, c:put J n:put sp ] ;
#10 [ #5 inner indexed-times ] indexed-times

Related

I K indexed-times


##    ## 
##   ##  
## ###   
####     
###      
####     
## ##    
##  ##   
##   ##  
##    ## 

K

Stack

-n

Description

Access the grandparent loop index for the current loop. (For loops made using indexed-times)

Examples

:inner [ I n:put $, c:put J n:put $, c:put K n:put sp ] ;
:outer #3 inner indexed-times ;
#10 [ #5 &outer indexed-times ] indexed-times

Related

I J indexed-times


 ######     ##                ##      ###             
##    ##    ##                ##       ##             
##                                     ##             
 ###        ##      ######    ##       ##     ######  
   ###      ##     ##   ##    ##       ##    ##    ## 
     ##     ##    ##    ##    ##       ##     ###     
      ##    ##    ##   ###    ##       ##       ####  
##    ##    ##    ##  ####    ##       ##          ## 
##    ##    ##    ## ## ##    ##       ##    ##    ## 
 ######     ##     ###  ##    ##       ##     ######  
                        ##                            
                  ##    ##                            
                   ######                             

Sigils

Stack

-

Description

Data. Table of sigil handlers

Examples

(get_pointer_to_sigil_table)

&Sigils

Notes

Sigils is a table holding up to 128 (the lower 7-bit ASCII space) pointers to sigil handlers. Unused sigils have the matching entries here set to zero.


  #####  
  ##     
  ##     
  ##     
  ##     
  ##     
  ##     
  ##     
  ##     
  ##     
  ##     
  #####  

[

Stack

-p

Description

Begin a quotation

Examples

[ #45 n:put ] call

Notes

Quotations are anonymous, nestable functions. RetroForth uses `[` to begin one.

Related

]


 #####   
    ##   
    ##   
    ##   
    ##   
    ##   
    ##   
    ##   
    ##   
    ##   
    ##   
 #####   

]

Stack

p-p

Description

End a quotation

Examples

[ #45 n:put ] call

Notes

Quotations are anonymous, nestable functions. RetroForth uses `]` to end one.

Related

[


                                                                     ## 
                                                                     ## 
            ##                                                       ## 
  #####     ##      #####  ##  ###  ##  ###    #####  ##  ###     ##### 
 ##   ##           ##   ## ## ## ## ## ## ##  ##   ## ## ## ##  ###  ## 
   #####             ##### ####  ## ####  ## ##  ###  ####  ## ##    ## 
 ###  ##           ###  ## ###   ## ###   ## #####    ###   ## ##   ### 
##    ##    ##    ##    ## ##    ## ##    ## ##       ##    ## ##  #### 
##  ####    ##    ##  #### ##   ##  ##   ##  ##    ## ##    ## ## ## ## 
 #### ##           #### ## ######   ######    ######  ##    ##  ###  ## 
                           ##       ##                                  
                           ##       ##                                  
                           ##       ##                                  

a:append

Stack

aa-a

Description

Create a new array with the contents of a1 followed by a2

Examples

(displays:_1_2_3_6_5_4)

( #3 #2 #1 ) #3 a:make/temp
( #4 #5 #6 ) #3 a:make/temp
a:append

[ n:put sp ] a:for-each

Notes

An `a:append` operations constructs a new (temporal) array from the contents of two provided arrays.

Related

a:prepend


                  ##                ##                               ## 
                  ##                ##                               ## 
            ##    ##                ##                               ## 
  #####     ##    ## ###     #####  ##  ###    #####    #####     ##### 
 ##   ##          #### ##   ##   ## ## ## ##  ##   ##  ##   ##  ###  ## 
   #####          ##    ## ##  ###  ####  ## ##  ###     ##### ##    ## 
 ###  ##          ##    ## #####    ###   ## #####     ###  ## ##   ### 
##    ##    ##    ##   ##  ##       ##    ## ##       ##    ## ##  #### 
##  ####    ##    ## ###   ##    ## ##    ## ##    ## ##  #### ## ## ## 
 #### ##          ####      ######  ##    ##  ######   #### ##  ###  ## 

a:behead

Stack

a-a

Description

Remove first item from an array

Examples

(remove_first_item_in_array)

( #100 #200 #300 ) #3 a:make/temp a:behead

Related

a:chop


                           ##                         
                           ##                         
            ##             ##                         
  #####     ##       ####  ##  ###    #####  ##  ###  
 ##   ##            ##  ## ## ## ##  ##   ## ## ## ## 
   #####           ##      ####  ## ##    ## ####  ## 
 ###  ##          ##       ###   ## ##    ## ###   ## 
##    ##    ##    ##       ##    ## ##    ## ##    ## 
##  ####    ##    ##    ## ##    ## ##   ##  ##   ##  
 #### ##           ######  ##    ##  #####   ######   
                                             ##       
                                             ##       
                                             ##       

a:chop

Stack

a-a

Description

Remove last item from an array

Examples

(remove_last_item_in_array)

( #100 #200 #300 ) #3 a:make/temp a:chop

Notes

New array is allocated in the temporary pool.

Related

a:behead


                                                #                 ##                        #####  
                                               ##                 ##                       ##   ## 
            ##                                 ##                                         ##   ##  
  #####     ##       ####    #####  ##  ###    ####     #####     ##    ##  ###   ######      ##   
 ##   ##            ##  ##  ##   ## ## ## ## ####      ##   ##    ##    ## ## ## ##    ##    ##    
   #####           ##      ##    ## ####  ##   ##        #####    ##    ####  ##  ###       ##     
 ###  ##          ##       ##    ## ###   ##   ##      ###  ##    ##    ###   ##    ####    ##     
##    ##    ##    ##       ##    ## ##    ##   ## ##  ##    ##    ##    ##    ##       ##          
##  ####    ##    ##    ## ##   ##  ##    ##   ####   ##  ####    ##    ##    ## ##    ##   ##     
 #### ##           ######   #####   ##    ##    ##     #### ##    ##    ##    ##  ######    ##     

a:contains?

Stack

an-f

Description

True if array contains n. False otherwise

Examples

( #100 #200 #300 ) #3 a:make \data-set

&data-set #300 a:contains? n:put nl
&data-set #281 a:contains? n:put nl


            ##                                        
  #####     ##       ####    #####  ##  ###  ##    ## 
 ##   ##            ##  ##  ##   ## ## ## ## ##    ## 
   #####           ##      ##    ## ####  ## ##    ## 
 ###  ##          ##       ##    ## ###   ## ##    ## 
##    ##    ##    ##       ##    ## ##    ## ##    ## 
##  ####    ##    ##    ## ##   ##  ##   ##   ##  ##  
 #### ##           ######   #####   ######     #####  
                                    ##           ##   
                                    ##       ## ##    
                                    ##        ###     

a:copy

Stack

ap-

Description

Copy array a to memory starting at pointer p

Examples

( #100 #200 #300 ) #3 a:make \data-set
here #4 allot \data-set-copy
&data-set &data-set-copy a:copy


                        ##                   
                        ##                   
            ##          ##                   
  #####     ##       ##### ##    ## ##  ###  
 ##   ##           ###  ## ##    ## ## ## ## 
   #####          ##    ## ##    ## ####  ## 
 ###  ##          ##   ### ##   ### ###   ## 
##    ##    ##    ##  #### ##  #### ##    ## 
##  ####    ##    ## ## ## ## ## ## ##   ##  
 #### ##           ###  ##  ###  ## ######   
                                    ##       
                                    ##       
                                    ##       

a:dup

Stack

a-a

Description

Make a copy of an array

Examples

( #100 #200 #300 ) #3 a:make \data-set
&data-set a:dup [ n:put sp ] a:for-each


                                      #####  
                                     ##   ## 
            ##                      ##   ##  
  #####     ##      #####   ###  ##     ##   
 ##   ##           ##   ## ## ## ##    ##    
   #####          ##  ###  ##  ####   ##     
 ###  ##          #####    ##   ###   ##     
##    ##    ##    ##       ##    ##          
##  ####    ##    ##    ##  ##   ##   ##     
 #### ##           ######    ######   ##     
                                 ##          
                                 ##          
                                 ##          

a:eq?

Stack

aa-f

Description

Compare two arrays for equality

Examples

( #100 #200 #300 ) #3 a:make \data-set1
( #100 #200 #300 ) #3 a:make \data-set2
( #10 #20 #30 ) #3 a:make \data-set3

&data-set1 &data-set2 a:eq? n:put nl
&data-set1 &data-set3 a:eq? n:put nl
&data-set2 &data-set3 a:eq? n:put nl


                                               #####  
                                              ##   ## 
            ##                               ##   ##  
  #####     ##               #####   ###  ##     ##   
 ##   ##                    ##   ## ## ## ##    ##    
   #####           ######  ##  ###  ##  ####   ##     
 ###  ##                   #####    ##   ###   ##     
##    ##    ##             ##       ##    ##          
##  ####    ##             ##    ##  ##   ##   ##     
 #### ##                    ######    ######   ##     
                                          ##          
                                          ##          
                                          ##          

a:-eq?

Stack

aa-f

Description

Compare two arrays for inequality

Examples

( #100 #200 #300 ) #3 a:make \data-set1
( #100 #200 #300 ) #3 a:make \data-set2
( #10 #20 #30 ) #3 a:make \data-set3

&data-set1 &data-set2 a:-eq? n:put nl
&data-set1 &data-set3 a:-eq? n:put nl
&data-set2 &data-set3 a:-eq? n:put nl


                     ####              #              ##       
                    ##  ##            ##              ##       
            ##      ##                ##              ##       
  #####     ##      ##       #####    ####      ####  ##  ###  
 ##   ##            ####    ##   ## ####       ##  ## ## ## ## 
   #####          ####     ##  ###    ##      ##      ####  ## 
 ###  ##            ##     #####      ##     ##       ###   ## 
##    ##    ##      ##     ##         ## ##  ##       ##    ## 
##  ####    ##      ##     ##    ##   ####   ##    ## ##    ## 
 #### ##            ##      ######     ##     ######  ##    ## 

a:fetch

Stack

an-v

Description

Fetch value stored at index n in array

Examples

( #100 #200 #300 ) #3 a:make \data-set
&data-set #2 a:fetch n:put

Related

a:store a:th


                     ####     ##      ###       #                       
                    ##  ##    ##       ##      ##                       
            ##      ##                 ##      ##                       
  #####     ##      ##        ##       ##      ####     #####  ##  ###  
 ##   ##            ####      ##       ##    ####      ##   ## ## ## ## 
   #####          ####        ##       ##      ##     ##  ###  ####  ## 
 ###  ##            ##        ##       ##      ##     #####    ###      
##    ##    ##      ##        ##       ##      ## ##  ##       ##       
##  ####    ##      ##        ##       ##      ####   ##    ## ##       
 #### ##            ##        ##       ##       ##     ######  ##       

a:filter

Stack

ap-a

Description

Run p once for each value in a. If it returns true, copy value new array

Examples

( #1 #2 #3 #4 ) #4 a:make \data-set
&data-set [ #2 n:mod n:zero? ] a:filter [ n:put sp ] a:for-each


                     ####     ##                         #     
                    ##  ##    ##                        ##     
            ##      ##                                  ##     
  #####     ##      ##        ##    ##  ###   ######    ####   
 ##   ##            ####      ##    ## ## ## ##    ## ####     
   #####          ####        ##    ####  ##  ###       ##     
 ###  ##            ##        ##    ###         ####    ##     
##    ##    ##      ##        ##    ##             ##   ## ##  
##  ####    ##      ##        ##    ##       ##    ##   ####   
 #### ##            ##        ##    ##        ######     ##    

a:first

Stack

a-n

Description

Return the first value in an array

Examples

( #1 #2 #3 #4 ) #4 a:make/temp a:first n:put nl


                     ####                                                        ##       
                    ##  ##                                                       ##       
            ##      ##                                                           ##       
  #####     ##      ##       #####  ##  ###             #####    #####     ####  ##  ###  
 ##   ##            ####    ##   ## ## ## ##           ##   ##  ##   ##   ##  ## ## ## ## 
   #####          ####     ##    ## ####  ##  ######  ##  ###     #####  ##      ####  ## 
 ###  ##            ##     ##    ## ###               #####     ###  ## ##       ###   ## 
##    ##    ##      ##     ##    ## ##                ##       ##    ## ##       ##    ## 
##  ####    ##      ##     ##   ##  ##                ##    ## ##  #### ##    ## ##    ## 
 #### ##            ##      #####   ##                 ######   #### ##  ######  ##    ## 

a:for-each

Stack

ap-

Description

Run p once for each value in the array. Pushes each value prior to calling p

Examples

( #1 #2 #3 #4 ) #4 a:make/temp [ n:put tab ] a:for-each nl


                  ##                         ##       
                  ##                         ##       
            ##    ##                         ##       
  #####     ##    ##  ###    #####   ######  ##  ###  
 ##   ##          ## ## ##  ##   ## ##    ## ## ## ## 
   #####          ####  ##    #####  ###     ####  ## 
 ###  ##          ###   ##  ###  ##    ####  ###   ## 
##    ##    ##    ##    ## ##    ##       ## ##    ## 
##  ####    ##    ##    ## ##  #### ##    ## ##    ## 
 #### ##          ##    ##  #### ##  ######  ##    ## 

a:hash

Stack

a-n

Description

Return the hash of an array

Examples

( #1 #2 #3 #4 ) #4 a:make/temp a:hash


                     ##                   ##    ##                               
                     ##                   ##    ##                               
            ##                            ##                                     
  #####     ##       ##    ##  ###     #####    ##       ####    #####   ######  
 ##   ##             ##    ## ## ##  ###  ##    ##      ##  ##  ##   ## ##    ## 
   #####             ##    ####  ## ##    ##    ##     ##      ##  ###   ###     
 ###  ##             ##    ###   ## ##   ###    ##    ##       #####       ####  
##    ##    ##       ##    ##    ## ##  ####    ##    ##       ##             ## 
##  ####    ##       ##    ##    ## ## ## ##    ##    ##    ## ##    ## ##    ## 
 #### ##             ##    ##    ##  ###  ##    ##     ######   ######   ######  

a:indices

Stack

av-a

Description

Return array of indices for v in source array

Examples

'hello_world $o a:indices [ n:put sp ] a:for-each nl

Related

a:index


                     ##                   ##                   
                     ##                   ##                   
            ##                            ##                   
  #####     ##       ##    ##  ###     #####   #####  ##    ## 
 ##   ##             ##    ## ## ##  ###  ##  ##   ##  ##  ##  
   #####             ##    ####  ## ##    ## ##  ###    ####   
 ###  ##             ##    ###   ## ##   ### #####       ##    
##    ##    ##       ##    ##    ## ##  #### ##         ####   
##  ####    ##       ##    ##    ## ## ## ## ##    ##  ##  ##  
 #### ##             ##    ##    ##  ###  ##  ######  ##    ## 

a:index

Stack

av-n

Description

Return first index of n in a

Examples

'hello_world $e a:index n:put nl

Related

a:indices


                    ###                         #     
                     ##                        ##     
            ##       ##                        ##     
  #####     ##       ##      #####   ######    ####   
 ##   ##             ##     ##   ## ##    ## ####     
   #####             ##       #####  ###       ##     
 ###  ##             ##     ###  ##    ####    ##     
##    ##    ##       ##    ##    ##       ##   ## ##  
##  ####    ##       ##    ##  #### ##    ##   ####   
 #### ##             ##     #### ##  ######     ##    

a:last

Stack

a-n

Description

Return the last value in an array

Examples

'hello a:last c:put


                    ###                ####     #     
                     ##               ##  ##   ##     
            ##       ##               ##       ##     
  #####     ##       ##      #####    ##       ####   
 ##   ##             ##     ##   ##   ####   ####     
   #####             ##    ##  ###  ####       ##     
 ###  ##             ##    #####      ##       ##     
##    ##    ##       ##    ##         ##       ## ##  
##  ####    ##       ##    ##    ##   ##       ####   
 #### ##             ##     ######    ##        ##    

a:left

Stack

an-a

Description

Return left n values from array

Examples

( #1 #20 #13 #84 #5 ) #5 a:make/temp #3 a:left

Notes

New array is allocated in the temporary pool.

Related

a:right a:middle


                    ###                                  #     ##       
                     ##                                 ##     ##       
            ##       ##                                 ##     ##       
  #####     ##       ##      #####  ##  ###    ######   ####   ##  ###  
 ##   ##             ##     ##   ## ## ## ##  ##   ## ####     ## ## ## 
   #####             ##    ##  ###  ####  ## ##    ##   ##     ####  ## 
 ###  ##             ##    #####    ###   ## ##   ###   ##     ###   ## 
##    ##    ##       ##    ##       ##    ## ##  ####   ## ##  ##    ## 
##  ####    ##       ##    ##    ## ##    ## ## ## ##   ####   ##    ## 
 #### ##             ##     ######  ##    ##  ###  ##    ##    ##    ## 
                                                   ##                   
                                             ##    ##                   
                                              ######                    

a:length

Stack

a-n

Description

Return the length of an array

Examples

(returns_3)

( #100 #200 #300 ) #3 a:make/temp a:length


                                    ##                
                                    ##                
            ##                      ##                
  #####     ##    ###  ##    #####  ##   ##    #####  
 ##   ##          ## ## ##  ##   ## ##  ##    ##   ## 
   #####          ## ## ##    ##### ## ##    ##  ###  
 ###  ##          ## ## ##  ###  ## #####    #####    
##    ##    ##    ##    ## ##    ## ### ##   ##       
##  ####    ##    ##    ## ##  #### ##   ##  ##    ## 
 #### ##          ##    ##  #### ## ##    ##  ######  

a:make

Stack

...n-a

Description

Create a new permanent array from the provided values

Examples

(create_an_array_of_three_characters,_"cba")

$a $b $c #3 a:make

(display_it_as_a_string)

s:put nl

Notes

This creates an array in the permanent memory area. For arrays that aren't needed long term, it may be better to use `a:make/temp` instead.

Related

a:make/temp


                                    ##                     ##     #                                
                                    ##                     #     ##                                
            ##                      ##                    ##     ##                                
  #####     ##    ###  ##    #####  ##   ##    #####      #      ####     #####  ###  ##  ##  ###  
 ##   ##          ## ## ##  ##   ## ##  ##    ##   ##    ##    ####      ##   ## ## ## ## ## ## ## 
   #####          ## ## ##    ##### ## ##    ##  ###     #       ##     ##  ###  ## ## ## ####  ## 
 ###  ##          ## ## ##  ###  ## #####    #####      ##       ##     #####    ## ## ## ###   ## 
##    ##    ##    ##    ## ##    ## ### ##   ##         #        ## ##  ##       ##    ## ##    ## 
##  ####    ##    ##    ## ##  #### ##   ##  ##    ##  ##        ####   ##    ## ##    ## ##   ##  
 #### ##          ##    ##  #### ## ##    ##  ######   #          ##     ######  ##    ## ######   
                                                      ##                                  ##       
                                                                                          ##       
                                                                                          ##       

a:make/temp

Stack

...n-a

Description

Create a new temporary array from the provided values

Examples

(create_an_array_of_three_characters,_"cba")

$a $b $c #3 a:make/temp

(display_it_as_a_string)

 s:put nl

Notes

This creates an array in the temporary pool. This is preferred for short lived arrays.

Related

a:make


            ##                               
  #####     ##    ###  ##    #####  ##  ###  
 ##   ##          ## ## ##  ##   ## ## ## ## 
   #####          ## ## ##    ##### ####  ## 
 ###  ##          ## ## ##  ###  ## ###   ## 
##    ##    ##    ##    ## ##    ## ##    ## 
##  ####    ##    ##    ## ##  #### ##   ##  
 #### ##          ##    ##  #### ## ######   
                                    ##       
                                    ##       
                                    ##       

a:map

Stack

ap-a

Description

Run p once for each value in the array. Takes the returned value and creates a new array

Examples

(displays:_30_20_10)

( #1 #2 #3 ) #3 a:make/temp [ #10 n:mul ] a:map [ n:put sp ] a:for-each


                              ##          ##       ##   ###             
                              ##          ##       ##    ##             
            ##                            ##       ##    ##             
  #####     ##    ###  ##     ##       #####    #####    ##      #####  
 ##   ##          ## ## ##    ##     ###  ##  ###  ##    ##     ##   ## 
   #####          ## ## ##    ##    ##    ## ##    ##    ##    ##  ###  
 ###  ##          ## ## ##    ##    ##   ### ##   ###    ##    #####    
##    ##    ##    ##    ##    ##    ##  #### ##  ####    ##    ##       
##  ####    ##    ##    ##    ##    ## ## ## ## ## ##    ##    ##    ## 
 #### ##          ##    ##    ##     ###  ##  ###  ##    ##     ######  

a:middle

Stack

afl-a

Description

Return new array from f to l, inclusive

Examples

(__5__4__3__2__1__0_:-_value_offset)
( #6 #5 #4 #3 #2 #1 ) #6 a:make/temp
(_______^^__________:_-_start_at_offset_3)  #3
(____^^_^^__________:_-_take_two_values)    #2
a:middle

Related

a:left a:right


                                                                              ## 
                                                                              ## 
            ##                                                                ## 
  #####     ##    ##  ###  ##  ###    #####  ##  ###    #####  ##  ###     ##### 
 ##   ##          ## ## ## ## ## ##  ##   ## ## ## ##  ##   ## ## ## ##  ###  ## 
   #####          ####  ## ####  ## ##  ###  ####  ## ##  ###  ####  ## ##    ## 
 ###  ##          ###   ## ###      #####    ###   ## #####    ###   ## ##   ### 
##    ##    ##    ##    ## ##       ##       ##    ## ##       ##    ## ##  #### 
##  ####    ##    ##   ##  ##       ##    ## ##   ##  ##    ## ##    ## ## ## ## 
 #### ##          ######   ##        ######  ######    ######  ##    ##  ###  ## 
                  ##                         ##                                  
                  ##                         ##                                  
                  ##                         ##                                  

a:prepend

Stack

aa-a

Description

Create a new array with the contents of a2 followed by a1

Examples

(displays:_6_5_4_1_2_3)

( #3 #2 #1 ) #3 a:make/temp
( #4 #5 #6 ) #3 a:make/temp

a:prepend

[ n:put sp ] a:for-each

Notes

An `a:prepend` operations constructs a new (temporal) array from the contents of two provided arrays. This is identical to `a:append` except for the argument ordering.

Related

a:append


                                          ##                            
                                          ##                            
            ##                            ##                            
  #####     ##    ##  ###    #####     ##### ##    ##    ####    #####  
 ##   ##          ## ## ##  ##   ##  ###  ## ##    ##   ##  ##  ##   ## 
   #####          ####  ## ##  ###  ##    ## ##    ##  ##      ##  ###  
 ###  ##          ###      #####    ##   ### ##   ### ##       #####    
##    ##    ##    ##       ##       ##  #### ##  #### ##       ##       
##  ####    ##    ##       ##    ## ## ## ## ## ## ## ##    ## ##    ## 
 #### ##          ##        ######   ###  ##  ###  ##  ######   ######  

a:reduce

Stack

anp-n

Description

Takes an array, a starting value, and a quote. This will apply the quote to each item in the array; the quote should consume two values and return one

Examples

(sum_values_in_array)

:a:sum (a-n)  #0 [ n:add ] a:reduce ;

( #1 #20 #13 #84 #5 ) #5 a:make/temp a:sum


            ##                                                                   
  #####     ##    ##  ###    #####  ##    ##   #####  ##  ###   ######    #####  
 ##   ##          ## ## ##  ##   ## ##    ##  ##   ## ## ## ## ##    ##  ##   ## 
   #####          ####  ## ##  ###  ##    ## ##  ###  ####  ##  ###     ##  ###  
 ###  ##          ###      #####     ##  ##  #####    ###         ####  #####    
##    ##    ##    ##       ##        ## ##   ##       ##             ## ##       
##  ####    ##    ##       ##    ##   ###    ##    ## ##       ##    ## ##    ## 
 #### ##          ##        ######     ##     ######  ##        ######   ######  

a:reverse

Stack

a-a

Description

Reverse the order of items in an array

Examples

( #1 #20 #13 #84 #5 ) #5 a:make/temp a:reverse

Notes

New array is allocated in the temporary pool.


                              ##             ##          #     
                              ##             ##         ##     
            ##                               ##         ##     
  #####     ##    ##  ###     ##      ###### ##  ###    ####   
 ##   ##          ## ## ##    ##     ##   ## ## ## ## ####     
   #####          ####  ##    ##    ##    ## ####  ##   ##     
 ###  ##          ###         ##    ##   ### ###   ##   ##     
##    ##    ##    ##          ##    ##  #### ##    ##   ## ##  
##  ####    ##    ##          ##    ## ## ## ##    ##   ####   
 #### ##          ##          ##     ###  ## ##    ##    ##    
                                          ##                   
                                    ##    ##                   
                                     ######                    

a:right

Stack

an-a

Description

Return right n values from array

Examples

( #1 #20 #13 #84 #5 ) #5 a:make/temp #2 a:right

Notes

New array is allocated in the temporary pool.

Related

a:left a:middle


                              #                                
                             ##                                
            ##               ##                                
  #####     ##     ######    ####     #####  ##  ###    #####  
 ##   ##          ##    ## ####      ##   ## ## ## ##  ##   ## 
   #####           ###       ##     ##    ## ####  ## ##  ###  
 ###  ##             ####    ##     ##    ## ###      #####    
##    ##    ##          ##   ## ##  ##    ## ##       ##       
##  ####    ##    ##    ##   ####   ##   ##  ##       ##    ## 
 #### ##           ######     ##     #####   ##        ######  

a:store

Stack

van-

Description

Store value v into array at index n

Examples

( #1 #20 #13 #84 #5 ) #5 a:make \data-set

&data-set [ n:put sp ] a:for-each
#2000 &data-set #2 a:store
&data-set [ n:put sp ] a:for-each

Related

a:fetch a:th


                     #                                
                    ##                                
            ##      ##                                
  #####     ##      ####     #####  ###  ##  ##  ###  
 ##   ##          ####      ##   ## ## ## ## ## ## ## 
   #####            ##     ##  ###  ## ## ## ####  ## 
 ###  ##            ##     #####    ## ## ## ###   ## 
##    ##    ##      ## ##  ##       ##    ## ##    ## 
##  ####    ##      ####   ##    ## ##    ## ##   ##  
 #### ##             ##     ######  ##    ## ######   
                                             ##       
                                             ##       
                                             ##       

a:temp

Stack

a-a

Description

Make a copy of the array in the temporary string/array space

Examples

(make_an_array)

( #10 #15 #20 ) #3 a:make

(put_a_copy_into_the_temporary_buffers)

a:temp

Notes

The temporary pool is shared with strings.


                     #     ##       
                    ##     ##       
            ##      ##     ##       
  #####     ##      ####   ##  ###  
 ##   ##          ####     ## ## ## 
   #####            ##     ####  ## 
 ###  ##            ##     ###   ## 
##    ##    ##      ## ##  ##    ## 
##  ####    ##      ####   ##    ## 
 #### ##             ##    ##    ## 

a:th

Stack

an-p

Description

Return the address of a specific index into the array

Examples

( #10 #15 #20 ) #3 a:make/temp #1 a:th

Notes

The calculation for this is:

array-start + offset + 1

`a:th` is provided to aid in readability, and is mainly an internal factor used by `a:fetch` and `a:store`.

Related

a:fetch a:store


           ###      ###                #     
            ##       ##               ##     
            ##       ##               ##     
  #####     ##       ##      #####    ####   
 ##   ##    ##       ##     ##   ## ####     
   #####    ##       ##    ##    ##   ##     
 ###  ##    ##       ##    ##    ##   ##     
##    ##    ##       ##    ##    ##   ## ##  
##  ####    ##       ##    ##   ##    ####   
 #### ##    ##       ##     #####      ##    

allot

Stack

n-

Description

Allocate n cells of memory

Examples

(allocate_500_cells)
#500 allot

(free_500_cells)
#-500 allot

Notes

`allot` both allocates and frees (when passed a negative length) memory at `here`. The allocations are strictly linear, so take care when freeing memory. If you need to temporarily allocate memory, it's recommended to use `allot` in a `gc` quote to handle the cleanup.

Related

Free here gc


                        ## 
                        ## 
                        ## 
  #####  ##  ###     ##### 
 ##   ## ## ## ##  ###  ## 
   ##### ####  ## ##    ## 
 ###  ## ###   ## ##   ### 
##    ## ##    ## ##  #### 
##  #### ##    ## ## ## ## 
 #### ## ##    ##  ###  ## 

and

Stack

nn-n

Description

Perform a bitwise AND

Examples

#0  #-1 and n:put nl (0)
#-1 #-1 and n:put nl (-1)
#-1 #0  and n:put nl (0)
#0  #0  and n:put nl (0)

Related

or xor not


##          ##    
##          ##    
##                
## ###      ##    
#### ##     ##    
##    ##    ##    
##    ##    ##    
##   ##     ##    
## ###      ##    
####        ##    

bi

Stack

xpp-?

Description

Execute p1 against x, then p2 against a copy of x

Examples

#10 [ n:inc ] [ n:dec ] bi

Related

bi* bi@ tri tri* tri@


##          ##     ##  ##  
##          ##      ####   
##                ######## 
## ###      ##      ####   
#### ##     ##     ##  ##  
##    ##    ##             
##    ##    ##             
##   ##     ##             
## ###      ##             
####        ##             

bi*

Stack

xypp-

Description

Execute p1 against x and p2 against y

Examples

#10 #20 [ n:inc ] [ n:dec ] bi*

Related

bi bi@ tri tri* tri@


##          ##       ####  
##          ##      ##  ## 
##                 ## #### 
## ###      ##    ## ## ## 
#### ##     ##    ## ## ## 
##    ##    ##    ## ## ## 
##    ##    ##    ## ####  
##   ##     ##    ## ##    
## ###      ##    ##   ##  
####        ##    ## ###   
                   ###     

bi@

Stack

xyp-

Description

Execute p against x, execute p against y

Examples

#10 #20 [ #10 n:div ] bi@

Related

bi bi* tri tri* tri@


##         ###                      ##                  ###                            ## 
##          ##                      ##                   ##                            ## 
##          ##                      ##          ##       ##                            ## 
## ###      ##      #####     ####  ##   ##     ##       ##      #####    #####     ##### 
#### ##     ##     ##   ##   ##  ## ##  ##               ##     ##   ##  ##   ##  ###  ## 
##    ##    ##    ##    ##  ##      ## ##                ##    ##    ##    ##### ##    ## 
##    ##    ##    ##    ## ##       #####                ##    ##    ##  ###  ## ##   ### 
##   ##     ##    ##    ## ##       ### ##      ##       ##    ##    ## ##    ## ##  #### 
## ###      ##    ##   ##  ##    ## ##   ##     ##       ##    ##   ##  ##  #### ## ## ## 
####        ##     #####    ######  ##    ##             ##     #####    #### ##  ###  ## 

block:load

Stack

np-

Description

Read 1024 cells in block n to p

Examples

(load_contents_of_block_45_into_block_buffer)
#45 block:buffer block:load

Related

block:save block:buffer


##         ###                      ##                                                    
##          ##                      ##                                                    
##          ##                      ##          ##                                        
## ###      ##      #####     ####  ##   ##     ##     ######    #####  ##    ##   #####  
#### ##     ##     ##   ##   ##  ## ##  ##            ##    ##  ##   ## ##    ##  ##   ## 
##    ##    ##    ##    ##  ##      ## ##              ###        ##### ##    ## ##  ###  
##    ##    ##    ##    ## ##       #####                ####   ###  ##  ##  ##  #####    
##   ##     ##    ##    ## ##       ### ##      ##          ## ##    ##  ## ##   ##       
## ###      ##    ##   ##  ##    ## ##   ##     ##    ##    ## ##  ####   ###    ##    ## 
####        ##     #####    ######  ##    ##           ######   #### ##    ##     ######  

block:save

Stack

np-

Description

Save 1024 cells at p to block n

Examples

(save_contents_of_block_buffer_to_block_45)
#45 block:buffer block:save

Related

block:load block:buffer


##         ###                      ##                ##                   ####     ####                    
##          ##                      ##                ##                  ##  ##   ##  ##                   
##          ##                      ##          ##    ##                  ##       ##                       
## ###      ##      #####     ####  ##   ##     ##    ## ###   ##    ##   ##       ##       #####  ##  ###  
#### ##     ##     ##   ##   ##  ## ##  ##            #### ##  ##    ##   ####     ####    ##   ## ## ## ## 
##    ##    ##    ##    ##  ##      ## ##             ##    ## ##    ## ####     ####     ##  ###  ####  ## 
##    ##    ##    ##    ## ##       #####             ##    ## ##   ###   ##       ##     #####    ###      
##   ##     ##    ##    ## ##       ### ##      ##    ##   ##  ##  ####   ##       ##     ##       ##       
## ###      ##    ##   ##  ##    ## ##   ##     ##    ## ###   ## ## ##   ##       ##     ##    ## ##       
####        ##     #####    ######  ##    ##          ####      ###  ##   ##       ##      ######  ##       

block:buffer

Stack

-p

Description

Return a pointer to the start of the block buffer

Examples

block:buffer

Related

block:load block:save


##                         
##                         
##                         
## ###   ##    ##   #####  
#### ##  ##    ##  ##   ## 
##    ## ##    ## ##  ###  
##    ## ##    ## #####    
##   ##  ##    ## ##       
## ###    ##  ##  ##    ## 
####       #####   ######  
             ##            
         ## ##             
          ###              

bye

Stack

-

Description

Exit RetroForth/ilo

Examples

(exit_retroforth/ilo)

bye

Notes

On a hosted system, `bye` will generally exit the system. On a native/embedded system the behaviour is left to the implementation. Consult the documentation for your local system in this case.


                                       #     
                                      ##     
            ##                        ##     
   ####     ##      ######   #####    ####   
  ##  ##           ##   ##  ##   ## ####     
 ##               ##    ## ##  ###    ##     
##                ##   ### #####      ##     
##          ##    ##  #### ##         ## ##  
##    ##    ##    ## ## ## ##    ##   ####   
 ######            ###  ##  ######     ##    
                        ##                   
                  ##    ##                   
                   ######                    

c:get

Stack

-c

Description

Read a character from the keyboard

Examples

:pause 'Press_a_key... s:put c:get drop ;

Notes

This word may return as soon as a key is hit or buffered until a newline is entered. On a BSD or Linux, you can run `stty cbreak` prior to starting RetroForth/ilo to have it return immediately. If you do this, run `stty -cbreak` when done.

If you use a Unix and prefer line buffering, it's worth considering using something like `rlwrap` to get history and line editing support.

`c:get` is a hookable word. It starts with a set of two `........` instruction bundles (NOPs) that can be replaced to jump to a user-chosen word instead. If you are trying to inject data as input, this should be your starting point.

Related

c:put


                    ###                                                                              #####  
                     ##                                                                             ##   ## 
            ##       ##                                                                            ##   ##  
   ####     ##       ##      #####  ##    ##   #####  ##  ###     ####    #####   ######    #####      ##   
  ##  ##             ##     ##   ## ##    ##  ##   ## ## ## ##   ##  ##  ##   ## ##    ##  ##   ##    ##    
 ##                  ##    ##    ## ##    ## ##  ###  ####  ##  ##         #####  ###     ##  ###    ##     
##                   ##    ##    ## ## ## ## #####    ###      ##        ###  ##    ####  #####      ##     
##          ##       ##    ##    ## ## ## ## ##       ##       ##       ##    ##       ## ##                
##    ##    ##       ##    ##   ##  ######## ##    ## ##       ##    ## ##  #### ##    ## ##    ##   ##     
 ######              ##     #####   ##    ##  ######  ##        ######   #### ##  ######   ######    ##     

c:lowercase?

Stack

c-f

Description

Return true if character is lowercase or false if not

Examples

(returns_true)
$c c:lowercase?

(returns false)
$D c:lowercase?

Notes

The case determination only works with ASCII (or the subset of UTF8 corresponding to ASCII).

Related

c:uppercase?


                                       #     
                                      ##     
            ##                        ##     
   ####     ##    ##  ###  ##    ##   ####   
  ##  ##          ## ## ## ##    ## ####     
 ##               ####  ## ##    ##   ##     
##                ###   ## ##   ###   ##     
##          ##    ##    ## ##  ####   ## ##  
##    ##    ##    ##   ##  ## ## ##   ####   
 ######           ######    ###  ##    ##    
                  ##                         
                  ##                         
                  ##                         

c:put

Stack

c-

Description

Display a single character

Examples

$h c:put $e c:put $l c:put $l c:put $o c:put

Notes

`c:put` is a hookable word. It starts with a set of two `........` instruction bundles (NOPs) that can be replaced to jump to a user-chosen word instead. If you are trying to capture all output, this is the best bet.

Related

c:get


                     #                         ###                                        
                    ##                          ##                                        
            ##      ##                          ##                                        
   ####     ##      ####     #####              ##      #####  ##    ##   #####  ##  ###  
  ##  ##          ####      ##   ##             ##     ##   ## ##    ##  ##   ## ## ## ## 
 ##                 ##     ##    ##  ######     ##    ##    ## ##    ## ##  ###  ####  ## 
##                  ##     ##    ##             ##    ##    ## ## ## ## #####    ###      
##          ##      ## ##  ##    ##             ##    ##    ## ## ## ## ##       ##       
##    ##    ##      ####   ##   ##              ##    ##   ##  ######## ##    ## ##       
 ######              ##     #####               ##     #####   ##    ##  ######  ##       

c:to-lower

Stack

c-c

Description

Convert character to lowercase

Examples

$c c:to-lower c:put

Notes

The case conversion only works with ASCII (or the subset of UTF8 corresponding to ASCII).

Related

c:to-upper


                     #                                
                    ##                                
            ##      ##                                
   ####     ##      ####     #####            ######  
  ##  ##          ####      ##   ##          ##    ## 
 ##                 ##     ##    ##  ######   ###     
##                  ##     ##    ##             ####  
##          ##      ## ##  ##    ##                ## 
##    ##    ##      ####   ##   ##           ##    ## 
 ######              ##     #####             ######  

c:to-s

Stack

c-s

Description

Convert a character to a string

Examples

$c c:to-s

Notes

This create a temporary string and sets the first character to the provided one. It's useful if you need to append a character to a string.

Related

s:to-n n:to-s


                     #                                                                    
                    ##                                                                    
            ##      ##                                                                    
   ####     ##      ####     #####           ##    ## ##  ###  ##  ###    #####  ##  ###  
  ##  ##          ####      ##   ##          ##    ## ## ## ## ## ## ##  ##   ## ## ## ## 
 ##                 ##     ##    ##  ######  ##    ## ####  ## ####  ## ##  ###  ####  ## 
##                  ##     ##    ##          ##   ### ###   ## ###   ## #####    ###      
##          ##      ## ##  ##    ##          ##  #### ##    ## ##    ## ##       ##       
##    ##    ##      ####   ##   ##           ## ## ## ##   ##  ##   ##  ##    ## ##       
 ######              ##     #####             ###  ## ######   ######    ######  ##       
                                                      ##       ##                         
                                                      ##       ##                         
                                                      ##       ##                         

c:to-upper

Stack

c-c

Description

Convert character to uppercase

Examples

$c c:to-upper c:put

Notes

The case conversion only works with ASCII (or the subset of UTF8 corresponding to ASCII).

Related

c:to-lower


                                                                                                     #####  
                                                                                                    ##   ## 
            ##                                                                                     ##   ##  
   ####     ##    ##    ## ##  ###  ##  ###    #####  ##  ###     ####    #####   ######    #####      ##   
  ##  ##          ##    ## ## ## ## ## ## ##  ##   ## ## ## ##   ##  ##  ##   ## ##    ##  ##   ##    ##    
 ##               ##    ## ####  ## ####  ## ##  ###  ####  ##  ##         #####  ###     ##  ###    ##     
##                ##   ### ###   ## ###   ## #####    ###      ##        ###  ##    ####  #####      ##     
##          ##    ##  #### ##    ## ##    ## ##       ##       ##       ##    ##       ## ##                
##    ##    ##    ## ## ## ##   ##  ##   ##  ##    ## ##       ##    ## ##  #### ##    ## ##    ##   ##     
 ######            ###  ## ######   ######    ######  ##        ######   #### ##  ######   ######    ##     
                           ##       ##                                                                      
                           ##       ##                                                                      
                           ##       ##                                                                      

c:uppercase?

Stack

c-f

Description

Return true if character is uppercase or false if not

Examples

(returns_true)
$C c:uppercase?

(returns false)
$d c:uppercase?

Notes

The case determination only works with ASCII (or the subset of UTF8 corresponding to ASCII).

Related

c:lowercase?


                    ###      ###    
                     ##       ##    
                     ##       ##    
   ####    #####     ##       ##    
  ##  ##  ##   ##    ##       ##    
 ##         #####    ##       ##    
##        ###  ##    ##       ##    
##       ##    ##    ##       ##    
##    ## ##  ####    ##       ##    
 ######   #### ##    ##       ##    

call

Stack

p-

Description

Call a function

Examples

(call_a_function_[via_pointer])
&bye call

(or_call_a_quote)
[ bye ] call

Related

jump


         ##                                           
         ##                                           
         ##                                           
   ####  ##  ###    #####    #####   ######    #####  
  ##  ## ## ## ##  ##   ##  ##   ## ##    ##  ##   ## 
 ##      ####  ## ##    ## ##    ##  ###     ##  ###  
##       ###   ## ##    ## ##    ##    ####  #####    
##       ##    ## ##    ## ##    ##       ## ##       
##    ## ##    ## ##   ##  ##   ##  ##    ## ##    ## 
 ######  ##    ##  #####    #####    ######   ######  

choose

Stack

fpp-

Description

Execute p1 if flag is non-zero or p2 if zero.

Examples

:is-one? (n-)
  [ #1 eq? ] [ #-1 eq? ] bi or
  [ 'Yes! ] [ 'No! ] choose s:put nl ;

#10 is-one? (No!)
#1 is-one? (Yes!)
#-1 is-one? (Yes!)
#-10 is-one? (No!)

Related

if -if


   ####    #####  ###  ##  ###  ##    #####  
  ##  ##  ##   ## ## ## ## ## ## ##  ##   ## 
 ##      ##    ## ## ## ## ## ## ##    ##### 
##       ##    ## ## ## ## ## ## ##  ###  ## 
##       ##    ## ##    ## ##    ## ##    ## 
##    ## ##   ##  ##    ## ##    ## ##  #### 
 ######   #####   ##    ## ##    ##  #### ## 

comma

Stack

n-

Description

Inline a value to here and increment Free

Examples

(let's_make_a_manual_array)
here       (pointer)
  #3 comma (length)
  $a comma (value_0)
  $b comma (value_1)
  $c comma (value_2)

(display it)
[ c:put ] a:for-each nl


   ####    #####  ###  ##  ##  ###    #####  ##  ###    #####  
  ##  ##  ##   ## ## ## ## ## ## ##  ##   ## ## ## ##  ##   ## 
 ##      ##    ## ## ## ## ####  ##    ##### ####  ## ##  ###  
##       ##    ## ## ## ## ###   ##  ###  ## ###      #####    
##       ##    ## ##    ## ##    ## ##    ## ##       ##       
##    ## ##   ##  ##    ## ##   ##  ##  #### ##       ##    ## 
 ######   #####   ##    ## ######    #### ## ##        ######  
                           ##                                  
                           ##                                  
                           ##                                  

compare

Stack

sdn-f

Description

Compare n cells of memory startng at s to memory starting at d. Return true if all match or false otherwise

Examples

'Hello s:keep \Test-1
'Nevermore s:keep \Test-2
'Hello s:keep \Test-3
&Test-1 &Test-2 over s:length n:inc compare n:put nl (0)
&Test-1 &Test-3 over s:length n:inc compare n:put nl (-1)
&Test-2 &Test-3 over s:length n:inc compare n:put nl (0)


                                       ##      ###       ##                        #####  
                                       ##       ##       ##                       ##   ## 
                                                ##                               ##   ##  
   ####    #####  ###  ##  ##  ###     ##       ##       ##    ##  ###    ######     ##   
  ##  ##  ##   ## ## ## ## ## ## ##    ##       ##       ##    ## ## ##  ##   ##    ##    
 ##      ##    ## ## ## ## ####  ##    ##       ##       ##    ####  ## ##    ##   ##     
##       ##    ## ## ## ## ###   ##    ##       ##       ##    ###   ## ##   ###   ##     
##       ##    ## ##    ## ##    ##    ##       ##       ##    ##    ## ##  ####          
##    ## ##   ##  ##    ## ##   ##     ##       ##       ##    ##    ## ## ## ##   ##     
 ######   #####   ##    ## ######      ##       ##       ##    ##    ##  ###  ##   ##     
                           ##                                                 ##          
                           ##                                           ##    ##          
                           ##                                            ######           

compiling?

Stack

-f

Description

True if Compiler is set, False otherwise

Examples

:c?
  compiling? [ 'Compiler_active ] [ 'Interpreting ] choose
  s:put nl ; #-1 @Dictionary d:flags store

c?
[ c? ] drop

Related

Compiler sigil:: ;


                                       ##      ###                        ###       ##       #     
                                       ##       ##                         ##       ##      ##     
                                                ##                ##       ##               ##     
   ####    #####  ###  ##  ##  ###     ##       ##      #####     ##       ##       ##      ####   
  ##  ##  ##   ## ## ## ## ## ## ##    ##       ##     ##   ##             ##       ##    ####     
 ##      ##    ## ## ## ## ####  ##    ##       ##    ##  ###              ##       ##      ##     
##       ##    ## ## ## ## ###   ##    ##       ##    #####                ##       ##      ##     
##       ##    ## ##    ## ##    ##    ##       ##    ##          ##       ##       ##      ## ##  
##    ## ##   ##  ##    ## ##   ##     ##       ##    ##    ##    ##       ##       ##      ####   
 ######   #####   ##    ## ######      ##       ##     ######              ##       ##       ##    
                           ##                                                                      
                           ##                                                                      
                           ##                                                                      

compile:lit

Stack

n-

Description

Internal. Compile an ilo li instruction

Examples

(used_internally)


                                       ##      ###                                          ###      ###    
                                       ##       ##                                           ##       ##    
                                                ##                ##                         ##       ##    
   ####    #####  ###  ##  ##  ###     ##       ##      #####     ##       ####    #####     ##       ##    
  ##  ##  ##   ## ## ## ## ## ## ##    ##       ##     ##   ##            ##  ##  ##   ##    ##       ##    
 ##      ##    ## ## ## ## ####  ##    ##       ##    ##  ###            ##         #####    ##       ##    
##       ##    ## ## ## ## ###   ##    ##       ##    #####             ##        ###  ##    ##       ##    
##       ##    ## ##    ## ##    ##    ##       ##    ##          ##    ##       ##    ##    ##       ##    
##    ## ##   ##  ##    ## ##   ##     ##       ##    ##    ##    ##    ##    ## ##  ####    ##       ##    
 ######   #####   ##    ## ######      ##       ##     ######            ######   #### ##    ##       ##    
                           ##                                                                               
                           ##                                                                               
                           ##                                                                               

compile:call

Stack

p-

Description

Internal. Compile an ilo lica instruction

Examples

(used_internally)


                                       ##      ###                          ##                              
                                       ##       ##                          ##                              
                                                ##                ##                                        
   ####    #####  ###  ##  ##  ###     ##       ##      #####     ##        ##   ##    ## ###  ##  ##  ###  
  ##  ##  ##   ## ## ## ## ## ## ##    ##       ##     ##   ##              ##   ##    ## ## ## ## ## ## ## 
 ##      ##    ## ## ## ## ####  ##    ##       ##    ##  ###               ##   ##    ## ## ## ## ####  ## 
##       ##    ## ## ## ## ###   ##    ##       ##    #####                 ##   ##   ### ## ## ## ###   ## 
##       ##    ## ##    ## ##    ##    ##       ##    ##          ##        ##   ##  #### ##    ## ##    ## 
##    ## ##   ##  ##    ## ##   ##     ##       ##    ##    ##    ##        ##   ## ## ## ##    ## ##   ##  
 ######   #####   ##    ## ######      ##       ##     ######               ##    ###  ## ##    ## ######   
                           ##                                           ##  ##                     ##       
                           ##                                           ##  ##                     ##       
                           ##                                            ####                      ##       

compile:jump

Stack

p-

Description

Internal. Compile an ilo liju instruction

Examples

(used_internally)


   ####    #####  ##  ###  ##    ## 
  ##  ##  ##   ## ## ## ## ##    ## 
 ##      ##    ## ####  ## ##    ## 
##       ##    ## ###   ## ##    ## 
##       ##    ## ##    ## ##    ## 
##    ## ##   ##  ##   ##   ##  ##  
 ######   #####   ######     #####  
                  ##           ##   
                  ##       ## ##    
                  ##        ###     

copy

Stack

sdc-

Description

Copy c cells starting at s to memory starting at d. Does not support overlapping regions

Examples

'Test d:create #45 allot

'Test_data &Test over s:length n:inc copy


   ####  ##    ## ##  ###  ##  ###  ##    ## 
  ##  ## ##    ## ## ## ## ## ## ## ##    ## 
 ##      ##    ## ####  ## ####  ## ##    ## 
##       ##   ### ###      ###      ##    ## 
##       ##  #### ##       ##       ##    ## 
##    ## ## ## ## ##       ##        ##  ##  
 ######   ###  ## ##       ##         #####  
                                        ##   
                                    ## ##    
                                     ###     

curry

Stack

vp-p

Description

Create a new quote pushing the value, then calling p1

Examples

#100 &n:put curry \100

100 (displays_100)


      ##                         ##       ##                                     
      ##                         ##       ##                                     
      ##    ##                   ##       ##                                     
   #####    ##      #####     #####    ##### ##  ###    #####   ######   ######  
 ###  ##           ##   ##  ###  ##  ###  ## ## ## ##  ##   ## ##    ## ##    ## 
##    ##             ##### ##    ## ##    ## ####  ## ##  ###   ###      ###     
##   ###           ###  ## ##   ### ##   ### ###      #####       ####     ####  
##  ####    ##    ##    ## ##  #### ##  #### ##       ##             ##       ## 
## ## ##    ##    ##  #### ## ## ## ## ## ## ##       ##    ## ##    ## ##    ## 
 ###  ##           #### ##  ###  ##  ###  ## ##        ######   ######   ######  

d:address

Stack

d-p

Description

Given a dictionary header, return a pointer to the address field

Examples

(get_address_of_most_recent_word)

@Dictionary d:address fetch

Related

d:flags d:hash d:link


      ##                                                 #              
      ##                                                ##              
      ##    ##                                          ##              
   #####    ##       ####  ##  ###    #####    #####    ####     #####  
 ###  ##            ##  ## ## ## ##  ##   ##  ##   ## ####      ##   ## 
##    ##           ##      ####  ## ##  ###     #####   ##     ##  ###  
##   ###          ##       ###      #####     ###  ##   ##     #####    
##  ####    ##    ##       ##       ##       ##    ##   ## ##  ##       
## ## ##    ##    ##    ## ##       ##    ## ##  ####   ####   ##    ## 
 ###  ##           ######  ##        ######   #### ##    ##     ######  

d:create

Stack

s-

Description

Create a new header

Examples

(create_a_new_header_for_"foo")

'foo d:create

(the_address_field_is_pointing_to_`here`)

Related

sigil::


      ##                               ##                #                #####  
      ##                               ##               ##               ##   ## 
      ##    ##                                          ##              ##   ##  
   #####    ##      #####  ##    ##    ##     ######    ####    ######      ##   
 ###  ##           ##   ##  ##  ##     ##    ##    ## ####     ##    ##    ##    
##    ##          ##  ###    ####      ##     ###       ##      ###       ##     
##   ###          #####       ##       ##       ####    ##        ####    ##     
##  ####    ##    ##         ####      ##          ##   ## ##        ##          
## ## ##    ##    ##    ##  ##  ##     ##    ##    ##   ####   ##    ##   ##     
 ###  ##           ######  ##    ##    ##     ######     ##     ######    ##     

d:exists?

Stack

s-f

Description

Given a dictionary header, return a flag indicating whether or not the word exists

Examples

:defined? (s-) d:exists? [ 'yes ] [ 'no ] choose s:put nl ;

'drop defined?
'dfo4j2o41oj defined?


      ##             ####    ###                               
      ##            ##  ##    ##                               
      ##    ##      ##        ##                               
   #####    ##      ##        ##      #####    ######  ######  
 ###  ##            ####      ##     ##   ##  ##   ## ##    ## 
##    ##          ####        ##       ##### ##    ##  ###     
##   ###            ##        ##     ###  ## ##   ###    ####  
##  ####    ##      ##        ##    ##    ## ##  ####       ## 
## ## ##    ##      ##        ##    ##  #### ## ## ## ##    ## 
 ###  ##            ##        ##     #### ##  ###  ##  ######  
                                                   ##          
                                             ##    ##          
                                              ######           

d:flags

Stack

d-p

Description

Given a dictionary header, return a pointer to the flags field

Examples

(get_flags_of_most_recent_word)

@Dictionary d:flags fetch

Notes

The flags field is currently used to identify immediate words. We can extend this to support up to 32 flags, but there are no plans to do so at this time.

Related

d:address d:hash d:link


      ##          ##                         ##       
      ##          ##                         ##       
      ##    ##    ##                         ##       
   #####    ##    ##  ###    #####   ######  ##  ###  
 ###  ##          ## ## ##  ##   ## ##    ## ## ## ## 
##    ##          ####  ##    #####  ###     ####  ## 
##   ###          ###   ##  ###  ##    ####  ###   ## 
##  ####    ##    ##    ## ##    ##       ## ##    ## 
## ## ##    ##    ##    ## ##  #### ##    ## ##    ## 
 ###  ##          ##    ##  #### ##  ######  ##    ## 

d:hash

Stack

d-p

Description

Given a dictionary header, return a pointer to the hash field

Examples

(get_hash_of_most_recent_word)

@Dictionary d:hash fetch

Related

d:address d:flags d:link


      ##            ###       ##             ##       
      ##             ##       ##             ##       
      ##    ##       ##                      ##       
   #####    ##       ##       ##    ##  ###  ##   ##  
 ###  ##             ##       ##    ## ## ## ##  ##   
##    ##             ##       ##    ####  ## ## ##    
##   ###             ##       ##    ###   ## #####    
##  ####    ##       ##       ##    ##    ## ### ##   
## ## ##    ##       ##       ##    ##    ## ##   ##  
 ###  ##             ##       ##    ##    ## ##    ## 

d:link

Stack

d-p

Description

Given a dictionary header, return a pointer to the link field

Examples

(get_header_of_most_recent_word)

@Dictionary

(follow_d:link_to_previous_header)

d:link fetch

Related

d:address d:flags d:hash


      ##            ###                      ##                         
      ##             ##                      ##                         
      ##    ##       ##                      ##                         
   #####    ##       ##      #####    #####  ##   ##  ##    ## ##  ###  
 ###  ##             ##     ##   ##  ##   ## ##  ##   ##    ## ## ## ## 
##    ##             ##    ##    ## ##    ## ## ##    ##    ## ####  ## 
##   ###             ##    ##    ## ##    ## #####    ##   ### ###   ## 
##  ####    ##       ##    ##    ## ##    ## ### ##   ##  #### ##    ## 
## ## ##    ##       ##    ##   ##  ##   ##  ##   ##  ## ## ## ##   ##  
 ###  ##             ##     #####    #####   ##    ##  ###  ## ######   
                                                               ##       
                                                               ##       
                                                               ##       

d:lookup

Stack

s-d

Description

Lookup a word in the dictionary. Returns zero if not found or the dictionary header address

Examples

:defined? (s-f) d:lookup n:-zero? ;
'sys:info defined? n:put nl (-1)
'dj13j1gm0 defined? n:put nl (0)

'bye d:lookup d:address fetch call


      ##                      #     ##                
      ##                     ##     ##                
      ##                     ##     ##                
   #####   #####  ##  ###    ####   ##  ###   ######  
 ###  ##  ##   ## ## ## ## ####     ## ## ## ##    ## 
##    ## ##  ###  ####  ##   ##     ####  ##  ###     
##   ### #####    ###   ##   ##     ###   ##    ####  
##  #### ##       ##    ##   ## ##  ##    ##       ## 
## ## ## ##    ## ##   ##    ####   ##    ## ##    ## 
 ###  ##  ######  ######      ##    ##    ##  ######  
                  ##                                  
                  ##                                  
                  ##                                  

depths

Stack

-nm

Description

Return depths of data and address stacks

Examples

depths n:put tab n:put nl

Notes

The returned depth of the data stack does not include the values being pushed by this.

Related

depth/data depth/address


      ##                      #     ##            ##        ##             #              
      ##                     ##     ##            #         ##            ##              
      ##                     ##     ##           ##         ##            ##              
   #####   #####  ##  ###    ####   ##  ###      #       #####   #####    ####     #####  
 ###  ##  ##   ## ## ## ## ####     ## ## ##    ##     ###  ##  ##   ## ####      ##   ## 
##    ## ##  ###  ####  ##   ##     ####  ##    #     ##    ##    #####   ##        ##### 
##   ### #####    ###   ##   ##     ###   ##   ##     ##   ###  ###  ##   ##      ###  ## 
##  #### ##       ##    ##   ## ##  ##    ##   #      ##  #### ##    ##   ## ##  ##    ## 
## ## ## ##    ## ##   ##    ####   ##    ##  ##      ## ## ## ##  ####   ####   ##  #### 
 ###  ##  ######  ######      ##    ##    ##  #        ###  ##  #### ##    ##     #### ## 
                  ##                         ##                                           
                  ##                                                                      
                  ##                                                                      

depth/data

Stack

-n

Description

Return the depth of the data stack

Examples

:.stk depth/data n:put '_items_on_the_stack s:put nl ;
.stk

Notes

The returned depth does not include the value being pushed by this.

Related

depths depth/address


      ##                      #     ##            ##                 ##       ##                                     
      ##                     ##     ##            #                  ##       ##                                     
      ##                     ##     ##           ##                  ##       ##                                     
   #####   #####  ##  ###    ####   ##  ###      #      #####     #####    ##### ##  ###    #####   ######   ######  
 ###  ##  ##   ## ## ## ## ####     ## ## ##    ##     ##   ##  ###  ##  ###  ## ## ## ##  ##   ## ##    ## ##    ## 
##    ## ##  ###  ####  ##   ##     ####  ##    #        ##### ##    ## ##    ## ####  ## ##  ###   ###      ###     
##   ### #####    ###   ##   ##     ###   ##   ##      ###  ## ##   ### ##   ### ###      #####       ####     ####  
##  #### ##       ##    ##   ## ##  ##    ##   #      ##    ## ##  #### ##  #### ##       ##             ##       ## 
## ## ## ##    ## ##   ##    ####   ##    ##  ##      ##  #### ## ## ## ## ## ## ##       ##    ## ##    ## ##    ## 
 ###  ##  ######  ######      ##    ##    ##  #        #### ##  ###  ##  ###  ## ##        ######   ######   ######  
                  ##                         ##                                                                      
                  ##                                                                                                 
                  ##                                                                                                 

depth/address

Stack

-n

Description

Return the depth of the address stack

Examples

depth/address n:put nl

Related

depth/data depths


      ##    ##             
      ##    ##             
      ##                   
   #####    ##    ##  ###  
 ###  ##    ##    ## ## ## 
##    ##    ##    ####  ## 
##   ###    ##    ###   ## 
##  ####    ##    ##    ## 
## ## ##    ##    ##   ##  
 ###  ##    ##    ######   
                  ##       
                  ##       
                  ##       

dip

Stack

np-n

Description

Push n to address stack, call p. then restore n to data stack

Examples

#1 #2 [ n:put nl ] dip n:put nl

Notes

This is the same as doing:

push ... pop

Related

sip push pop


      ##                            
      ##                            
      ##                            
   ##### ##  ###    #####  ##  ###  
 ###  ## ## ## ##  ##   ## ## ## ## 
##    ## ####  ## ##    ## ####  ## 
##   ### ###      ##    ## ###   ## 
##  #### ##       ##    ## ##    ## 
## ## ## ##       ##   ##  ##   ##  
 ###  ## ##        #####   ######   
                           ##       
                           ##       
                           ##       

drop

Stack

n-

Description

Discard top value on stack

Examples

#1 #2 #3 #4 #5 #6 drop
#5 [ n:put tab ] times nl

Related

drop-pair nip


      ##                                                          ##             
      ##                                                          ##             
      ##                                                                         
   ##### ##  ###    #####  ##  ###           ##  ###    #####     ##    ##  ###  
 ###  ## ## ## ##  ##   ## ## ## ##          ## ## ##  ##   ##    ##    ## ## ## 
##    ## ####  ## ##    ## ####  ##  ######  ####  ##    #####    ##    ####  ## 
##   ### ###      ##    ## ###   ##          ###   ##  ###  ##    ##    ###      
##  #### ##       ##    ## ##    ##          ##    ## ##    ##    ##    ##       
## ## ## ##       ##   ##  ##   ##           ##   ##  ##  ####    ##    ##       
 ###  ## ##        #####   ######            ######    #### ##    ##    ##       
                           ##                ##                                  
                           ##                ##                                  
                           ##                ##                                  

drop-pair

Stack

nn-

Description

Discard top two values on stack

Examples

#1 #2 #3 #4 #5 #6 drop-pair
n:put tab n:put nl
n:put tab n:put nl

Notes

This is the same as doing `drop drop`.

Related

drop nip


      ##    #              
      ##   ##              
      ##   ##              
   #####   ####      ####  
 ###  ## ####       ##  ## 
##    ##   ##      ##      
##   ###   ##     ##       
##  ####   ## ##  ##       
## ## ##   ####   ##    ## 
 ###  ##    ##     ######  

dtc

Stack

-

Description

Internal. Data following is a direct threaded address list

Examples

(used_internally)


      ##                   
      ##                   
      ##                   
   ##### ##    ## ##  ###  
 ###  ## ##    ## ## ## ## 
##    ## ##    ## ####  ## 
##   ### ##   ### ###   ## 
##  #### ##  #### ##    ## 
## ## ## ## ## ## ##   ##  
 ###  ##  ###  ## ######   
                  ##       
                  ##       
                  ##       

dup

Stack

n-nn

Description

Duplicate top value on stack

Examples

#13 dup n:put tab n:put nl

Related

dup-pair


      ##                                                 ##             
      ##                                                 ##             
      ##                                                                
   ##### ##    ## ##  ###           ##  ###    #####     ##    ##  ###  
 ###  ## ##    ## ## ## ##          ## ## ##  ##   ##    ##    ## ## ## 
##    ## ##    ## ####  ##  ######  ####  ##    #####    ##    ####  ## 
##   ### ##   ### ###   ##          ###   ##  ###  ##    ##    ###      
##  #### ##  #### ##    ##          ##    ## ##    ##    ##    ##       
## ## ## ## ## ## ##   ##           ##   ##  ##  ####    ##    ##       
 ###  ##  ###  ## ######            ######    #### ##    ##    ##       
                  ##                ##                                  
                  ##                ##                                  
                  ##                ##                                  

dup-pair

Stack

nm-nmnm

Description

Duplicate top two values

Examples

#1 #2 dup-pair
n:put tab n:put nl
n:put tab n:put nl

Related

dup


                  ######      ##                        ###                      
                  ##   ##     ##                         ##                      
            ##    ##    ##                               ##                      
  #####     ##    ##    ##    ##     ######  ##  ###     ##      #####  ##    ## 
 ##   ##          ##    ##    ##    ##    ## ## ## ##    ##     ##   ## ##    ## 
##  ###           ##    ##    ##     ###     ####  ##    ##       ##### ##    ## 
#####             ##    ##    ##       ####  ###   ##    ##     ###  ## ##    ## 
##          ##    ##   ##     ##          ## ##    ##    ##    ##    ## ##    ## 
##    ##    ##    ## ###      ##    ##    ## ##   ##     ##    ##  ####  ##  ##  
 ######           ####        ##     ######  ######      ##     #### ##   #####  
                                             ##                             ##   
                                             ##                         ## ##    
                                             ##                          ###     

e:Display

Stack

-

Description

Data. Holds a pointer to a block display word. Called by edit.

Examples

&list# !e:Display
@e:Display call

Notes

The `e:Display` variable holds a pointer to the word used to display a block when editing starts via `edit`. It defaults to holding a pointer to `list`.

Related

list list* list# sys:info


                                                                    ##    ###       ##                      
                                                                    #      ##       ##                      
            ##                                                     ##      ##                               
  #####     ##      #####  ##  ###    #####   ######    #####      #       ##       ##    ##  ###    #####  
 ##   ##           ##   ## ## ## ##  ##   ## ##    ##  ##   ##    ##       ##       ##    ## ## ##  ##   ## 
##  ###           ##  ###  ####  ##    #####  ###     ##  ###     #        ##       ##    ####  ## ##  ###  
#####             #####    ###       ###  ##    ####  #####      ##        ##       ##    ###   ## #####    
##          ##    ##       ##       ##    ##       ## ##         #         ##       ##    ##    ## ##       
##    ##    ##    ##    ## ##       ##  #### ##    ## ##    ##  ##         ##       ##    ##    ## ##    ## 
 ######            ######  ##        #### ##  ######   ######   #          ##       ##    ##    ##  ######  
                                                               ##                                           

e:erase/line

Stack

n-

Description

Erase line n in the block buffer

Examples

(erase_contents_of_line_10)
#10 e:erase/line


                     ##                                           #     
                     ##                                          ##     
            ##                                                   ##     
  #####     ##       ##    ##  ###   ######    #####  ##  ###    ####   
 ##   ##             ##    ## ## ## ##    ##  ##   ## ## ## ## ####     
##  ###              ##    ####  ##  ###     ##  ###  ####  ##   ##     
#####                ##    ###   ##    ####  #####    ###        ##     
##          ##       ##    ##    ##       ## ##       ##         ## ##  
##    ##    ##       ##    ##    ## ##    ## ##    ## ##         ####   
 ######              ##    ##    ##  ######   ######  ##          ##    

e:insert

Stack

n'-

Description

Erase line n, parse to end of line, insert into line n

Examples

(replace_line_10_with_text_following_`e:insert`)
#10 e:insert hello, world!

Related

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 e:insert-at


                     ##                                           #                          #     
                     ##                                          ##                         ##     
            ##                                                   ##                         ##     
  #####     ##       ##    ##  ###   ######    #####  ##  ###    ####              #####    ####   
 ##   ##             ##    ## ## ## ##    ##  ##   ## ## ## ## ####               ##   ## ####     
##  ###              ##    ####  ##  ###     ##  ###  ####  ##   ##      ######     #####   ##     
#####                ##    ###   ##    ####  #####    ###        ##               ###  ##   ##     
##          ##       ##    ##    ##       ## ##       ##         ## ##           ##    ##   ## ##  
##    ##    ##       ##    ##    ## ##    ## ##    ## ##         ####            ##  ####   ####   
 ######              ##    ##    ##  ######   ######  ##          ##              #### ##    ##    

e:insert-at

Stack

lc'-

Description

Parse to end of line. Insert text into line l at column c

Examples

(replace_line_10,_starting_at_column_5,_with_text_following_`e:insert`)
#10 #5 e:insert hello, world!

Related

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 e:insert


                    ###       ##                      
                     ##       ##                      
            ##       ##                               
  #####     ##       ##       ##    ##  ###    #####  
 ##   ##             ##       ##    ## ## ##  ##   ## 
##  ###              ##       ##    ####  ## ##  ###  
#####                ##       ##    ###   ## #####    
##          ##       ##       ##    ##    ## ##       
##    ##    ##       ##       ##    ##    ## ##    ## 
 ######              ##       ##    ##    ##  ######  

e:line

Stack

n-

Description

Display a single line from the current block

Examples

(display_line_10_of_current_block)
#10 e:line


                                               ###                               
                                                ##                               
            ##                                  ##                               
  #####     ##    ##  ###    #####  ##  ###     ##      #####     ####    #####  
 ##   ##          ## ## ##  ##   ## ## ## ##    ##     ##   ##   ##  ##  ##   ## 
##  ###           ####  ## ##  ###  ####  ##    ##       #####  ##      ##  ###  
#####             ###      #####    ###   ##    ##     ###  ## ##       #####    
##          ##    ##       ##       ##    ##    ##    ##    ## ##       ##       
##    ##    ##    ##       ##    ## ##   ##     ##    ##  #### ##    ## ##    ## 
 ######           ##        ######  ######      ##     #### ##  ######   ######  
                                    ##                                           
                                    ##                                           
                                    ##                                           

e:replace

Stack

ls-

Description

Insert text s into line l

Examples

(Replace_line_10_with_"Hello_World!")
#10 'Hello_World! e:replace list

Related

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 e:insert e:insert-at e:replace-at


                                               ###                                                    #     
                                                ##                                                   ##     
            ##                                  ##                                                   ##     
  #####     ##    ##  ###    #####  ##  ###     ##      #####     ####    #####             #####    ####   
 ##   ##          ## ## ##  ##   ## ## ## ##    ##     ##   ##   ##  ##  ##   ##           ##   ## ####     
##  ###           ####  ## ##  ###  ####  ##    ##       #####  ##      ##  ###   ######     #####   ##     
#####             ###      #####    ###   ##    ##     ###  ## ##       #####              ###  ##   ##     
##          ##    ##       ##       ##    ##    ##    ##    ## ##       ##                ##    ##   ## ##  
##    ##    ##    ##       ##    ## ##   ##     ##    ##  #### ##    ## ##    ##          ##  ####   ####   
 ######           ##        ######  ######      ##     #### ##  ######   ######            #### ##    ##    
                                    ##                                                                      
                                    ##                                                                      
                                    ##                                                                      

e:replace-at

Stack

lcs-

Description

Insert text s into line l at column c

Examples

(Replace_text_in_line_10_with_"Hello_World!")
(Starts_at_column_5)
#10 #5 'Hello_World! e:replace list

Related

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 e:insert e:insert-at e:replace-at


                     #                         ###       ##                      
                    ##                          ##       ##                      
            ##      ##                          ##                               
  #####     ##      ####     #####              ##       ##    ##  ###    #####  
 ##   ##          ####      ##   ##             ##       ##    ## ## ##  ##   ## 
##  ###             ##     ##    ##  ######     ##       ##    ####  ## ##  ###  
#####               ##     ##    ##             ##       ##    ###   ## #####    
##          ##      ## ##  ##    ##             ##       ##    ##    ## ##       
##    ##    ##      ####   ##   ##              ##       ##    ##    ## ##    ## 
 ######              ##     #####               ##       ##    ##    ##  ######  

e:to-line

Stack

n-p

Description

Return pointer to start of line in the block buffer

Examples

#10 e:to-line n:put (address_of_line_10)


               ##    ##       #     
               ##    ##      ##     
               ##            ##     
  #####     #####    ##      ####   
 ##   ##  ###  ##    ##    ####     
##  ###  ##    ##    ##      ##     
#####    ##   ###    ##      ##     
##       ##  ####    ##      ## ##  
##    ## ## ## ##    ##      ####   
 ######   ###  ##    ##       ##    

edit

Stack

n-

Description

Set Block to n. Load and display block

Examples

(begin_editing_block_0)

#0 edit

Related

list list* list# e:Display sys:info


                    #####  
                   ##   ## 
                  ##   ##  
  #####   ###  ##     ##   
 ##   ## ## ## ##    ##    
##  ###  ##  ####   ##     
#####    ##   ###   ##     
##       ##    ##          
##    ##  ##   ##   ##     
 ######    ######   ##     
               ##          
               ##          
               ##          

eq?

Stack

nn-f

Description

Compare values for equality

Examples

#10 #10 eq? n:put nl
 #9 #10 eq? n:put nl

Related

-eq? lt? gt? lteq? gteq?


   ####              #              ##       
  ##  ##            ##              ##       
  ##                ##              ##       
  ##       #####    ####      ####  ##  ###  
  ####    ##   ## ####       ##  ## ## ## ## 
####     ##  ###    ##      ##      ####  ## 
  ##     #####      ##     ##       ###   ## 
  ##     ##         ## ##  ##       ##    ## 
  ##     ##    ##   ####   ##    ## ##    ## 
  ##      ######     ##     ######  ##    ## 

fetch

Stack

p-n

Description

Fetch a value stored at address

Examples

#75 'foo var-n
&foo fetch n:put nl

Related

fetch-next


   ####              #              ##                                              #     
  ##  ##            ##              ##                                             ##     
  ##                ##              ##                                             ##     
  ##       #####    ####      ####  ##  ###           ##  ###    #####  ##    ##   ####   
  ####    ##   ## ####       ##  ## ## ## ##          ## ## ##  ##   ##  ##  ##  ####     
####     ##  ###    ##      ##      ####  ##  ######  ####  ## ##  ###    ####     ##     
  ##     #####      ##     ##       ###   ##          ###   ## #####       ##      ##     
  ##     ##         ## ##  ##       ##    ##          ##    ## ##         ####     ## ##  
  ##     ##    ##   ####   ##    ## ##    ##          ##    ## ##    ##  ##  ##    ####   
  ##      ######     ##     ######  ##    ##          ##    ##  ######  ##    ##    ##    

fetch-next

Stack

a-an

Description

Fetch a value stored at address Also returns the next address

Examples

#75 'foo var-n #80 comma
&foo fetch-next n:put tab fetch n:put nl

Related

fetch


   ####     ##      ###      ###    
  ##  ##    ##       ##       ##    
  ##                 ##       ##    
  ##        ##       ##       ##    
  ####      ##       ##       ##    
####        ##       ##       ##    
  ##        ##       ##       ##    
  ##        ##       ##       ##    
  ##        ##       ##       ##    
  ##        ##       ##       ##    

fill

Stack

vpn-

Description

Fill n cells of memory starting at p with value v

Examples

'Test d:create #100 comma #100 allot

(populate_string_with_100_"f"_characters)
$f &Test n:inc #100 fill

(display_100_"f"_characters_in_string)
&Test s:put


   ####                                                        
  ##  ##                                                       
  ##                                                           
  ##       #####  ##  ###    #####  ##    ##   #####  ##  ###  
  ####    ##   ## ## ## ##  ##   ## ##    ##  ##   ## ## ## ## 
####     ##    ## ####  ## ##  ###  ##    ## ##  ###  ####  ## 
  ##     ##    ## ###      #####     ##  ##  #####    ###      
  ##     ##    ## ##       ##        ## ##   ##       ##       
  ##     ##   ##  ##       ##    ##   ###    ##    ## ##       
  ##      #####   ##        ######     ##     ######  ##       

forever

Stack

p-

Description

Run p repeatedly, in an unending loop

Examples

[ 'hello! s:put nl ] forever

Related

I J K indexed-times times while until


  ######    ####  
 ##   ##   ##  ## 
##    ##  ##      
##   ### ##       
##  #### ##       
## ## ## ##    ## 
 ###  ##  ######  
      ##          
##    ##          
 ######           

gc

Stack

p-

Description

Run function at pointer p. Saves and restores Free to recover any memory allocated during run

Examples

[ here n:put nl
  #1000 allot
  here n:put nl ] gc

Notes

This is a very simple form of garbage collection. Some words will allocate memory at `here`. By wrapping calls to these in a quote and passing to `gc`, this memory will be reclaimed when the quote returns.

You shouldn't use this with code that's actually allocating things you want to keep around.

Related

Free here allot


            #       #####  
           ##      ##   ## 
           ##     ##   ##  
  ######   ####       ##   
 ##   ## ####        ##    
##    ##   ##       ##     
##   ###   ##       ##     
##  ####   ## ##           
## ## ##   ####     ##     
 ###  ##    ##      ##     
      ##                   
##    ##                   
 ######                    

gt?

Stack

nn-f

Description

Compare values for n1 greater than n2

Examples

#10 #11 gt? n:put nl
#10 #10 gt? n:put nl
 #9 #10 gt? n:put nl

Related

-eq? eq? lt? lteq? gteq?


            #                         #####  
           ##                        ##   ## 
           ##                       ##   ##  
  ######   ####     #####   ###  ##     ##   
 ##   ## ####      ##   ## ## ## ##    ##    
##    ##   ##     ##  ###  ##  ####   ##     
##   ###   ##     #####    ##   ###   ##     
##  ####   ## ##  ##       ##    ##          
## ## ##   ####   ##    ##  ##   ##   ##     
 ###  ##    ##     ######    ######   ##     
      ##                         ##          
##    ##                         ##          
 ######                          ##          

gteq?

Stack

nn-f

Description

Compare two values for greater than or equality

Examples

#10 #11 gteq? n:put nl
#10 #10 gteq? n:put nl
 #9 #10 gteq? n:put nl

Related

-eq? eq? lt? gt? lteq?


##                                  
##                                  
##                                  
##  ###    #####  ##  ###    #####  
## ## ##  ##   ## ## ## ##  ##   ## 
####  ## ##  ###  ####  ## ##  ###  
###   ## #####    ###      #####    
##    ## ##       ##       ##       
##    ## ##    ## ##       ##    ## 
##    ##  ######  ##        ######  

here

Stack

-a

Description

Return the next free memory address

Examples

(print_"here")

here n:put nl

(determine_length_of_allocated_data)
here ( #1 #2 #3 ) #3 a:make drop here swap n:sub n:put nl

Related

Free allot gc


   ##       ####  
   ##      ##  ## 
           ##     
   ##      ##     
   ##      ####   
   ##    ####     
   ##      ##     
   ##      ##     
   ##      ##     
   ##      ##     

if

Stack

fp-

Description

Execute p if flag is non-zero

Examples

:check [ 'Value_is_valid_for_true_(non-zero) s:put nl ] if ;

#100 check
#0 check
#-100 check

Related

-if choose


   ##                   ##                                  ##             #        ##                               
   ##                   ##                                  ##            ##        ##                               
                        ##                                  ##            ##                                         
   ##    ##  ###     #####   #####  ##    ##   #####     #####            ####      ##    ###  ##    #####   ######  
   ##    ## ## ##  ###  ##  ##   ##  ##  ##   ##   ##  ###  ##          ####        ##    ## ## ##  ##   ## ##    ## 
   ##    ####  ## ##    ## ##  ###    ####   ##  ###  ##    ##  ######    ##        ##    ## ## ## ##  ###   ###     
   ##    ###   ## ##   ### #####       ##    #####    ##   ###            ##        ##    ## ## ## #####       ####  
   ##    ##    ## ##  #### ##         ####   ##       ##  ####            ## ##     ##    ##    ## ##             ## 
   ##    ##    ## ## ## ## ##    ##  ##  ##  ##    ## ## ## ##            ####      ##    ##    ## ##    ## ##    ## 
   ##    ##    ##  ###  ##  ######  ##    ##  ######   ###  ##             ##       ##    ##    ##  ######   ######  

indexed-times

Stack

np-

Description

Run a quote the specified number of times, tracking the loop index in I

Examples

#10 [ I n:put sp ] indexed-times nl

Notes

With `indexed-times` you can obtain the loop index with `I`. This will always count down towards zero. If you don't need the loop index, use `times` instead as it's more efficient.

Related

I J K forever times until while


   ##                #                                           ###               ###       ##       #     
   ##               ##                                            ##                ##       ##      ##     
                    ##                                            ##       ##       ##               ##     
   ##    ##  ###    ####     #####  ##  ###  ##  ###    #####     ##       ##       ##       ##      ####   
   ##    ## ## ## ####      ##   ## ## ## ## ## ## ##  ##   ##    ##                ##       ##    ####     
   ##    ####  ##   ##     ##  ###  ####  ## ####  ##    #####    ##                ##       ##      ##     
   ##    ###   ##   ##     #####    ###      ###   ##  ###  ##    ##                ##       ##      ##     
   ##    ##    ##   ## ##  ##       ##       ##    ## ##    ##    ##       ##       ##       ##      ## ##  
   ##    ##    ##   ####   ##    ## ##       ##    ## ##  ####    ##       ##       ##       ##      ####   
   ##    ##    ##    ##     ######  ##       ##    ##  #### ##    ##                ##       ##       ##    

internal:lit

Stack

-n

Description

Internal. Push next value in memory to the stack

Examples

(used_internally)


   ##                #                                           ###                                           #              
   ##               ##                                            ##                                          ##              
                    ##                                            ##       ##                                 ##              
   ##    ##  ###    ####     #####  ##  ###  ##  ###    #####     ##       ##     ###  ## ##    ##   #####    ####     #####  
   ##    ## ## ## ####      ##   ## ## ## ## ## ## ##  ##   ##    ##             ## ## ## ##    ##  ##   ## ####      ##   ## 
   ##    ####  ##   ##     ##  ###  ####  ## ####  ##    #####    ##             ##  #### ##    ## ##    ##   ##     ##  ###  
   ##    ###   ##   ##     #####    ###      ###   ##  ###  ##    ##             ##   ### ##   ### ##    ##   ##     #####    
   ##    ##    ##   ## ##  ##       ##       ##    ## ##    ##    ##       ##    ##    ## ##  #### ##    ##   ## ##  ##       
   ##    ##    ##   ####   ##    ## ##       ##    ## ##  ####    ##       ##     ##   ## ## ## ## ##   ##    ####   ##    ## 
   ##    ##    ##    ##     ######  ##       ##    ##  #### ##    ##               ######  ###  ##  #####      ##     ######  
                                                                                       ##                                     
                                                                                       ##                                     
                                                                                       ##                                     

internal:quote

Stack

-p

Description

Internal. Skip over quote. Push address of quote to stack.

Examples

(used_internally)


   ##                #                                                     #     
   ##               ##                                                    ##     
                    ##                                                    ##     
   ##    ##  ###    ####     #####  ##  ###  ##  ###  ##  ###    #####    ####   
   ##    ## ## ## ####      ##   ## ## ## ## ## ## ## ## ## ##  ##   ## ####     
   ##    ####  ##   ##     ##  ###  ####  ## ####  ## ####  ## ##  ###    ##     
   ##    ###   ##   ##     #####    ###      ###   ## ###      #####      ##     
   ##    ##    ##   ## ##  ##       ##       ##    ## ##       ##         ## ##  
   ##    ##    ##   ####   ##    ## ##       ##   ##  ##       ##    ##   ####   
   ##    ##    ##    ##     ######  ##       ######   ##        ######     ##    
                                             ##                                  
                                             ##                                  
                                             ##                                  

interpret

Stack

s-

Description

Interpret token

Examples

'#124 interpret
'n:put interpret

Related

s:evaluate


   ##             
   ##             
   ##      #####  
   ##     ##   ## 
   ##    ##    ## 
   ##    ##    ## 
   ##    ##    ## 
   ##    ##   ##  
   ##     #####   

io

Stack

...n-

Description

Trigger an I/O operation

Examples

(used_internally)


    ##                              
    ##                              
    ##   ##    ## ###  ##  ##  ###  
    ##   ##    ## ## ## ## ## ## ## 
    ##   ##    ## ## ## ## ####  ## 
    ##   ##   ### ## ## ## ###   ## 
    ##   ##  #### ##    ## ##    ## 
    ##   ## ## ## ##    ## ##   ##  
    ##    ###  ## ##    ## ######   
##  ##                     ##       
##  ##                     ##       
 ####                      ##       

jump

Stack

p-

Description

Internal. Jump to an address

Examples

&bye jump

Related

call


  ###       ##                #      ##  ##  
   ##       ##               ##       ####   
   ##                        ##     ######## 
   ##       ##     ######    ####     ####   
   ##       ##    ##    ## ####      ##  ##  
   ##       ##     ###       ##              
   ##       ##       ####    ##              
   ##       ##          ##   ## ##           
   ##       ##    ##    ##   ####            
   ##       ##     ######     ##             

list*

Stack

-

Description

Display the text in the block

Examples

list*

Related

list# list e:Display sys:info


  ###       ##                #       ##  ## 
   ##       ##               ##       ##  ## 
   ##                        ##     ######## 
   ##       ##     ######    ####    ##  ##  
   ##       ##    ##    ## ####      ##  ##  
   ##       ##     ###       ##      ##  ##  
   ##       ##       ####    ##      ##  ##  
   ##       ##          ##   ## ##  ######## 
   ##       ##    ##    ##   ####   ##  ##   
   ##       ##     ######     ##    ##  ##   

list#

Stack

-

Description

Display the block with line numbers

Examples

list#

Related

list* list e:Display sys:info


  ###       ##                #     
   ##       ##               ##     
   ##                        ##     
   ##       ##     ######    ####   
   ##       ##    ##    ## ####     
   ##       ##     ###       ##     
   ##       ##       ####    ##     
   ##       ##          ##   ## ##  
   ##       ##    ##    ##   ####   
   ##       ##     ######     ##    

list

Stack

-

Description

Display the block with line numbers and rules

Examples

list

Related

list* list# e:Display sys:info


  ###                            ## 
   ##                            ## 
   ##                            ## 
   ##      #####    #####     ##### 
   ##     ##   ##  ##   ##  ###  ## 
   ##    ##    ##    ##### ##    ## 
   ##    ##    ##  ###  ## ##   ### 
   ##    ##    ## ##    ## ##  #### 
   ##    ##   ##  ##  #### ## ## ## 
   ##     #####    #### ##  ###  ## 

load

Stack

-

Description

(re)Load the current block

Examples

load

Notes

Loads block (number taken from `Block`) into the `block:buffer`.

Related

set save block:load block:save block:buffer


  ###       #       #####  
   ##      ##      ##   ## 
   ##      ##     ##   ##  
   ##      ####       ##   
   ##    ####        ##    
   ##      ##       ##     
   ##      ##       ##     
   ##      ## ##           
   ##      ####     ##     
   ##       ##      ##     

lt?

Stack

nn-f

Description

Compare values for n1 less than n2

Examples

#10 #11 lt? n:put nl
#10 #10 lt? n:put nl
 #9 #10 lt? n:put nl

Related

-eq? eq? gt? lteq? gteq?


  ###       #                         #####  
   ##      ##                        ##   ## 
   ##      ##                       ##   ##  
   ##      ####     #####   ###  ##     ##   
   ##    ####      ##   ## ## ## ##    ##    
   ##      ##     ##  ###  ##  ####   ##     
   ##      ##     #####    ##   ###   ##     
   ##      ## ##  ##       ##    ##          
   ##      ####   ##    ##  ##   ##   ##     
   ##       ##     ######    ######   ##     
                                 ##          
                                 ##          
                                 ##          

lteq?

Stack

nn-f

Description

Compare two values for less than or equality

Examples

#10 #11 lteq? n:put nl
#10 #10 lteq? n:put nl
 #9 #10 lteq? n:put nl

Related

-eq? eq? lt? gt? gteq?


                           ##                
                           ##                
            ##             ##                
##  ###     ##      #####  ## ###    ######  
## ## ##           ##   ## #### ##  ##    ## 
####  ##             ##### ##    ##  ###     
###   ##           ###  ## ##    ##    ####  
##    ##    ##    ##    ## ##   ##        ## 
##    ##    ##    ##  #### ## ###   ##    ## 
##    ##           #### ## ####      ######  

n:abs

Stack

n-n

Description

Return the absolute value of n

Examples

#-190 n:abs n:put nl
#31 n:abs n:put nl

Related

n:negate


                                 ##       ## 
                                 ##       ## 
            ##                   ##       ## 
##  ###     ##      #####     #####    ##### 
## ## ##           ##   ##  ###  ##  ###  ## 
####  ##             ##### ##    ## ##    ## 
###   ##           ###  ## ##   ### ##   ### 
##    ##    ##    ##    ## ##  #### ##  #### 
##    ##    ##    ##  #### ## ## ## ## ## ## 
##    ##           #### ##  ###  ##  ###  ## 

n:add

Stack

nn-n

Description

Add n1 to n2, returning n3

Examples

(add_5_+_5)

#5 #5 n:add

Related

n:sub n:mul n:div n:divmod n:mod


                  ##                   #                                           #####  
                  ##                  ##                                          ##   ## 
            ##    ##                  ##                                         ##   ##  
##  ###     ##    ## ###     #####    ####   ##    ##   #####    #####  ##  ###      ##   
## ## ##          #### ##   ##   ## ####     ##    ##  ##   ##  ##   ## ## ## ##    ##    
####  ##          ##    ## ##  ###    ##     ##    ## ##  ###  ##  ###  ####  ##   ##     
###   ##          ##    ## #####      ##     ## ## ## #####    #####    ###   ##   ##     
##    ##    ##    ##   ##  ##         ## ##  ## ## ## ##       ##       ##    ##          
##    ##    ##    ## ###   ##    ##   ####   ######## ##    ## ##    ## ##    ##   ##     
##    ##          ####      ######     ##    ##    ##  ######   ######  ##    ##   ##     

n:between?

Stack

nlu-f

Description

True if n is between l and u, inclusive

Examples

#10 #1 #100 n:between? [ 'yes s:put nl ] if
#10 #10 #100 n:between? [ 'yes s:put nl ] if
#10 #-1 #10 n:between? [ 'yes s:put nl ] if
#10 #50 #93 n:between? [ 'yes s:put nl ] if


                        ##                   
                        ##                   
            ##          ##                   
##  ###     ##       #####   #####     ####  
## ## ##           ###  ##  ##   ##   ##  ## 
####  ##          ##    ## ##  ###   ##      
###   ##          ##   ### #####    ##       
##    ##    ##    ##  #### ##       ##       
##    ##    ##    ## ## ## ##    ## ##    ## 
##    ##           ###  ##  ######   ######  

n:dec

Stack

n-n

Description

Decrement n by 1

Examples

(decrease_100_by_1)

#100 n:dec

Related

n:inc


                        ##    ##             
                        ##    ##             
            ##          ##                   
##  ###     ##       #####    ##    ##    ## 
## ## ##           ###  ##    ##    ##    ## 
####  ##          ##    ##    ##    ##    ## 
###   ##          ##   ###    ##     ##  ##  
##    ##    ##    ##  ####    ##     ## ##   
##    ##    ##    ## ## ##    ##      ###    
##    ##           ###  ##    ##       ##    

n:div

Stack

nn-n

Description

Divine n1 by n2; get result

Examples

#110 #10 n:div n:put nl (11)

Related

n:add n:sub n:mul n:divmod n:mod


                        ##    ##                                     ## 
                        ##    ##                                     ## 
            ##          ##                                           ## 
##  ###     ##       #####    ##    ##    ## ###  ##    #####     ##### 
## ## ##           ###  ##    ##    ##    ## ## ## ##  ##   ##  ###  ## 
####  ##          ##    ##    ##    ##    ## ## ## ## ##    ## ##    ## 
###   ##          ##   ###    ##     ##  ##  ## ## ## ##    ## ##   ### 
##    ##    ##    ##  ####    ##     ## ##   ##    ## ##    ## ##  #### 
##    ##    ##    ## ## ##    ##      ###    ##    ## ##   ##  ## ## ## 
##    ##           ###  ##    ##       ##    ##    ##  #####    ###  ## 

n:divmod

Stack

nn-nn

Description

Divide n1 by n2 and return the result and remainder

Examples

#115 #10 n:divmod n:put sp n:put nl (11,_5)

Related

n:add n:sub n:mul n:div n:mod


                     ##                      
                     ##                      
            ##                               
##  ###     ##       ##    ##  ###     ####  
## ## ##             ##    ## ## ##   ##  ## 
####  ##             ##    ####  ##  ##      
###   ##             ##    ###   ## ##       
##    ##    ##       ##    ##    ## ##       
##    ##    ##       ##    ##    ## ##    ## 
##    ##             ##    ##    ##  ######  

n:inc

Stack

n-n

Description

Increment n by 1

Examples

(increment_100_by_1)

#100 n:inc

Related

n:dec


                    ###       ##                ##       #     
                     ##       ##                ##      ##     
            ##       ##                                 ##     
##  ###     ##       ##       ##    ###  ##     ##      ####   
## ## ##             ##       ##    ## ## ##    ##    ####     
####  ##             ##       ##    ## ## ##    ##      ##     
###   ##             ##       ##    ## ## ##    ##      ##     
##    ##    ##       ##       ##    ##    ##    ##      ## ##  
##    ##    ##       ##       ##    ##    ##    ##      ####   
##    ##             ##       ##    ##    ##    ##       ##    

n:limit

Stack

nlu-n

Description

Constrain n to between l and u, inclusive

Examples

#10 #1 #100 n:limit n:put nl
#10 #1 #10 n:limit n:put nl
#10 #1 #5 n:limit n:put nl

Related

n:min n:max


            ##                               
##  ###     ##    ###  ##    #####  ##    ## 
## ## ##          ## ## ##  ##   ##  ##  ##  
####  ##          ## ## ##    #####   ####   
###   ##          ## ## ##  ###  ##    ##    
##    ##    ##    ##    ## ##    ##   ####   
##    ##    ##    ##    ## ##  ####  ##  ##  
##    ##          ##    ##  #### ## ##    ## 

n:max

Stack

nn-n

Description

Return the greater of two values

Examples

#33 #45 n:max n:put nl
#-1 #21 n:max n:put nl
#45 #33 n:max n:put nl

Related

n:limit n:min


                              ##             
                              ##             
            ##                               
##  ###     ##    ###  ##     ##    ##  ###  
## ## ##          ## ## ##    ##    ## ## ## 
####  ##          ## ## ##    ##    ####  ## 
###   ##          ## ## ##    ##    ###   ## 
##    ##    ##    ##    ##    ##    ##    ## 
##    ##    ##    ##    ##    ##    ##    ## 
##    ##          ##    ##    ##    ##    ## 

n:min

Stack

nn-n

Description

Return the lower of two values

Examples

#33 #45 n:min n:put nl
#-1 #21 n:min n:put nl
#45 #33 n:min n:put nl

Related

n:limit n:max


                                          ## 
                                          ## 
            ##                            ## 
##  ###     ##    ###  ##    #####     ##### 
## ## ##          ## ## ##  ##   ##  ###  ## 
####  ##          ## ## ## ##    ## ##    ## 
###   ##          ## ## ## ##    ## ##   ### 
##    ##    ##    ##    ## ##    ## ##  #### 
##    ##    ##    ##    ## ##   ##  ## ## ## 
##    ##          ##    ##  #####    ###  ## 

n:mod

Stack

nn-n

Description

Divide n1 by n2; get remainder

Examples

#115 #10 n:mod n:put nl (5)

Related

n:add n:sub n:mul n:div n:divmod


                                      ###    
                                       ##    
            ##                         ##    
##  ###     ##    ###  ##  ##    ##    ##    
## ## ##          ## ## ## ##    ##    ##    
####  ##          ## ## ## ##    ##    ##    
###   ##          ## ## ## ##   ###    ##    
##    ##    ##    ##    ## ##  ####    ##    
##    ##    ##    ##    ## ## ## ##    ##    
##    ##          ##    ##  ###  ##    ##    

n:mul

Stack

nn-n

Description

Multiply n1 by n2, returning n3

Examples

#33 #10 n:mul n:put nl

Related

n:add n:sub n:div n:divmod n:mod


                                                         #              
                                                        ##              
            ##                                          ##              
##  ###     ##    ##  ###    #####    ######   #####    ####     #####  
## ## ##          ## ## ##  ##   ##  ##   ##  ##   ## ####      ##   ## 
####  ##          ####  ## ##  ###  ##    ##    #####   ##     ##  ###  
###   ##          ###   ## #####    ##   ###  ###  ##   ##     #####    
##    ##    ##    ##    ## ##       ##  #### ##    ##   ## ##  ##       
##    ##    ##    ##    ## ##    ## ## ## ## ##  ####   ####   ##    ## 
##    ##          ##    ##  ######   ###  ##  #### ##    ##     ######  
                                          ##                            
                                    ##    ##                            
                                     ######                             

n:negate

Stack

n-n

Description

Invert the sign of n

Examples

#21 n:negate n:put nl
#-21 n:negate n:put nl

Related

n:abs


                                       #     
                                      ##     
            ##                        ##     
##  ###     ##    ##  ###  ##    ##   ####   
## ## ##          ## ## ## ##    ## ####     
####  ##          ####  ## ##    ##   ##     
###   ##          ###   ## ##   ###   ##     
##    ##    ##    ##    ## ##  ####   ## ##  
##    ##    ##    ##   ##  ## ## ##   ####   
##    ##          ######    ###  ##    ##    
                  ##                         
                  ##                         
                  ##                         

n:put

Stack

n-

Description

Display a number

Examples

#12 n:put nl
#-312 n:put nl

Related

c:put s:put


                                    ##       
                                    ##       
            ##                      ##       
##  ###     ##     ######  ##    ## ## ###   
## ## ##          ##    ## ##    ## #### ##  
####  ##           ###     ##    ## ##    ## 
###   ##             ####  ##   ### ##    ## 
##    ##    ##          ## ##  #### ##   ##  
##    ##    ##    ##    ## ## ## ## ## ###   
##    ##           ######   ###  ## ####     

n:sub

Stack

nn-n

Description

Subtract n2 from n1

Examples

(subtract_33_from_45)

#45 #33 n:sub n:put nl

Related

n:add n:mul n:div n:divmod n:mod


                     #                                
                    ##                                
            ##      ##                                
##  ###     ##      ####     #####            ######  
## ## ##          ####      ##   ##          ##    ## 
####  ##            ##     ##    ##  ######   ###     
###   ##            ##     ##    ##             ####  
##    ##    ##      ## ##  ##    ##                ## 
##    ##    ##      ####   ##   ##           ##    ## 
##    ##             ##     #####             ######  

n:to-s

Stack

n-s

Description

Convert number to a temp string

Examples

(convert_numbers_to_temporary_strings)

#124 n:to-s
#-13 n:to-s

Related

c:to-s s:to-n


                                                        #####  
                                                       ##   ## 
            ##                                        ##   ##  
##  ###     ##    ########   #####  ##  ###    #####      ##   
## ## ##               ##   ##   ## ## ## ##  ##   ##    ##    
####  ##              ##   ##  ###  ####  ## ##    ##   ##     
###   ##             ##    #####    ###      ##    ##   ##     
##    ##    ##      ##     ##       ##       ##    ##          
##    ##    ##     ##      ##    ## ##       ##   ##    ##     
##    ##          ########  ######  ##        #####     ##     

n:zero?

Stack

n-f

Description

Compare n to zero. True if zero, false otherwise

Examples

:zero? n:zero? [ 'yes! s:put nl ] if ;
#10 zero?
#0 zero?

Related

n:-zero?


                                                                 #####  
                                                                ##   ## 
            ##                                                 ##   ##  
##  ###     ##             ########   #####  ##  ###    #####      ##   
## ## ##                        ##   ##   ## ## ## ##  ##   ##    ##    
####  ##           ######      ##   ##  ###  ####  ## ##    ##   ##     
###   ##                      ##    #####    ###      ##    ##   ##     
##    ##    ##               ##     ##       ##       ##    ##          
##    ##    ##              ##      ##    ## ##       ##   ##    ##     
##    ##                   ########  ######  ##        #####     ##     

n:-zero?

Stack

n-f

Description

Compare n to zero. True if not zero, false otherwise

Examples

:zero? n:-zero? [ 'no! s:put nl ] if ;
#10 zero?
#0 zero?

Related

n:zero?


                                 ##          
                                 ##          
                                 ##          
##  ###    #####    #####     #####  ######  
## ## ##  ##   ##  ##   ##  ###  ## ##    ## 
####  ## ##  ###  ##  ###  ##    ##  ###     
###   ## #####    #####    ##   ###    ####  
##    ## ##       ##       ##  ####       ## 
##    ## ##    ## ##    ## ## ## ## ##    ## 
##    ##  ######   ######   ###  ##  ######  

needs

Stack

s-

Description

Run any blocks (in order found) with a title starting with s

Examples

'(std-library) needs

Notes

This is the most common way to load a set of blocks. You pass in an identifier (the first word, separated by whitespace, in the title line). Any matching blocks are then located and loaded.

If you are editing a block, `save` it first. The block buffer (`block:buffer`) is reused when loading blocks, so any changes you have made to your current one will be lost if not first saved.

Blocks can not use this to load other blocks.

Related

use using


##  ###    #####  ##    ## 
## ## ##  ##   ## ##    ## 
####  ## ##  ###  ##    ## 
###   ## #####    ## ## ## 
##    ## ##       ## ## ## 
##    ## ##    ## ######## 
##    ##  ######  ##    ## 

new

Stack

-

Description

Erase the contents of the current block

Examples

new


                              #     
                             ##     
                             ##     
##  ###    #####  ##    ##   ####   
## ## ##  ##   ##  ##  ##  ####     
####  ## ##  ###    ####     ##     
###   ## #####       ##      ##     
##    ## ##         ####     ## ##  
##    ## ##    ##  ##  ##    ####   
##    ##  ######  ##    ##    ##    

next

Stack

-

Description

Switch to and load next block

Examples

next

Related

prev set load


            ##             
            ##             
##  ###     ##    ##  ###  
## ## ##    ##    ## ## ## 
####  ##    ##    ####  ## 
###   ##    ##    ###   ## 
##    ##    ##    ##    ## 
##    ##    ##    ##   ##  
##    ##    ##    ######   
                  ##       
                  ##       
                  ##       

nip

Stack

xy-y

Description

Discard second item on stack

Examples

(will_display_3_then_1)
#1 #2 #3 nip n:put sp n:put

Related

drop drop-pair


           ###    
            ##    
            ##    
##  ###     ##    
## ## ##    ##    
####  ##    ##    
###   ##    ##    
##    ##    ##    
##    ##    ##    
##    ##    ##    

nl

Stack

-

Description

Display a newline

Examples

'hello s:put tab 'world s:put nl

Related

sp tab


                     #     
                    ##     
                    ##     
##  ###    #####    ####   
## ## ##  ##   ## ####     
####  ## ##    ##   ##     
###   ## ##    ##   ##     
##    ## ##    ##   ## ##  
##    ## ##   ##    ####   
##    ##  #####      ##    

not

Stack

n-n

Description

Perform a logical NOT operation

Examples

#1 #2 eq? not [ 'no_match s:put nl ] if

Related

and or xor


  #####  ##  ###  
 ##   ## ## ## ## 
##    ## ####  ## 
##    ## ###      
##    ## ##       
##   ##  ##       
 #####   ##       

or

Stack

nn-n

Description

Perform a bitwise OR

Examples

#1 #2 eq? #1 #2 lt? or [ 'a_condition_met s:put nl ] if

Related

and xor not


  #####  ##    ##   #####  ##  ###  
 ##   ## ##    ##  ##   ## ## ## ## 
##    ## ##    ## ##  ###  ####  ## 
##    ##  ##  ##  #####    ###      
##    ##  ## ##   ##       ##       
##   ##    ###    ##    ## ##       
 #####      ##     ######  ##       

over

Stack

nm-nmn

Description

Put a copy of NOS on top of stack

Examples

#2 #3 [ over n:put nl ] times nl

Notes

This is the same as `&dup dip swap` or `push dup pop swap`.

Related

tuck swap


##  ###    #####  ##  ###  
## ## ##  ##   ## ## ## ## 
####  ## ##    ## ####  ## 
###   ## ##    ## ###   ## 
##    ## ##    ## ##    ## 
##   ##  ##   ##  ##   ##  
######    #####   ######   
##                ##       
##                ##       
##                ##       

pop

Stack

-n

Description

Move top value on address stack to data stack

Examples

#33 [ push #3 #4 pop ] call #3 [ n:put tab ] times nl

Related

dip sip push


                             ###                   ##          
                              ##                   ##          
                              ##                   ##          
##  ###  ##  ###    #####     ##    ##    ##    #####   #####  
## ## ## ## ## ##  ##   ##    ##    ##    ##  ###  ##  ##   ## 
####  ## ####  ## ##  ###     ##    ##    ## ##    ## ##  ###  
###   ## ###      #####       ##    ##   ### ##   ### #####    
##    ## ##       ##          ##    ##  #### ##  #### ##       
##   ##  ##       ##    ##    ##    ## ## ## ## ## ## ##    ## 
######   ##        ######     ##     ###  ##  ###  ##  ######  
##                                                             
##                                                             
##                                                             

prelude

Stack

-

Description

Load & run blocks 1 & 2 if they appear to be code. Called by default `startup`.

Examples

prelude

Notes

`prelude` checks blocks 1 & 2 to see if they start with a `(` character. If so, it runs the contents of the blocks as code. This is called by the default `startup`.

Related

startup


##  ###  ##  ###    #####  ##    ## 
## ## ## ## ## ##  ##   ## ##    ## 
####  ## ####  ## ##  ###  ##    ## 
###   ## ###      #####     ##  ##  
##    ## ##       ##        ## ##   
##   ##  ##       ##    ##   ###    
######   ##        ######     ##    
##                                  
##                                  
##                                  

prev

Stack

-

Description

Switch to and load previous block

Examples

prev list

Related

next set load


                                                                              ##             #              
                                                                              ##            ##              
                                                                              ##            ##              
##  ###  ##  ###    #####     ####    #####   ######   ######              #####   #####    ####     #####  
## ## ## ## ## ##  ##   ##   ##  ##  ##   ## ##    ## ##    ##           ###  ##  ##   ## ####      ##   ## 
####  ## ####  ## ##    ##  ##      ##  ###   ###      ###      ######  ##    ##    #####   ##        ##### 
###   ## ###      ##    ## ##       #####       ####     ####           ##   ###  ###  ##   ##      ###  ## 
##    ## ##       ##    ## ##       ##             ##       ##          ##  #### ##    ##   ## ##  ##    ## 
##   ##  ##       ##   ##  ##    ## ##    ## ##    ## ##    ##          ## ## ## ##  ####   ####   ##  #### 
######   ##        #####    ######   ######   ######   ######            ###  ##  #### ##    ##     #### ## 
##                                                                                                          
##                                                                                                          
##                                                                                                          

process-data

Stack

n-?

Description

Internal. If compiling, compile value as a literal into the word. If interpreting, leave on the stack

Examples

(used_internally)


                           ##       
                           ##       
                           ##       
##  ###  ##    ##  ######  ##  ###  
## ## ## ##    ## ##    ## ## ## ## 
####  ## ##    ##  ###     ####  ## 
###   ## ##   ###    ####  ###   ## 
##    ## ##  ####       ## ##    ## 
##   ##  ## ## ## ##    ## ##    ## 
######    ###  ##  ######  ##    ## 
##                                  
##                                  
##                                  

push

Stack

n-

Description

Move TOS to the address stack

Examples

#33 [ push #3 #4 pop ] call #3 [ n:put tab ] times nl

Notes

Use of `push` must be paired with `pop`. You can not reliably use this to obtain return addresses due to the use of direct threaded code sequences and the address interpreter.

Related

dip sip pop


                              #                          #     
                             ##                         ##     
                             ##                         ##     
##  ###    #####   ######    ####     #####  ##  ###    ####   
## ## ##  ##   ## ##    ## ####      ##   ## ## ## ## ####     
####  ## ##  ###   ###       ##        ##### ####  ##   ##     
###      #####       ####    ##      ###  ## ###        ##     
##       ##             ##   ## ##  ##    ## ##         ## ##  
##       ##    ## ##    ##   ####   ##  #### ##         ####   
##        ######   ######     ##     #### ## ##          ##    

restart

Stack

-

Description

Reload the image and empty stacks

Examples

restart


                              ##                                        
##  ###    #####  ###  ##     ##     ######    #####  ##    ##   #####  
## ## ##  ##   ## ## ## ##          ##    ##  ##   ## ##    ##  ##   ## 
####  ## ##    ## ## ## ##           ###        ##### ##    ## ##  ###  
###      ##    ## ## ## ##             ####   ###  ##  ##  ##  #####    
##       ##    ## ##    ##    ##          ## ##    ##  ## ##   ##       
##       ##   ##  ##    ##    ##    ##    ## ##  ####   ###    ##    ## 
##        #####   ##    ##           ######   #### ##    ##     ######  

rom:save

Stack

-

Description

Save the current memory to disk (ilo.rom)

Examples

rom:save

Notes

If your ilo system supports it, this will dump the system memory (but not stacks or registers) to a physical medium for later use. This might be an image file ("ilo.rom"), physical flash media, disk, or whatever the underlying hardware best supports.


                     #     
                    ##     
                    ##     
##  ###    #####    ####   
## ## ##  ##   ## ####     
####  ## ##    ##   ##     
###      ##    ##   ##     
##       ##    ##   ## ##  
##       ##   ##    ####   
##        #####      ##    

rot

Stack

xyz-yzx

Description

Rotate the top three values

Examples

#1 #2 #3 rot n:put tab n:put tab n:put nl

Related

over tuck swap push pop dip sip


##  ###  ##    ## ##  ###  
## ## ## ##    ## ## ## ## 
####  ## ##    ## ####  ## 
###      ##   ### ###   ## 
##       ##  #### ##    ## 
##       ## ## ## ##    ## 
##        ###  ## ##    ## 

run

Stack

-

Description

Run code in the currently loaded block

Examples

run


                                                                     ## 
                                                                     ## 
            ##                                                       ## 
 ######     ##      #####  ##  ###  ##  ###    #####  ##  ###     ##### 
##    ##           ##   ## ## ## ## ## ## ##  ##   ## ## ## ##  ###  ## 
 ###                 ##### ####  ## ####  ## ##  ###  ####  ## ##    ## 
   ####            ###  ## ###   ## ###   ## #####    ###   ## ##   ### 
      ##    ##    ##    ## ##    ## ##    ## ##       ##    ## ##  #### 
##    ##    ##    ##  #### ##   ##  ##   ##  ##    ## ##    ## ## ## ## 
 ######            #### ## ######   ######    ######  ##    ##  ###  ## 
                           ##       ##                                  
                           ##       ##                                  
                           ##       ##                                  

s:append

Stack

ss-s

Description

Append s2 to s1, returning new temporary string

Examples

'hello_ 'world! s:append s:put nl

Related

s:prepend


                  ##                ##                               ## 
                  ##                ##                               ## 
            ##    ##                ##                               ## 
 ######     ##    ## ###     #####  ##  ###    #####    #####     ##### 
##    ##          #### ##   ##   ## ## ## ##  ##   ##  ##   ##  ###  ## 
 ###              ##    ## ##  ###  ####  ## ##  ###     ##### ##    ## 
   ####           ##    ## #####    ###   ## #####     ###  ## ##   ### 
      ##    ##    ##   ##  ##       ##    ## ##       ##    ## ##  #### 
##    ##    ##    ## ###   ##    ## ##    ## ##    ## ##  #### ## ## ## 
 ######           ####      ######  ##    ##  ######   #### ##  ###  ## 

s:behead

Stack

s-s

Description

Remove first item from a string

Examples

'hello_world s:behead s:put nl

Notes

New string is allocated in the temporary pool.

Related

s:chop


                           ##                         
                           ##                         
            ##             ##                         
 ######     ##       ####  ##  ###    #####  ##  ###  
##    ##            ##  ## ## ## ##  ##   ## ## ## ## 
 ###               ##      ####  ## ##    ## ####  ## 
   ####           ##       ###   ## ##    ## ###   ## 
      ##    ##    ##       ##    ## ##    ## ##    ## 
##    ##    ##    ##    ## ##    ## ##   ##  ##   ##  
 ######            ######  ##    ##  #####   ######   
                                             ##       
                                             ##       
                                             ##       

s:chop

Stack

s-s

Description

Remove last item from a string

Examples

'hello_world s:chop s:put nl

Notes

New string is allocated in the temporary pool.

Related

s:behead


                                                #                 ##                        #####  
                                               ##                 ##                       ##   ## 
            ##                                 ##                                         ##   ##  
 ######     ##       ####    #####  ##  ###    ####     #####     ##    ##  ###   ######      ##   
##    ##            ##  ##  ##   ## ## ## ## ####      ##   ##    ##    ## ## ## ##    ##    ##    
 ###               ##      ##    ## ####  ##   ##        #####    ##    ####  ##  ###       ##     
   ####           ##       ##    ## ###   ##   ##      ###  ##    ##    ###   ##    ####    ##     
      ##    ##    ##       ##    ## ##    ##   ## ##  ##    ##    ##    ##    ##       ##          
##    ##    ##    ##    ## ##   ##  ##    ##   ####   ##  ####    ##    ##    ## ##    ##   ##     
 ######            ######   #####   ##    ##    ##     #### ##    ##    ##    ##  ######    ##     

s:contains?

Stack

sc-f

Description

True if string contains c. False otherwise

Examples

'help!_I_lost_a_character. $z s:contains? n:put nl (0)
'help!_I_lost_a_character. $a s:contains? n:put nl (-1)


            ##                                        
 ######     ##       ####    #####  ##  ###  ##    ## 
##    ##            ##  ##  ##   ## ## ## ## ##    ## 
 ###               ##      ##    ## ####  ## ##    ## 
   ####           ##       ##    ## ###   ## ##    ## 
      ##    ##    ##       ##    ## ##    ## ##    ## 
##    ##    ##    ##    ## ##   ##  ##   ##   ##  ##  
 ######            ######   #####   ######     #####  
                                    ##           ##   
                                    ##       ## ##    
                                    ##        ###     

s:copy

Stack

sd-

Description

Copy string s to memory at d

Examples

'Target d:create #100 allot
'hello &Target s:copy


                        ##                   
                        ##                   
            ##          ##                   
 ######     ##       ##### ##    ## ##  ###  
##    ##           ###  ## ##    ## ## ## ## 
 ###              ##    ## ##    ## ####  ## 
   ####           ##   ### ##   ### ###   ## 
      ##    ##    ##  #### ##  #### ##    ## 
##    ##    ##    ## ## ## ## ## ## ##   ##  
 ######            ###  ##  ###  ## ######   
                                    ##       
                                    ##       
                                    ##       

s:dup

Stack

s-s

Description

Make a copy of string

Examples

'Test_string s:dup

Related

s:temp s:keep


                                      #####  
                                     ##   ## 
            ##                      ##   ##  
 ######     ##      #####   ###  ##     ##   
##    ##           ##   ## ## ## ##    ##    
 ###              ##  ###  ##  ####   ##     
   ####           #####    ##   ###   ##     
      ##    ##    ##       ##    ##          
##    ##    ##    ##    ##  ##   ##   ##     
 ######            ######    ######   ##     
                                 ##          
                                 ##          
                                 ##          

s:eq?

Stack

ss-f

Description

Compare two strings for equality

Examples

'hello_world! 'different_string s:eq? n:put nl
'hello_world! 'hello_world s:eq? n:put nl

Related

s:-eq?


                                               #####  
                                              ##   ## 
            ##                               ##   ##  
 ######     ##               #####   ###  ##     ##   
##    ##                    ##   ## ## ## ##    ##    
 ###               ######  ##  ###  ##  ####   ##     
   ####                    #####    ##   ###   ##     
      ##    ##             ##       ##    ##          
##    ##    ##             ##    ##  ##   ##   ##     
 ######                     ######    ######   ##     
                                          ##          
                                          ##          
                                          ##          

s:-eq?

Stack

ss-f

Description

Compare two strings for inequality

Examples

'hello_world! 'different_string s:-eq? n:put nl
'hello_world! 'hello_world s:-eq? n:put nl

Related

s:eq?


                                               ###                         #              
                                                ##                        ##              
            ##                                  ##                        ##              
 ######     ##      #####  ##    ##   #####     ##    ##    ##   #####    ####     #####  
##    ##           ##   ## ##    ##  ##   ##    ##    ##    ##  ##   ## ####      ##   ## 
 ###              ##  ###  ##    ##    #####    ##    ##    ##    #####   ##     ##  ###  
   ####           #####     ##  ##   ###  ##    ##    ##   ###  ###  ##   ##     #####    
      ##    ##    ##        ## ##   ##    ##    ##    ##  #### ##    ##   ## ##  ##       
##    ##    ##    ##    ##   ###    ##  ####    ##    ## ## ## ##  ####   ####   ##    ## 
 ######            ######     ##     #### ##    ##     ###  ##  #### ##    ##     ######  

s:evaluate

Stack

s-?

Description

Interpret each token in a string

Examples

'#100_#200_n:add_n:put_nl s:evaluate

Related

interpret


                     ####              #              ##       
                    ##  ##            ##              ##       
            ##      ##                ##              ##       
 ######     ##      ##       #####    ####      ####  ##  ###  
##    ##            ####    ##   ## ####       ##  ## ## ## ## 
 ###              ####     ##  ###    ##      ##      ####  ## 
   ####             ##     #####      ##     ##       ###   ## 
      ##    ##      ##     ##         ## ##  ##       ##    ## 
##    ##    ##      ##     ##    ##   ####   ##    ## ##    ## 
 ######             ##      ######     ##     ######  ##    ## 

s:fetch

Stack

sn-c

Description

Return character at index n in the string

Examples

'hello_world! #4 s:fetch c:put

Related

s:store s:th


                     ####     ##      ###       #                       
                    ##  ##    ##       ##      ##                       
            ##      ##                 ##      ##                       
 ######     ##      ##        ##       ##      ####     #####  ##  ###  
##    ##            ####      ##       ##    ####      ##   ## ## ## ## 
 ###              ####        ##       ##      ##     ##  ###  ####  ## 
   ####             ##        ##       ##      ##     #####    ###      
      ##    ##      ##        ##       ##      ## ##  ##       ##       
##    ##    ##      ##        ##       ##      ####   ##    ## ##       
 ######             ##        ##       ##       ##     ######  ##       

s:filter

Stack

sp-s

Description

Run p once for each value in s If it returns true, copy value new string

Examples

'HeLlO_WoRlD! [ c:upper? ] s:filter s:put nl


                     ####     ##                         #     
                    ##  ##    ##                        ##     
            ##      ##                                  ##     
 ######     ##      ##        ##    ##  ###   ######    ####   
##    ##            ####      ##    ## ## ## ##    ## ####     
 ###              ####        ##    ####  ##  ###       ##     
   ####             ##        ##    ###         ####    ##     
      ##    ##      ##        ##    ##             ##   ## ##  
##    ##    ##      ##        ##    ##       ##    ##   ####   
 ######             ##        ##    ##        ######     ##    

s:first

Stack

s-c

Description

Return the first character in a string

Examples

'hello_world! s:first c:put nl

Related

s:last


                     ####                                                        ##       
                    ##  ##                                                       ##       
            ##      ##                                                           ##       
 ######     ##      ##       #####  ##  ###             #####    #####     ####  ##  ###  
##    ##            ####    ##   ## ## ## ##           ##   ##  ##   ##   ##  ## ## ## ## 
 ###              ####     ##    ## ####  ##  ######  ##  ###     #####  ##      ####  ## 
   ####             ##     ##    ## ###               #####     ###  ## ##       ###   ## 
      ##    ##      ##     ##    ## ##                ##       ##    ## ##       ##    ## 
##    ##    ##      ##     ##   ##  ##                ##    ## ##  #### ##    ## ##    ## 
 ######             ##      #####   ##                 ######   #### ##  ######  ##    ## 

s:for-each

Stack

sp-

Description

Run p once for each character in s. Pushes each character to the stack before calling p

Examples

:s:put [ c:put ] s:for-each ;


                                       #          ##    ###       ##                      
                                      ##          #      ##       ##                      
            ##                        ##         ##      ##                               
 ######     ##      ######   #####    ####       #       ##       ##    ##  ###    #####  
##    ##           ##   ##  ##   ## ####        ##       ##       ##    ## ## ##  ##   ## 
 ###              ##    ## ##  ###    ##        #        ##       ##    ####  ## ##  ###  
   ####           ##   ### #####      ##       ##        ##       ##    ###   ## #####    
      ##    ##    ##  #### ##         ## ##    #         ##       ##    ##    ## ##       
##    ##    ##    ## ## ## ##    ##   ####    ##         ##       ##    ##    ## ##    ## 
 ######            ###  ##  ######     ##     #          ##       ##    ##    ##  ######  
                        ##                   ##                                           
                  ##    ##                                                                
                   ######                                                                 

s:get/line

Stack

'-s

Description

Read a line of input until enter is encountered. Return input as string

Examples

:input (s-s) s:put sp s:get/line s:temp ;
'Enter_your_name: input

Related

s:get/token


                                       #          ##     #              ##                         
                                      ##          #     ##              ##                         
            ##                        ##         ##     ##              ##                         
 ######     ##      ######   #####    ####       #      ####     #####  ##   ##    #####  ##  ###  
##    ##           ##   ##  ##   ## ####        ##    ####      ##   ## ##  ##    ##   ## ## ## ## 
 ###              ##    ## ##  ###    ##        #       ##     ##    ## ## ##    ##  ###  ####  ## 
   ####           ##   ### #####      ##       ##       ##     ##    ## #####    #####    ###   ## 
      ##    ##    ##  #### ##         ## ##    #        ## ##  ##    ## ### ##   ##       ##    ## 
##    ##    ##    ## ## ## ##    ##   ####    ##        ####   ##   ##  ##   ##  ##    ## ##    ## 
 ######            ###  ##  ######     ##     #          ##     #####   ##    ##  ######  ##    ## 
                        ##                   ##                                                    
                  ##    ##                                                                         
                   ######                                                                          

s:get/token

Stack

-s

Description

Read a string from the keyboard ending when a whitespace is encountered

Examples

:input (s-n) s:put sp s:get/token s:to-n ;
'Enter_your_age: input

Related

s:get/line


                  ##                         ##       
                  ##                         ##       
            ##    ##                         ##       
 ######     ##    ##  ###    #####   ######  ##  ###  
##    ##          ## ## ##  ##   ## ##    ## ## ## ## 
 ###              ####  ##    #####  ###     ####  ## 
   ####           ###   ##  ###  ##    ####  ###   ## 
      ##    ##    ##    ## ##    ##       ## ##    ## 
##    ##    ##    ##    ## ##  #### ##    ## ##    ## 
 ######           ##    ##  #### ##  ######  ##    ## 

s:hash

Stack

s-n

Description

Return the hash of the string

Examples

'hello_world s:hash


                     ##                   ##                        ##           
                     ##                   ##                        #            
            ##                            ##                       ##            
 ######     ##       ##    ##  ###     #####   #####  ##    ##     #       ####  
##    ##             ##    ## ## ##  ###  ##  ##   ##  ##  ##     ##      ##  ## 
 ###                 ##    ####  ## ##    ## ##  ###    ####      #      ##      
   ####              ##    ###   ## ##   ### #####       ##      ##     ##       
      ##    ##       ##    ##    ## ##  #### ##         ####     #      ##       
##    ##    ##       ##    ##    ## ## ## ## ##    ##  ##  ##   ##      ##    ## 
 ######              ##    ##    ##  ###  ##  ######  ##    ##  #        ######  
                                                               ##                

s:index/c

Stack

sc-f

Description

True if string contains c, false otherwise

Examples

'hello_world $e s:index/c n:put nl


                  ##                                  
                  ##                                  
            ##    ##                                  
 ######     ##    ##   ##    #####    #####  ##  ###  
##    ##          ##  ##    ##   ##  ##   ## ## ## ## 
 ###              ## ##    ##  ###  ##  ###  ####  ## 
   ####           #####    #####    #####    ###   ## 
      ##    ##    ### ##   ##       ##       ##    ## 
##    ##    ##    ##   ##  ##    ## ##    ## ##   ##  
 ######           ##    ##  ######   ######  ######   
                                             ##       
                                             ##       
                                             ##       

s:keep

Stack

s-s

Description

Move string to here, allocating space and returning a pointer

Examples

'banana_bread_is_good s:keep

Related

s:temp


                    ###                         #     
                     ##                        ##     
            ##       ##                        ##     
 ######     ##       ##      #####   ######    ####   
##    ##             ##     ##   ## ##    ## ####     
 ###                 ##       #####  ###       ##     
   ####              ##     ###  ##    ####    ##     
      ##    ##       ##    ##    ##       ##   ## ##  
##    ##    ##       ##    ##  #### ##    ##   ####   
 ######              ##     #### ##  ######     ##    

s:last

Stack

s-c

Description

Return the last character in a string

Examples

'hello a:last c:put

Related

s:last


                    ###                ####     #     
                     ##               ##  ##   ##     
            ##       ##               ##       ##     
 ######     ##       ##      #####    ##       ####   
##    ##             ##     ##   ##   ####   ####     
 ###                 ##    ##  ###  ####       ##     
   ####              ##    #####      ##       ##     
      ##    ##       ##    ##         ##       ## ##  
##    ##    ##       ##    ##    ##   ##       ####   
 ######              ##     ######    ##        ##    

s:left

Stack

sn-s

Description

Return left n characters of string

Examples

'banana_bread_is_good #6 s:left

Notes

New string is allocated in the temporary pool.

Related

s:right s:middle


                    ###                                  #     ##       
                     ##                                 ##     ##       
            ##       ##                                 ##     ##       
 ######     ##       ##      #####  ##  ###    ######   ####   ##  ###  
##    ##             ##     ##   ## ## ## ##  ##   ## ####     ## ## ## 
 ###                 ##    ##  ###  ####  ## ##    ##   ##     ####  ## 
   ####              ##    #####    ###   ## ##   ###   ##     ###   ## 
      ##    ##       ##    ##       ##    ## ##  ####   ## ##  ##    ## 
##    ##    ##       ##    ##    ## ##    ## ## ## ##   ####   ##    ## 
 ######              ##     ######  ##    ##  ###  ##    ##    ##    ## 
                                                   ##                   
                                             ##    ##                   
                                              ######                    

s:length

Stack

s-n

Description

Return the length of a string

Examples

'banana_bread_is_good s:length


            ##                               
 ######     ##    ###  ##    #####  ##  ###  
##    ##          ## ## ##  ##   ## ## ## ## 
 ###              ## ## ##    ##### ####  ## 
   ####           ## ## ##  ###  ## ###   ## 
      ##    ##    ##    ## ##    ## ##    ## 
##    ##    ##    ##    ## ##  #### ##   ##  
 ######           ##    ##  #### ## ######   
                                    ##       
                                    ##       
                                    ##       

s:map

Stack

sp-s

Description

Run p once for each value in the string. Takes the returned value and creates a new string

Examples

:make-uppercase [ c:to-upper ] s:map ;
'banana_bread_is_good make-uppercase s:put nl


                              ##          ##       ##   ###             
                              ##          ##       ##    ##             
            ##                            ##       ##    ##             
 ######     ##    ###  ##     ##       #####    #####    ##      #####  
##    ##          ## ## ##    ##     ###  ##  ###  ##    ##     ##   ## 
 ###              ## ## ##    ##    ##    ## ##    ##    ##    ##  ###  
   ####           ## ## ##    ##    ##   ### ##   ###    ##    #####    
      ##    ##    ##    ##    ##    ##  #### ##  ####    ##    ##       
##    ##    ##    ##    ##    ##    ## ## ## ## ## ##    ##    ##    ## 
 ######           ##    ##    ##     ###  ##  ###  ##    ##     ######  

s:middle

Stack

sfl-s

Description

Return substring from f to l, inclusive

Examples

(01234567890123456789)
'banana_bread_is_good
(_______^____________) #7 (starting_point)
(___________^________) #5 (length)
s:middle s:put ("bread")

Related

s:left s:right


                                                                              ## 
                                                                              ## 
            ##                                                                ## 
 ######     ##    ##  ###  ##  ###    #####  ##  ###    #####  ##  ###     ##### 
##    ##          ## ## ## ## ## ##  ##   ## ## ## ##  ##   ## ## ## ##  ###  ## 
 ###              ####  ## ####  ## ##  ###  ####  ## ##  ###  ####  ## ##    ## 
   ####           ###   ## ###      #####    ###   ## #####    ###   ## ##   ### 
      ##    ##    ##    ## ##       ##       ##    ## ##       ##    ## ##  #### 
##    ##    ##    ##   ##  ##       ##    ## ##   ##  ##    ## ##    ## ## ## ## 
 ######           ######   ##        ######  ######    ######  ##    ##  ###  ## 
                  ##                         ##                                  
                  ##                         ##                                  
                  ##                         ##                                  

s:prepend

Stack

ss-s

Description

Create a new string with the contents of s2 followed by s1

Examples

'world! 'hello_ s:prepend s:put nl

Related

s:append


                                       #     
                                      ##     
            ##                        ##     
 ######     ##    ##  ###  ##    ##   ####   
##    ##          ## ## ## ##    ## ####     
 ###              ####  ## ##    ##   ##     
   ####           ###   ## ##   ###   ##     
      ##    ##    ##    ## ##  ####   ## ##  
##    ##    ##    ##   ##  ## ## ##   ####   
 ######           ######    ###  ##    ##    
                  ##                         
                  ##                         
                  ##                         

s:put

Stack

s-

Description

Display a string

Examples

'banana_bread_is_good s:put nl


            ##                                                                   
 ######     ##    ##  ###    #####  ##    ##   #####  ##  ###   ######    #####  
##    ##          ## ## ##  ##   ## ##    ##  ##   ## ## ## ## ##    ##  ##   ## 
 ###              ####  ## ##  ###  ##    ## ##  ###  ####  ##  ###     ##  ###  
   ####           ###      #####     ##  ##  #####    ###         ####  #####    
      ##    ##    ##       ##        ## ##   ##       ##             ## ##       
##    ##    ##    ##       ##    ##   ###    ##    ## ##       ##    ## ##    ## 
 ######           ##        ######     ##     ######  ##        ######   ######  

s:reverse

Stack

s-s

Description

Reverse the order of values in the string. Returns a pointer to the new string

Examples

'banana_bread_is_good s:reverse


                                                         ##       #              
                                                         ##      ##              
            ##                                                   ##              
 ######     ##    ##  ###    #####  ##    ## ##  ###     ##      ####     #####  
##    ##          ## ## ##  ##   ## ##    ## ## ## ##    ##    ####      ##   ## 
 ###              ####  ## ##  ###  ##    ## ####  ##    ##      ##     ##  ###  
   ####           ###      #####    ## ## ## ###         ##      ##     #####    
      ##    ##    ##       ##       ## ## ## ##          ##      ## ##  ##       
##    ##    ##    ##       ##    ## ######## ##          ##      ####   ##    ## 
 ######           ##        ######  ##    ## ##          ##       ##     ######  

s:rewrite

Stack

s-s

Description

Replace underscores in string with spaces

Examples

'abcdef s:rewrite


                              ##             ##          #     
                              ##             ##         ##     
            ##                               ##         ##     
 ######     ##    ##  ###     ##      ###### ##  ###    ####   
##    ##          ## ## ##    ##     ##   ## ## ## ## ####     
 ###              ####  ##    ##    ##    ## ####  ##   ##     
   ####           ###         ##    ##   ### ###   ##   ##     
      ##    ##    ##          ##    ##  #### ##    ##   ## ##  
##    ##    ##    ##          ##    ## ## ## ##    ##   ####   
 ######           ##          ##     ###  ## ##    ##    ##    
                                          ##                   
                                    ##    ##                   
                                     ######                    

s:right

Stack

sn-s

Description

Return right n characters of string

Examples

'banana_bread_is_good #4 s:right

Notes

New string is allocated in the temporary pool.

Related

s:left s:middle


                              #                                
                             ##                                
            ##               ##                                
 ######     ##     ######    ####     #####  ##  ###    #####  
##    ##          ##    ## ####      ##   ## ## ## ##  ##   ## 
 ###               ###       ##     ##    ## ####  ## ##  ###  
   ####              ####    ##     ##    ## ###      #####    
      ##    ##          ##   ## ##  ##    ## ##       ##       
##    ##    ##    ##    ##   ####   ##   ##  ##       ##    ## 
 ######            ######     ##     #####   ##        ######  

s:store

Stack

csn-

Description

Store character into string at index n

Examples

$H 'hello_world [ #0 s:store ] sip s:put nl

Related

s:fetch s:th


                     #                                
                    ##                                
            ##      ##                                
 ######     ##      ####     #####  ###  ##  ##  ###  
##    ##          ####      ##   ## ## ## ## ## ## ## 
 ###                ##     ##  ###  ## ## ## ####  ## 
   ####             ##     #####    ## ## ## ###   ## 
      ##    ##      ## ##  ##       ##    ## ##    ## 
##    ##    ##      ####   ##    ## ##    ## ##   ##  
 ######              ##     ######  ##    ## ######   
                                             ##       
                                             ##       
                                             ##       

s:temp

Stack

s-s

Description

Put a copy of a string in the temporary buffers. Return a pointer to it

Examples

'hello_world s:temp

Related

s:keep


                     #     ##       
                    ##     ##       
            ##      ##     ##       
 ######     ##      ####   ##  ###  
##    ##          ####     ## ## ## 
 ###                ##     ####  ## 
   ####             ##     ###   ## 
      ##    ##      ## ##  ##    ## 
##    ##    ##      ####   ##    ## 
 ######              ##    ##    ## 

s:th

Stack

sn-a

Description

Given a string and index, return the address

Examples

'hello_reader! #6 s:th
(______^________return_address_of_character_at_offset_6)
(0123456789...)

(and_display_it: fetch c:put

Related

s:fetch s:store


                     #                         ###                                        
                    ##                          ##                                        
            ##      ##                          ##                                        
 ######     ##      ####     #####              ##      #####  ##    ##   #####  ##  ###  
##    ##          ####      ##   ##             ##     ##   ## ##    ##  ##   ## ## ## ## 
 ###                ##     ##    ##  ######     ##    ##    ## ##    ## ##  ###  ####  ## 
   ####             ##     ##    ##             ##    ##    ## ## ## ## #####    ###      
      ##    ##      ## ##  ##    ##             ##    ##    ## ## ## ## ##       ##       
##    ##    ##      ####   ##   ##              ##    ##   ##  ######## ##    ## ##       
 ######              ##     #####               ##     #####   ##    ##  ######  ##       

s:to-lower

Stack

s-s

Description

Make all characters in string lowercase

Examples

'Mixed_CASE_To_LowerCase s:to-lower

Related

s:to-upper


                     #                                
                    ##                                
            ##      ##                                
 ######     ##      ####     #####           ##  ###  
##    ##          ####      ##   ##          ## ## ## 
 ###                ##     ##    ##  ######  ####  ## 
   ####             ##     ##    ##          ###   ## 
      ##    ##      ## ##  ##    ##          ##    ## 
##    ##    ##      ####   ##   ##           ##    ## 
 ######              ##     #####            ##    ## 

s:to-n

Stack

s-n

Description

Convert a string to a number

Examples

'341 s:to-n n:inc n:put nl
'-33 s:to-n n:put nl

Notes

Conversion to numbers only supports decimal (base 10) numbers. If negative, the negative sign (-) should be the first character in the string.

Related

n:to-s


                     #                                                                    
                    ##                                                                    
            ##      ##                                                                    
 ######     ##      ####     #####           ##    ## ##  ###  ##  ###    #####  ##  ###  
##    ##          ####      ##   ##          ##    ## ## ## ## ## ## ##  ##   ## ## ## ## 
 ###                ##     ##    ##  ######  ##    ## ####  ## ####  ## ##  ###  ####  ## 
   ####             ##     ##    ##          ##   ### ###   ## ###   ## #####    ###      
      ##    ##      ## ##  ##    ##          ##  #### ##    ## ##    ## ##       ##       
##    ##    ##      ####   ##   ##           ## ## ## ##   ##  ##   ##  ##    ## ##       
 ######              ##     #####             ###  ## ######   ######    ######  ##       
                                                      ##       ##                         
                                                      ##       ##                         
                                                      ##       ##                         

s:to-upper

Stack

s-s

Description

Make all characters in a string uppercase

Examples

'Mixed_CASE_To_uPPerCase s:to-upper

Related

s:to-lower


                     #                 ##             
                    ##                 ##             
            ##      ##                                
 ######     ##      ####   ##  ###     ##    ###  ##  
##    ##          ####     ## ## ##    ##    ## ## ## 
 ###                ##     ####  ##    ##    ## ## ## 
   ####             ##     ###         ##    ## ## ## 
      ##    ##      ## ##  ##          ##    ##    ## 
##    ##    ##      ####   ##          ##    ##    ## 
 ######              ##    ##          ##    ##    ## 

s:trim

Stack

s-s

Description

Trim both leading and trailing whitespace from a string

Examples

'___hello_world_!___ s:trim s:put '| s:put nl

Related

s:trim-right s:trim-left


                     #                 ##                                  ##             ##          #     
                    ##                 ##                                  ##             ##         ##     
            ##      ##                                                                    ##         ##     
 ######     ##      ####   ##  ###     ##    ###  ##           ##  ###     ##      ###### ##  ###    ####   
##    ##          ####     ## ## ##    ##    ## ## ##          ## ## ##    ##     ##   ## ## ## ## ####     
 ###                ##     ####  ##    ##    ## ## ##  ######  ####  ##    ##    ##    ## ####  ##   ##     
   ####             ##     ###         ##    ## ## ##          ###         ##    ##   ### ###   ##   ##     
      ##    ##      ## ##  ##          ##    ##    ##          ##          ##    ##  #### ##    ##   ## ##  
##    ##    ##      ####   ##          ##    ##    ##          ##          ##    ## ## ## ##    ##   ####   
 ######              ##    ##          ##    ##    ##          ##          ##     ###  ## ##    ##    ##    
                                                                                       ##                   
                                                                                 ##    ##                   
                                                                                  ######                    

s:trim-right

Stack

s-s

Description

Trim trailing whitespace from a string

Examples

'___hello_world_!___ s:trim-right s:put '| s:put nl

Related

s:trim s:trim-left


                     #                 ##                        ###                ####     #     
                    ##                 ##                         ##               ##  ##   ##     
            ##      ##                                            ##               ##       ##     
 ######     ##      ####   ##  ###     ##    ###  ##              ##      #####    ##       ####   
##    ##          ####     ## ## ##    ##    ## ## ##             ##     ##   ##   ####   ####     
 ###                ##     ####  ##    ##    ## ## ##  ######     ##    ##  ###  ####       ##     
   ####             ##     ###         ##    ## ## ##             ##    #####      ##       ##     
      ##    ##      ## ##  ##          ##    ##    ##             ##    ##         ##       ## ##  
##    ##    ##      ####   ##          ##    ##    ##             ##    ##    ##   ##       ####   
 ######              ##    ##          ##    ##    ##             ##     ######    ##        ##    

s:trim-left

Stack

s-s

Description

Trim leading whitespace from a string

Examples

'___hello_world_!___ s:trim-left s:put '| s:put nl

Related

s:trim s:trim-right


         ##          ##       ####     #                ###                ####     #     
         ##          ##      ##  ##   ##                 ##               ##  ##   ##     
         ##                  ##       ##                 ##               ##       ##     
 ######  ##  ###     ##      ##       ####               ##      #####    ##       ####   
##    ## ## ## ##    ##      ####   ####                 ##     ##   ##   ####   ####     
 ###     ####  ##    ##    ####       ##      ######     ##    ##  ###  ####       ##     
   ####  ###   ##    ##      ##       ##                 ##    #####      ##       ##     
      ## ##    ##    ##      ##       ## ##              ##    ##         ##       ## ##  
##    ## ##    ##    ##      ##       ####               ##    ##    ##   ##       ####   
 ######  ##    ##    ##      ##        ##                ##     ######    ##        ##    

shift-left

Stack

nn-n

Description

Shift n1 left by n2 bits

Examples

#1793 #8 shift-left n:put


         ##          ##       ####     #                          ##             ##          #     
         ##          ##      ##  ##   ##                          ##             ##         ##     
         ##                  ##       ##                                         ##         ##     
 ######  ##  ###     ##      ##       ####            ##  ###     ##      ###### ##  ###    ####   
##    ## ## ## ##    ##      ####   ####              ## ## ##    ##     ##   ## ## ## ## ####     
 ###     ####  ##    ##    ####       ##      ######  ####  ##    ##    ##    ## ####  ##   ##     
   ####  ###   ##    ##      ##       ##              ###         ##    ##   ### ###   ##   ##     
      ## ##    ##    ##      ##       ## ##           ##          ##    ##  #### ##    ##   ## ##  
##    ## ##    ##    ##      ##       ####            ##          ##    ## ## ## ##    ##   ####   
 ######  ##    ##    ##      ##        ##             ##          ##     ###  ## ##    ##    ##    
                                                                              ##                   
                                                                        ##    ##                   
                                                                         ######                    

shift-right

Stack

nn-n

Description

Shift n1 right by n2 bits

Examples

#1793 #8 shift-right n:put


                                                          ##   
            ##                ##      ###                ##    
            ##                ##       ##               ##     
                                       ##       ##      ##     
 ######     ##      ######    ##       ##       ##     ##      
##    ##    ##     ##   ##    ##       ##              ##      
 ###        ##    ##    ##    ##       ##              ##      
   ####     ##    ##   ###    ##       ##              ##      
      ##    ##    ##  ####    ##       ##       ##      ##     
##    ##    ##    ## ## ##    ##       ##       ##      ##     
 ######     ##     ###  ##    ##       ##                ##    
                        ##                                ##   
                  ##    ##                                     
                   ######                                      

sigil:(

Stack

-

Description

Sigil. Token is a comment

Examples

(comments_are_ignored)


            ##                ##      ###               ##  ## 
            ##                ##       ##               ##  ## 
                                       ##       ##    ######## 
 ######     ##      ######    ##       ##       ##     ##  ##  
##    ##    ##     ##   ##    ##       ##              ##  ##  
 ###        ##    ##    ##    ##       ##              ##  ##  
   ####     ##    ##   ###    ##       ##              ##  ##  
      ##    ##    ##  ####    ##       ##       ##    ######## 
##    ##    ##    ## ## ##    ##       ##       ##    ##  ##   
 ######     ##     ###  ##    ##       ##             ##  ##   
                        ##                                     
                  ##    ##                                     
                   ######                                      

sigil:#

Stack

s-n

Description

Sigil. Token is a number

Examples

#-190 n:put
#100 #200 n:add n:put


            ##                ##      ###                ###   
            ##                ##       ##               ## ##  
                                       ##       ##     ##  ##  
 ######     ##      ######    ##       ##       ##      ####   
##    ##    ##     ##   ##    ##       ##               ###    
 ###        ##    ##    ##    ##       ##              ## ##   
   ####     ##    ##   ###    ##       ##             ##   ### 
      ##    ##    ##  ####    ##       ##       ##    ##   ##  
##    ##    ##    ## ## ##    ##       ##       ##     ## ###  
 ######     ##     ###  ##    ##       ##               ### ## 
                        ##                                     
                  ##    ##                                     
                   ######                                      

sigil:&

Stack

s-a

Description

Sigil. Token is a named pointer

Examples

&bye call


            ##                ##      ###                 ##   
            ##                ##       ##                ##    
                                       ##       ##      ##     
 ######     ##      ######    ##       ##       ##             
##    ##    ##     ##   ##    ##       ##                      
 ###        ##    ##    ##    ##       ##                      
   ####     ##    ##   ###    ##       ##                      
      ##    ##    ##  ####    ##       ##       ##             
##    ##    ##    ## ## ##    ##       ##       ##             
 ######     ##     ###  ##    ##       ##                      
                        ##                                     
                  ##    ##                                     
                   ######                                      

sigil:'

Stack

s-s

Description

Sigil. Token is a string.

Examples

'hello!
'underscores_are_replaced_with_spaces!


            ##                ##      ###                      
            ##                ##       ##                      
                                       ##       ##       ##    
 ######     ##      ######    ##       ##       ##       ##    
##    ##    ##     ##   ##    ##       ##                      
 ###        ##    ##    ##    ##       ##                      
   ####     ##    ##   ###    ##       ##                      
      ##    ##    ##  ####    ##       ##       ##       ##    
##    ##    ##    ## ## ##    ##       ##       ##       ##    
 ######     ##     ###  ##    ##       ##                      
                        ##                                     
                  ##    ##                                     
                   ######                                      

sigil::

Stack

s-

Description

Sigil. Token is name of a new word to define

Examples

:test (s-) s:put nl ;

Related

Compiler compiling? d:create ;


                                                         ##    
            ##                ##      ###              ######  
            ##                ##       ##             ## ## ## 
                                       ##       ##    ## ##    
 ######     ##      ######    ##       ##       ##     ####    
##    ##    ##     ##   ##    ##       ##                ###   
 ###        ##    ##    ##    ##       ##                ####  
   ####     ##    ##   ###    ##       ##                ## ## 
      ##    ##    ##  ####    ##       ##       ##    ## ## ## 
##    ##    ##    ## ## ##    ##       ##       ##    ## ## ## 
 ######     ##     ###  ##    ##       ##              ######  
                        ##                               ##    
                  ##    ##                                     
                   ######                                      

sigil:$

Stack

s-c

Description

Sigil. Return first character of token

Examples

$9 c:put


            ##                ##      ###                                  #     
            ##                ##       ##                                 ##     
                                       ##       ##                        ##     
 ######     ##      ######    ##       ##       ##      ######   #####    ####   
##    ##    ##     ##   ##    ##       ##              ##   ##  ##   ## ####     
 ###        ##    ##    ##    ##       ##             ##    ## ##  ###    ##     
   ####     ##    ##   ###    ##       ##             ##   ### #####      ##     
      ##    ##    ##  ####    ##       ##       ##    ##  #### ##         ## ##  
##    ##    ##    ## ## ##    ##       ##       ##    ## ## ## ##    ##   ####   
 ######     ##     ###  ##    ##       ##              ###  ##  ######     ##    
                        ##                                  ##                   
                  ##    ##                            ##    ##                   
                   ######                              ######                    

sigil:get

Stack

c-p

Description

Return the address of a sigil handler for character c

Examples

$@ sigil:get n:put (address_of_sigil:@)


            ##                ##      ###                                  #     
            ##                ##       ##                                 ##     
                                       ##       ##                        ##     
 ######     ##      ######    ##       ##       ##     ######    #####    ####   
##    ##    ##     ##   ##    ##       ##             ##    ##  ##   ## ####     
 ###        ##    ##    ##    ##       ##              ###     ##  ###    ##     
   ####     ##    ##   ###    ##       ##                ####  #####      ##     
      ##    ##    ##  ####    ##       ##       ##          ## ##         ## ##  
##    ##    ##    ## ## ##    ##       ##       ##    ##    ## ##    ##   ####   
 ######     ##     ###  ##    ##       ##              ######   ######     ##    
                        ##                                                       
                  ##    ##                                                       
                   ######                                                        

sigil:set

Stack

pc-

Description

Assign word at address to the sigil handler for character c

Examples

:sigil:. s:rewrite compiling?
  [ s:keep &s:put compile:call ] [ s:put ] choose  ;

&sigil:. $. sigil:set
.Hello_World!


            ##                ##      ###                ####  
            ##                ##       ##               ##  ## 
                                       ##       ##     ## #### 
 ######     ##      ######    ##       ##       ##    ## ## ## 
##    ##    ##     ##   ##    ##       ##             ## ## ## 
 ###        ##    ##    ##    ##       ##             ## ## ## 
   ####     ##    ##   ###    ##       ##             ## ####  
      ##    ##    ##  ####    ##       ##       ##    ## ##    
##    ##    ##    ## ## ##    ##       ##       ##    ##   ##  
 ######     ##     ###  ##    ##       ##             ## ###   
                        ##                             ###     
                  ##    ##                                     
                   ######                                      

sigil:@

Stack

s-n

Description

Sigil. Use to fetch value from a named variable

Examples

@Free n:put


            ##                ##      ###                ##    
            ##                ##       ##                ##    
                                       ##       ##       ##    
 ######     ##      ######    ##       ##       ##       ##    
##    ##    ##     ##   ##    ##       ##                ##    
 ###        ##    ##    ##    ##       ##                ##    
   ####     ##    ##   ###    ##       ##                ##    
      ##    ##    ##  ####    ##       ##       ##             
##    ##    ##    ## ## ##    ##       ##       ##       ##    
 ######     ##     ###  ##    ##       ##                ##    
                        ##                                     
                  ##    ##                                     
                   ######                                      

sigil:!

Stack

ns-

Description

Sigil. Use to store value into a named variable

Examples

'Data var

#456 !Data


            ##                ##      ###             ##       
            ##                ##       ##              #       
                                       ##       ##     ##      
 ######     ##      ######    ##       ##       ##      #      
##    ##    ##     ##   ##    ##       ##               ##     
 ###        ##    ##    ##    ##       ##                #     
   ####     ##    ##   ###    ##       ##                ##    
      ##    ##    ##  ####    ##       ##       ##        #    
##    ##    ##    ## ## ##    ##       ##       ##        ##   
 ######     ##     ###  ##    ##       ##                  #   
                        ##                                 ##  
                  ##    ##                                     
                   ######                                      

sigil:\

Stack

as-

Description

Sigil. Bind name s to function a

Examples

[ 'hello! s:put nl ] \hello

Notes

If making an alias to another word this is preferable to wrapping the word in a colon definition. Use of the `\` sigil will result in only a header being created, with no additional wrapper code.


            ##             
            ##             
 ######     ##    ##  ###  
##    ##    ##    ## ## ## 
 ###        ##    ####  ## 
   ####     ##    ###   ## 
      ##    ##    ##    ## 
##    ##    ##    ##   ##  
 ######     ##    ######   
                  ##       
                  ##       
                  ##       

sip

Stack

np-n

Description

Push a copy of n to address then call p. Afterwards, restore to the data stack

Examples

#100 [ n:put nl ] sip n:put nl

Notes

This is the same as doing:

dup push ... pop

In general use of `sip` is preferable as it ensures the stack stays balanced. You may wish to use the above form if the logic leading up to the duplicated value would be clearer, or if you need to save some space (the dup/push/pop form saves three cells over using a quotation and sip).

Related

dip dup push pop


 ######    #####  ##    ##   #####  
##    ##  ##   ## ##    ##  ##   ## 
 ###        ##### ##    ## ##  ###  
   ####   ###  ##  ##  ##  #####    
      ## ##    ##  ## ##   ##       
##    ## ##  ####   ###    ##    ## 
 ######   #### ##    ##     ######  

save

Stack

-

Description

Save the current block

Examples

save

Notes

Writes `block:buffer` to block (number taken from `Block`)

Related

set load block:load block:save block:buffer


                     #     
                    ##     
                    ##     
 ######    #####    ####   
##    ##  ##   ## ####     
 ###     ##  ###    ##     
   ####  #####      ##     
      ## ##         ## ##  
##    ## ##    ##   ####   
 ######   ######     ##    

set

Stack

n-

Description

Set Block to n. Does not load or save the block

Examples

#45 set load list

Notes

Assigns `Block` to the provided number.


 ######  ##  ###  
##    ## ## ## ## 
 ###     ####  ## 
   ####  ###   ## 
      ## ##    ## 
##    ## ##   ##  
 ######  ######   
         ##       
         ##       
         ##       

sp

Stack

-

Description

Display a space

Examples

'hello s:put sp 'world s:put nl

:spaces (n-) &sp times ;

Related

nl tab


            #                          #                       
           ##                         ##                       
           ##                         ##                       
 ######    ####     #####  ##  ###    ####   ##    ## ##  ###  
##    ## ####      ##   ## ## ## ## ####     ##    ## ## ## ## 
 ###       ##        ##### ####  ##   ##     ##    ## ####  ## 
   ####    ##      ###  ## ###        ##     ##   ### ###   ## 
      ##   ## ##  ##    ## ##         ## ##  ##  #### ##    ## 
##    ##   ####   ##  #### ##         ####   ## ## ## ##   ##  
 ######     ##     #### ## ##          ##     ###  ## ######   
                                                      ##       
                                                      ##       
                                                      ##       

startup

Stack

-

Description

Called on startup to prepare the system. You can replace this to have ilo start your application

Examples

startup

Notes

RetroForth/ilo searches for this word when starting. If found, it is then run. If redefined, only the most recently created `startup` word will be run.

Related

prelude


            #                                
           ##                                
           ##                                
 ######    ####     #####  ##  ###    #####  
##    ## ####      ##   ## ## ## ##  ##   ## 
 ###       ##     ##    ## ####  ## ##  ###  
   ####    ##     ##    ## ###      #####    
      ##   ## ##  ##    ## ##       ##       
##    ##   ####   ##   ##  ##       ##    ## 
 ######     ##     #####   ##        ######  

store

Stack

na-

Description

Store n into address a

Examples

'data var

#102 &data store

Related

store-next


            #                                                                       #     
           ##                                                                      ##     
           ##                                                                      ##     
 ######    ####     #####  ##  ###    #####           ##  ###    #####  ##    ##   ####   
##    ## ####      ##   ## ## ## ##  ##   ##          ## ## ##  ##   ##  ##  ##  ####     
 ###       ##     ##    ## ####  ## ##  ###   ######  ####  ## ##  ###    ####     ##     
   ####    ##     ##    ## ###      #####             ###   ## #####       ##      ##     
      ##   ## ##  ##    ## ##       ##                ##    ## ##         ####     ## ##  
##    ##   ####   ##   ##  ##       ##    ##          ##    ## ##    ##  ##  ##    ####   
 ######     ##     #####   ##        ######           ##    ##  ######  ##    ##    ##    

store-next

Stack

na-a

Description

Store n int address a, return address a + 1

Examples

'data d:create #4 allot

#102 #103 #104 #3 &data n:inc store-next store-next store
&data [ n:put sp ] a:for-each nl

Related

store


 ######  ##    ##   #####  ##  ###  
##    ## ##    ##  ##   ## ## ## ## 
 ###     ##    ##    ##### ####  ## 
   ####  ## ## ##  ###  ## ###   ## 
      ## ## ## ## ##    ## ##    ## 
##    ## ######## ##  #### ##   ##  
 ######  ##    ##  #### ## ######   
                           ##       
                           ##       
                           ##       

swap

Stack

xy-yx

Description

Exchange the top two stack items

Examples

#1 #2 n:put tab n:put nl
#1 #2 swap n:put tab n:put nl

Related

over tuck rot push pop dip sip


                                    ##                   ####     ####                                  ##  ##         ###                      ##       
                                    ##                  ##  ##   ##  ##                                 #   ##          ##                      ##       
                              ##    ##                  ##       ##                                    ##   ##          ##                      ##       
 ######  ##    ##  ######     ##    ## ###   ##    ##   ##       ##       #####  ##  ###   ######      #    ## ###      ##      #####     ####  ##   ##  
##    ## ##    ## ##    ##          #### ##  ##    ##   ####     ####    ##   ## ## ## ## ##    ##    ##    #### ##     ##     ##   ##   ##  ## ##  ##   
 ###     ##    ##  ###              ##    ## ##    ## ####     ####     ##  ###  ####  ##  ###        #     ##    ##    ##    ##    ##  ##      ## ##    
   ####  ##    ##    ####           ##    ## ##   ###   ##       ##     #####    ###         ####    ##     ##    ##    ##    ##    ## ##       #####    
      ## ##    ##       ##    ##    ##   ##  ##  ####   ##       ##     ##       ##             ##   #      ##   ##     ##    ##    ## ##       ### ##   
##    ##  ##  ##  ##    ##    ##    ## ###   ## ## ##   ##       ##     ##    ## ##       ##    ##  ##      ## ###      ##    ##   ##  ##    ## ##   ##  
 ######    #####   ######           ####      ###  ##   ##       ##      ######  ##        ######   #       ####        ##     #####    ######  ##    ## 
             ##                                                                                    ##                                                    
         ## ##                                                                                                                                           
          ###                                                                                                                                            

sys:buffers/block

Stack

-

Description

Data. Points to the start of the block buffer.

Examples



                                    ##                   ####     ####                                  ##    ###                                        
                                    ##                  ##  ##   ##  ##                                 #      ##                                        
                              ##    ##                  ##       ##                                    ##      ##                                        
 ######  ##    ##  ######     ##    ## ###   ##    ##   ##       ##       #####  ##  ###   ######      #       ##      #####    #####  ##  ###   ######  
##    ## ##    ## ##    ##          #### ##  ##    ##   ####     ####    ##   ## ## ## ## ##    ##    ##       ##     ##   ##  ##   ## ## ## ## ##    ## 
 ###     ##    ##  ###              ##    ## ##    ## ####     ####     ##  ###  ####  ##  ###        #        ##    ##    ## ##    ## ####  ##  ###     
   ####  ##    ##    ####           ##    ## ##   ###   ##       ##     #####    ###         ####    ##        ##    ##    ## ##    ## ###   ##    ####  
      ## ##    ##       ##    ##    ##   ##  ##  ####   ##       ##     ##       ##             ##   #         ##    ##    ## ##    ## ##    ##       ## 
##    ##  ##  ##  ##    ##    ##    ## ###   ## ## ##   ##       ##     ##    ## ##       ##    ##  ##         ##    ##   ##  ##   ##  ##   ##  ##    ## 
 ######    #####   ######           ####      ###  ##   ##       ##      ######  ##        ######   #          ##     #####    #####   ######    ######  
             ##                                                                                    ##                                  ##                
         ## ##                                                                                                                         ##                
          ###                                                                                                                          ##                

sys:buffers/loops

Stack

-

Description

Data. Holds loop indices.

Examples



                                    ##                   ####     ####                                  ##                                                  ##                                                                                        ##                      
                                    ##                  ##  ##   ##  ##                                 #                                                   ##                                                                                        ##                      
                              ##    ##                  ##       ##                                    ##                                                                                                                                                                     
 ######  ##    ##  ######     ##    ## ###   ##    ##   ##       ##       #####  ##  ###   ######      #    ##  ###  ##    ## ###  ##    #####  ##  ###     ##       ####              ####    #####  ##  ###  ##    ##   #####  ##  ###   ######     ##      #####  ##  ###  
##    ## ##    ## ##    ##          #### ##  ##    ##   ####     ####    ##   ## ## ## ## ##    ##    ##    ## ## ## ##    ## ## ## ##  ##   ## ## ## ##    ##      ##  ##            ##  ##  ##   ## ## ## ## ##    ##  ##   ## ## ## ## ##    ##    ##     ##   ## ## ## ## 
 ###     ##    ##  ###              ##    ## ##    ## ####     ####     ##  ###  ####  ##  ###        #     ####  ## ##    ## ## ## ## ##  ###  ####  ##    ##     ##       ######   ##      ##    ## ####  ## ##    ## ##  ###  ####  ##  ###        ##    ##    ## ####  ## 
   ####  ##    ##    ####           ##    ## ##   ###   ##       ##     #####    ###         ####    ##     ###   ## ##   ### ## ## ## #####    ###         ##    ##                ##       ##    ## ###   ##  ##  ##  #####    ###         ####     ##    ##    ## ###   ## 
      ## ##    ##       ##    ##    ##   ##  ##  ####   ##       ##     ##       ##             ##   #      ##    ## ##  #### ##    ## ##       ##          ##    ##                ##       ##    ## ##    ##  ## ##   ##       ##             ##    ##    ##    ## ##    ## 
##    ##  ##  ##  ##    ##    ##    ## ###   ## ## ##   ##       ##     ##    ## ##       ##    ##  ##      ##    ## ## ## ## ##    ## ##    ## ##          ##    ##    ##          ##    ## ##   ##  ##    ##   ###    ##    ## ##       ##    ##    ##    ##   ##  ##    ## 
 ######    #####   ######           ####      ###  ##   ##       ##      ######  ##        ######   #       ##    ##  ###  ## ##    ##  ######  ##          ##     ######            ######   #####   ##    ##    ##     ######  ##        ######     ##     #####   ##    ## 
             ##                                                                                    ##                                                                                                                                                                         
         ## ##                                                                                                                                                                                                                                                                
          ###                                                                                                                                                                                                                                                                 

sys:buffers/numeric-conversion

Stack

-

Description

Data. Used by s:to-n.

Examples



                                    ##                   ####     ####                                  ##                                               
                                    ##                  ##  ##   ##  ##                                 #                                                
                              ##    ##                  ##       ##                                    ##                                                
 ######  ##    ##  ######     ##    ## ###   ##    ##   ##       ##       #####  ##  ###   ######      #     ######     ####    #####  ##  ###    #####  
##    ## ##    ## ##    ##          #### ##  ##    ##   ####     ####    ##   ## ## ## ## ##    ##    ##    ##    ##   ##  ##  ##   ## ## ## ##  ##   ## 
 ###     ##    ##  ###              ##    ## ##    ## ####     ####     ##  ###  ####  ##  ###        #      ###      ##      ##    ## ####  ## ##  ###  
   ####  ##    ##    ####           ##    ## ##   ###   ##       ##     #####    ###         ####    ##        ####  ##       ##    ## ###   ## #####    
      ## ##    ##       ##    ##    ##   ##  ##  ####   ##       ##     ##       ##             ##   #            ## ##       ##    ## ##    ## ##       
##    ##  ##  ##  ##    ##    ##    ## ###   ## ## ##   ##       ##     ##    ## ##       ##    ##  ##      ##    ## ##    ## ##   ##  ##   ##  ##    ## 
 ######    #####   ######           ####      ###  ##   ##       ##      ######  ##        ######   #        ######   ######   #####   ######    ######  
             ##                                                                                    ##                                  ##                
         ## ##                                                                                                                         ##                
          ###                                                                                                                          ##                

sys:buffers/scope

Stack

-

Description

Data. Holds dictionary pointers for {{ ---reveal--- }}

Examples



                                    ##                   ####     ####                                  ##                                   ##          
                                    ##                  ##  ##   ##  ##                                 #                                    ##          
                              ##    ##                  ##       ##                                    ##                                    ##          
 ######  ##    ##  ######     ##    ## ###   ##    ##   ##       ##       #####  ##  ###   ######      #    ##  ###    #####    #####     #####  ######  
##    ## ##    ## ##    ##          #### ##  ##    ##   ####     ####    ##   ## ## ## ## ##    ##    ##    ## ## ##  ##   ##  ##   ##  ###  ## ##    ## 
 ###     ##    ##  ###              ##    ## ##    ## ####     ####     ##  ###  ####  ##  ###        #     ####  ## ##  ###  ##  ###  ##    ##  ###     
   ####  ##    ##    ####           ##    ## ##   ###   ##       ##     #####    ###         ####    ##     ###   ## #####    #####    ##   ###    ####  
      ## ##    ##       ##    ##    ##   ##  ##  ####   ##       ##     ##       ##             ##   #      ##    ## ##       ##       ##  ####       ## 
##    ##  ##  ##  ##    ##    ##    ## ###   ## ## ##   ##       ##     ##    ## ##       ##    ##  ##      ##    ## ##    ## ##    ## ## ## ## ##    ## 
 ######    #####   ######           ####      ###  ##   ##       ##      ######  ##        ######   #       ##    ##  ######   ######   ###  ##  ######  
             ##                                                                                    ##                                                    
         ## ##                                                                                                                                           
          ###                                                                                                                                            

sys:buffers/needs

Stack

-

Description

Data. Used by needs

Examples



                                    ##                   ####     ####                                  ##                                                                       ## 
                                    ##                  ##  ##   ##  ##                                 #                                                                        ## 
                              ##    ##                  ##       ##                                    ##                                                                        ## 
 ######  ##    ##  ######     ##    ## ###   ##    ##   ##       ##       #####  ##  ###   ######      #    ##  ###    #####   ######    #####  ##  ###  ##    ##   #####     ##### 
##    ## ##    ## ##    ##          #### ##  ##    ##   ####     ####    ##   ## ## ## ## ##    ##    ##    ## ## ##  ##   ## ##    ##  ##   ## ## ## ## ##    ##  ##   ##  ###  ## 
 ###     ##    ##  ###              ##    ## ##    ## ####     ####     ##  ###  ####  ##  ###        #     ####  ## ##  ###   ###     ##  ###  ####  ## ##    ## ##  ###  ##    ## 
   ####  ##    ##    ####           ##    ## ##   ###   ##       ##     #####    ###         ####    ##     ###      #####       ####  #####    ###       ##  ##  #####    ##   ### 
      ## ##    ##       ##    ##    ##   ##  ##  ####   ##       ##     ##       ##             ##   #      ##       ##             ## ##       ##        ## ##   ##       ##  #### 
##    ##  ##  ##  ##    ##    ##    ## ###   ## ## ##   ##       ##     ##    ## ##       ##    ##  ##      ##       ##    ## ##    ## ##    ## ##         ###    ##    ## ## ## ## 
 ######    #####   ######           ####      ###  ##   ##       ##      ######  ##        ######   #       ##        ######   ######   ######  ##          ##     ######   ###  ## 
             ##                                                                                    ##                                                                               
         ## ##                                                                                                                                                                      
          ###                                                                                                                                                                       

sys:buffers/reserved

Stack

-

Description

Data. Reserved for future use.

Examples



                                    ##                   ####     ####                                  ##              #                 ##                                                                                              
                                    ##                  ##  ##   ##  ##                                 #              ##                 ##                                                                                              
                              ##    ##                  ##       ##                                    ##              ##                                                                                                                 
 ######  ##    ##  ######     ##    ## ###   ##    ##   ##       ##       #####  ##  ###   ######      #     ######    ####   ##  ###     ##    ##  ###    ######  ######     ##      #####  ##  ###  ##  ###    #####  ##    ##  ######  
##    ## ##    ## ##    ##          #### ##  ##    ##   ####     ####    ##   ## ## ## ## ##    ##    ##    ##    ## ####     ## ## ##    ##    ## ## ##  ##   ## ##    ##    ##     ##   ## ## ## ## ## ## ##  ##   ## ##    ## ##    ## 
 ###     ##    ##  ###              ##    ## ##    ## ####     ####     ##  ###  ####  ##  ###        #      ###       ##     ####  ##    ##    ####  ## ##    ##  ###      ######     ##### ####  ## ####  ##    ##### ##    ##  ###     
   ####  ##    ##    ####           ##    ## ##   ###   ##       ##     #####    ###         ####    ##        ####    ##     ###         ##    ###   ## ##   ###    ####     ##     ###  ## ###      ###       ###  ## ##    ##    ####  
      ## ##    ##       ##    ##    ##   ##  ##  ####   ##       ##     ##       ##             ##   #            ##   ## ##  ##          ##    ##    ## ##  ####       ##    ##    ##    ## ##       ##       ##    ## ##    ##       ## 
##    ##  ##  ##  ##    ##    ##    ## ###   ## ## ##   ##       ##     ##    ## ##       ##    ##  ##      ##    ##   ####   ##          ##    ##    ## ## ## ## ##    ##          ##  #### ##       ##       ##  ####  ##  ##  ##    ## 
 ######    #####   ######           ####      ###  ##   ##       ##      ######  ##        ######   #        ######     ##    ##          ##    ##    ##  ###  ##  ######            #### ## ##       ##        #### ##   #####   ######  
             ##                                                                                    ##                                                          ##                                                           ##            
         ## ##                                                                                                                                           ##    ##                                                       ## ##             
          ###                                                                                                                                             ######                                                         ###              

sys:buffers/strings+arrays

Stack

-

Description

Data. Start of the temporary string & array pool.

Examples



                                    ##                   ####     ####                                  ##     ##                                  #     
                                    ##                  ##  ##   ##  ##                                 #      ##                                 ##     
                              ##    ##                  ##       ##                                    ##                                         ##     
 ######  ##    ##  ######     ##    ## ###   ##    ##   ##       ##       #####  ##  ###   ######      #       ##    ##  ###  ##  ###  ##    ##   ####   
##    ## ##    ## ##    ##          #### ##  ##    ##   ####     ####    ##   ## ## ## ## ##    ##    ##       ##    ## ## ## ## ## ## ##    ## ####     
 ###     ##    ##  ###              ##    ## ##    ## ####     ####     ##  ###  ####  ##  ###        #        ##    ####  ## ####  ## ##    ##   ##     
   ####  ##    ##    ####           ##    ## ##   ###   ##       ##     #####    ###         ####    ##        ##    ###   ## ###   ## ##   ###   ##     
      ## ##    ##       ##    ##    ##   ##  ##  ####   ##       ##     ##       ##             ##   #         ##    ##    ## ##    ## ##  ####   ## ##  
##    ##  ##  ##  ##    ##    ##    ## ###   ## ## ##   ##       ##     ##    ## ##       ##    ##  ##         ##    ##    ## ##   ##  ## ## ##   ####   
 ######    #####   ######           ####      ###  ##   ##       ##      ######  ##        ######   #          ##    ##    ## ######    ###  ##    ##    
             ##                                                                                    ##                         ##                         
         ## ##                                                                                                                ##                         
          ###                                                                                                                 ##                         

sys:buffers/input

Stack

-

Description

Data. Holds the current input token.

Examples



                                       ##                ####           
                                       ##               ##  ##          
                              ##                        ##              
 ######  ##    ##  ######     ##       ##    ##  ###    ##       #####  
##    ## ##    ## ##    ##             ##    ## ## ##   ####    ##   ## 
 ###     ##    ##  ###                 ##    ####  ## ####     ##    ## 
   ####  ##    ##    ####              ##    ###   ##   ##     ##    ## 
      ## ##    ##       ##    ##       ##    ##    ##   ##     ##    ## 
##    ##  ##  ##  ##    ##    ##       ##    ##    ##   ##     ##   ##  
 ######    #####   ######              ##    ##    ##   ##      #####   
             ##                                                         
         ## ##                                                          
          ###                                                           

sys:info

Stack

-

Description

Display system information

Examples

sys:info

Notes

The default `list` word for displaying the blocks looks up and runs this word to display the status line below the block. You can define a new status display word with the same name to override the default.

Related

list list* list# e:Display


   #              ##       
  ##              ##       
  ##              ##       
  ####     #####  ## ###   
####      ##   ## #### ##  
  ##        ##### ##    ## 
  ##      ###  ## ##    ## 
  ## ##  ##    ## ##   ##  
  ####   ##  #### ## ###   
   ##     #### ## ####     

tab

Stack

-

Description

Display a tab

Examples

'hello s:put tab 'world s:put nl

Related

sp nl


   #        ##                               
  ##        ##                               
  ##                                         
  ####      ##    ###  ##    #####   ######  
####        ##    ## ## ##  ##   ## ##    ## 
  ##        ##    ## ## ## ##  ###   ###     
  ##        ##    ## ## ## #####       ####  
  ## ##     ##    ##    ## ##             ## 
  ####      ##    ##    ## ##    ## ##    ## 
   ##       ##    ##    ##  ######   ######  

times

Stack

np-

Description

For n iterations, execute p

Examples

#10 [ $. c:put ] times nl

Related

I J K forever indexed-times while until


   #        ##       #       ###                      
  ##        ##      ##        ##                      
  ##                ##        ##                      
  ####      ##      ####      ##      #####   ######  
####        ##    ####        ##     ##   ## ##    ## 
  ##        ##      ##        ##    ##  ###   ###     
  ##        ##      ##        ##    #####       ####  
  ## ##     ##      ## ##     ##    ##             ## 
  ####      ##      ####      ##    ##    ## ##    ## 
   ##       ##       ##       ##     ######   ######  

titles

Stack

-

Description

Display the block title lines. The output is paginated every 16 lines

Examples

titles

Notes

The titles listing adds a break after each 16 titles. Blocks must have a non-space character as the first character in the title line (the first line) to be included in the listing.


   #                 ##    
  ##                 ##    
  ##                       
  ####   ##  ###     ##    
####     ## ## ##    ##    
  ##     ####  ##    ##    
  ##     ###         ##    
  ## ##  ##          ##    
  ####   ##          ##    
   ##    ##          ##    

tri

Stack

xppp-?

Description

Apply p1 against x, then p2 against a copy of x, and finally p3 against another copy of x

Examples

#1 [ #10 n:mul ] [ #20 n:mul ] [ #30 n:mul ] tri

Notes

The naming of this originally derives from the Factor programming language.

Related

bi bi* bi@ tri* tri@


   #                 ##     ##  ##  
  ##                 ##      ####   
  ##                       ######## 
  ####   ##  ###     ##      ####   
####     ## ## ##    ##     ##  ##  
  ##     ####  ##    ##             
  ##     ###         ##             
  ## ##  ##          ##             
  ####   ##          ##             
   ##    ##          ##             

tri*

Stack

xyzppp-?

Description

Apply p1 against x, p2 against y, and p3 against z

Examples

#1 #2 #3 [ #10 n:mul ] [ #20 n:mul ] [ #30 n:mul ] tri*

Notes

The naming of this originally derives from the Factor programming language.

Related

bi bi* bi@ tri tri@


   #                 ##       ####  
  ##                 ##      ##  ## 
  ##                        ## #### 
  ####   ##  ###     ##    ## ## ## 
####     ## ## ##    ##    ## ## ## 
  ##     ####  ##    ##    ## ## ## 
  ##     ###         ##    ## ####  
  ## ##  ##          ##    ## ##    
  ####   ##          ##    ##   ##  
   ##    ##          ##    ## ###   
                            ###     

tri@

Stack

xyzp-?

Description

Apply p against x, then against y, and finally against z

Examples

#1 #2 #3 [ #10 n:mul ] tri@

Notes

The naming of this originally derives from the Factor programming language.

Related

bi bi* bi@ tri tri*


   #                       ##       
  ##                       ##       
  ##                       ##       
  ####   ##    ##    ####  ##   ##  
####     ##    ##   ##  ## ##  ##   
  ##     ##    ##  ##      ## ##    
  ##     ##   ### ##       #####    
  ## ##  ##  #### ##       ### ##   
  ####   ## ## ## ##    ## ##   ##  
   ##     ###  ##  ######  ##    ## 

tuck

Stack

xy-yxy

Description

Put a copy of TOS under NOS

Examples

#10 #20 tuck
#3 [ n:put sp ] times

Notes

`tuck` is the same as `swap over`

Related

over swap rot push pop dip sip


                     #        ##      ###    
                    ##        ##       ##    
                    ##                 ##    
##    ## ##  ###    ####      ##       ##    
##    ## ## ## ## ####        ##       ##    
##    ## ####  ##   ##        ##       ##    
##   ### ###   ##   ##        ##       ##    
##  #### ##    ##   ## ##     ##       ##    
## ## ## ##    ##   ####      ##       ##    
 ###  ## ##    ##    ##       ##       ##    

until

Stack

p-

Description

Run a quote in a loop repeatedly The loop must return a flag. End loop when flag is not zero

Examples

#100 [ dup n:put sp n:dec dup n:zero? ] until

Related

I J K forever indexed-times times while


##    ##  ######    #####  
##    ## ##    ##  ##   ## 
##    ##  ###     ##  ###  
##   ###    ####  #####    
##  ####       ## ##       
## ## ## ##    ## ##    ## 
 ###  ##  ######   ######  

use

Stack

n-

Description

Load and run a specific block numbered n

Examples

#33 use

Notes

If you are editing a block, `save` it first. The block buffer (`block:buffer`) is reused when loading blocks, so any changes you have made to your current one will be lost if not first saved.

Blocks can not use this to load other blocks.

Related

needs using


                     ##                      
                     ##                      
##    ##  ######     ##    ##  ###    ###### 
##    ## ##    ##    ##    ## ## ##  ##   ## 
##    ##  ###        ##    ####  ## ##    ## 
##   ###    ####     ##    ###   ## ##   ### 
##  ####       ##    ##    ##    ## ##  #### 
## ## ## ##    ##    ##    ##    ## ## ## ## 
 ###  ##  ######     ##    ##    ##  ###  ## 
                                          ## 
                                    ##    ## 
                                     ######  

using

Stack

nn-

Description

Load and run blocks n1 thru n2

Examples

#33 #45 using

Notes

If you are editing a block, `save` it first. The block buffer (`block:buffer`) is reused when loading blocks, so any changes you have made to your current one will be lost if not first saved.

Blocks can not use this to load other blocks.

Related

needs use


                        ##                   
                        ##                   
            ##          ##                   
##    ##    ##       #####   #####     ####  
##    ##           ###  ##  ##   ##   ##  ## 
##    ##          ##    ## ##  ###   ##      
 ##  ##           ##   ### #####    ##       
 ## ##      ##    ##  #### ##       ##       
  ###       ##    ## ## ## ##    ## ##    ## 
   ##              ###  ##  ######   ######  

v:dec

Stack

a-

Description

Decrement the value stored at address

Examples

'Count var

&Count v:inc

Related

v:inc


                     ##                      
                     ##                      
            ##                               
##    ##    ##       ##    ##  ###     ####  
##    ##             ##    ## ## ##   ##  ## 
##    ##             ##    ####  ##  ##      
 ##  ##              ##    ###   ## ##       
 ## ##      ##       ##    ##    ## ##       
  ###       ##       ##    ##    ## ##    ## 
   ##                ##    ##    ##  ######  

v:inc

Stack

a-

Description

Increment the value stored at address

Examples

'Count var

&Count v:dec

Related

v:dec


##    ##   #####  ##  ###  
##    ##  ##   ## ## ## ## 
##    ##    ##### ####  ## 
 ##  ##   ###  ## ###      
 ## ##   ##    ## ##       
  ###    ##  #### ##       
   ##     #### ## ##       

var

Stack

s-

Description

Create a variable with a value of zero

Examples

'Count var

Notes

The initial value is set to zero.

Related

var-n


##    ##   #####  ##  ###           ##  ###  
##    ##  ##   ## ## ## ##          ## ## ## 
##    ##    ##### ####  ##  ######  ####  ## 
 ##  ##   ###  ## ###               ###   ## 
 ## ##   ##    ## ##                ##    ## 
  ###    ##  #### ##                ##    ## 
   ##     #### ## ##                ##    ## 

var-n

Stack

ns-

Description

Create a variable with a value of n

Examples

#500 'Count var-n

Notes

This is like `var`, but sets the initial value. This is cleaner to read than doing something like:

'foo var #5 !foo

Related

var


         ##          ##      ###             
         ##          ##       ##             
         ##                   ##             
##    ## ##  ###     ##       ##      #####  
##    ## ## ## ##    ##       ##     ##   ## 
##    ## ####  ##    ##       ##    ##  ###  
## ## ## ###   ##    ##       ##    #####    
## ## ## ##    ##    ##       ##    ##       
######## ##    ##    ##       ##    ##    ## 
##    ## ##    ##    ##       ##     ######  

while

Stack

p-

Description

Run a quote in a loop repeatedly The loop must return a flag. End loop when flag is zero

Examples

(display_100_to_1)
#100 [ dup n:put sp n:dec dup n:-zero? ] while drop

Related

I J K forever indexed-times times until


##    ##   #####  ##  ###  
 ##  ##   ##   ## ## ## ## 
  ####   ##    ## ####  ## 
   ##    ##    ## ###      
  ####   ##    ## ##       
 ##  ##  ##   ##  ##       
##    ##  #####   ##       

xor

Stack

nn-n

Description

Perform a bitwise XOR

Examples

#1 #2 eq? #1 #2 lt? xor [ 'a_condition_met s:put nl ] if

Related

and or not