diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a5663af..d02a72a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -2,6 +2,10 @@ ## Core Language +## Renamed + +- prefix: namespace to sigil: + ## I/O - simplify definition of `c:get` diff --git a/doc/Glossary-Concise.txt b/doc/Glossary-Concise.txt index 44530d5..f6b611c 100644 --- a/doc/Glossary-Concise.txt +++ b/doc/Glossary-Concise.txt @@ -1078,45 +1078,6 @@ Copy a string to the pasteboard. pop D: -n A: n- F: - Move a value from the return stack to the data stack. -prefix:! D: ns- A: - F: - -Store a value into a variable. - -prefix:# D: s-n A: - F: - -Process token as a number. - -prefix:$ D: s-c A: - F: - -Process token as an ASCII character. - -prefix:& D: s-a A: - F: - -Return a pointer to a named item. - -prefix:' D: s-s A: - F: - -Process token as a string. - -prefix:( D: s- A: - F: - -Process token as a comment. - -prefix:. D: s- A: - F: -F -Interpret time: convert string to a floating point value. Compile time: convert string to a floating point value and compile code to push this value to the float stack. - -prefix:: D: s- A: - F: - -Process token as a new definition. - -prefix:@ D: s-n A: - F: - -Fetch from a stored variable. - -prefix:\ D: s- A: - F: - -Process token as an instruction bundle. - -prefix:^ D: s- A: - F: - -Process token as a function reference. - -prefix:` D: s- A: - F: - -Process token as a bytecode. - -prefix:| D: s- A: - F: - -POSTPONE equivalent. - primitive D: - A: - F: - Change the class of the most recently defined word to `class:primitive`. @@ -1324,6 +1285,45 @@ Patch the hook point in a2 to point to a1. shift D: mn-o A: - F: - Peform a bitwise shift of m by n bits. If n is positive, shift right. If negative, the shift will be to the left. +sigil:! D: ns- A: - F: - +Store a value into a variable. + +sigil:# D: s-n A: - F: - +Process token as a number. + +sigil:$ D: s-c A: - F: - +Process token as an ASCII character. + +sigil:& D: s-a A: - F: - +Return a pointer to a named item. + +sigil:' D: s-s A: - F: - +Process token as a string. + +sigil:( D: s- A: - F: - +Process token as a comment. + +sigil:. D: s- A: - F: -F +Interpret time: convert string to a floating point value. Compile time: convert string to a floating point value and compile code to push this value to the float stack. + +sigil:: D: s- A: - F: - +Process token as a new definition. + +sigil:@ D: s-n A: - F: - +Fetch from a stored variable. + +sigil:\ D: s- A: - F: - +Process token as an instruction bundle. + +sigil:^ D: s- A: - F: - +Process token as a function reference. + +sigil:` D: s- A: - F: - +Process token as a bytecode. + +sigil:| D: s- A: - F: - +POSTPONE equivalent. + sip D: nq-n A: - F: - Run quote. After execution completes, put a copy of n back on top of the stack. diff --git a/doc/Glossary-Names-and-Stack.txt b/doc/Glossary-Names-and-Stack.txt index 3e0ff9e..50381af 100644 --- a/doc/Glossary-Names-and-Stack.txt +++ b/doc/Glossary-Names-and-Stack.txt @@ -358,19 +358,6 @@ pb:get D: a- A: - F: - pb:length D: -n A: - F: - pb:set D: s- A: - F: - pop D: -n A: n- F: - -prefix:! D: ns- A: - F: - -prefix:# D: s-n A: - F: - -prefix:$ D: s-c A: - F: - -prefix:& D: s-a A: - F: - -prefix:' D: s-s A: - F: - -prefix:( D: s- A: - F: - -prefix:. D: s- A: - F: -F -prefix:: D: s- A: - F: - -prefix:@ D: s-n A: - F: - -prefix:\ D: s- A: - F: - -prefix:^ D: s- A: - F: - -prefix:` D: s- A: - F: - -prefix:| D: s- A: - F: - primitive D: - A: - F: - push D: n- A: -n F: - r D: s- A: - F: - @@ -440,6 +427,19 @@ script:ignore-to-eol D: - A: - F: - script:name D: -s A: - F: - set-hook D: aa- A: - F: - shift D: mn-o A: - F: - +sigil:! D: ns- A: - F: - +sigil:# D: s-n A: - F: - +sigil:$ D: s-c A: - F: - +sigil:& D: s-a A: - F: - +sigil:' D: s-s A: - F: - +sigil:( D: s- A: - F: - +sigil:. D: s- A: - F: -F +sigil:: D: s- A: - F: - +sigil:@ D: s-n A: - F: - +sigil:\ D: s- A: - F: - +sigil:^ D: s- A: - F: - +sigil:` D: s- A: - F: - +sigil:| D: s- A: - F: - sip D: nq-n A: - F: - socket:accept D: n-nn A: - F: - socket:bind D: sn-nn A: - F: - diff --git a/doc/Glossary.html b/doc/Glossary.html index 1aebf49..3c3c30b 100644 --- a/doc/Glossary.html +++ b/doc/Glossary.html @@ -18,14 +18,14 @@ Float: -
Provide a visual indication of a code group.
-Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: -
Addr: -
Float: -
Provide a visual indication of a code group.
-Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: nn-n
Addr: -
@@ -2725,166 +2725,6 @@
Move a value from the return stack to the data stack.
Class: | class:macro |
Namespace: | global |
Interface Layer: | all |
Data: ns-
-Addr: -
-Float: -
Store a value into a variable.
-Interpret Time: - Store a value into the named variable.
- -Compile Time: - Compile the code to store a value into a named variable.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-n
-Addr: -
-Float: -
Process token as a number.
-Interpret Time: - Convert the string into a number and leave on the stack.
- -Compile Time: - Convert the string into a number and compile into the current definition as a literal.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-c
-Addr: -
-Float: -
Process token as an ASCII character.
-Interpret Time: - Fetch first character from string. Leave on stack.
- -Compile Time: - Fetch first character from the string. Compile into the current definition as literal.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-a
-Addr: -
-Float: -
Return a pointer to a named item.
-Interpret Time: - Lookup name in dictionary, return contents of the xt field on the stack.
- -Compile Time: - Lookup name in dictionary, compile code to push the contents of the xt field into the current definition.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-s
-Addr: -
-Float: -
Process token as a string.
-Interpret Time: - Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space.
- -Compile Time: - Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Then compile the string into the current definition.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-
-Addr: -
-Float: -
Process token as a comment.
-Interpret Time: - Discard the string.
- -Compile Time: - Discard the string.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-
-Addr: -
-Float: -F
Interpret time: convert string to a floating point value. Compile time: convert string to a floating point value and compile code to push this value to the float stack.
-Class: | class:macro |
Namespace: | prefix |
Interface Layer: | rre |
Data: s-
-Addr: -
-Float: -
Process token as a new definition.
-Interpret Time: - Create a header pointing to `here` with the provided string as the name. Sets class to `class:word`.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-n
-Addr: -
-Float: -
Fetch from a stored variable.
-Interpret Time: - Fetch a value from a named variable.
- -Compile Time: - Compile the code to fetch a value from a named variable into the current definition.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-
-Addr: -
-Float: -
Process token as an instruction bundle.
-Interpret Time: - Discard the string.
- -Compile Time: - Assemble the opcodes in the string and use `,` to inline it into the current definition.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-
-Addr: -
-Float: -
Process token as a function reference.
-Interpret Time: - Discard the string.
- -Compile Time: - Comma the XT of the word into the current definition.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-
-Addr: -
-Float: -
Process token as a bytecode.
-Interpret Time: - Discard the string.
- -Compile Time: - Convert the string to a number and use `,` to inline it into the current definition.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: s-
-Addr: -
-Float: -
POSTPONE equivalent.
-Interpret Time: - Discard the string.
- -Compile Time: - Convert the string to a number and use `,` to inline it into the current definition.
- -Class: | class:macro |
Namespace: | prefix |
Interface Layer: | all |
Data: -
Addr: -
@@ -3395,6 +3235,166 @@
Peform a bitwise shift of m by n bits. If n is positive, shift right. If negative, the shift will be to the left.
Class: | class:primitive |
Namespace: | global |
Interface Layer: | all |
Data: ns-
+Addr: -
+Float: -
Store a value into a variable.
+Interpret Time: + Store a value into the named variable.
+ +Compile Time: + Compile the code to store a value into a named variable.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-n
+Addr: -
+Float: -
Process token as a number.
+Interpret Time: + Convert the string into a number and leave on the stack.
+ +Compile Time: + Convert the string into a number and compile into the current definition as a literal.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-c
+Addr: -
+Float: -
Process token as an ASCII character.
+Interpret Time: + Fetch first character from string. Leave on stack.
+ +Compile Time: + Fetch first character from the string. Compile into the current definition as literal.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-a
+Addr: -
+Float: -
Return a pointer to a named item.
+Interpret Time: + Lookup name in dictionary, return contents of the xt field on the stack.
+ +Compile Time: + Lookup name in dictionary, compile code to push the contents of the xt field into the current definition.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-s
+Addr: -
+Float: -
Process token as a string.
+Interpret Time: + Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space.
+ +Compile Time: + Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Then compile the string into the current definition.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-
+Addr: -
+Float: -
Process token as a comment.
+Interpret Time: + Discard the string.
+ +Compile Time: + Discard the string.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-
+Addr: -
+Float: -F
Interpret time: convert string to a floating point value. Compile time: convert string to a floating point value and compile code to push this value to the float stack.
+Class: | class:macro |
Namespace: | sigil |
Interface Layer: | rre |
Data: s-
+Addr: -
+Float: -
Process token as a new definition.
+Interpret Time: + Create a header pointing to `here` with the provided string as the name. Sets class to `class:word`.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-n
+Addr: -
+Float: -
Fetch from a stored variable.
+Interpret Time: + Fetch a value from a named variable.
+ +Compile Time: + Compile the code to fetch a value from a named variable into the current definition.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-
+Addr: -
+Float: -
Process token as an instruction bundle.
+Interpret Time: + Discard the string.
+ +Compile Time: + Assemble the opcodes in the string and use `,` to inline it into the current definition.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-
+Addr: -
+Float: -
Process token as a function reference.
+Interpret Time: + Discard the string.
+ +Compile Time: + Comma the XT of the word into the current definition.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-
+Addr: -
+Float: -
Process token as a bytecode.
+Interpret Time: + Discard the string.
+ +Compile Time: + Convert the string to a number and use `,` to inline it into the current definition.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: s-
+Addr: -
+Float: -
POSTPONE equivalent.
+Interpret Time: + Discard the string.
+ +Compile Time: + Convert the string to a number and use `,` to inline it into the current definition.
+ +Class: | class:macro |
Namespace: | sigil |
Interface Layer: | all |
Data: nq-n
Addr: -
diff --git a/doc/Glossary.txt b/doc/Glossary.txt
index cb2073f..272e76a 100644
--- a/doc/Glossary.txt
+++ b/doc/Glossary.txt
@@ -28,7 +28,7 @@ Class: class:macro | Namespace: global | Interface Layer: all
Provide a visual indication of a code group.
-Class: class:macro | Namespace: prefix | Interface Layer: all
+Class: class:macro | Namespace: sigil | Interface Layer: all
------------------------------------------------------------------------
)
@@ -39,7 +39,7 @@ Class: class:macro | Namespace: prefix | Interface Layer: all
Provide a visual indication of a code group.
-Class: class:macro | Namespace: prefix | Interface Layer: all
+Class: class:macro | Namespace: sigil | Interface Layer: all
------------------------------------------------------------------------
*
@@ -4206,218 +4206,6 @@ Move a value from the return stack to the data stack.
Class: class:macro | Namespace: global | Interface Layer: all
------------------------------------------------------------------------
-prefix:!
-
- Data: ns-
- Addr: -
- Float: -
-
-Store a value into a variable.
-
-Interpret Time:
- Store a value into the named variable.
-
-Compile Time:
- Compile the code to store a value into a named variable.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:#
-
- Data: s-n
- Addr: -
- Float: -
-
-Process token as a number.
-
-Interpret Time:
- Convert the string into a number and leave on the stack.
-
-Compile Time:
- Convert the string into a number and compile into the current definition as a literal.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:$
-
- Data: s-c
- Addr: -
- Float: -
-
-Process token as an ASCII character.
-
-Interpret Time:
- Fetch first character from string. Leave on stack.
-
-Compile Time:
- Fetch first character from the string. Compile into the current definition as literal.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:&
-
- Data: s-a
- Addr: -
- Float: -
-
-Return a pointer to a named item.
-
-Interpret Time:
- Lookup name in dictionary, return contents of the xt field on the stack.
-
-Compile Time:
- Lookup name in dictionary, compile code to push the contents of the xt field into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:'
-
- Data: s-s
- Addr: -
- Float: -
-
-Process token as a string.
-
-Interpret Time:
- Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space.
-
-Compile Time:
- Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Then compile the string into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:(
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as a comment.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Discard the string.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:.
-
- Data: s-
- Addr: -
- Float: -F
-
-Interpret time: convert string to a floating point value. Compile time: convert string to a floating point value and compile code to push this value to the float stack.
-
-Class: class:macro | Namespace: prefix | Interface Layer: rre
-------------------------------------------------------------------------
-
-prefix::
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as a new definition.
-
-Interpret Time:
- Create a header pointing to `here` with the provided string as the name. Sets class to `class:word`.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:@
-
- Data: s-n
- Addr: -
- Float: -
-
-Fetch from a stored variable.
-
-Interpret Time:
- Fetch a value from a named variable.
-
-Compile Time:
- Compile the code to fetch a value from a named variable into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:\
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as an instruction bundle.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Assemble the opcodes in the string and use `,` to inline it into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:^
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as a function reference.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Comma the XT of the word into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:`
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as a bytecode.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Convert the string to a number and use `,` to inline it into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:|
-
- Data: s-
- Addr: -
- Float: -
-
-POSTPONE equivalent.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Convert the string to a number and use `,` to inline it into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
primitive
Data: -
@@ -5210,6 +4998,218 @@ Peform a bitwise shift of m by n bits. If n is positive, shift right. If negativ
Class: class:primitive | Namespace: global | Interface Layer: all
------------------------------------------------------------------------
+sigil:!
+
+ Data: ns-
+ Addr: -
+ Float: -
+
+Store a value into a variable.
+
+Interpret Time:
+ Store a value into the named variable.
+
+Compile Time:
+ Compile the code to store a value into a named variable.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:#
+
+ Data: s-n
+ Addr: -
+ Float: -
+
+Process token as a number.
+
+Interpret Time:
+ Convert the string into a number and leave on the stack.
+
+Compile Time:
+ Convert the string into a number and compile into the current definition as a literal.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:$
+
+ Data: s-c
+ Addr: -
+ Float: -
+
+Process token as an ASCII character.
+
+Interpret Time:
+ Fetch first character from string. Leave on stack.
+
+Compile Time:
+ Fetch first character from the string. Compile into the current definition as literal.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:&
+
+ Data: s-a
+ Addr: -
+ Float: -
+
+Return a pointer to a named item.
+
+Interpret Time:
+ Lookup name in dictionary, return contents of the xt field on the stack.
+
+Compile Time:
+ Lookup name in dictionary, compile code to push the contents of the xt field into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:'
+
+ Data: s-s
+ Addr: -
+ Float: -
+
+Process token as a string.
+
+Interpret Time:
+ Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space.
+
+Compile Time:
+ Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Then compile the string into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:(
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as a comment.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Discard the string.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:.
+
+ Data: s-
+ Addr: -
+ Float: -F
+
+Interpret time: convert string to a floating point value. Compile time: convert string to a floating point value and compile code to push this value to the float stack.
+
+Class: class:macro | Namespace: sigil | Interface Layer: rre
+------------------------------------------------------------------------
+
+sigil::
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as a new definition.
+
+Interpret Time:
+ Create a header pointing to `here` with the provided string as the name. Sets class to `class:word`.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:@
+
+ Data: s-n
+ Addr: -
+ Float: -
+
+Fetch from a stored variable.
+
+Interpret Time:
+ Fetch a value from a named variable.
+
+Compile Time:
+ Compile the code to fetch a value from a named variable into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:\
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as an instruction bundle.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Assemble the opcodes in the string and use `,` to inline it into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:^
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as a function reference.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Comma the XT of the word into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:`
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as a bytecode.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Convert the string to a number and use `,` to inline it into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:|
+
+ Data: s-
+ Addr: -
+ Float: -
+
+POSTPONE equivalent.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Convert the string to a number and use `,` to inline it into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
sip
Data: nq-n
diff --git a/doc/RETRO-Book.md b/doc/RETRO-Book.md
index 97916f6..f8fb76e 100644
--- a/doc/RETRO-Book.md
+++ b/doc/RETRO-Book.md
@@ -637,7 +637,7 @@ name it:
:palindrome? dup s:reverse s:eq? ;
```
-Naming uses the `:` prefix to add a new word to the dictionary.
+Naming uses the `:` sigil to add a new word to the dictionary.
The words that make up the definition are then placed, with a
final word (`;`) ending the definition. We can then use this:
@@ -661,12 +661,12 @@ Input is divided into a series of whitespace delimited tokens.
Each of these is then processed individually. There are no
parsing words in RETRO.
-Tokens may have a single character *prefix*, which RETRO will
+Tokens may have a single character *sigil*, which RETRO will
use to decide how to process the token.
-## Prefixes
+## Sigils
-Prefixes are single characters added to the start of a token
+Sigils are single characters added to the start of a token
to guide the compiler. The use of these is a major way in
which RETRO differs from traditional Forth.
@@ -696,24 +696,24 @@ like:
In RETRO, the interpret process is basically:
get token
- does the first character match a `prefix:` word?
- yes: pass the token to the prefix handler
+ does the first character match a `sigil:` word?
+ yes: pass the token to the sigil handler
no: is token a word in the dictionary?
yes: push the XT to the stack and call the
class handler
no: report an error ("not found")
All of the actual logic for how to deal with tokens is moved
-to the individual prefix handlers, and the logic for handling
+to the individual sigil handlers, and the logic for handling
words is moved to word class handlers.
-This means that prefixes are used for a lot of things. Numbers?
-Handled by a `#` prefix. Strings? Use the `'` prefix. Comments?
-Use `(`. Making a new word? Use the `:` prefix.
+This means that sigils are used for a lot of things. Numbers?
+Handled by a `#` sigil. Strings? Use the `'` sigil. Comments?
+Use `(`. Making a new word? Use the `:` sigil.
-The major prefixes are:
+The major sigils are:
- | Prefix | Used For |
+ | Sigil | Used For |
| ------ | ----------------------------- |
| @ | Fetch from variable |
| ! | Store into variable |
@@ -724,7 +724,7 @@ The major prefixes are:
| ( | Comments |
| : | Define a word |
-The individual prefixes will be covered in more detail in the
+The individual sigils will be covered in more detail in the
later chapters on working with different data types.
## Word Classes
@@ -1083,7 +1083,7 @@ Word names in RETRO generally follow the following conventions.
* Readability is important
* Be consistent
-* Don't use a prefix as the first character of a name
+* Don't use a sigil as the first character of a name
* Don't use underscores in word names
* Use short names for indices
* Word names start with a `-` for "not"
@@ -1138,7 +1138,7 @@ The common namespaces are:
| err: | Words for handling errors |
| io: | General I/O words |
| n: | Words operating on numeric data |
- | prefix: | Contains prefix handlers |
+ | sigil: | Contains sigil handlers |
| s: | Words operating on string data |
| v: | Words operating on variables |
| file: | File I/O words |
@@ -1147,15 +1147,15 @@ The common namespaces are:
## Tips
-### Don't Start Names With Prefix Characters
+### Don't Start Names With Sigil Characters
-Avoid using a prefix as the first character of a word name. RETRO
-will look for prefixes first, this will prevent direct use of
+Avoid using a sigil as the first character of a word name. RETRO
+will look for sigils first, this will prevent direct use of
the work in question.
-To find a list of prefix characters, do:
+To find a list of sigil characters, do:
- 'prefix: d:words-with
+ 'sigil: d:words-with
### Don't Use Underscores
@@ -1441,7 +1441,7 @@ Instead of:
i dudumu..
-The runtime assembler also provides three prefixes for use in
+The runtime assembler also provides three sigils for use in
inlining machine code into a definition. These are:
\ Treat token as an assembly sequence
@@ -1618,9 +1618,9 @@ buffer:start s:put nl
RETRO provides words for working with ASCII characters.
-## Prefix
+## Sigil
-Character constants are returned using the `$` prefix.
+Character constants are returned using the `$` sigil.
## Namespace
@@ -1812,7 +1812,7 @@ precision (1 bit for the sign, 11 bits for the exponent, and
the remaining 52 bits for the value), i.e. 15 decimal digits
of precision.
-## Prefix
+## Sigil
Floating point numbers start with a `.`
@@ -2213,9 +2213,9 @@ two forms.
Numbers in RETRO are signed integers.
-## Token Prefix
+## Sigil
-All numbers start with a `#` prefix.
+All numbers start with a `#` sigil.
## Namespace
@@ -2294,9 +2294,9 @@ To display a number, use `n:put`.
# Working With Pointers
-## Prefix
+## Sigil
-Pointers are returned by the `&` prefix.
+Pointers are returned by the `&` sigil.
## Examples
@@ -2550,7 +2550,7 @@ strings can contain UTF8 encoded data if the host platform
allows. Words like `s:length` will return the number of bytes,
not the number of logical characters in this case.
-## Prefix
+## Sigil
Strings begin with a single `'`.
@@ -3746,7 +3746,7 @@ listener:
stack_push(1024);
execute("interpret", memory[2]);
-The `interpret` word handles things like prefixes, so this is
+The `interpret` word handles things like sigils, so this is
needed if you want to run something that needs those.
# Historical Papers and Notes
@@ -4103,7 +4103,7 @@ Sources:
- http://forth.works/c812416f397af11db58e97388a3238f2
- gopher://forth.works/0/c812416f397af11db58e97388a3238f2
-## Prefixes as a Language Element
+## Sigils as a Language Element
A big change in RETRO 12 was the elimination of the traditional
parser from the language. This was a sacrifice due to the lack
@@ -4115,26 +4115,26 @@ And so `interpret` operates only on the current token. The core
language does not track what came before or attempt to guess at
what might come in the future.
-This leads into the prefixes. RETRO 11 had a complicated system
-for prefixes, with different types of prefixes for words that
+This leads into the sigils. RETRO 11 had a complicated system
+for sigils, with different types of sigilss for words that
parsed ahead (e.g., strings) and words that operated on the
current token (e.g., `@`). RETRO 12 eliminates all of these in
-favor of just having a single prefix model.
+favor of just having a single sigil model.
The first thing `interpret` does is look to see if the first
-character in a token matches a `prefix:` word. If it does, it
-passes the rest of the token as a string pointer to the prefix
-specific handler to deal with. If there is no valid prefix
+character in a token matches a `sigil:` word. If it does, it
+passes the rest of the token as a string pointer to the sigil
+specific handler to deal with. If there is no valid sigil
found, it tries to find it in the dictionary. Assuming that it
finds the words, it passes the `d:xt` field to the handler that
`d:class` points to. Otherwise it calls `err:notfound`.
This has an important implication: *words can not reliably
-have names that start with a prefix character.*
+have names that start with a sigil character.*
It also simplifies things. Anything that would normally parse
-becomes a prefix handler. So creating a new word? Use the `:`
-prefix. Strings? Use `'`. Pointers? Try `&`. And so on. E.g.,
+becomes a sigil handler. So creating a new word? Use the `:`
+sigil. Strings? Use `'`. Pointers? Try `&`. And so on. E.g.,
In ANS | In RETRO
: foo ... ; | :foo ... ;
@@ -4142,12 +4142,12 @@ prefix. Strings? Use `'`. Pointers? Try `&`. And so on. E.g.,
: bar ... ['] foo ; | :bar ... &foo ;
s" hello world!" | 'hello_world!
-If you are familiar with ColorForth, prefixes are a similar
+If you are familiar with ColorForth, sigils are a similar
idea to colors, but can be defined by the user as normal words.
After doing this for quite a while I rather like it. I can see
why Chuck Moore eventually went towards ColorForth as using
-color (or prefixes in my case) does simplify the implementation
+color (or sigils in my case) does simplify the implementation
in many ways.
## On The Kernel Wordset
@@ -4187,14 +4187,14 @@ Compiler & Interpreter
Compiler Heap ; [ ] Dictionary
d:link d:class d:xt d:name d:add-header
class:word class:primitive class:data class:macro
- prefix:: prefix:# prefix:& prefix:$
+ sigil:: sigil:# sigil:& sigil:$
interpret d:lookup err:notfound
Assembler
i d r
-I *could* slightly reduce this. The $ prefix could be defined in
+I *could* slightly reduce this. The $ sigil could be defined in
higher level code, and I don't strictly *need* to expose the
`fetch-next` and `store-next` here. But since the are already
implemented as dependencies of the words in the kernel, it would
@@ -4440,9 +4440,9 @@ Consider:
'test_name var
#188 !test_name
-In the first case, the `:` prefix handles the token, so the
+In the first case, the `:` sigil handles the token, so the
underscore is not remapped to a space, creating a word name as
-`hello_msg`. But in the second, the `'` prefix remaps the
+`hello_msg`. But in the second, the `'` sigil remaps the
underscore to a space, giving a variable name of `test name`.
In the third line, the name lookup will fail as `test_name` is
not defined, so the store will be done to an incorrect address.
diff --git a/doc/book/general/quick-tutorial b/doc/book/general/quick-tutorial
index d367275..3642d29 100644
--- a/doc/book/general/quick-tutorial
+++ b/doc/book/general/quick-tutorial
@@ -32,7 +32,7 @@ name it:
:palindrome? dup s:reverse s:eq? ;
```
-Naming uses the `:` prefix to add a new word to the dictionary.
+Naming uses the `:` sigil to add a new word to the dictionary.
The words that make up the definition are then placed, with a
final word (`;`) ending the definition. We can then use this:
diff --git a/doc/book/general/syntax b/doc/book/general/syntax
index dc4713a..7185a07 100644
--- a/doc/book/general/syntax
+++ b/doc/book/general/syntax
@@ -11,12 +11,12 @@ Input is divided into a series of whitespace delimited tokens.
Each of these is then processed individually. There are no
parsing words in RETRO.
-Tokens may have a single character *prefix*, which RETRO will
+Tokens may have a single character *sigil*, which RETRO will
use to decide how to process the token.
-## Prefixes
+## Sigils
-Prefixes are single characters added to the start of a token
+Sigils are single characters added to the start of a token
to guide the compiler. The use of these is a major way in
which RETRO differs from traditional Forth.
@@ -46,24 +46,24 @@ like:
In RETRO, the interpret process is basically:
get token
- does the first character match a `prefix:` word?
- yes: pass the token to the prefix handler
+ does the first character match a `sigil:` word?
+ yes: pass the token to the sigil handler
no: is token a word in the dictionary?
yes: push the XT to the stack and call the
class handler
no: report an error ("not found")
All of the actual logic for how to deal with tokens is moved
-to the individual prefix handlers, and the logic for handling
+to the individual sigil handlers, and the logic for handling
words is moved to word class handlers.
-This means that prefixes are used for a lot of things. Numbers?
-Handled by a `#` prefix. Strings? Use the `'` prefix. Comments?
-Use `(`. Making a new word? Use the `:` prefix.
+This means that sigils are used for a lot of things. Numbers?
+Handled by a `#` sigil. Strings? Use the `'` sigil. Comments?
+Use `(`. Making a new word? Use the `:` sigil.
-The major prefixes are:
+The major sigils are:
- | Prefix | Used For |
+ | Sigil | Used For |
| ------ | ----------------------------- |
| @ | Fetch from variable |
| ! | Store into variable |
@@ -74,7 +74,7 @@ The major prefixes are:
| ( | Comments |
| : | Define a word |
-The individual prefixes will be covered in more detail in the
+The individual sigils will be covered in more detail in the
later chapters on working with different data types.
## Word Classes
diff --git a/doc/book/glossary/glossary b/doc/book/glossary/glossary
index 738cc18..272e76a 100644
--- a/doc/book/glossary/glossary
+++ b/doc/book/glossary/glossary
@@ -28,7 +28,7 @@ Class: class:macro | Namespace: global | Interface Layer: all
Provide a visual indication of a code group.
-Class: class:macro | Namespace: prefix | Interface Layer: all
+Class: class:macro | Namespace: sigil | Interface Layer: all
------------------------------------------------------------------------
)
@@ -39,7 +39,7 @@ Class: class:macro | Namespace: prefix | Interface Layer: all
Provide a visual indication of a code group.
-Class: class:macro | Namespace: prefix | Interface Layer: all
+Class: class:macro | Namespace: sigil | Interface Layer: all
------------------------------------------------------------------------
*
@@ -1152,6 +1152,17 @@ Create a new string from the provided array. This string will be stored in the t
Class: class:word | Namespace: a | Interface Layer: all
------------------------------------------------------------------------
+abort
+
+ Data: -
+ Addr: -
+ Float: -
+
+Abort execution.
+
+Class: class:macro | Namespace: global | Interface Layer: rre
+------------------------------------------------------------------------
+
again
Data: -
@@ -2060,7 +2071,7 @@ d:lookup
Addr: -
Float: -
-Lookup the specified name in the dictionary and return a pointer to its dictionary header. This returns zero if the word is not found.
+Lookup the specified name in the dictionary and return a pointer to its dictionary header. This returns zero if the word is not found. This also sets an internal variable ('which' in retro.muri) to the header address.
Class: class:word | Namespace: d | Interface Layer: all
------------------------------------------------------------------------
@@ -4195,218 +4206,6 @@ Move a value from the return stack to the data stack.
Class: class:macro | Namespace: global | Interface Layer: all
------------------------------------------------------------------------
-prefix:!
-
- Data: ns-
- Addr: -
- Float: -
-
-Store a value into a variable.
-
-Interpret Time:
- Store a value into the named variable.
-
-Compile Time:
- Compile the code to store a value into a named variable.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:#
-
- Data: s-n
- Addr: -
- Float: -
-
-Process token as a number.
-
-Interpret Time:
- Convert the string into a number and leave on the stack.
-
-Compile Time:
- Convert the string into a number and compile into the current definition as a literal.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:$
-
- Data: s-c
- Addr: -
- Float: -
-
-Process token as an ASCII character.
-
-Interpret Time:
- Fetch first character from string. Leave on stack.
-
-Compile Time:
- Fetch first character from the string. Compile into the current definition as literal.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:&
-
- Data: s-a
- Addr: -
- Float: -
-
-Return a pointer to a named item.
-
-Interpret Time:
- Lookup name in dictionary, return contents of the xt field on the stack.
-
-Compile Time:
- Lookup name in dictionary, compile code to push the contents of the xt field into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:'
-
- Data: s-s
- Addr: -
- Float: -
-
-Process token as a string.
-
-Interpret Time:
- Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space.
-
-Compile Time:
- Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Then compile the string into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:(
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as a comment.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Discard the string.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:.
-
- Data: s-
- Addr: -
- Float: -F
-
-Interpret time: convert string to a floating point value. Compile time: convert string to a floating point value and compile code to push this value to the float stack.
-
-Class: class:macro | Namespace: prefix | Interface Layer: rre
-------------------------------------------------------------------------
-
-prefix::
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as a new definition.
-
-Interpret Time:
- Create a header pointing to `here` with the provided string as the name. Sets class to `class:word`.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:@
-
- Data: s-n
- Addr: -
- Float: -
-
-Fetch from a stored variable.
-
-Interpret Time:
- Fetch a value from a named variable.
-
-Compile Time:
- Compile the code to fetch a value from a named variable into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:\
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as an instruction bundle.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Assemble the opcodes in the string and use `,` to inline it into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:^
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as a function reference.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Comma the XT of the word into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:`
-
- Data: s-
- Addr: -
- Float: -
-
-Process token as a bytecode.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Convert the string to a number and use `,` to inline it into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
-prefix:|
-
- Data: s-
- Addr: -
- Float: -
-
-POSTPONE equivalent.
-
-Interpret Time:
- Discard the string.
-
-Compile Time:
- Convert the string to a number and use `,` to inline it into the current definition.
-
-Class: class:macro | Namespace: prefix | Interface Layer: all
-------------------------------------------------------------------------
-
primitive
Data: -
@@ -5148,6 +4947,17 @@ Discard remaining lines in the file currently being evaluated. This only works w
Class: class:word | Namespace: sys | Interface Layer: rre
------------------------------------------------------------------------
+script:ignore-to-eol
+
+ Data: -
+ Addr: -
+ Float: -
+
+Discard remaining tokens in the current line. This only works when including a file, not at the interpreter.
+
+Class: class:word | Namespace: sys | Interface Layer: rre
+------------------------------------------------------------------------
+
script:name
Data: -s
@@ -5188,6 +4998,218 @@ Peform a bitwise shift of m by n bits. If n is positive, shift right. If negativ
Class: class:primitive | Namespace: global | Interface Layer: all
------------------------------------------------------------------------
+sigil:!
+
+ Data: ns-
+ Addr: -
+ Float: -
+
+Store a value into a variable.
+
+Interpret Time:
+ Store a value into the named variable.
+
+Compile Time:
+ Compile the code to store a value into a named variable.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:#
+
+ Data: s-n
+ Addr: -
+ Float: -
+
+Process token as a number.
+
+Interpret Time:
+ Convert the string into a number and leave on the stack.
+
+Compile Time:
+ Convert the string into a number and compile into the current definition as a literal.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:$
+
+ Data: s-c
+ Addr: -
+ Float: -
+
+Process token as an ASCII character.
+
+Interpret Time:
+ Fetch first character from string. Leave on stack.
+
+Compile Time:
+ Fetch first character from the string. Compile into the current definition as literal.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:&
+
+ Data: s-a
+ Addr: -
+ Float: -
+
+Return a pointer to a named item.
+
+Interpret Time:
+ Lookup name in dictionary, return contents of the xt field on the stack.
+
+Compile Time:
+ Lookup name in dictionary, compile code to push the contents of the xt field into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:'
+
+ Data: s-s
+ Addr: -
+ Float: -
+
+Process token as a string.
+
+Interpret Time:
+ Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space.
+
+Compile Time:
+ Move string into temporary buffer. If `RewriteUnderscores` is `TRUE`, replace all instances of _ with space. Then compile the string into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:(
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as a comment.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Discard the string.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:.
+
+ Data: s-
+ Addr: -
+ Float: -F
+
+Interpret time: convert string to a floating point value. Compile time: convert string to a floating point value and compile code to push this value to the float stack.
+
+Class: class:macro | Namespace: sigil | Interface Layer: rre
+------------------------------------------------------------------------
+
+sigil::
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as a new definition.
+
+Interpret Time:
+ Create a header pointing to `here` with the provided string as the name. Sets class to `class:word`.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:@
+
+ Data: s-n
+ Addr: -
+ Float: -
+
+Fetch from a stored variable.
+
+Interpret Time:
+ Fetch a value from a named variable.
+
+Compile Time:
+ Compile the code to fetch a value from a named variable into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:\
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as an instruction bundle.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Assemble the opcodes in the string and use `,` to inline it into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:^
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as a function reference.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Comma the XT of the word into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:`
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Process token as a bytecode.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Convert the string to a number and use `,` to inline it into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
+sigil:|
+
+ Data: s-
+ Addr: -
+ Float: -
+
+POSTPONE equivalent.
+
+Interpret Time:
+ Discard the string.
+
+Compile Time:
+ Convert the string to a number and use `,` to inline it into the current definition.
+
+Class: class:macro | Namespace: sigil | Interface Layer: all
+------------------------------------------------------------------------
+
sip
Data: nq-n
@@ -5376,39 +5398,6 @@ Exchange the position of the top two items on the stack
Class: class:primitive | Namespace: global | Interface Layer: all
------------------------------------------------------------------------
-sys:argc
-
- Data: -n
- Addr: -
- Float: -
-
-Return the number of arguments passed to the program. Deprecated. Use script:arguments
-
-Class: class:word | Namespace: sys | Interface Layer: rre
-------------------------------------------------------------------------
-
-sys:argv
-
- Data: n-s
- Addr: -
- Float: -
-
-Given an argument number, return the argument as a string. Deprecated. Use script:get-argument instead.
-
-Class: class:word | Namespace: sys | Interface Layer: rre
-------------------------------------------------------------------------
-
-sys:name
-
- Data: -s
- Addr: -
- Float: -
-
-Return the filename of the program being run. Deprecated. Use script:name instead.
-
-Class: class:word | Namespace: sys | Interface Layer: rre
-------------------------------------------------------------------------
-
tab
Data: -
@@ -5480,6 +5469,171 @@ Put a copy of the top item on the stack under the second one.
Class: class:word | Namespace: global | Interface Layer: all
------------------------------------------------------------------------
+ui:add-view
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Add view named `s` to the displayed views.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:create-view
+
+ Data: ss-
+ Addr: -
+ Float: -
+
+Create a new view. `s1` is the name and `s2` is the type.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:get-action
+
+ Data: s-a
+ Addr: -
+ Float: -
+
+Return the address of the Retro handler for a view's associated action.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:get-position
+
+ Data: s-nn
+ Addr: -
+ Float: -
+
+Return the row and column of the named view.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:get-size
+
+ Data: s-nn
+ Addr: -
+ Float: -
+
+Return the height and width of the named view.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:get-text
+
+ Data: s-s
+ Addr: -
+ Float: -
+
+Get the value of the text property of the named view.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:get-title
+
+ Data: s-s
+ Addr: -
+ Float: -
+
+Get the value of the title property for the named view.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:operation
+
+ Data: ...n-
+ Addr: -
+ Float: -
+
+Carry out a UI operation. Used internally by the other `ui:` words.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:present
+
+ Data: -
+ Addr: -
+ Float: -
+
+Display all views.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:remove-view
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Remove view named `s` from the displayed views.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:set-action
+
+ Data: as-
+ Addr: -
+ Float: -
+
+Set the action handler for a view to the specified Retro word address.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:set-position
+
+ Data: nns-
+ Addr: -
+ Float: -
+
+Move view `s` to row `n1` and column `n2`.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:set-size
+
+ Data: nns-
+ Addr: -
+ Float: -
+
+Set view `s` to height `n1` and width `n2`.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:set-text
+
+ Data: ss-
+ Addr: -
+ Float: -
+
+Set the text property of view `s2` to `s1`.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
+ui:set-title
+
+ Data: ss-
+ Addr: -
+ Float: -
+
+Set the title property of view `s2` to `s1`.
+
+Class: class:word | Namespace: ui | Interface Layer: retro/python
+------------------------------------------------------------------------
+
unhook
Data: a-
@@ -5663,6 +5817,22 @@ Close a pipe.
Class: class:word | Namespace: unix | Interface Layer: rre
------------------------------------------------------------------------
+unix:pipe
+
+ Data: s-
+ Addr: -
+ Float: -
+
+Takes a string with a Unix command line and run it in a pipe, returning a new string with the first line of the output from the pipe.
+
+Class: class:word | Namespace: unix | Interface Layer: rre
+
+Example #1:
+
+ 'ls_-l unix:pipe s:put nl
+
+------------------------------------------------------------------------
+
unix:popen
Data: sn-n
diff --git a/doc/book/internals/calling-retro-from-c b/doc/book/internals/calling-retro-from-c
index 3389131..1ccb6d4 100644
--- a/doc/book/internals/calling-retro-from-c
+++ b/doc/book/internals/calling-retro-from-c
@@ -63,5 +63,5 @@ listener:
stack_push(1024);
execute("interpret", memory[2]);
-The `interpret` word handles things like prefixes, so this is
+The `interpret` word handles things like sigils, so this is
needed if you want to run something that needs those.
diff --git a/doc/book/tech-notes/kernel-words b/doc/book/tech-notes/kernel-words
index 3f5b198..296ce72 100644
--- a/doc/book/tech-notes/kernel-words
+++ b/doc/book/tech-notes/kernel-words
@@ -35,14 +35,14 @@ Compiler & Interpreter
Compiler Heap ; [ ] Dictionary
d:link d:class d:xt d:name d:add-header
class:word class:primitive class:data class:macro
- prefix:: prefix:# prefix:& prefix:$
+ sigil:: sigil:# sigil:& sigil:$
interpret d:lookup err:notfound
Assembler
i d r
-I *could* slightly reduce this. The $ prefix could be defined in
+I *could* slightly reduce this. The $ sigil could be defined in
higher level code, and I don't strictly *need* to expose the
`fetch-next` and `store-next` here. But since the are already
implemented as dependencies of the words in the kernel, it would
diff --git a/doc/book/tech-notes/prefixes b/doc/book/tech-notes/prefixes
index 9a7422c..2038965 100644
--- a/doc/book/tech-notes/prefixes
+++ b/doc/book/tech-notes/prefixes
@@ -1,4 +1,4 @@
-## Prefixes as a Language Element
+## Sigils as a Language Element
A big change in RETRO 12 was the elimination of the traditional
parser from the language. This was a sacrifice due to the lack
@@ -10,26 +10,26 @@ And so `interpret` operates only on the current token. The core
language does not track what came before or attempt to guess at
what might come in the future.
-This leads into the prefixes. RETRO 11 had a complicated system
-for prefixes, with different types of prefixes for words that
+This leads into the sigils. RETRO 11 had a complicated system
+for sigils, with different types of sigilss for words that
parsed ahead (e.g., strings) and words that operated on the
current token (e.g., `@`). RETRO 12 eliminates all of these in
-favor of just having a single prefix model.
+favor of just having a single sigil model.
The first thing `interpret` does is look to see if the first
-character in a token matches a `prefix:` word. If it does, it
-passes the rest of the token as a string pointer to the prefix
-specific handler to deal with. If there is no valid prefix
+character in a token matches a `sigil:` word. If it does, it
+passes the rest of the token as a string pointer to the sigil
+specific handler to deal with. If there is no valid sigil
found, it tries to find it in the dictionary. Assuming that it
finds the words, it passes the `d:xt` field to the handler that
`d:class` points to. Otherwise it calls `err:notfound`.
This has an important implication: *words can not reliably
-have names that start with a prefix character.*
+have names that start with a sigil character.*
It also simplifies things. Anything that would normally parse
-becomes a prefix handler. So creating a new word? Use the `:`
-prefix. Strings? Use `'`. Pointers? Try `&`. And so on. E.g.,
+becomes a sigil handler. So creating a new word? Use the `:`
+sigil. Strings? Use `'`. Pointers? Try `&`. And so on. E.g.,
In ANS | In RETRO
: foo ... ; | :foo ... ;
@@ -37,10 +37,10 @@ prefix. Strings? Use `'`. Pointers? Try `&`. And so on. E.g.,
: bar ... ['] foo ; | :bar ... &foo ;
s" hello world!" | 'hello_world!
-If you are familiar with ColorForth, prefixes are a similar
+If you are familiar with ColorForth, sigils are a similar
idea to colors, but can be defined by the user as normal words.
After doing this for quite a while I rather like it. I can see
why Chuck Moore eventually went towards ColorForth as using
-color (or prefixes in my case) does simplify the implementation
+color (or sigils in my case) does simplify the implementation
in many ways.
diff --git a/doc/book/tech-notes/underscores-in-names b/doc/book/tech-notes/underscores-in-names
index 1742cef..4873cad 100644
--- a/doc/book/tech-notes/underscores-in-names
+++ b/doc/book/tech-notes/underscores-in-names
@@ -13,9 +13,9 @@ Consider:
'test_name var
#188 !test_name
-In the first case, the `:` prefix handles the token, so the
+In the first case, the `:` sigil handles the token, so the
underscore is not remapped to a space, creating a word name as
-`hello_msg`. But in the second, the `'` prefix remaps the
+`hello_msg`. But in the second, the `'` sigil remaps the
underscore to a space, giving a variable name of `test name`.
In the third line, the name lookup will fail as `test_name` is
not defined, so the store will be done to an incorrect address.
diff --git a/doc/book/techniques/assembly b/doc/book/techniques/assembly
index ed053e2..ed9e0af 100644
--- a/doc/book/techniques/assembly
+++ b/doc/book/techniques/assembly
@@ -100,7 +100,7 @@ Instead of:
i dudumu..
-The runtime assembler also provides three prefixes for use in
+The runtime assembler also provides three sigils for use in
inlining machine code into a definition. These are:
\ Treat token as an assembly sequence
diff --git a/doc/book/techniques/characters b/doc/book/techniques/characters
index 3e7fd4f..eca1dd5 100644
--- a/doc/book/techniques/characters
+++ b/doc/book/techniques/characters
@@ -2,9 +2,9 @@
RETRO provides words for working with ASCII characters.
-## Prefix
+## Sigil
-Character constants are returned using the `$` prefix.
+Character constants are returned using the `$` sigil.
## Namespace
diff --git a/doc/book/techniques/floating-point b/doc/book/techniques/floating-point
index 7589289..3e42c72 100644
--- a/doc/book/techniques/floating-point
+++ b/doc/book/techniques/floating-point
@@ -9,7 +9,7 @@ precision (1 bit for the sign, 11 bits for the exponent, and
the remaining 52 bits for the value), i.e. 15 decimal digits
of precision.
-## Prefix
+## Sigil
Floating point numbers start with a `.`
diff --git a/doc/book/techniques/naming-conventions b/doc/book/techniques/naming-conventions
index 23eab25..01a5675 100644
--- a/doc/book/techniques/naming-conventions
+++ b/doc/book/techniques/naming-conventions
@@ -6,7 +6,7 @@ Word names in RETRO generally follow the following conventions.
* Readability is important
* Be consistent
-* Don't use a prefix as the first character of a name
+* Don't use a sigil as the first character of a name
* Don't use underscores in word names
* Use short names for indices
* Word names start with a `-` for "not"
@@ -61,7 +61,7 @@ The common namespaces are:
| err: | Words for handling errors |
| io: | General I/O words |
| n: | Words operating on numeric data |
- | prefix: | Contains prefix handlers |
+ | sigil: | Contains sigil handlers |
| s: | Words operating on string data |
| v: | Words operating on variables |
| file: | File I/O words |
@@ -70,15 +70,15 @@ The common namespaces are:
## Tips
-### Don't Start Names With Prefix Characters
+### Don't Start Names With Sigil Characters
-Avoid using a prefix as the first character of a word name. RETRO
-will look for prefixes first, this will prevent direct use of
+Avoid using a sigil as the first character of a word name. RETRO
+will look for sigils first, this will prevent direct use of
the work in question.
-To find a list of prefix characters, do:
+To find a list of sigil characters, do:
- 'prefix: d:words-with
+ 'sigil: d:words-with
### Don't Use Underscores
diff --git a/doc/book/techniques/numbers b/doc/book/techniques/numbers
index d7ed2fb..f7298f1 100644
--- a/doc/book/techniques/numbers
+++ b/doc/book/techniques/numbers
@@ -2,9 +2,9 @@
Numbers in RETRO are signed integers.
-## Token Prefix
+## Sigil
-All numbers start with a `#` prefix.
+All numbers start with a `#` sigil.
## Namespace
diff --git a/doc/book/techniques/pointers b/doc/book/techniques/pointers
index cfe4f1a..c5c8579 100644
--- a/doc/book/techniques/pointers
+++ b/doc/book/techniques/pointers
@@ -1,8 +1,8 @@
# Working With Pointers
-## Prefix
+## Sigil
-Pointers are returned by the `&` prefix.
+Pointers are returned by the `&` sigil.
## Examples
diff --git a/doc/book/techniques/strings b/doc/book/techniques/strings
index 939fe0b..d4e59bb 100644
--- a/doc/book/techniques/strings
+++ b/doc/book/techniques/strings
@@ -9,7 +9,7 @@ strings can contain UTF8 encoded data if the host platform
allows. Words like `s:length` will return the number of bytes,
not the number of logical characters in this case.
-## Prefix
+## Sigil
Strings begin with a single `'`.
diff --git a/doc/html/chapters/general/quick-tutorial.html b/doc/html/chapters/general/quick-tutorial.html
index 8ca17b1..0f31165 100644
--- a/doc/html/chapters/general/quick-tutorial.html
+++ b/doc/html/chapters/general/quick-tutorial.html
@@ -71,7 +71,7 @@ name it:
```
:palindrome? dup s:reverse s:eq? ;
```
-Naming uses the : prefix to add a new word to the dictionary.
+Naming uses the : sigil to add a new word to the dictionary.
The words that make up the definition are then placed, with a
final word (;) ending the definition. We can then use this:
diff --git a/doc/html/chapters/general/syntax.html b/doc/html/chapters/general/syntax.html
index d1c7aed..9848695 100644
--- a/doc/html/chapters/general/syntax.html
+++ b/doc/html/chapters/general/syntax.html
@@ -56,12 +56,12 @@ Input is divided into a series of whitespace delimited tokens.
Each of these is then processed individually. There are no
parsing words in RETRO.
-Tokens may have a single character prefix, which RETRO will
+Tokens may have a single character sigil, which RETRO will
use to decide how to process the token.
-Prefixes
+Sigils
-Prefixes are single characters added to the start of a token
+Sigils are single characters added to the start of a token
to guide the compiler. The use of these is a major way in
which RETRO differs from traditional Forth.
@@ -91,24 +91,24 @@ like:
In RETRO, the interpret process is basically:
get token
-does the first character match a `prefix:` word?
- yes: pass the token to the prefix handler
+does the first character match a `sigil:` word?
+ yes: pass the token to the sigil handler
no: is token a word in the dictionary?
yes: push the XT to the stack and call the
class handler
no: report an error ("not found")
All of the actual logic for how to deal with tokens is moved
-to the individual prefix handlers, and the logic for handling
+to the individual sigil handlers, and the logic for handling
words is moved to word class handlers.
-This means that prefixes are used for a lot of things. Numbers?
-Handled by a # prefix. Strings? Use the ' prefix. Comments?
-Use (. Making a new word? Use the : prefix.
+This means that sigils are used for a lot of things. Numbers?
+Handled by a # sigil. Strings? Use the ' sigil. Comments?
+Use (. Making a new word? Use the : sigil.
-The major prefixes are:
+The major sigils are:
-| Prefix | Used For |
+| Sigil | Used For |
| ------ | ----------------------------- |
| @ | Fetch from variable |
| ! | Store into variable |
@@ -119,7 +119,7 @@ The major prefixes are:
| ( | Comments |
| : | Define a word |
-The individual prefixes will be covered in more detail in the
+The individual sigils will be covered in more detail in the
later chapters on working with different data types.
Word Classes
diff --git a/doc/html/chapters/internals/calling-retro-from-c.html b/doc/html/chapters/internals/calling-retro-from-c.html
index 5ab955c..dbade3c 100644
--- a/doc/html/chapters/internals/calling-retro-from-c.html
+++ b/doc/html/chapters/internals/calling-retro-from-c.html
@@ -108,7 +108,7 @@ listener:
stack_push(1024);
execute("interpret", memory[2]);
-The interpret word handles things like prefixes, so this is
+The interpret word handles things like sigils, so this is
needed if you want to run something that needs those.