From 529de2d3c71e8ed9d3b7a879cabafc604b25d9bc Mon Sep 17 00:00:00 2001 From: crc Date: Fri, 9 Nov 2018 03:25:59 +0000 Subject: [PATCH] minor fixes FossilOrigin-Name: d652359889a08ef9863c12862a4d078457570d7caf89479215c939fbb26bfb58 --- doc/Glossary.txt | 1507 +--------------------------------------------- tools/muri.c | 2 +- tools/unu.c | 2 +- 3 files changed, 9 insertions(+), 1502 deletions(-) diff --git a/doc/Glossary.txt b/doc/Glossary.txt index dd02e9d..664580e 100644 --- a/doc/Glossary.txt +++ b/doc/Glossary.txt @@ -3557,1511 +3557,18 @@ Class Handler: class:macro | Namespace: prefix | Interface Layer: all ---------------------------------------------------------------- -push - - Data: n- - Addr: -n - Float: - - -Move a value from the data stack to the return stack. - -Class Handler: class:macro | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -r - - Data: s- - Addr: - - Float: - - -Lookup a reference by name and inline its pointer to the current assembly segment. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -reclass - - Data: a- - Addr: - - Float: - - -Change the class handler of the most recently defined word to the specified one. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -reorder - - Data: ...ss-? - Addr: - - Float: - - -Restructure the order of items on the stack. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -repeat - - Data: - - Addr: - - Float: - - -Begin an unconditional loop. - -Class Handler: class:macro | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -reset - - Data: ...- - Addr: - - Float: - - -Remove all items from the stack. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -rot - - Data: abc-bca - Addr: - - Float: - - -Rotate the top three values. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -s, - - Data: s- - Addr: - - Float: - - -Compile the code needed to push a string pointer to the stack and inline the string data into the current definition. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -s:ASCII-LETTERS - - Data: -s - Addr: - - Float: - - -Constant. Returns a string of the ASCII letters (upper and lower case) - -Class Handler: class:data | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:ASCII-LOWERCASE - - Data: -s - Addr: - - Float: - - -Constant. Returns a string of the ASCII letters in lowercase - -Class Handler: class:data | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:ASCII-UPPERCASE - - Data: -s - Addr: - - Float: - - -Constant. Returns a string of the ASCII letters in uppercase - -Class Handler: class:data | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:DIGITS - - Data: -s - Addr: - - Float: - - -Constant. Return a string of characters recognized as numeric digits. - -Class Handler: class:data | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:PUNCTUATION - - Data: -s - Addr: - - Float: - - -Constant. Return a string of characters recognized as punctuation. - -Class Handler: class:data | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:WHITESPACE - - Data: -s - Addr: - - Float: - - -Constant. Returns a string of characters recognized as whitespace. - -Class Handler: class:data | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:append - - Data: ss-s - Addr: - - Float: - - -Return a new string consisting of s1 followed by s2. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:case - - Data: sSq- || sSq-s - Addr: - - Float: - - -If the `s` matches `S`, discard `s` and run the quote before exiting the caller. If they do not match, discard the quote and leave `s` on the stack. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:chop - - Data: s-s - Addr: - - Float: - - -Remove the last character from a string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:const - - Data: ss- - Addr: - - Float: - - -Create a constant named s2, returning a pointer to s1. This will use `s:keep` to preserve the original string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:contains-char? - - Data: sc-f - Addr: - - Float: - - -Return `TRUE` if the character is present in the string or `FALSE` otherwise. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:contains-string? - - Data: ss-f - Addr: - - Float: - - -Return `TRUE` if the second string is present in the first string or `FALSE` otherwise. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:copy - - Data: sa- - Addr: - - Float: - - -Copy a string (s) to a destination (a). This will include the terminator character when copying. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:empty - - Data: -s - Addr: - - Float: - - -Return an empty string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:eq? - - Data: ss-f - Addr: - - Float: - - -Compare two strings for equality. Return `TRUE` if identical or `FALSE` if not. - -Class Handler: class:word | Namespace: s | Interface Layer: all - -Example #1: - - 'hello 'again s:eq? - 'test 'test s:eq? - ----------------------------------------------------------------- - -s:evaluate +prefix:| Data: s-? Addr: - Float: - -Evaluate string as if it was typed into the interpreter. +This is similar to POSTPONE in ANS FORTH. -Class Handler: class:word | Namespace: s | Interface Layer: all +Interpret Time: + class:macro ----------------------------------------------------------------- - -s:filter - - Data: sq-s - Addr: - - Float: - - -Execute the quote once for each value in the string. If the quote returns `TRUE`, append the value into a new string. If `FALSE` the value will be discarded. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:for-each - - Data: sq- - Addr: - - Float: - - -Execute the quote once for each value in the string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:format - - Data: ...s-s - Addr: - - Float: - - -Construct a new string using the template passed and items from the stack. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:get - - Data: -s - Addr: - - Float: - - -Read input from standard in (via `c:get`) until a CR or LF is encountered. Returns a strig. - -Class Handler: class:word | Namespace: all | Interface Layer: rre - ----------------------------------------------------------------- - -s:hash - - Data: s-n - Addr: - - Float: - - -Calculate a hash value for a string. This uses the djb2 algorithm. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:index-of - - Data: sc-n - Addr: - - Float: - - -Return the location of the first instance of the specified character in the string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:index-of-string - - Data: ss-n - Addr: - - Float: - - -Return the location of the first instance of the specified substring (s2) in the string (s1). Returns -1 if not found. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:keep - - Data: s-s - Addr: - - Float: - - -Store a string into the heap and return a pointer to the start of it. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:left - - Data: sn-s - Addr: - - Float: - - -Return a new string containing the first `n` characters from the source string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:length - - Data: s-n - Addr: - - Float: - - -Return the number of characters in a string, excluding the NULL terminator. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:map - - Data: sq-s - Addr: - - Float: - - -Execute the specified quote once for each character in the string. Builds a new string from the return value of the quote. The quote should return only one value. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:prepend - - Data: ss-s - Addr: - - Float: - - -Return a new string consisting of s2 followed by s1. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:put - - Data: s- - Addr: - - Float: - - -Display a string. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -s:replace - - Data: sss-s - Addr: - - Float: - - -Replace the first instance of s2 in s1 with s3. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:reverse - - Data: s-s - Addr: - - Float: - - -Reverse the order of ASCII characters in a string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:right - - Data: sn-s - Addr: - - Float: - - -Return a new string containing the specified number of characters from the right side of the string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:skip - - Data: - - Addr: - - Float: - - -Internal helper function used to skip over a string in a definition. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:split - - Data: sc-ss - Addr: - - Float: - - -Split a string on the first occurrance of the specified character. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:split-on-string - - Data: ss-ss - Addr: - - Float: - - -Split a string on the first occurrance of the specified string. After the split, the top stack item will be the part of the string before the specified subsring, and the second item will be the rest of the original string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - -Example #1: - - 'Hello_Brave_World! 'Brave s:split-on-string s:put nl s:put nl - ----------------------------------------------------------------- - -s:substr - - Data: sfl-s - Addr: - - Float: - - -Extract a substring from the specified string. This will take the characters starting at `f` and extend `l` characters in length. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:temp - - Data: s-s - Addr: - - Float: - - -Move a string into the temporary string buffers. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:to-float - - Data: s- - Addr: - - Float: -F - -Convert a string representation into a floating point value. - -Class Handler: class:word | Namespace: s | Interface Layer: rre - ----------------------------------------------------------------- - -s:to-lower - - Data: s-s - Addr: - - Float: - - -Convert uppercase ASCII characters in a string to lowercase. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:to-number - - Data: s-n - Addr: - - Float: - - -Convert a string to a number. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:to-upper - - Data: s-s - Addr: - - Float: - - -Convert lowercase ASCII characters in a string to uppercase. - -Class Handler: class:word | Namespace: s | Interface Layer: all - ----------------------------------------------------------------- - -s:tokenize - - Data: sc-a - Addr: - - Float: - - -Takes a string and a character to use as a separator. It splits the string into a set of substrings and returns a set containing pointers to each of them. - -Class Handler: class:word | Namespace: {n/a} | Interface Layer: {n/a} - ----------------------------------------------------------------- - -s:tokenize-on-string - - Data: ss-a - Addr: - - Float: - - -Takes a string (s1) and a substring (s2) use as a separator. It splits the string into a set of substrings and returns a set containing pointers to each of them. - -Class Handler: class:word | Namespace: {n/a} | Interface Layer: {n/a} - ----------------------------------------------------------------- - -s:trim - - Data: s-s - Addr: - - Float: - - -Trim leading and trailing whitespace from a string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - -Example #1: - - '__hello__ s:trim - ----------------------------------------------------------------- - -s:trim-left - - Data: s-s - Addr: - - Float: - - -Trim leading whitespace from a string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - -Example #1: - - '__hello__ s:trim-left - ----------------------------------------------------------------- - -s:trim-right - - Data: s-s - Addr: - - Float: - - -Trim trailing whitespace from a string. - -Class Handler: class:word | Namespace: s | Interface Layer: all - -Example #1: - - '__hello__ s:trim-right - ----------------------------------------------------------------- - -set:contains-string? - - Data: sa-f - Addr: - - Float: - - -Return `TRUE` if the string value is in the set or`FALSE` otherwise. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:contains? - - Data: na-f - Addr: - - Float: - - -Return `TRUE` if the value is in the set or `FALSE` otherwise. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:dup - - Data: a-b - Addr: - - Float: - - -Make a copy of a set. Return the address of the copy. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:filter - - Data: aq-b - Addr: - - Float: - - -For each item in the initial set, run the specified quote. If the quote returns `TRUE`, copy the item into a new set. If `FALSE`, discard it. Returns a pointer to the new set. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:for-each - - Data: aq- - Addr: - - Float: - - -Execute the quote once for each item in the set. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:from-results - - Data: q-a - Addr: - - Float: - - -Execute quote. Return a new set containing the values the quote leaves on the stack. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:from-string - - Data: s-a - Addr: - - Float: - - -Create a new set with the characters in the source string. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:length - - Data: a-n - Addr: - - Float: - - -Return the length of a set. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:make - - Data: q-a - Addr: - - Float: - - -Execute quote. Return a new set containing the values the quote leaves on the stack. This is identical to doing `set:from-results set:reverse` - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:map - - Data: aq- - Addr: - - Float: - - -Execute quote once for each item in the set. Constructs a new set from the value returned by the quote. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:nth - - Data: an-b - Addr: - - Float: - - -Return the actual address of the nth item in the set. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:reduce - - Data: pnq-n - Addr: - - Float: - - -Takes a set, a starting value, and a quote. This will apply the quote to each item in the set; the quote should consume two values and return one. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -set:reverse - - Data: a-b - Addr: - - Float: - - -Reverse the order of items in a set. This will return a new set. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -shift - - Data: mn-o - Addr: - - Float: - - -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 Handler: class:primitive | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -sip - - Data: nq-n - Addr: - - Float: - - -Run quote. After execution completes, put a copy of n back on top of the stack. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -sp - - Data: - - Addr: - - Float: - - -Display a space (`ASCII:SPACE`) - -Class Handler: class:word | Namespace: global | Interface Layer: all - -Example #1: - - :spaces (n-) [ sp ] times ; - #12 spaces - ----------------------------------------------------------------- - -store - - Data: na- - Addr: - - Float: - - -Store a value into the specified address. - -Class Handler: class:primitive | Namespace: global | Interface Layer: all - -Example #1: - - 'Base var - #10 &Base store - ----------------------------------------------------------------- - -store-next - - Data: na-a - Addr: - - Float: - - -Store a value into the specified address and return the next address. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -swap - - Data: nm-mn - Addr: - - Float: - - -Exchange the position of the top two items on the stack - -Class Handler: class:primitive | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -sys:argc - - Data: -n - Addr: - - Float: - - -Return the number of arguments passed to the program. - -Class Handler: class:word | Namespace: sys | Interface Layer: rre - ----------------------------------------------------------------- - -sys:argv - - Data: n-s - Addr: - - Float: - - -Given an argument number, return the argument as a string. - -Class Handler: class:word | Namespace: sys | Interface Layer: rre - ----------------------------------------------------------------- - -tab - - Data: - - Addr: - - Float: - - -Display a tab (`ASCII:HT`) - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -times - - Data: nq- - Addr: - - Float: - - -Run the specified quote the specified number of times. - -Class Handler: class:word | Namespace: global | Interface Layer: all - -Example #1: - - #12 [ $- c:put ] times - ----------------------------------------------------------------- - -times - - Data: nq- - Addr: - - Float: - - -Run a quote the specified number of times, tracking the loop index in `I`. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -tri - - Data: xqqq-? - Addr: - - Float: - - -Apply q1 against x, then q2 against a copy of x, and finally q3 against another copy of x. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -tri* - - Data: xyzqqq-? - Addr: - - Float: - - -Apply q1 against x, q2 against y, and q3 against z. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -tri@ - - Data: xyzq-? - Addr: - - Float: - - -Apply q against x, then against y, and finally against z. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -tuck - - Data: nm-mnm - Addr: - - Float: - - -Put a copy of the top item on the stack under the second one. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -unix:chdir - - Data: s- - Addr: - - Float: - - -Change the current working directory to the specified one. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - -Example #1: - - '/etc unix:chdir - ----------------------------------------------------------------- - -unix:exec0 - - Data: s- - Addr: - - Float: - - -Execute a process by running the application specified by s. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:exec1 - - Data: ss- - Addr: - - Float: - - -Execute a process by running the application specified by s1. Pass s2 as an argument. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:exec2 - - Data: sss- - Addr: - - Float: - - -Execute a process by running the application specified by s1. Pass s2 and s3 as arguments. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:exec3 - - Data: ssss- - Addr: - - Float: - - -Execute a process by running the application specified by s1. Pass s2, s3, and s4 as arguments. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:exit - - Data: n- - Addr: - - Float: - - -Exit the current process, returning the specified return code. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:fork - - Data: -n - Addr: - - Float: - - -Fork the current process. Returns a PID. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:getenv - - Data: sa- - Addr: - - Float: - - -Get an environment variable. Provide the name and an address to store it in. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - -Example #1: - - 'SHELL s:empty [ unix:getenv ] sip s:put nl - ----------------------------------------------------------------- - -unix:getpid - - Data: -n - Addr: - - Float: - - -Return the PID of the current process. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:io:n:put - - Data: n- - Addr: - - Float: - - -Display a number (in base 10) to the standard output device. This is faster than `n:put`, but not portable. - -Class Handler: class:word | Namespace: unix:io | Interface Layer: rre - ----------------------------------------------------------------- - -unix:io:s:put - - Data: s- - Addr: - - Float: - - -Display a string to stdout. This is faster than `s:put`, but not portable. - -Class Handler: class:word | Namespace: unix:io | Interface Layer: rre - ----------------------------------------------------------------- - -unix:kill - - Data: nn- - Addr: - - Float: - - -Terminates a process. Takes a process and a signal to send. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:pclose - - Data: n- - Addr: - - Float: - - -Close a pipe. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:popen - - Data: sn-n - Addr: - - Float: - - -Open a pipe. Takes a command to run, and a file mode (`file:R` or `file:W`; `file:R+` may work on some systems). Returns a file ID usable with words in the `file:` namespace. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:putenv - - Data: s- - Addr: - - Float: - - -Takes a string in the form `name=value` and sets an environment variable named `name` to `value`. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - -Example #1: - - 'EDITOR=vi unix:putenv - ----------------------------------------------------------------- - -unix:sleep - - Data: n- - Addr: - - Float: - - -Sleep for the specified number of seconds. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:system - - Data: s- - Addr: - - Float: - - -Runs another application using the system shell and returns after execution is completed. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - -Example #1: - - 'ls_-lh_/etc unix:system - ----------------------------------------------------------------- - -unix:wait - - Data: -n - Addr: - - Float: - - -Waits for a child process to complete. This maps to the wait() system call. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -unix:write - - Data: sh- - Addr: - - Float: - - -Write a string to the specified file handle. - -Class Handler: class:word | Namespace: unix | Interface Layer: rre - ----------------------------------------------------------------- - -until - - Data: q- - Addr: - - Float: - - -Execute quote repeatedly while the quote returns a value of `FALSE`. The quote should return a flag of either `TRUE` or `FALSE`, though `until` will treat any non-zero value as `TRUE`. - -Class Handler: class:word | Namespace: global | Interface Layer: all - -Example #1: - - #10 [ dup n:put nl n:dec dup n:zero? ] until - ----------------------------------------------------------------- - -v:dec - - Data: a- - Addr: - - Float: - - -Decrement the value stored at the specified address by 1. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -v:dec-by - - Data: na- - Addr: - - Float: - - -Decrement the value stored at the specified address by the specified value. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -v:inc - - Data: a- - Addr: - - Float: - - -Increment the value stored at the specified address by 1. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -v:inc-by - - Data: na- - Addr: - - Float: - - -Increment the value stored at the specified address by the specified value. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -v:limit - - Data: alu- - Addr: - - Float: - - -Fetch the value stored at the address, then run `n:limit` against it, using the specified lower and upper bounds. Then store the resulting value back to the original address. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -v:off - - Data: a- - Addr: - - Float: - - -Set a variable to 0. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -v:on - - Data: a- - Addr: - - Float: - - -Set a variable to -1. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -v:preserve - - Data: aq- - Addr: - - Float: - - -Make a copy of the value at the address, then run the quote. Once the quote completes, restore the address to the specified value. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -v:update-using - - Data: aq- - Addr: - - Float: - - -Fetch a value from the specified address, then run the quotation with this value on the stack. Afterwards, store the returned value at the original address. - -Class Handler: class:word | Namespace: v | Interface Layer: all - ----------------------------------------------------------------- - -var - - Data: s- - Addr: - - Float: - - -Create a variable. The variable is initialized to 0. - -Class Handler: class:word | Namespace: global | Interface Layer: all - -Example #1: - - 'Base var - ----------------------------------------------------------------- - -var - - Data: ns- - Addr: - - Float: - - -Create a variable with the specified initial value. - -Class Handler: class:word | Namespace: global | Interface Layer: all - -Example #1: - - #10 'Base var - - ----------------------------------------------------------------- - -while - - Data: q- - Addr: - - Float: - - -Execute quote repeatedly while the quote returns a `TRUE` value. The quote should return a flag of either `TRUE` or `FALSE`, though `while` will treat any non-zero value as `TRUE`. - -Class Handler: class:word | Namespace: global | Interface Layer: all - -Example #1: - - #10 [ dup n:put nl n:dec dup n:-zero? ] while - ----------------------------------------------------------------- - -xor - - Data: mn-o - Addr: - - Float: - - -Perform a bitwise XOR operation. - -Class Handler: class:primitive | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -{ - - Data: - - Addr: - - Float: - - -Begin a set. This is intended to make creating sets a bit cleaner than using a quotation and `set:from-results`. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -{{ - - Data: - - Addr: - - Float: - - -Begin a lexically scoped area. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -} - - Data: -a - Addr: - - Float: - - -Complete a set begun by `{`. Returns a pointer to the data. - -Class Handler: class:word | Namespace: set | Interface Layer: all - ----------------------------------------------------------------- - -}as - - Data: f- - Addr: - - Float: - - -End an assembly section. - -Class Handler: class:macro | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- - -}} - - Data: - - Addr: - - Float: - - -End a lexically scoped area. - -Class Handler: class:word | Namespace: global | Interface Layer: all - ----------------------------------------------------------------- +Compile Time: + {n/a} +Attempt to store outside of memory bounds diff --git a/tools/muri.c b/tools/muri.c index 2fdb5d7..9db810d 100644 --- a/tools/muri.c +++ b/tools/muri.c @@ -167,6 +167,6 @@ int main(int argc, char **argv) { printf("Wrote %d cells to ngaImage\n", here); } else - printf("muri\n(c) 2017 charles childers\n\n%s filename\n", argv[0]); + printf("muri\n(c) 2017-2018 charles childers\n\n%s filename\n", argv[0]); return 0; } diff --git a/tools/unu.c b/tools/unu.c index 7d954d6..b06fd97 100644 --- a/tools/unu.c +++ b/tools/unu.c @@ -61,6 +61,6 @@ int main(int argc, char **argv) { } } else - printf("unu\n(c) 2013-2017 charles childers\n\nTry:\n %s filename\n", argv[0]); + printf("unu\n(c) 2013-2018 charles childers\n\nTry:\n %s filename\n", argv[0]); return 0; }