The 8th™ Programming Language
Word list version 24.06
Copyright © AHT Associates LLC, All Rights Reserved 8th™ is a trademark of AHT Associates LLC
Words by namespace
The following is an exhaustive list of the built-in words in 8th, arranged by namespace, including descriptions of the words and their SEDs. This information is the same as that provided by the console help.
Namespace: 2fa
Description: Two factor authentication
| word | sed/description |
|---|---|
| gen-secret | -- b (as of 21.02) |
| needs 2fa/totp Generate a secret key for the TOTP algorithm to use. Returns a 16 byte random buffer. |
|
| gen-url | m -- url (as of 21.02) |
| needs 2fa/totp Takes a map with the parameters to be converted to a QR code or base64 encoded for Authy or Google Authenticator, etc. Valid keys are: |
|
| validate-code | key code ndigits -- T (as of 21.02) |
| needs 2fa/totp Takes the TOTP secret and the code entered by the user, and validates the code |
Namespace: app
Description: Application
| word | sed/description |
|---|---|
| 8thdir | -- s |
Returns the name of the (OS specific) directory where 8th stores data; this is almost the same as |
|
| asset | s -- b |
Read an "asset", which is a resource bundled with the application. Returns a buffer containing the resource content. The parameter |
|
| atrun | opt -- |
| needs win/atrun given a map opt, arrange to launch the indicated application at a specific time. the keys in the map are: "exe" - a string which is the name of the executable to run (required); "args" - an array of strings which has the command-line arguments to the application; "when" - a date which indicates the time at which the application should be run (required); "dir" - the directory where the exe should run (not effective on linux/rpi). |
|
| atrun | opt -- |
| needs mac/atrun Given a map opt, arrange to launch the indicated application at a specific time. The keys in the map are: "exe" - a string which is the name of the executable to run (required); "args" - an array of strings which has the command-line arguments to the application; "when" - a date which indicates the time at which the application should be run (required); "dir" - the directory where the exe should run (not effective on Linux/RPI). |
|
| atrun | m -- |
| needs lin/atrun given a map, arrange to launch the indicated application at a specific time. The keys in the map are:
Requires "atd" be installed and running. |
|
| basedir | -- s |
Returns a string which is the name of the (OS specific) application-accessible directory. |
|
| basename | -- s (as of 23.04) |
Returns the name of the executable 8th is named as. |
|
| config-file-name | s -- s (as of 21.08) |
| needs utils/config-file Given a base-name, return the OS-specific path to a "private" configuration file It is the result of |
|
| current | -- (as of 18.01) |
Launches a system-defined browser to the canonical 8th "current" page, with your user id and version of 8th. Will give you the option to refresh your build if you like. |
|
| datadir | -- s |
Returns the OS specific name of the directory where this application stores data. |
|
| display-moved | n -- (as of 23.08) |
| DEFFERED Invoked when the primary monitor has moved or changes position with another monitor. |
|
| exename | -- s |
Returns a string which is the running executable's full path name. |
|
| localechanged | -- (as of 21.08) |
| DEFFERED Invoked when the user changes the system locale. After this message is received, you can get the new current locale using |
|
| lowmem | -- (as of 20.01) |
| DEFFERED Invoked if the OS is running low on memory. Free up resources if you can. |
|
| main | -- |
If you define a word with this name, your application will start there. Otherwise, the default version will run, which just invokes |
|
| name | -- v (as of 21.06) |
A var which contains the name of the current application. The default value is "8th", so you probably want to change it, e.g. |
|
| onback | -- (as of 24.05) |
| DEFFERED Invoked when the "back button" is pressed (Android only). The default d: behavior invokes |
|
| oncrash | s -- (as of 18.06) |
If the application crashed, this word is invoked with a message. |
|
| opts! | s x -- (as of 19.07) |
Stores the value See also: app:opts@ |
|
| opts@ | s -- x (as of 19.07) |
Returns the value See also: app:opts! |
|
| orientation | n -- (as of 16.13) |
| DEFFERED Invoked (on mobile devices) when the device orientation has changed. |
|
| orientation! | n -- (as of 20.04) |
On mobile devices (Android only for the moment) sets the permitted orientation: 1 for 'upright', 2 for 'upside down', 3 for 'rotated clockwise' and 4 for 'rotated anti-clockwise'. |
|
| pid | -- n (as of 17.06) |
Returns the application's OS-specific process-id. |
|
| post-main | -- (as of 20.01) |
| DEFFERED For non-mobile applications only. Invoked just after |
|
| pre-main | -- (as of 20.01) |
| DEFFERED For non-mobile applications only. Invoked prior to |
|
| privdir | -- s (as of 21.08) |
Returns the os-specific "private dir" (e.g. "/etc/" on POSIX systems) |
|
| raise | n -- | s -- (as of 19.09) |
Sends ("raises") the given signal to the app. If it's a number, that signal number is raised; if it's a string, then the signal of that name is raised. Only signals which 8th traps by default can be named. Ex: See also: app:signal app:trap |
|
| read-config | s -- m (as of 21.08) |
| needs utils/config-file Given the config-file base-name, return a buffer containing the contents of the file (or null, if there's nothing there) |
|
| read-config-map | s -- m (as of 21.08) |
| needs utils/config-file Given the config-file base-name, return a map with values in the JSON formatted map in that file. Returns an empty map if the file does not contain one. |
|
| read-config-var | s name -- x (as of 21.08) |
| needs utils/config-file Given the config-file base-name, and the name of a variable (a key in the map therein), return the value of the key. |
|
| request-perm | s -- T (as of 20.05) |
ANDROID: request the OS-specific permission (e.g. "android.permission.RECORD_AUDIO"). Returns |
|
| restart | -- (as of 17.06) |
Restarts the application from the beginning, launching a new process. |
|
| resumed | -- |
| DEFFERED Mobile only. Invoked when the application is about to be resumed. TOS is See also: app:suspended |
|
| signal | s -- (as of 19.09) |
| DEFFERED Invoked when the OS signal See also: app:trap app:raise |
|
| standalone | -- v (as of 17.10) |
A var which holds the value |
|
| standalone! | T -- (as of 24.06) |
Sets |
|
| subdir | s -- s' (as of 17.01) |
Returns the name of the subdirectory of the (OS specific) directory where 8th stores data. |
|
| suspended | T -- |
| DEFFERED Mobile only. Invoked when the application is about to be suspended. TOS is See also: app:resumed |
|
| sysquit | -- T |
| DEFFERED Invoked if the system requests that the application shut down. The default simply returns Note: denying the OS doesn't mean you will succeed... |
|
| terminated | -- (as of 20.01) |
| DEFFERED Invoked if the OS is terminating the application for some reason. |
|
| ticks | -- n (as of 24.06) |
Gets the number of 'ticks' the app has been running, since the app was loaded. See also: t:ticks |
|
| timeout | n -- (as of 22.01) |
| needs utils/timeout Creates a background task which waits for |
|
| trap | n T -- (as of 19.09) |
Tell 8th to trap the signal whose number is See also: app:signal app:raise |
Namespace: a
Description: Arrays are sequentially ordered containers accessed by numeric index
| word | sed/description |
|---|---|
| ! | a ix x -- a |
Put the item See also: a:@ |
|
| + | a1 a2 -- a1 |
Append contents of array |
|
| - | a ix -- a |
Remove the item at index |
|
| / | a ix -- a1 a2 | a w -- a1 a2 (as of 21.01) |
Splits an existing array into two parts at the index. If the index is less than 0, splits at that index from the end of the array. If given a |
|
| 2each | a1 a2 w -- a1 a2 (as of 18.08) |
Iterates over two arrays, invoking NOTE: You must not modify the array being iterated, while it is being iterated! Modifying the array while it is being iterated may throw an exception. See also: a:each a:each! a:x-each |
|
| 2map | a1 a2 w -- a' (as of 18.08) |
Similar to See also: a:map a:2map= |
|
| 2map+ | a1 a2 w n1 n2 -- a' (as of 18.08) |
Similar to
The SED of By default, the initial slice index increments by 1 each iteration; by using Ex: See also: a:2map |
|
| 2map= | a1 a2 w -- a1 (as of 18.08) |
Same as See also: a:map a:2map |
|
| <> | a ix1 ix2 -- a (as of 22.07) |
Swaps the array items at those indices. Ex: |
|
| = | a1 a2 w -- a1 a2 T (as of 18.04) |
Compares the two arrays using the word |
|
| @ | a ix -- a x | a a1 -- a a2 |
Returns the item in the array at index See also: a:! a:exists? |
|
| @? | a ix x -- a x' |
Same as See also: a:! a:exists? m:@? |
|
| []! | a n x -- a (as of 20.08) |
Same as Ex: |
|
| _@ | a n -- x (as of 19.07) |
Same as See also: a:@ |
|
| all | a w -- a T |
| needs python/any Iterates the array, invoking w on each one. If all of the items return true from w then returns true; otherwise returns false. Short-circuits on first 'false' result. |
|
| any | a w -- a T |
| needs python/any Iterates the array, invoking w on each one. If any of the items returns true from w then returns true; otherwise returns false. Short-circuits on first 'true' result. |
|
| bsearch | a x w -- a ix (as of 16.01) |
Search for the item Returns the index of the matching item, or Note: The array must have been sorted in ascending order using the same comparator |
|
| centroid | a -- a' |
| needs array/centroid Given an array of points, where each point is an array of x,y coordinates, return an array which consists of the centroids of those points. May be any dimension as long as each point is the same dimension. |
|
| clear | a -- a |
Remove all elements from the array. Similar to repeatedly invoking |
|
| close | x1 x2 x3 ... xN n -- a |
Create an array from See also: a:open |
|
| cmp | a1 a2 w -- a1 a2 n (as of 23.08) |
| needs array/cmp Compare two arrays. Similar to 'a:=', but given a comparator word (like s:cmp or n:cmp) The first non-equal element terminates the comparison, and 'n' is the result of the comparator on that element. Result 'n' is 0 if arrays compare 'equal', '-1' if a1 is 'less' |
|
| diff | a1 a2 w -- a1 (as of 22.02) |
Removes from |
|
| dot | a1 a2 w1 w2 -- x |
Generalized "dot product" of the two arrays |
|
| each | a w -- a |
Iterate over the array, invoking While running, the array is not available on the stack, to avoid consistency problems. NOTE: You must not modify the array being iterated, while it is being iterated! Modifying the array while it is being iterated may throw an exception. See also: a:each! |
|
| each! | a w -- a (as of 19.04) |
Same as NOTE: You must not modify the array being iterated, while it is being iterated! Modifying the array while it is being iterated may throw an exception. See also: a:each |
|
| each-par | a w n -- a (as of 23.09) |
| needs array/parallel Splits the array into |
|
| each-slice | arr wrd sz -- arr |
| needs array/each-slice Split array arr into slices of size sz elements, and feed each slice to the word wrd. That callback gets the stack slicenumber slice on its stack. |
|
| exists? | a ix -- a T |
Returns |
|
| filter | a w -- a' |
Creates an array, whose elements are those from the initial array for which the word While this word is running, the original array is not on the stack so it is possible to access items which were under it. See also: a:reduce a:map |
|
| filter-par | a w n -- a' (as of 23.09) |
| needs array/parallel Splits the array into |
|
| generate | w n1 n2 -- a | w -- a (as of 18.08) |
Loops over the numeric range If given only a word, then that word is invoked repeatedly with a SED of |
|
| group | a w -- m (as of 18.08) |
Group elements in an array, creating a map whose values are arrays containing items with the same grouping. The word used to group the items takes an array element and returns an item which is the group to which that element belongs, SED |
|
| indexof | a x w -- a ix (as of 16.01) |
Search for the item Returns the index of the matching item, or |
|
| insert | a1 a2 ix -- a3 |
Create a new array by inserting the contents of array See also: a:+ |
|
| intersect | a1 a2 w -- a3 (as of 22.02) |
Produces the "intersection" of two arrays over the comparator word. The resultant array contains only those values common to the input arrays (without duplication). |
|
| join | a sep -- s |
Inverse of See also: s:/ |
|
| len | a -- a n |
Returns the length of the array, e.g. the highest index occupied plus 1 (indices start at 0). The actual number of items contained may be less than the array's length, because one can insert an item at any index (subject to system memory constraints). |
|
| len' | a -- n (as of 24.03) |
Same as |
|
| len2 | a1 a2 -- a1 a2 n1 n2 (as of 24.03) |
Given two arrays, returns their respective lengths. Much faster and more efficient than the hard way. |
|
| map | a w -- a' |
Creates an array, whose elements are formed by executing the word While this word is running, the original array is not on the stack so it is possible to access items which were under it. See also: a:filter a:reduce |
|
| map+ | a w n1 n2 -- a' (as of 18.08) |
Similar to
The SED of See also: a:map |
|
| map-par | a w n -- a' (as of 23.09) |
| needs array/parallel Splits the array into |
|
| map= | a w -- a (as of 18.05) |
Same as See also: a:map |
|
| maxlen | a -- n (as of 23.01) |
| needs array/maxlen Returns the maximum (character) length of an array of strings |
|
| mean | a -- a n |
| needs math/mean Calculate the mean (average) value of an array of numbers. Should be faster than a:mean&variance if all you need is the arithmetic mean |
|
| mean&variance | a -- a a' |
| needs math/mean Uses the Knuth variance algorithm to calculate mean and variance in one pass. Returns an array containing [sample variance, mean, count, population variance, stddev] |
|
| merge | a1 a2 w -- a3 (as of 21.06) |
Combines the two arrays as in a 'merge sort', using the given word as a comparator. If the arrays are not already sorted, garbage will result. |
|
| new | -- a (as of 17.05) |
Create a new, empty array. |
|
| op! | a ix w -- a (as of 17.01) |
Invokes w on the array contents at the specified index, replacing the current contents. Any operands to |
|
| open | a -- x1 x2 x3 ... xN |
"Open up" the contents of the array See also: a:close |
|
| pigeon | a1 a2 x w -- x' (as of 21.09) |
Performs a 'pigeonhole operation', meaning that returns "blue", since 15 is between 10 and 20. |
|
| pivot | a -- a' (as of 22.08) |
"Pivots" the array. If it consists of arrays (all the same length) like |
|
| pop | a -- a x |
Pop the item Note: Since it is possible that See also: a:push a:@ a:! |
|
| push | a x -- a | x a -- a |
Push the item The order may be either See also: a:pop a:@ a:! |
|
| push' | a x -- (as of 24.03) |
Same effect as |
|
| qsort | a w -- a (as of 18.08) |
Sorts the array using the "quicksort" algorithm and the comparison word The SED of Note: If the comparison function modifies the elements it is given, they will be modified in the original array! It is typically slower than See also: a:sort |
|
| randeach | a w -- a (as of 18.08) |
Same as NOTE: You must not modify the array while it is being iterated! |
|
| reduce | a w x -- x' |
Iterate over the array, invoking The SED of While running, the original array is not on the stack. Ex: See also: a:map a:filter |
|
| reduce+ | a w x n1 n2 -- x' (as of 18.08) |
Same as
As with Ex: See also: a:reduce |
|
| remove | a x -- a n (as of 20.01) |
Removes all instances of the item |
|
| rev | a -- a |
Given an array, modifies it so the elements are in reverse order. |
|
| rindexof | a x w -- a ix (as of 21.09) |
Same as |
|
| shift | a -- a x |
Removes the item See also: a:slide a:push a:pop |
|
| shuffle | a -- a |
Randomly shuffles the entries in the array Uses |
|
| slice | a ix n -- a' |
Returns a slice of the array |
|
| slice+ | a ix n step -- a' (as of 18.04) |
Same was Ex: See also: a:slice |
|
| slide | a x -- a |
Puts See also: a:shift a:push a:pop |
|
| smear | a n -- a (as of 22.04) |
Smears the last item in the array, duplicating it to fill the array up to |
|
| sort | a w -- a |
Sorts the array using the "timsort" algorithm and the comparison word The SED of Note: If the comparison function modifies the elements it is given, they will be modified in the original array! This sort is generally faster than See also: a:qsort |
|
| split | a n -- a' (as of 23.09) |
Splits the array into one containing |
|
| squash | a -- a' (as of 22.07) |
Reduces an "array of arrays" to a array whose contents are the contents of the arrays. Ex: |
|
| switch | a ix1 ix2 -- a (as of 22.05) |
Swaps the items at the given array indices. |
|
| union | a1 a1 w -- a3 (as of 22.02) |
Creates an array |
|
| uniq | a w -- a' (as of 22.02) |
Removes consecutive equal elements of the array. |
|
| unzip | a -- a' (as of 22.05) |
Inverse of See also: a:zip |
|
| when | a -- |
Given an array containing pairs of words, it invokes the first word in each pair. If that word evaluates to See also: a:when! |
|
| when! | a -- |
Same as See also: a:when |
|
| x | a1 a2 w -- a' (as of 18.08) |
Same as See also: a:x-each |
|
| x-each | a1 a2 w -- a1 a2 (as of 18.08) |
Iterate over two arrays, invoking NOTE: You must not modify the array being iterated, while it is being iterated! Modifying the array while it is being iterated may throw an exception. See also: a:each a:each! a:2each a:x |
|
| xchg | a ix x -- a x' (as of 18.04) |
Stores a new value in the array at index See also: G:xchg m:xchg |
|
| y | a w -- a' |
Given an array and a word whose SED is |
|
| zip | a1 a2 -- a3 a4 ... |
Takes two arrays, and "zips" them together (think like a "zipper" on clothing), producing a new array for each corresponding item in the first two. Ex: Note: be careful not to use this on very long arrays or you may overflow the stack! |
Namespace: astro
Description: Various astronomical calculations
| word | sed/description |
|---|---|
| dawn | -- v |
| needs astro/sunrise var with dawn angle of sun, v. Default is -7. |
|
| do-dawn | -- rise set |
| needs astro/sunrise Do dawn calculation. |
|
| do-dusk | -- rise set |
| needs astro/sunrise Do dusk calculation. |
|
| do-rise | -- rise set |
| needs astro/sunrise Do sunrise/sunset calculation (this is the default). |
|
| dusk | -- v |
| needs astro/sunrise var with dusk angle of sun, degrees below horizon. Default is -7. |
|
| latitude | -- v |
| needs astro/sunrise var with latitude coordinate of location (default is Jerusalem: 31.778). North is positive, south is negative. |
|
| location! | loc -- lock |
| needs astro/sunrise Takes a location map from the geo/location and sets current latitude and longitude. |
|
| longitude | -- v |
| needs astro/sunrise var with longitude coordinate of location (default is Jerusalem: 35.235). East is positive, west is negative. |
|
| sunrise | d -- rise set |
| needs astro/sunrise For the given date d, return rise, set times. Assumes the location has been set already. |
Namespace: auth
Description: Authentication for communication channels
| word | sed/description |
|---|---|
| genkeys | -- priv pub (as of 22.06) |
| needs auth/keys Return a pair of keys to be used for session authentication |
|
| secret | priv pub -- b (as of 22.06) |
| needs auth/keys Return a buffer which is the DH shared-secret of the keys |
|
| session-id | -- s (as of 22.06) |
| needs auth/sessionkey Return a random 16 character string (12 bytes of random data). This string is intended to identify the session from amongst a multitude of sessions over the channel. Save |
|
| session-key | -- b (as of 22.06) |
| needs auth/sessionkey Return a random session-key. A key is a cryptographically random buffer which can be used for encrypting the communications channel. The key should not be stored permanently. |
|
| validate | priv pub key -- T (as of 22.06) |
| needs auth/keys With one party's public key and the other party's private key, validate that the 'key' is the result of 'auth:secret' |
Namespace: AWS
Description: Amazon AWS CLI utility
| word | sed/description |
|---|---|
| cb | w -- (as of 23.03) |
| needs amazon/aws Set the given word as the callback for |
|
| cli | s -- (as of 23.03) |
| needs amazon/aws Set the |
|
| cmd | cmd [opts] cb -- (as of 23.03) |
| needs amazon/aws Execute the given command and options, asynchronously shelling the |
|
| cp | args cb -- (as of 23.03) |
| needs amazon/aws Issue the AWS CLI |
|
| rc | -- n (as of 23.03) |
| needs amazon/aws Returns the last return-code returned from an AWS operation (unless you used |
Namespace: bc
Description: Blockchain Framework
| word | sed/description |
|---|---|
| +block | chain x -- chain |
| needs blockchain/framework Create a new block containing the string or buffer data item x and add it to the given chain |
|
| .blocks | chain -- chain |
| needs blockchain/framework Prints the blocks in the given blockchain |
|
| add-block | chain block -- chain |
| needs blockchain/framework Internal word which adds the given block to the chain. You will use bc:+block instead |
|
| block-hash | block -- block hash |
| needs blockchain/framework Calculates the hash for the given block, assuming the values it contains are correct |
|
| block@ | chain ix -- chain block |
| needs blockchain/framework Given a chain and a number block index, return the block. Return null if there is no such block. In future will accept the hash |
|
| first-block | -- block |
| needs blockchain/framework Returns the first, or "genesis" block for the chain. NOTE: currently, all genesis blocks are identical |
|
| hash | -- v |
| needs blockchain/framework A global var which contains the name of the hash to be used. By default, this is 'blake'. NOTE: if you are using blockchains and you also need to use other hash algos, you should either make certain to save and restore the hash in your non-blockchain code, or ensure the blockchain code runs on a separate task (e.g. thread) |
|
| last-block | chain -- chain block |
| needs blockchain/framework Returns the last block in the chain |
|
| load | chain file -- chain flag |
| needs blockchain/framework Loads a BC_MEM blockchain from a file, where it was saved previously with bc:save |
|
| new | -- chain |
| needs blockchain/framework Sets the hash to use and initializes the blockchain. Returns a new and empty blockchain to use. The blockchain is set initially to be "in-memory". NOTE: a blockchain should not be shared between tasks, since the hash algo it sets is task-specific |
|
| save | chain file -- chain flag |
| needs blockchain/framework For a BC_MEM blockchain, saves it to a file, so it may be restored with bc:load |
|
| set-sql | chain file-name -- chain flag |
| needs blockchain/framework Sets the chain to be a BC_SQL chain. If file-name doesn't exist, a new SQL file is created and the chain initialised. Otherwise, the chain is loaded from the file. If the file exists but is not a valid SQL file or doesn't contain a valid chain, false is returned on TOS; otherwise, true is returned. |
|
| validate | chain -- chain flag |
| needs blockchain/framework Validate that the entire chain is valid |
|
| validate-block | chain block -- chain block flag |
| needs blockchain/framework Validate that the block's hash is valid, and that its prior hash is the previous block's hash |
Namespace: bloom
Description: Bloom filters
| word | sed/description |
|---|---|
| add | filter value -- filter |
| needs utils/bloomfilter Adds the string value to the Bloom filter |
|
| filter | size #hash -- filter |
| needs utils/bloomfilter Create a new Bloom filter, which can have up to size items, using #hash different hashes. |
|
| in? | filter value -- filter flag |
| needs utils/bloomfilter Checks if the string value is in the Bloom filter. If it returns false, the value is definitely not in the filter. Otherwise, depending on the filter parameters, it is probably in it. |
Namespace: bt
Description: Bluetooth discovery and I/O
| word | sed/description |
|---|---|
| accept | bt -- bt' |
| Professional version Given a bt created with See also: bt:listen bt:read bt:write |
|
| ch! | bt svcuuid uuid b -- bt T (as of 16.11) |
| Professional version Writes a BLE characteristic identified by the string NOTE: Currently unimplemented as of 20.01 See also: bt:ch@ |
|
| ch@ | bt svcuuid uuid -- bt b (as of 16.11) |
| Professional version Reads a BLE characteristic identified by the string NOTE: Currently unimplemented as of 20.01 See also: bt:ch! |
|
| connect | m -- bt |
| Professional version Given a map representing information about a BT device, as returned from Additional keys in
See also: bt:scan bt:read bt:write |
|
| disconnect | bt -- bt (as of 16.12) |
| Professional version Given a bt returned from |
|
| init | -- T (as of 19.09) |
Ensures the Bluetooth system is running; returns |
|
| leconnect | m -- bt (as of 16.11) |
| Professional version Given a map returned from See also: bt:lescan bt:read bt:write |
|
| lescan | w n -- (as of 16.11) |
| Professional version Scans for nearby Bluetooth Low Energy (BLE) devices. The scan will continue as long as any devices were found within |
|
| listen | m -- bt |
| Professional version Given a map defining what service to bind to and listen on etc., returns a new bt item which may be used with The keys in
See also: bt:accept |
|
| on? | -- T (as of 16.11) |
| Professional version Returns |
|
| read | bt s n -- bt s n |
| Professional version Same as See also: bt:write bt:connect |
|
| scan | w n -- |
| Professional version Scans for nearby Bluetooth (BT) devices for The map passed to |
|
| service? | s uuid -- a|null |
| Professional version Scans the BT device with string identifier |
|
| services? | bt w n -- bt (as of 16.11) |
| Professional version Takes a bt returned from Implemented on Android, iOS, and macOS. |
|
| write | bt s -- bt n |
| Professional version Same as See also: bt:read bt:connect |
Namespace: bson
Description: BSON parse
| word | sed/description |
|---|---|
| parse | b w -- (as of 23.06) |
Parse a buffer of BSON data, invoking the callback |
Namespace: b
Description: Buffers represent a memory area with a specific length
| word | sed/description |
|---|---|
| ! | b ix n -- b' |
Put the byte See also: b:@ b:writable |
|
| + | b1 b2 -- b3 |
Appends the buffer |
|
| / | b n -- a | b a1 -- a2 |
Split the buffer If an array of numbers See also: s:/ |
|
| 1+ | b ix -- b (as of 19.09) |
Add 1 to the byte at offset |
|
| 1- | b ix -- b (as of 19.09) |
Subtract 1 from the byte at offset |
|
| <> | b ix1 ix2 -- b (as of 22.07) |
Swaps the bytes at those indices in the buffer. Does modify the original buffer! If you don't want to modify the original, take care to clone it first. |
|
| = | b1 b2 -- T |
Compare the two buffers, returning |
|
| >base16 | sb -- s (as of 21.02) |
| Professional version Takes a string or buffer and converts it to a RFC-4648 base16 encoded string |
|
| >base32 | sb -- s (as of 21.02) |
| Professional version Takes a string or buffer and converts it to a RFC-4648 base32 encoded string |
|
| >base64 | b -- s |
Encode buffer (or string) in base64 encoding. See also: b:base64> |
|
| >base85 | sb -- s (as of 21.02) |
| Professional version Takes a string or buffer and converts it to a RFC-4648 base85 encoded string |
|
| >hex | s -- b |
Convert the 'hex dump' string into the bytes it represents. See also: b:hex> |
|
| >mpack | x -- b T (as of 18.08) |
| Professional version Converts any 8th item to a buffer containing the equivalent MessagePack binary format. TOS is |
|
| @ | b ix -- b n |
Returns the byte at offset See also: b:! |
|
| append | b1 b2 -- b1 (as of 17.10) |
Appends the buffer or string |
|
| base16> | s -- b (as of 21.02) |
| Professional version Takes a string encoded in RFC-4648 base16 and returns a decoded buffer. |
|
| base32> | s -- b (as of 21.02) |
| Professional version Takes a string encoded in RFC-4648 base32 and returns a decoded buffer. |
|
| base64> | s -- b |
Decode string See also: b:>base64 |
|
| base85> | s -- b (as of 21.02) |
| Professional version Takes a string encoded in RFC-4648 base85 and returns a decoded buffer. |
|
| bit! | b ix n -- b (as of 18.04) |
Sets the value of the bit at the given index to Modifies |
|
| bit@ | b ix -- b n (as of 18.04) |
Gets the value of the bit at the given index in the buffer, treating it as an array of bits. Position 0 is the low bit of the first byte. Returns See also: b:bit! |
|
| clear | b -- b |
Overwrites the contents of the Note: this modifies the original buffer itself! See also: s:clear |
|
| compress | b -- b' |
Exactly analogous to See also: s:compress b:expand |
|
| conv | b from to -- b' | b from to -- n null (as of 16.05) |
Converts the buffer from the character encoding Note: Linux and RPI users must have installed the "libiconv" library for this to work. The
|
|
| each | b w -- (as of 16.02) |
Invokes |
|
| each! | b w -- (as of 19.04) |
Same as See also: b:each |
|
| each-slice | b n w -- (as of 17.04) |
Invokes |
|
| expand | b n -- b' |
Exactly analogous to See also: s:expand b:compress |
|
| fill | b n -- b' | b ix sb -- b' |
Fills the contents of the Note: if you want to modify the original buffer, you must use See also: s:fill |
|
| getb | buf -- buf b |
| needs buf/getb Read a single byte from the given buffer. If no byte is available, null is returned. |
|
| hex> | b -- s (as of 16.11) |
Converts a buffer into its "hex dump" representation. See also: b:>hex |
|
| len | b -- b n |
Returns the length of the buffer in bytes. |
|
| mem> | n size -- b (as of 17.01) |
DANGEROUS! Returns a buffer containing a copy of the contents of the memory at address Note: if you give an invalid memory address and/or size, you may cause 8th to crash. Also, if you allow arbitrary code to access this word, you open a security hole, so use "w:forget" or "G:only" if you allow arbitrary code to be evaluated. |
|
| move | b dst src n -- b (as of 18.01) |
Moves |
|
| mpack-compat | T -- (as of 20.08) |
| Professional version By default, the mpack words add a compatibility tag to all future versions of 8th to unpack older versions. However, that means 8th's packing is not decipherable to third-party programs. To make the encoding acceptable to outsiders, pass |
|
| mpack-date | T -- (as of 18.08) |
| Professional version If |
|
| mpack-ignore | T -- (as of 18.08) |
| Professional version If |
|
| mpack> | b -- x flag (as of 18.08) |
| Professional version Converts a buffer containing MessagePack binary data into the appropriate 8th item. Returns |
|
| n! | b ix n T n' -- b (as of 21.06) |
Inverse of Modifies See also: b:n@ |
|
| n+ | b ix n -- b (as of 19.09) |
Adds the number to the byte at offset |
|
| n@ | b ix n T -- b n' (as of 21.06) |
Gets values from the buffer as numbers of byte-size Ex: If the index+bittedness is out of range of the buffer, See also: b:n! |
|
| new | x -- b |
Create a new buffer. If
|
|
| op | source key w -- b |
Takes two buffers and invokes the word This can be used, for example, to perform an "xor" of a password against a block of data. The result is a buffer the same size as The SED of |
|
| op! | b ix w -- b (as of 22.03) |
Invokes |
|
| pad | b len -- b' (as of 20.05) |
| needs buf/pad Pad the given buffer to a multiple of 'len' bytes, using the number of bytes as the filler. Always pads the buffer, even if it is already a multiple of 'len' Can only use a 'len' up to 0xFF See also: b:unpad |
|
| rev | b -- b' (as of 16.04) |
Reverses the order of bytes in a buffer. |
|
| search | haystack needle -- haystack n | haystack ofs needle -- haystack n |
Search the buffer See also: s:search |
|
| shmem | s n T -- b |
Returns a buffer containing "shared memory", given a string to use as an identifier for an IPC shared-memory object, a number specifying its size, and a boolean indicating if the memory should be read-only (if |
|
| slice | b1 ix n -- b2 |
Returns a slice of the buffer See also: s:slice |
|
| splice | b1 b2 ix -- b' (as of 19.01) |
Replaces a portion of the buffer |
|
| ungetb | buf b -- buf |
| needs buf/getb Take the given byte and "unget" it, so that the next b:getb will return it. |
|
| unpad | b -- b' (as of 20.05) |
| needs buf/pad Undoes the padding done by b:pad. Do not use it on a buffer which was not padded! See also: b:pad |
|
| writable | b T -- b (as of 17.01) |
Make the buffer writable if See also: b:! |
|
| xor | b n -- b' | b1 b2 -- b' (as of 16.02) |
Applies a byte-wise XOR between every byte of the buffer and either the Unicode character or the buffer Note: if the original buffer is writable, its contents are overwritten; otherwise, a new buffer is created. |
Namespace: cal
Description: Calendar utilities
| word | sed/description |
|---|---|
| (.hebrew) | month day year -- S |
| needs calendar/hebrew Returns a string with the given Hebrew date. |
|
| (.islamic) | year month day -- s |
| needs calendar/islamic Returns a string corresponding to the Islamic date given. |
|
| .hebrew | month day year -- |
| needs calendar/hebrew Prints the given Hebrew date. |
|
| .islamic | year month day -- |
| needs calendar/islamic Prints the Islamic date given. |
|
| >hebepoch | gy -- hy |
| needs calendar/hebrew Convert Gregorian year gy to Hebrew year hy. |
|
| >jdn | d -- n (as of 20.01) |
| needs calendar/julian Converts a date to a "Julian day number" as used in astronomy See also: cal:jdn> |
|
| Adar | -- 12 |
| needs calendar/hebrew Constant representing the twelvth Hebrew month. |
|
| Adar2 | -- 13 |
| needs calendar/hebrew Constant representing the thirteenth Hebrew month, in a leap year. |
|
| Av | -- 5 |
| needs calendar/hebrew Constant representing the fifth Hebrew month. |
|
| Elul | -- 6 |
| needs calendar/hebrew Constant representing the sixth Hebrew month. |
|
| Heshvan | -- 8 |
| needs calendar/hebrew Constant representing the eighth Hebrew month. |
|
| Iyar | -- 2 |
| needs calendar/hebrew Constant representing the second Hebrew month. |
|
| Kislev | -- 9 |
| needs calendar/hebrew Constant representing the ninth Hebrew month. |
|
| Nissan | -- 1 |
| needs calendar/hebrew Constant representing the first Hebrew month. |
|
| Shevat | -- 11 |
| needs calendar/hebrew Constant representing the eleventh Hebrew month. |
|
| Sivan | -- 3 |
| needs calendar/hebrew Constant representing the third Hebrew month. |
|
| Tammuz | -- 4 |
| needs calendar/hebrew Constant representing the fourth Hebrew month. |
|
| Tevet | -- 10 |
| needs calendar/hebrew Constant representing the tenth Hebrew month. |
|
| Tishrei | -- 7 |
| needs calendar/hebrew Constant representing the seventh Hebrew month. |
|
| days-in-hebrew-year | hyr -- days |
| needs calendar/hebrew How many days are in the given year?. |
|
| displaying-hebrew | -- v |
| needs calendar/hebrew A var which controls whether the Hebrew date displays in Hebrew or English. Defaults to false. |
|
| fixed>hebrew | date -- month day year |
| needs calendar/hebrew Converts the fixed-date into the Hebrew date. |
|
| fixed>islamic | fixed -- year month day |
| needs calendar/islamic Convert the given fixed-date to the Islamic date. |
|
| gershayim | s -- s2 |
| needs calendar/hebrew Inserts the Hebrew "gershayim" character (0x05f4) as appropriate for a Hebrew number. |
|
| hanukkah | hy -- fixed |
| needs calendar/hebrew Returns the fixed-date of the first day of Hanukkah in the given Hebrew year. |
|
| hebrew-epoch | -- hepoch |
| needs calendar/hebrew Fixed date corresponding to the beginning of AM (anno mundi, Hebrew year). |
|
| hebrew-leap-year? | yr -- flag |
| needs calendar/hebrew Return 1 if yr is a Hebrew leap year or 0 otherwise. |
|
| hebrew>fixed | month day year -- date |
| needs calendar/hebrew Convert the Hebrew month, day and year given into a "fixed date", a number. |
|
| hebrewtoday | -- month day year |
| needs calendar/hebrew Returns a the Hebrew date corresponding to today. |
|
| hmonth-name | nr -- s |
| needs calendar/hebrew Returns a string containing the name of the Hebrew month given as a number. Returns Hebrew if d:displaying-hebrew is true. |
|
| islamic.epoch | -- epoch |
| needs calendar/islamic Returns the fixed-date of the start of the Islamic epoch. |
|
| islamic>fixed | year month day -- fixed |
| needs calendar/islamic Convert the given Islamic date to a fixed-date. |
|
| islamictoday | -- year month day |
| needs calendar/islamic Returns the Islamic date corresponding to today. |
|
| jdn> | n -- d (as of 20.01) |
| needs calendar/julian Converts a "Julian day number" as used in astronomy to a date See also: cal:>jdn |
|
| last-day-of-hebrew-month | month year -- day |
| needs calendar/hebrew Returns the last day of the given month in a particular year. Either 29 or 30, takes into account the dehiyot etc. |
|
| number>hebrew | n -- s |
| needs calendar/hebrew Returns a string which is the traditional Hebrew number corresponding to the number given. |
|
| omer | hy -- days |
| needs calendar/hebrew Returns the "count of the omer" for the specific fixed-date. If that date is outside the omer period, returns 0. |
|
| pesach | hy -- fd |
| needs calendar/hebrew Returns the fixed-date of Passover in the given Hebrew year. |
|
| purim | hy -- fd |
| needs calendar/hebrew Returns the fixed-date of Purim in the given Hebrew year. |
|
| rosh-chodesh? | fd -- flag |
| needs calendar/hebrew Returns true if the given fixed-date is "Rosh Chodesh". |
|
| rosh-hashanah | hy -- fd |
| needs calendar/hebrew Returns the fixed-date of Rosh Hashana in the given Hebrew year. |
|
| shavuot | hy -- fd |
| needs calendar/hebrew Returns the fixed-date of Shavuot in the given Hebrew year. |
|
| taanit-esther | hy -- fixed |
| needs calendar/hebrew Returns the fixed-date of the Fast of Esther in the given Hebrew year. |
|
| tisha-beav | hy -- fixed |
| needs calendar/hebrew Returns the fixed-date of the Fast of the Ninth of Av in the given Hebrew year. |
|
| yom-haatsmaut | hy -- fixed |
| needs calendar/hebrew Returns the fixed-date of the Israeli Independence Day in the given Hebrew year. |
|
| yom-kippur | hy -- fd |
| needs calendar/hebrew Returns the fixed-date of Yom Kippur in the given Hebrew year. |
Namespace: clr
Description: Colors
| word | sed/description |
|---|---|
| >hsva | x -- a (as of 24.04) |
Returns the color converted from ARGB to HSVA as an array [hue,saturation,value,alpha]. |
|
| complement | x -- n (as of 24.04) |
Returns a color "complimentary" to the given one. |
|
| dist | x1 x2 -- n (as of 24.04) |
Returns the "distance" between two colors, a value between 0 and 1 where 0 means identical. |
|
| gradient | x1 x2 n -- a (as of 24.04) |
Returns a gradient of colors from x1 to x2, in n steps. |
|
| hsva> | a -- n (as of 24.04) |
Inverse of |
|
| invert | x -- n (as of 24.04) |
"inverts" the given color |
|
| nearest-name | x -- s (as of 24.04) |
| needs nk/color Takes a color name or value, and returns the name of the color most nearly matching it from our internal list of colors. |
|
| parse | x -- n (as of 24.04) |
Converts a color definition (number, string, or array of values) to an RGBA number value of the color. |
Namespace: c
Description: Numbers: complex (native doubles)
| word | sed/description |
|---|---|
| * | c1 c2 -- c3 (as of 18.07) |
Multiplies two complex numbers. See also: c:new c:+ c:abs c:>ri c:conj c:arg c:= |
|
| * | c1 c2 -- c3 |
| needs math/complex Returns the complex product of the two inputs. |
|
| + | c1 c2 -- c3 |
| needs math/complex Adds two complex numbers returning their complex sum. |
|
| + | c1 c2 -- c3 (as of 18.07) |
Adds two complex numbers. See also: c:new c:* c:abs c:>ri c:conj c:arg c:= |
|
| = | c1 c2 -- T |
| needs math/complex Compares two complex numbers and returns |
|
| = | c1 c2 -- T (as of 18.07) |
Compares two complex numbers, returning See also: c:new c:+ c:* c:>abs c:>ri c:conj c:arg |
|
| >polar | c -- c' (as of 24.04) |
| needs math/complex Returns the complex number in "polar form" |
|
| >polar | c -- c' (as of 24.04) |
Returns the complex number in "polar form". |
|
| >ri | c -- real imag |
| needs math/complex Returns the "real" and "imaginary" components of the complex number. |
|
| >ri | c1 -- real imag (as of 18.07) |
Returns the "real" and "imaginary" components of the complex number. See also: c:new c:+ c:* c:>abs c:conj c:arg c:= |
|
| ^ | c n -- c' (as of 24.04) |
| needs math/complex Raises the complex number c to the exponent n, analagous to |
|
| ^ | c n -- c' (as of 24.04) |
Raises the complex number c to the exponent n, analagous to |
|
| abs | c -- n |
| needs math/complex Returns a the absolute-value (e.g. magnitude) of the input. |
|
| abs | c1 -- n (as of 18.07) |
Returns the absolute-value of the complex number. See also: c:new c:+ c:* c:>ri c:conj c:arg c:= |
|
| arg | c -- n |
| needs math/complex Returns the "argument" (e.g. angle of the radius, in radians) of the input. |
|
| arg | c -- n (as of 18.07) |
Returns the "argument" (the angle of the radius in radians) of the complex number. See also: c:new c:+ c:* c:>abs c:>ri c:conj c:= |
|
| conj | c -- c' |
| needs math/complex Returns the "complex conjugate" of the input. If c is 1+2i, c' is 1-2i. |
|
| conj | c -- c' (as of 18.07) |
Returns the complex-conjugate of the complex number. See also: c:new c:+ c:* c:>abs c:>ri c:arg c:= |
|
| im | c -- im |
| needs math/complex Returns a number which is the "imaginary" component of the complex number c. |
|
| im | c -- n (as of 24.04) |
Returns the imaginary component of the complex |
|
| log | c -- c' (as of 24.04) |
| needs math/complex Returns the "principal value" of the natural logarithm of |
|
| log | c -- c' (as of 24.04) |
Returns the "principal value" of the natural logarithm of |
|
| n> | n -- c (as of 24.04) |
Converts a number to a complex, e.g. creates a new complex number, |
|
| n> | n -- c |
| needs math/complex Converts a number to the complex c, represented as "n+0i". |
|
| new | real imag -- c | a -- c (as of 18.07) |
Create a new complex number based on native doubles (not regular 8th numbers). This is a faster implementation than the one in the "math/complex" library, but it does not allow unlimited precision. The parameters are either two numbers or an array of two numbers, in the order "real, imag". The numbers given must fit into a native double or they will be truncated, with unpredictable results. May return See also: c:+ c:* c:abs c:>ri c:conj c:arg c:= |
|
| new | a -- c |
| needs math/complex From either a pair of numbers, or an array containing two numbers, returns a new complex representing "real + i * imag". |
|
| polar> | n1 n2 -- c (as of 24.04) |
| needs math/complex Returns the complex number determined by the "polar coordinates" n1 (abs(c)), and n2 (arg(c)). |
|
| polar> | n1 n2 -- c (as of 24.04) |
Returns the complex number determined by the "polar coordinates" n1 (abs(c)), and n2 (arg(c)). |
|
| re | c -- re |
| needs math/complex Returns a number which is the "real" component of the complex number c. |
|
| re | c -- n (as of 24.04) |
Returns the real component of the complex |
Namespace: con
Description: Console I/O
| word | sed/description |
|---|---|
| >redir | -- |
| needs console/redirect Redirects console output (from "." etc) to a string |
|
| accept | n a -- s |
Requests a string of maximum length See also: meta:console con:key con:accept-pwd |
|
| accept-nl | T -- (as of 23.03) |
If |
|
| accept-pwd | n -- s |
Same as See also: con:accept con:key |
|
| alert | -- (as of 22.05) |
| IMMEDIATE Invoked from the 'con:accept' words if an 'alert' is required. The default does nothing. |
|
| ansi? | -- T (as of 20.05) |
Returns |
|
| black | -- |
| needs console/loaded Set the console foreground color to black. Must be paired with one of the con:on... color commands. |
|
| blue | -- |
| needs console/loaded Set the console foreground color to blue. Must be paired with one of the con:on... color commands. |
|
| clreol | -- |
Clear the current console line from the current position until the end of the line. See also: meta:console con:cls |
|
| cls | -- |
Clear the console screen and put the cursor on the first row. See also: meta:console con:clreol |
|
| ctrld-empty | T -- (as of 23.07) |
If |
|
| cyan | -- |
| needs console/loaded Set the console foreground color to cyan. Must be paired with one of the con:on... color commands. |
|
| down | -- |
Move the console position down one. See also: meta:console con:left con:right con:up |
|
| file>history | T s -- (as of 22.03) |
| needs console/history Restore console history from a file. If |
|
| free | -- |
Closes the console window. Note: Windows OS only. |
|
| getxy | -- row col |
Returns the position of the console cursor. |
|
| gotoxy | row col -- |
Set the console cursor position. See also: meta:console con:getxy |
|
| green | -- |
| needs console/loaded Set the console foreground color to green. Must be paired with one of the con:on... color commands. |
|
| history-handler | w -- (as of 22.03) |
| needs console/history Set the history handling word. Its SED is |
|
| history>file | s -- (as of 22.03) |
| needs console/history Save console history to the named file, one line per item. If |
|
| init | -- T (as of 24.01) |
Returns |
|
| key | -- n |
Returns the key-code of a pressed key, waiting for a key to be pressed. See also: meta:console con:key? con:accept con:accept-pwd |
|
| key? | -- T |
Returns See also: con:key meta:console |
|
| left | -- |
Move the console position left one. See also: meta:console con:right con:up con:down |
|
| load-history | a T -- |
Load the console's history from the array of strings. If See also: meta:console |
|
| magenta | -- |
| needs console/loaded Set the console foreground color to magenta. Must be paired with one of the con:on... color commands. |
|
| max-history | n -- (as of 23.03) |
Changes the default console history size from 100 to See also: meta:console |
|
| onBlack | -- |
| needs console/loaded Set the console background color to black. |
|
| onBlue | -- |
| needs console/loaded Set the console background color to blue. |
|
| onCyan | -- |
| needs console/loaded Set the console background color to cyan. |
|
| onGreen | -- |
| needs console/loaded Set the console background color to green. |
|
| onMagenta | -- |
| needs console/loaded Set the console background color to magenta. |
|
| onRed | -- |
| needs console/loaded Set the console background color to red. |
|
| onWhite | -- |
| needs console/loaded Set the console background color to white. |
|
| onYellow | -- |
| needs console/loaded Set the console background color to yellow. |
|
| s -- | |
Print the string to the console, taking into account console text attributes and positioning. See also: meta:console |
|
| red | -- |
| needs console/loaded Set the console foreground color to red. Must be paired with one of the con:on... color commands. |
|
| redir> | -- s |
| needs console/redirect Stops console redirection and returns the captured string |
|
| redir? | -- T |
Returns See also: meta:console |
|
| right | -- |
Move the console position right one. See also: meta:console con:left con:up con:down |
|
| save-history | w -- | null -- |
If given word, it is a callback for saving history whose SED is History is not saved by default. This word causes the history to be saved from the point it is invoked with a word, until the point it is invoked with The library See also: meta:console |
|
| size? | -- col row (as of 16.10) |
Returns the current size of the console in columns and rows. |
|
| up | -- |
Move the console position up one. See also: meta:console con:left con:right con:down |
|
| white | -- |
| needs console/loaded Set the console foreground color to white. Must be paired with one of the con:on... color commands. |
|
| yellow | -- |
| needs console/loaded Set the console foreground color to yellow. Must be paired with one of the con:on... color commands. |
Namespace: cr
Description: Encryption and decryption
| word | sed/description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| >aes128gcm | item key -- buf | |||||||||||||||||||||
| needs crypto/aes128gcm Encrypt the buffer or string item with the buffer or string key using AES-128-GCM. The key will be converted into an appropriate buffer using cr:ensurekey. The encrypted buffer buf is returned. |
||||||||||||||||||||||
| >aes256gcm | sb sb2 -- b (as of 17.04) | |||||||||||||||||||||
Encrypts See also: cr:aes256gcm> cr:ensurekey |
||||||||||||||||||||||
| >cp | sb sb2 -- b (as of 17.04) | |||||||||||||||||||||
Takes a string or buffer See also: cr:cp> cr:ensurekey |
||||||||||||||||||||||
| >cpe | sb b b2 -- b3 (as of 17.04) | |||||||||||||||||||||
Encrypts the string or buffer using the key See also: cr:cpe> |
||||||||||||||||||||||
| >decrypt | sb key -- cr | sb key iv aad tag -- cr | m -- cr | |||||||||||||||||||||
Given a buffer If a map is given, it has the same keys as for See also: cr:decrypt> cr:decrypt+ |
||||||||||||||||||||||
| >edbox | sb b -- b2 (as of 17.04) | |||||||||||||||||||||
Creates a "box" from a string or buffer See also: cr:edbox> cr:ed25519 |
||||||||||||||||||||||
| >encrypt | sb key -- cr | sb key iv aad -- cr | m -- cr | |||||||||||||||||||||
Given a buffer In modes other than ECB, and for the "chacha" and "chacha1305" ciphers, a buffer If a map is given, then its keys are as follows:
The callback words, if present, have the following SEDs:
|
||||||||||||||||||||||
| >nbuf | num -- buf | |||||||||||||||||||||
| needs crypto/totp Convert a number into a (64-bit) buffer of the binary digits. |
||||||||||||||||||||||
| >rsabox | sb b -- b' (as of 17.04) | |||||||||||||||||||||
Creates a box containing a head and signature from the string or buffer See also: cr:rsabox> cr:rsa_genkey |
||||||||||||||||||||||
| >uuid | b -- s | |||||||||||||||||||||
Creates a UUID string from a 16-byte buffer. |
||||||||||||||||||||||
| aad? | -- T (as of 17.04) | |||||||||||||||||||||
Returns |
||||||||||||||||||||||
| aes128box-sig | item key -- buf | |||||||||||||||||||||
| needs crypto/aes128gcm This is the encryption header, which identifies the 'box' as being AES128GCM. The last three numbers are "id", "IV size", and "tag length" (in AEAD suites). |
||||||||||||||||||||||
| aes128gcm> | buf key -- item flag | |||||||||||||||||||||
| needs crypto/aes128gcm Inverse of cr:>aes128gcm. Decrypt the buffer buf with the buffer or string key using AES-128-GCM. The key will be converted into an appropriate buffer using cr:ensurekey. The decrypted buffer item is returned and flag is true, if the decryption was successful. Otherwise, the original buffer is returned and false is on TOS. |
||||||||||||||||||||||
| aes256box-sig | -- b (as of 17.04) | |||||||||||||||||||||
Returns a buffer containing the correct 8-byte signature for an AES-256-GCM box. |
||||||||||||||||||||||
| aes256gcm> | b b2 -- b' (as of 17.04) | |||||||||||||||||||||
Decrypts a buffer which was encrypted with See also: cr:>aes256gcm |
||||||||||||||||||||||
| aesgcm | -- (as of 17.04) | |||||||||||||||||||||
Sets the encryption mode to GCM, the cipher to AES, and the GCM tag size to 16. |
||||||||||||||||||||||
| blakehash | -- (as of 17.04) | |||||||||||||||||||||
Sets the current hash to "blake". |
||||||||||||||||||||||
| chacha20box-sig | -- b (as of 17.04) | |||||||||||||||||||||
Returns a buffer containing the correct 8-byte signature for a Chacha20Poly1305 box. |
||||||||||||||||||||||
| chachapoly | -- (as of 17.04) | |||||||||||||||||||||
Sets the current encryption cipher to "Chacha20Poly1305". |
||||||||||||||||||||||
| cipher! | s -- (as of 16.01) | |||||||||||||||||||||
Set the cipher to use in this task. The string may be any of the ones returned by See also: cr:hash! cr:encrypt cr:decrypt |
||||||||||||||||||||||
| cipher@ | -- s (as of 16.04) | |||||||||||||||||||||
Returns the current cipher algorithm name, suitable for passing to See also: cr:cipher! |
||||||||||||||||||||||
| ciphers | -- a (as of 22.04) | |||||||||||||||||||||
Returns an array of the names of all supported ciphers. |
||||||||||||||||||||||
| cp> | b b2 -- b' (as of 17.04) | |||||||||||||||||||||
Decrypts a buffer which was encrypted with See also: cr:>cp cr:ensurekey |
||||||||||||||||||||||
| cpe> | b b2 b3 -- b' (as of 17.04) | |||||||||||||||||||||
Decrypts the buffer |
||||||||||||||||||||||
| decrypt | -- (as of 17.04) | |||||||||||||||||||||
Shorthand for |
||||||||||||||||||||||
| decrypt+ | sb cr -- cr | |||||||||||||||||||||
Given a crypt returned by See also: cr:decrypt> cr:>decrypt |
||||||||||||||||||||||
| decrypt> | cr -- b | cr -- tag b | |||||||||||||||||||||
Given a crypt returned by In GCM mode or chacha1305 cipher, returns the tag as well. If callbacks were used, then the buffer returned on TOS will be an empty one (since the results will have been written using the callback). See also: cr:decrypt+ cr:>decrypt |
||||||||||||||||||||||
| ebox-sig | b -- b' (as of 17.04) | |||||||||||||||||||||
Creates an encryption box signature buffer from a three-byte buffer. |
||||||||||||||||||||||
| ecc-curves | -- a (as of 22.04) | |||||||||||||||||||||
Returns an array of maps containing "id" and "name" of all supported ECC curves. |
||||||||||||||||||||||
| ecc-genkey | n -- priv pub (as of 16.01) | |||||||||||||||||||||
Returns a binary encoded ECC key-pair corresponding to NOTE: valid values of See also: cr:ecc-secret cr:ecc-sign cr:ecc-verify |
||||||||||||||||||||||
| ecc-secret | priv pub -- b (as of 16.01) | |||||||||||||||||||||
Generates an ECC shared secret using one party's private ECC key, and the other party's public ECC key. The result is a buffer with the shared secret, or See also: cr:ecc-genkey cr:ecc-sign cr:ecc-verify |
||||||||||||||||||||||
| ecc-sign | priv hash -- sig (as of 16.01) | |||||||||||||||||||||
Signs the hash using ECDSA algorithms with the private key and returns an signature buffer in See also: cr:ecc-genkey cr:ecc-secret cr:ecc-verify |
||||||||||||||||||||||
| ecc-verify | pub hash sig -- T (as of 16.01) | |||||||||||||||||||||
Verifies the hash signature versus the public key of the sender, using ECDSA algorithms and returns See also: cr:ecc-genkey cr:ecc-secret cr:ecc-sign |
||||||||||||||||||||||
| ed25519 | -- priv pub | |||||||||||||||||||||
Generates an "ed25519" key-pair in two buffers, corresponding to the new private-key and public-key. See also: cr:ed25519-secret cr:ed25519-sign cr:ed25519-verify |
||||||||||||||||||||||
| ed25519-secret | priv pub -- b | |||||||||||||||||||||
Generates an ed25519 shared secret using one party's private key See also: cr:ed25519 cr:ed25519-sign cr:ed25519-verify |
||||||||||||||||||||||
| ed25519-sign | priv hash -- sig | |||||||||||||||||||||
Given a buffer containing an ed25519 Diffie-Hellman private key of the sender, and another buffer containing a hash (could be a full message, but typically it's just a hash) of a message, signs the hash using DH algorithms and returns an signature buffer in See also: cr:ed25519 cr:ed25519-secret cr:ed25519-verify |
||||||||||||||||||||||
| ed25519-verify | pub hash sig -- T | |||||||||||||||||||||
Given a buffer containing an ed25519 Diffie-Hellman public key (of the sender), another buffer containing a hash which was presumably signed by the sender, and another buffer containing the DH signature, verifies the hash signature using DH algorithms and returns See also: cr:ed25519-genkey cr:ed25519-secret cr:ed25519-sign |
||||||||||||||||||||||
| edbox-sig | -- b (as of 17.04) | |||||||||||||||||||||
Returns a buffer containing the correct 8-byte signature for a Chacha20Poly1305Ed25519 box. |
||||||||||||||||||||||
| edbox> | b sb b2 -- T (as of 17.04) | |||||||||||||||||||||
Given an Ed25519 public key See also: cr:>edbox cr:ed25519 |
||||||||||||||||||||||
| encrypt | -- (as of 17.04) | |||||||||||||||||||||
Shorthand for |
||||||||||||||||||||||
| encrypt+ | sb cr -- cr | |||||||||||||||||||||
Given the crypt See also: cr:>encrypt cr:encrypt> |
||||||||||||||||||||||
| encrypt> | cr -- b | cr -- tag b | |||||||||||||||||||||
Given the crypt returned by In GCM mode or if using "chacha1305", a buffer See also: cr:>encrypt cr:encrypt+ |
||||||||||||||||||||||
| ensurekey | sb n -- b (as of 17.04) | |||||||||||||||||||||
Ensures that a buffer of See also: cr:genkey |
||||||||||||||||||||||
| genkey | pwd salt iter -- key | |||||||||||||||||||||
Takes the password string or buffer See also: cr:randkey cr:rsagenkey |
||||||||||||||||||||||
| hash | sb -- cr | |||||||||||||||||||||
Returns the hash of a string or buffer as a crypt, or See also: cr:hash! cr:hash+ cr:hash>s cr:hash>b cr:hmac |
||||||||||||||||||||||
| hash! | s -- (as of 16.01) | |||||||||||||||||||||
Set the hash to use in this task. The string may be any of the values returned by Throws an exception if given an unknown hash name. See also: cr:hash cr:cipher! |
||||||||||||||||||||||
| hash+ | sb cr -- cr | |||||||||||||||||||||
Take the string or buffer and add its data to the current hash in the crypt (returned from See also: cr:hash! cr:hash cr:hash>s cr:hash>b cr:hmac |
||||||||||||||||||||||
| hash>b | cr -- b | |||||||||||||||||||||
Finalize the hash calculation of crypt See also: cr:hash! cr:hash cr:hash+ cr:hash>s cr:hmac |
||||||||||||||||||||||
| hash>s | cr -- s | |||||||||||||||||||||
Finalize the hash calculation of crypt See also: cr:hash! cr:hash cr:hash+ cr:hash>b cr:hmac |
||||||||||||||||||||||
| hash@ | -- s (as of 16.04) | |||||||||||||||||||||
Returns the current hash algorithm name, suitable for passing to See also: cr:hash! |
||||||||||||||||||||||
| hashes | -- a (as of 22.04) | |||||||||||||||||||||
Returns an array of the names of all supported hashes. |
||||||||||||||||||||||
| hmac | sb key -- cr | |||||||||||||||||||||
Take the string or buffer and return a crypt See also: cr:hash! cr:hash cr:hash+ cr:hash>s cr:hash>b |
||||||||||||||||||||||
| hotp | key time #digits -- totp | |||||||||||||||||||||
| needs crypto/totp Same as cr:totp, but uses an incrementing counter rather than the time. |
||||||||||||||||||||||
| iv? | -- T (as of 17.04) | |||||||||||||||||||||
Returns |
||||||||||||||||||||||
| pem-read | s -- m | b -- m (as of 22.04) | |||||||||||||||||||||
Reads a PEM-encoded item. If given a string, reads from that named file. If given a buffer, the PEM data are in-memory. Returns a map with "name", "header", and "data"; or |
||||||||||||||||||||||
| pem-write | name header b filename -- T (as of 22.04) | |||||||||||||||||||||
Takes strings 'name' and 'header' and 'filename', and a buffer; writes them in PEM format to the file. Returns |
||||||||||||||||||||||
| pwd-valid? | s m -- T (as of 22.03) | |||||||||||||||||||||
| needs crypto/password Determines whether or not the given password meets the minimum requirements given in the map, which has numbers corresponding to |
||||||||||||||||||||||
| pwd/ | s -- m (as of 22.03) | |||||||||||||||||||||
| needs crypto/password Splits the given password string into components for analysis as to its fitness. The returned map has "uc", "lc", and "len", which are counts of number of uppercase, lowercase, and total string length. It will also have the count of characters by script, e.g. "number", "symbol", "latin", "cyrillic" etc (as per |
||||||||||||||||||||||
| pwd>hash | s n -- salt hash (as of 22.03) | |||||||||||||||||||||
| needs crypto/password Given a password string and a number indicating how many random bytes of salt to create, returns a random salt string as well as the salted hash of the password |
||||||||||||||||||||||
| rand | -- n | |||||||||||||||||||||
Generate a 64-bit cryptographically-secure pseudo-random number using the "ChaCha20" generator. Much slower than the other PRNGs, but suitable for crypto work. Each task has its own PRNG. See also: G:rand-pcg G:rand-jsf G:rand-jit |
||||||||||||||||||||||
| randbuf | n -- b | |||||||||||||||||||||
Generate a buffer of size See also: G:randbuf-pcg |
||||||||||||||||||||||
| randkey | -- b | |||||||||||||||||||||
Returns a buffer containing a pseudo-random key for encryption, using a cryptographically strong random number generator, suitable for the currently chosen cipher. See also: G:randbuf cr:rsagenkey cr:genkey |
||||||||||||||||||||||
| restore | X -- (as of 17.04) | |||||||||||||||||||||
Restores the crypto settings to what they were when See also: cr:save |
||||||||||||||||||||||
| root-certs | -- cert | |||||||||||||||||||||
| needs crypto/root-certs A var which contains "root certificates" which you can give as the "rootcert" key of a net transaction |
||||||||||||||||||||||
| rsa_decrypt | b sb -- b' | |||||||||||||||||||||
Decrypt the string or buffer See also: cr:rsa_encrypt cr:rsagenkey |
||||||||||||||||||||||
| rsa_encrypt | b sb -- b' | |||||||||||||||||||||
Encrypt the string or buffer See also: cr:rsa_decrypt cr:rsagenkey |
||||||||||||||||||||||
| rsa_sign | hash key -- b | |||||||||||||||||||||
Sign the See also: cr:rsa_verify |
||||||||||||||||||||||
| rsa_verify | hash key sig -- T | |||||||||||||||||||||
Verify the See also: cr:rsa_sign |
||||||||||||||||||||||
| rsabox-sig | -- b (as of 17.04) | |||||||||||||||||||||
Returns a buffer containing the correct 8-byte signature for a AES-256-GCM-RSA box. |
||||||||||||||||||||||
| rsabox> | b sb b2 -- T (as of 17.04) | |||||||||||||||||||||
Verifies that the signature box See also: cr:>rsabox cr:rsa_genkey |
||||||||||||||||||||||
| rsagenkey | n -- priv pub | |||||||||||||||||||||
Generate an RSA key-pair of size See also: G:randbuf cr:randkey cr:rsa_encrypt cr:rsa_decrypt cr:genkey |
||||||||||||||||||||||
| save | -- X (as of 17.04) | |||||||||||||||||||||
Returns an item encoding the current crypto settings. Use See also: cr:restore |
||||||||||||||||||||||
| sbox-sig | b -- b' (as of 17.04) | |||||||||||||||||||||
Creates an "signature box signature" buffer from a three-byte buffer. |
||||||||||||||||||||||
| sha1-hmac | msg key -- hash | |||||||||||||||||||||
| needs crypto/totp Returns the SHA1-HMAC hash of the buffer or string msg given the buffer key. |
||||||||||||||||||||||
| shard | sb n m -- a (as of 17.04) | |||||||||||||||||||||
Uses Shamir Secret Sharing to split a string or buffer into See also: cr:unshard |
||||||||||||||||||||||
| tag? | -- T (as of 17.04) | |||||||||||||||||||||
Returns |
||||||||||||||||||||||
| totp | key time #digits -- totp | |||||||||||||||||||||
| needs crypto/totp Given a key *buffer, a number time, and a number #digits to return, returns a "Time-based One-Time Password". |
||||||||||||||||||||||
| totp-epoch | -- var | |||||||||||||||||||||
| needs crypto/totp A var containing the epoch to use for the TOTP. Defaults to 0. |
||||||||||||||||||||||
| totp-time-step | -- var | |||||||||||||||||||||
| needs crypto/totp A var containing the time-step to use for TOTP. Defaults to 30 seconds. |
||||||||||||||||||||||
| unshard | a -- b (as of 17.04) | |||||||||||||||||||||
Recombines an array containing buffers of shards produced by Note: un-sharding might not fail to produce a result, even if the number of shards given was incorrect, or if the shards were incorrect; the result will simply be incorrect (and have nothing to do with the See also: cr:shard |
||||||||||||||||||||||
| uuid | -- s | |||||||||||||||||||||
Returns a cryptographically strong random UUID (RFC 4122 compliant). |
||||||||||||||||||||||
| uuid> | s -- b | |||||||||||||||||||||
Returns a buffer 16 bytes long representing the given UUID, or |
||||||||||||||||||||||
| validate-pgp-sig | fname -- ok (as of 18.06) | |||||||||||||||||||||
| needs crypto/pgp Takes a string fname which is a file whose PGP signature(s) are to be validated, and runs See also: G:-----BEGIN |
||||||||||||||||||||||
| validate-pwd | pwd salt hash -- T (as of 22.03) | |||||||||||||||||||||
| needs crypto/password Validates the hash matches the password and salt as returned by |
Namespace: d
Description: Date and time object
| word | sed/description | ||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| (.time) | n -- s | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Factor of |
|||||||||||||||||||||||||||||||||||||||||||||
| + | d n -- d' | ||||||||||||||||||||||||||||||||||||||||||||
Add See also: d:- d:= |
|||||||||||||||||||||||||||||||||||||||||||||
| +day | d1 hr -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date a certain mumber of days from the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| +hour | d1 hr -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date a certain mumber of hours from the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| +min | d1 min -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date a certain mumber of minutes from the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| +msec | d n -- d' | ||||||||||||||||||||||||||||||||||||||||||||
Advances the date by See also: d:new d:msec |
|||||||||||||||||||||||||||||||||||||||||||||
| - | d1 d2 -- n | ||||||||||||||||||||||||||||||||||||||||||||
Returns the difference See also: d:+ d:= |
|||||||||||||||||||||||||||||||||||||||||||||
| .time | n -- | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Print the number as HH:MM |
|||||||||||||||||||||||||||||||||||||||||||||
| / | d -- a | ||||||||||||||||||||||||||||||||||||||||||||
Split the date into an array containing, in order: year, month, day, hour, minute, second, tzHH, tzMM (time-zone offset in hours and minutes from GMT), msec, and "approx" (if not zero, how uncertain the date is in days). See also: d:join |
|||||||||||||||||||||||||||||||||||||||||||||
| = | d1 d2 -- T | ||||||||||||||||||||||||||||||||||||||||||||
Returns See also: d:- d:+ d:?= |
|||||||||||||||||||||||||||||||||||||||||||||
| >fixed | d -- n | ||||||||||||||||||||||||||||||||||||||||||||
Returns the "fixed" time value corresponding to the date See also: d:fixed> |
|||||||||||||||||||||||||||||||||||||||||||||
| >hmds | x -- s (as of 23.08) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/format Convert a millisecond value to a string like "1h 23m 5.678s". If See also: d:>hmds: |
|||||||||||||||||||||||||||||||||||||||||||||
| >hmds: | x -- s (as of 23.08) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/format Convert a millisecond value to a string like "1:23:05.678". If See also: d:>hmds |
|||||||||||||||||||||||||||||||||||||||||||||
| >msec | d -- n | ||||||||||||||||||||||||||||||||||||||||||||
Returns the number of milliseconds since Jan 01 1970 corresponding to the date. It takes the TZ of the date into account, normalizing to UTC. See also: d:msec> |
|||||||||||||||||||||||||||||||||||||||||||||
| >unix | d -- n | ||||||||||||||||||||||||||||||||||||||||||||
Returns the Unix time-stamp See also: d:unix> |
|||||||||||||||||||||||||||||||||||||||||||||
| >ymd | d1 -- y m d | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the year, month and day for a given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| ?= | d1 d2 n -- T (as of 20.07) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/approx Return true if the dates d1 and d2 are approximately equal, based on a maximum day-difference of n. Takes into account if the date is approximate as well. |
|||||||||||||||||||||||||||||||||||||||||||||
| Fri | -- 5 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the number corresponding to Friday. |
|||||||||||||||||||||||||||||||||||||||||||||
| Mon | -- 1 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the number corresponding to Monday. |
|||||||||||||||||||||||||||||||||||||||||||||
| Sat | -- 6 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the number corresponding to Saturday. |
|||||||||||||||||||||||||||||||||||||||||||||
| Sun | -- 0 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the number corresponding to Sunday. |
|||||||||||||||||||||||||||||||||||||||||||||
| Thu | -- 4 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the number corresponding to Thursday. |
|||||||||||||||||||||||||||||||||||||||||||||
| Tue | -- 2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the number corresponding to Tuesday. |
|||||||||||||||||||||||||||||||||||||||||||||
| Wed | -- 3 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the number corresponding to Wednesday. |
|||||||||||||||||||||||||||||||||||||||||||||
| adjust-dst | d n -- d | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/dst Adjusts the date d according to the number 0-6 of the dst-zone, n. See d:dst for the meaning of that number. |
|||||||||||||||||||||||||||||||||||||||||||||
| alarm | d m -- | d -- | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/alarm Set (if a map on TOS) or remove (if a date on TOS) an "alarm". The alarm will go off at or very close to the time requested (within a second). The map has the key |
|||||||||||||||||||||||||||||||||||||||||||||
| approx! | d n -- d (as of 20.07) | ||||||||||||||||||||||||||||||||||||||||||||
Sets the uncertainty, in days, of the given date, modifying it. |
|||||||||||||||||||||||||||||||||||||||||||||
| approx? | d -- d n (as of 20.07) | ||||||||||||||||||||||||||||||||||||||||||||
Returns the uncertainty, in days, of the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| approximates! | a -- (as of 20.07) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/approx Set the regex to use for approximate date matches. Pass an array of strings each of which is indicates "approximate". Be careful to not use text which matches your localized month names. |
|||||||||||||||||||||||||||||||||||||||||||||
| between | d1 d2 d3 -- T (as of 22.07) | ||||||||||||||||||||||||||||||||||||||||||||
Like |
|||||||||||||||||||||||||||||||||||||||||||||
| cmp | d1 d2 -- n (as of 22.07) | ||||||||||||||||||||||||||||||||||||||||||||
Compare the two dates, similar to |
|||||||||||||||||||||||||||||||||||||||||||||
| d. | d -- | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Format and print the given date in "YYYY-MM-DD" format. |
|||||||||||||||||||||||||||||||||||||||||||||
| default-now | T -- (as of 22.05) | ||||||||||||||||||||||||||||||||||||||||||||
If See also: d:parse d:join |
|||||||||||||||||||||||||||||||||||||||||||||
| doy | d -- day-in-year | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils For a given date, return the day in the year (counting Jan 1 as '1'). |
|||||||||||||||||||||||||||||||||||||||||||||
| dst-ofs | x d -- n (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/daylight Given a time-zone name and a date, returns the correct GMT offset in minutes for that date and tz |
|||||||||||||||||||||||||||||||||||||||||||||
| dst? | d n -- d f | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/dst Determines if the date d is in DST (Daylight Savings Time) or not, in accordance with the number n of the dst-zone. The values are 0=OFF, 1=ON, 2=USA, 3=EU, 4=Israel, 5=Mexico, 6=Australia. |
|||||||||||||||||||||||||||||||||||||||||||||
| dstinfo | zone -- arr (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/daylight Queries the 'libs/date/dst.db' database for the DST information for the given string zone (e.g. "America/New_York") or its numeric code (e.g. zones.id) Returns an array consisting of arrays with the "code", "name", "abbrev", "time_start" (in unix timestamp), "gmt_offset", and "dst" indicator. |
|||||||||||||||||||||||||||||||||||||||||||||
| dstquery | zone start end -- arr (as of 18.06) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/daylight Queries the 'libs/date/dst.db' database for the DST information for the given string zone (e.g. "America/New_York") between the dates start and end. Returns an array consisting of arrays with the "code", "name", "abbrev", "time_start" (in unix timestamp), "gmt_offset", and "dst" indicator. |
|||||||||||||||||||||||||||||||||||||||||||||
| dstzones? | -- arr | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/daylight Returns an array of known country-time-zones for DST queries. |
|||||||||||||||||||||||||||||||||||||||||||||
| elapsed-timer | n -- elapsed | ||||||||||||||||||||||||||||||||||||||||||||
| needs utils/elapsed Returns the number of ticks since timer n was started. |
|||||||||||||||||||||||||||||||||||||||||||||
| elapsed-timer-hmds | n T -- s (as of 23.08) | ||||||||||||||||||||||||||||||||||||||||||||
| needs utils/elapsed Returns a string like "10h 23m 15.234s" if |
|||||||||||||||||||||||||||||||||||||||||||||
| elapsed-timer-msec | n -- msecs (as of 23.08) | ||||||||||||||||||||||||||||||||||||||||||||
| needs utils/elapsed Returns the number of milliseconds since timer n was started. |
|||||||||||||||||||||||||||||||||||||||||||||
| elapsed-timer-seconds | n -- secs | ||||||||||||||||||||||||||||||||||||||||||||
| needs utils/elapsed Returns the number of seconds since timer n was started. |
|||||||||||||||||||||||||||||||||||||||||||||
| first-dow | d1 dow -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date for the first day-of-week in the month of the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| fixed> | n -- d | ||||||||||||||||||||||||||||||||||||||||||||
Returns a new date corresponding to the number which is a "fixed" time value. The range of valid See also: d:>fixed |
|||||||||||||||||||||||||||||||||||||||||||||
| fixed>dow | n -- n | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the day-of-week (Sunday is 0) for a given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| format | s d -- s' | d s -- s' | ||||||||||||||||||||||||||||||||||||||||||||
Format a date according to the format string Valid format specifiers are:
|
|||||||||||||||||||||||||||||||||||||||||||||
| join | a -- d | ||||||||||||||||||||||||||||||||||||||||||||
Inverse of If the array is shorter than 10 items, the missing items will be given default values from the current date and time. See also: d:/ d:parse |
|||||||||||||||||||||||||||||||||||||||||||||
| last-dow | d1 dow -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date for the last day-of-week in the month of the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| last-month | d1 -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date one month before the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| last-week | d1 -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date one week before the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| last-year | d1 -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date one year before the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| leap? | d -- d T (as of 24.03) | ||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||
| mdays | d -- d n (as of 24.03) | ||||||||||||||||||||||||||||||||||||||||||||
Returns the number of days in the date's month. |
|||||||||||||||||||||||||||||||||||||||||||||
| msec | -- n | ||||||||||||||||||||||||||||||||||||||||||||
Returns the current time as number of milliseconds since Jan 01, 1970. See also: d:ticks d:new |
|||||||||||||||||||||||||||||||||||||||||||||
| msec> | n -- d | ||||||||||||||||||||||||||||||||||||||||||||
Returns a new date corresponding to the number of milliseconds since Jan 01 1970. It takes the current notion of timezone into account (that can be set using See also: d:>msec |
|||||||||||||||||||||||||||||||||||||||||||||
| new | -- d | ||||||||||||||||||||||||||||||||||||||||||||
Create a new date See also: d:ticks d:msec |
|||||||||||||||||||||||||||||||||||||||||||||
| next-dow | d1 dow -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date for the corresponding day-of-week on or after the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| next-month | d1 -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date one month after the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| next-week | d1 -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date one week after the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| next-year | d1 -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date one year after the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| parse | s -- d | ||||||||||||||||||||||||||||||||||||||||||||
Attempt to parse a valid date and/or time from a string, and return the date appropriately set if successful, or The string should be in one of the ISO-8601 formats or the RFC5322 format. It may also be "UNK" or "UNKNOWN", which returns a date which is "unknown"; "NOW", "TODAY", or "CURRENT", which return the current date; or something like "Nov 1896", in which case it will return an approximate date with the month of November, the year of 1896, and whatever the current day of the month is. The year must be less than 100 or greater than 1000; to create a date with a year of 150 (for example), use See also: d:join |
|||||||||||||||||||||||||||||||||||||||||||||
| parse-approx | s -- d|null (as of 20.07) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/approx Same as d:parse, but understands meaning of various "approximate" indicators like "ABT" or "CA". The list of words which is understood can be set using d::approximates! |
|||||||||||||||||||||||||||||||||||||||||||||
| parse-range | s -- a|null (as of 20.07) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/range Parse a "date range", e.g. "BET 2001 AND 2005" |
|||||||||||||||||||||||||||||||||||||||||||||
| prev-dow | d1 dow -- d2 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date for the corresponding day-of-week on or before the given date. |
|||||||||||||||||||||||||||||||||||||||||||||
| rfc5322 | d -- s (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/rfc Format a date as per RFC-5322 |
|||||||||||||||||||||||||||||||||||||||||||||
| start-timer | n -- | ||||||||||||||||||||||||||||||||||||||||||||
| needs utils/elapsed Starts a "high-resolution timer" accessed by the number n. Use d:elapsed-timer or d:elapsed-timer-seconds to read |
|||||||||||||||||||||||||||||||||||||||||||||
| ticks | -- n (as of 18.05) | ||||||||||||||||||||||||||||||||||||||||||||
Returns a number of "ticks", which is a "high-resolution" timing counter. The specific resolution can be retrieved using See also: d:ticks/sec d:msec |
|||||||||||||||||||||||||||||||||||||||||||||
| ticks/sec | -- n (as of 18.05) | ||||||||||||||||||||||||||||||||||||||||||||
Returns the resolution in "ticks per second" of the "high-resolution" timer. See also: d:ticks d:msec |
|||||||||||||||||||||||||||||||||||||||||||||
| timer | m -- X (as of 18.06) | ||||||||||||||||||||||||||||||||||||||||||||
Establishes a timer running on a separate task, in accordance with the options in the map. Keys are: |
|||||||||||||||||||||||||||||||||||||||||||||
| timer-ctrl | X m -- (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||
Controls a timer returned from See also: d:timer |
|||||||||||||||||||||||||||||||||||||||||||||
| tzadjust | d n -- d' (as of 18.05) | ||||||||||||||||||||||||||||||||||||||||||||
Applies a "time zone adjustment" of Or perhaps: |
|||||||||||||||||||||||||||||||||||||||||||||
| unix> | n -- d | ||||||||||||||||||||||||||||||||||||||||||||
Returns a new date corresponding to the Unix time-stamp See also: d:>unix |
|||||||||||||||||||||||||||||||||||||||||||||
| unknown | -- d (as of 20.07) | ||||||||||||||||||||||||||||||||||||||||||||
Returns the singleton "unknown" date. |
|||||||||||||||||||||||||||||||||||||||||||||
| unknown? | d -- d T (as of 20.07) | ||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||
| updatetz | n -- (as of 18.06) | ||||||||||||||||||||||||||||||||||||||||||||
Sets the current time-zone offset in minutes from GMT. If |
|||||||||||||||||||||||||||||||||||||||||||||
| year@ | d -- d y | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns the year from the given date d. |
|||||||||||||||||||||||||||||||||||||||||||||
| ymd | d -- d s | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Format a given date as YYYY-MM-DD, returning a string. |
|||||||||||||||||||||||||||||||||||||||||||||
| ymd> | y m d -- d1 | ||||||||||||||||||||||||||||||||||||||||||||
| needs date/utils Returns a date (at midnight) for a given year, month and day. |
Namespace: db
Description: SQLite database
| word | sed/description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| SQL! | param |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE needs db/sql Invokes the SQL query without returning values. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SQL[ | param |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE needs db/sql Returns an array (possibly empty) of the results of the SQL query. The rows are returned as an array of the column values. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| SQL{ | param |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE needs db/sql Returns an array (possibly empty) of the results of the SQL query. The rows are returned as a map of named column, value pairs. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| add-func | db m -- db T (as of 19.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a new SQLite function implemented in 8th to the open database. The map may contain the following keys:
Consult the SQLite documentation for definitions and semantics of "window", "aggregate", and "scalar". Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| aes! | T -- (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| again? | db -- db T (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
(SQLite only) Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| begin | db -- db (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Equivalent of issuing the SQL "BEGIN TRANSACTION" for the database. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bind | sql x n -- sql | sql a -- sql | sql m -- sql | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Bind parameters to the prepared SQL query in preparation for
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bind-exec | db s x w -- db (as of 19.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Combines bind and exec for a named sql. The |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bind-exec[] | db s a -- db a' (as of 19.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Like See also: db:bind-exec |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bind-exec{} | db s a -- db a' (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: db:bind-exec |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| close | db -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Close the database. It may not be read from or written to after this. See also: db:open |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| col | sql n -- sql x | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Used only inside a See also: db:exec-cb |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| col[] | sql -- sql a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
May be used only inside a See also: db:exec-cb db:col{} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| col{} | sql -- sql m | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
May be used only inside a See also: db:exec-cb db:col[] |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| commit | db -- db T (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Commits the transaction opened with |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| db | -- db (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Returns the current database. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dbpush | s -- n (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Opens the database file based on the string or map it's given. The opened database is pushed onto the list of open databases, and that database is accessible by number with |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| disuse | n -- (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Closes the database # |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| each | db s key fwd w -- db (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Iterates over the keys in a KV database. The starting point is the key Note: the callback |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| err-handler | w -- (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Sets the error handler for the SQL words. If a SQL error occurs, it will be invoked with a SED of |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec | db sql -- db | db s -- db | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Execute the prepared statement See also: db:open db:prepare db:exec-cb |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec-cb | db w sql -- db | db w s -- db | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Like See also: db:open db:prepare db:exec db:col |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec-name | db w s -- db (as of 19.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: db:exec-cb db:prep-name db:bind-exec |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec[] | db s -- db a (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Like See also: db:exec{} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exec{} | db s -- db a (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Like See also: db:exec[] |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| get | db key -- db x (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Get the value associated with the give key in the "kv" database. The key may be anything, but a string is preferred. It must have the same value as what was used with |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| get-sub | db s key -- db x (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key | db b -- db | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Tells the SQLite engine it should use that key as the encryption key for the database. The database must have been created encrypted in order for this to work, and the key must exactly match the one used originally. The buffer given must be 32-bytes long, most likely created with The key used can be changed using See also: db:rekey |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kind? | db -- db s (as of 19.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns one of "SQLITE", "MYSQL", "ODBC", "SQLITE ENC", or "KV" for the open db. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| last-rowid | db -- db n (as of 19.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the last row-id inserted (specific to SQLite databases). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mysql? | -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns MySQL support is only available for Pro+, so this word will always report See also: db:odbc? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| odbc? | -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns On Linux/RPI you need to have installed unixodbc or iodbc. On macOS you need to have configured an ODBC source. On mobile devices there is no ODBC support at present. ODBC support is only available on Pro+, so this word will always report See also: db:mysql? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| open | s -- db | b -- db | m -- db | null -- db | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Open the SQLite (Pro+: MySQL/ODBC/KV) database indicated by the string, buffer, or map. If passed a:
If a map is passed, uses these keys to create a SQLite database (possibly encrypted):
Limits are some of:
Pro+: creates a MySQL, ODBC, or KV database using the map keys below:
Returns See also: db:close |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| open? | filename -- db flag | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/open Open a presumed SQLite file. Returns 0 if the file is invalid, 1 if it is empty, and 2 if it has been initialized |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prep-name | db sql s -- db (as of 19.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same effect as See also: db:prepare db:exec-name db:sql@ db:bind-exec |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prepare | db s -- db sql | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Prepare a SQL query from the string See also: db:open db:exec db:exec-cb db:bind |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| query | db qry -- result | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/query Execute a query on the database db, and return the first row, as an array of items. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| query-all | db qry -- result | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/query Execute a query on the database db, and return all rows, as an array of arrays of items. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rekey | db b -- db | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Tell the SQLite engine it should use the new key as the encryption key for the database. If the database was not encrypted, it will be from now on; otherwise, it will be re-encrypted with the new key. Note: a system failure (power outage etc) during the rekeying will likely corrupt the database and render it unusable. So operate on a copy of the database when rekeying! See also: db:key |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rollback | db -- db (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Rolls back the transaction started with |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set | db key x -- db (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Puts a key-value pair into the database opened as type "kv". The key may be anything, but a string is preferred; the value can be anything. It is converted to a buffer using |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set-sub | db s key x -- db (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sql@ | db s -- db sql (as of 19.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Retrieve the sql indicated by the string. The return value may be |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sql[] | params s -- a (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sql[np] | s -- a (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sql{np} | s -- a (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sql{} | params s -- a (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use | n -- (as of 23.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/sql Makes the database # |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| zip | db -- db (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs db/zip Add compress() and expand() SQL functions to the open database |
Namespace: DBUS
Description: D-BUS Interface
| word | sed/description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| call | DBUS m -- DBUS s (as of 21.09) | |||||||||||||||||||||
| Professional version Linux/RPI only: call the D-Bus interface as specified in the map, returns a string result The map keys are:
Note: the |
||||||||||||||||||||||
| init | n -- DBUS (as of 21.09) | |||||||||||||||||||||
| Professional version Linux/RPI only: connect to the D-Bus system. |
Namespace: dbg
Description: Debugging words
| word | sed/description |
|---|---|
| .state | -- (as of 24.06) |
Prints the current task's state (for debugging only). |
|
| bp | w -- |
Set a breakpoint at the word See also: dbg:go dbg:stop |
|
| bt | -- (as of 23.01) |
| needs debug/nicer Once |
|
| except-task@ | -- t (as of 18.04) |
Returns the task from which the last exception was thrown, or See also: G:throw |
|
| go | -- |
Continue operation after See also: dbg:stop dbg:bp |
|
| prompt | s -- s' |
| DEFFERED Same as See also: G:prompt |
|
| see | w -- (as of 24.06) |
Display the contents of an 8th word. Useful for debugging compilation issues. |
|
| stop | -- |
Stops and enters an interpreter waiting for commands. Use See also: dbg:go dbg:bp |
|
| trace | T -- |
Turns "tracing" on or off. If on, new words will include invocations of the words set by See also: dbg:trace-leave dbg:trace-enter |
|
| trace-enter | w -- |
| needs debug/common If dbg:trace is on, invoke w upon entry to any compiled word. If w is null, turns off the trace. The word must consume TOS. The SED of w is See also: dbg:trace dbg:trace-leave |
|
| trace-leave | w -- |
| needs debug/common If dbg:trace is on, invoke w upon exit from any compiled word. If null, turns off the trace. The word must consume TOS. The SED of w is See also: dbg:trace dbg:trace-enter |
Namespace: DOM
Description: DOM (Document Object Model)
| word | sed/description |
|---|---|
| + | DOM1 DOM2 -- DOM1 (as of 21.08) |
Adds |
|
| - | DOM1 DOM2 -- DOM1 (as of 21.08) |
Removes |
|
| attr! | DOM s x -- DOM | DOM m -- DOM (as of 21.08) |
Sets the attribute with that name in the DOM. If a map is given, it is added to the DOM attributes (per key,val). |
|
| attr@ | DOM s -- DOM x (as of 21.08) |
Gets the attribute with that name from the DOM. Returns |
|
| attrs | DOM -- DOM m (as of 21.09) |
Returns the "attributes" of the DOM node, which may be null. |
|
| children | DOM -- DOM a (as of 21.08) |
Gets an array (perhaps empty) containing the child nodes of the DOM. |
|
| css-parse | sb -- m (as of 21.09) |
Takes a string or buffer containing CSS, and parses it into a map which can be used by |
|
| each | DOM w n -- DOM (as of 21.08) |
Iterates the DOM, passing the word The SED of |
|
| find | dom w depth -- dom a (as of 21.08) |
| needs dom/find Similar to |
|
| new | s DOM -- DOM' (as of 21.08) |
Create a new DOM node, with the string "type", and DOM "parent" -- either or both may be null. |
|
| type | DOM -- DOM s (as of 21.09) |
Returns the "type" of the DOM node, which may be null. |
Namespace: f
Description: File operations
| word | sed/description |
|---|---|
| / | s -- a (as of 21.02) |
Separates the "path" See also: f:join f:relpath f:abspath |
|
| >posix | s -- s' (as of 23.03) |
Converts any Windows backslash |
|
| abspath | f -- s | s -- s' |
Given a file or string containing a file name, returns a string containing the absolute path of the original file name. See also: f:relpath |
|
| absrel | x rel -- abs (as of 21.02) |
| needs file/absrel Like f:abspath, but assumes x is relative to the path given by rel |
|
| append | f -- f (as of 17.02) |
Seek to the end of the file in preparation for appending to it. See also: f:write |
|
| associate | ext desc longdesc app -- |
"Associate" the application named Note: only on Windows currently |
|
| atime | f -- f d (as of 16.05) |
Returns a time-stamp of when the file was last accessed. |
|
| autodel | f -- f (as of 22.03) |
Makes the file automatically delete itself when the program ends, or when the its refcount goes to 0. |
|
| canwrite? | s -- T |
Returns |
|
| chmod | f n -- | f s -- | s n -- | s s' -- |
Change the access "mode" of the file to that indicated in the string or number. If the mode is a string, it can contain "r" = "readable", "w" = "writeable", "x" = "executable". By default, it only affects "owner-modes". To affect "group" modes, use 'g'; to affect 'other' modes, use 'o'; to affect all, use 'a'. Ex: "o+x" will add execute permissions for 'others'. In order to apply to more than one you issue two separate stanzas, e.g. "o+xg+x". If a "+" is included then the modes are added to the existing one, if "-" they are removed, otherwise they are set exactly. The file given may be an open file or a string with the name of a file. If the mode is a number, then that OS-specific mode will be set exactly without interpretation by 8th. See also: f:getmod |
|
| close | f -- |
Close the file. I/O to that file will not be possible if, for example, a var stored See also: f:open-ro f:create f:open |
|
| copy | src dest -- T |
Try to copy the file named See also: f:copydir |
|
| copydir | src dest -- T |
Try to recursively copy the directory named |
|
| create | s -- f |
Create the file named by the string Note: an existing file by the same name will be destroyed. If that is not your intention, use |
|
| ctime | f -- f d |
Returns the 'creation' time of the file or string naming a file, as a date. See also: f:mtime f:atime |
|
| dir? | s -- T |
Returns |
|
| dname | s -- s' |
Returns the path of the filename, excluding the file name as returned by See also: f:fname f:abspath f:relpath |
|
| eachbuf | f w n -- f | s w n -- |
Similar to NOTE: the same actual buffer is passed to See also: f:getline s:eachline f:eachline |
|
| eachline | f w -- f | s w -- |
Similar to If the file cannot be read (or opened, if a string), NOTE: the same actual string is passed to See also: f:getline s:eachline f:eachbuf |
|
| enssep | s -- s' |
Ensure that the file name given by the string ends with the OS-appropriate directory-separator. Use this instead of hard-coding "\" or "/". |
|
| eof? | f -- f T (as of 18.03) |
Returns |
|
| exec | s -- (as of 23.01) |
Attempts to execute the file as 8th code, unpacking and decrypting it if necessary. Throws on failure. |
|
| exists? | s -- T |
Returns |
|
| flush | f -- f |
Make sure any buffers containing unwritten data in the file are written. |
|
| fname | s -- s' |
Returns the last part (exclusive of path) of the filename. See also: f:dname f:abspath f:relpath |
|
| getb | f -- f b |
| needs file/getc Read a single byte from the given file. If no byte is available, null is returned. |
|
| getc | f -- f c |
| needs file/getc Read a single Unicode character from the given file. If no character is available, null is returned. |
|
| getline | f -- f s |
Read one line from the file See also: f:eachline |
|
| getmod | f -- n | s -- n |
Returns the OS-specific numeric "mode" of the file. See your OS documentation for the specific interpretation of the "mode". It may be given an open file or a string representing the name of a file. See also: f:chmod |
|
| glob | s -- a |
Returns an array of file names matching the string pattern See also: f:rglob |
|
| glob-links | T -- (as of 22.01) |
If |
|
| glob-nocase | T -- |
If The default for this setting is See also: f:glob f:rglob |
|
| gunz | readcb writecb -- n (as of 22.04) |
"gzip -d" equivalent. Takes a read callback word to get buffers of data to decompress, and a write callback to write the decompressed data. Returns 0 on success, or a 'miniz' error code. The SED for readcb is |
|
| homedir | -- s (as of 19.08) |
Returns the home-directory for the current user |
|
| homedir! | s -- (as of 21.04) |
Sets the value returned by See also: f:homedir |
|
| include | s -- |
Read the named file and interpret it as 8th code. Looks for the file in this order:
Throws an exception if it cannot load the file. See also: G:needs f:slurp app:asset G:requires |
|
| ioctl | f req x -- f x' n | f null (as of 20.06) |
| Hobbyist version (NOT Windows) Issues an Returns a number and the value Note: This is OS and ioctl-call specific. Use with caution! If |
|
| join | a -- s (as of 21.02) |
Joins the array containing strings See also: f:/ f:relpath f:abspath |
|
| launch | s params -- |
Launches the named file. If it is executable, executes it; if it is a document, starts the appropriate application to open it; if it is a folder, displays it in the OS-specific folder viewer. Give the parameter string On mobile devices this is the same as passing |
|
| link | orig link -- T |
Makes a symbolic link named Note: Only on macOS, Linux, and RPI. |
|
| link> | s -- s' |
If the named file or folder named is a link or alias, returns what it points to; otherwise returns the original name. |
|
| link? | s -- T |
Returns |
|
| lock | f ofs len x -- f T (as of 22.03) |
Locks or unlocks the file. When locking: creates an "shared" lock (e.g. "read-only" access) if Returns To unlock, pass null as |
|
| mkdir | s -- T |
Create the named directory. Returns |
|
| mmap | s T -- b |
Opens the named file as "memory-mapped". If See also: f:mmap-range f:mmap-range? f:open |
|
| mmap-range | s T start end -- b |
Same as See also: f:mmap f:mmap-range? f:open |
|
| mmap-range? | b -- b start end |
Returns See also: f:mmap f:mmap-range f:open |
|
| mtime | f -- f d |
Returns the 'last-modified' time of the file or string naming a file, as a date. See also: f:ctime f:atime |
|
| mv | oldname newname -- T |
Rename ("move") the file named See also: f:rm f:rmdir |
|
| name@ | f -- f s (as of 21.02) |
Gets the name of the file. |
|
| open | s -- f | n -- f |
Opens the file named by the string for read/write access. Returns See also: f:open-ro f:create f:close |
|
| open! | s -- f (as of 22.03) |
Same as |
|
| open-ro | s -- f |
Same as See also: f:open |
|
| popen | s T -- f |
Returns a new file which is a "pipe" from which the results of the command See also: f:open |
|
| popen3 | s -- a |
Takes a string with the name and perhaps parameters of an external command to invoke and returns an array Not on mobile platforms. |
|
| s -- (as of 16.02) | |
| needs file/print Attempts to print the file named by the string using the default OS-specific method. Does not notify if there is an error. Uses CUPS on macOS, Linux and RPI; uses "ShellExecute" on Windows. Currently does nothing on mobile platforms. As of 20.01 moved to file/print library |
|
| read | f sb n -- f sb n | f n -- f b n |
Read If no string or buffer is given then a buffer is created to accommodate See also: f:open f:write f:read-buf |
|
| read-buf | f n -- f b (as of 22.04) |
Read This should be used in preference to See also: f:open f:write f:read |
|
| read? | f s n -- f s n (as of 19.06) |
Same as See also: f:read |
|
| relpath | f s -- s' | name s -- s' |
Returns a file name, which is the original file's name adjusted relative to the folder name See also: f:abspath |
|
| rglob | s -- a |
Same as See also: f:glob |
|
| rm | s -- T |
Remove the named file from the system. Returns See also: f:rmdir f:mv |
|
| rmdir | s -- T |
Remove the named directory from the system, as well as all its contents. Returns See also: f:rm f:mv |
|
| seek | f n -- f |
Seek to position See also: f:open f:create f:read f:tell |
|
| sep | -- n |
Returns the ASCII code of the character used for separating path components. Use this instead of hard-coding "\" or "/". |
|
| size | f -- f n |
Returns the byte size of a regular file or string naming a file |
|
| slurp | s -- b | f -- b |
Open the file named by the string (or an open file) and return its contents as a buffer. The name may begin with "~" to represent the user's HOME directory. If the file does not exist or if there is not enough memory to hold its contents, |
|
| sparse? | f -- T | s -- T (as of 19.02) |
If the file (or string containing the name of a file) is a "sparse file", returns |
|
| spit | x s -- (as of 21.03) |
Inverse of |
|
| stderr | -- f |
Open a file corresponding to the "standard error output". Desktop systems only: returns See also: f:stdin f:stdout |
|
| stdin | -- f |
Open a file corresponding to the "standard input". Desktop systems only: returns See also: f:stdout f:stderr |
|
| stdout | -- f |
Open a file corresponding to the "standard output". Desktop systems only: returns See also: f:stdin f:stderr |
|
| tell | f -- f n |
Returns the current read or write position in the file. See also: f:open f:create f:read f:seek |
|
| tempfile | -- f (as of 22.03) |
Creates a temporary file which will be automatically deleted as per |
|
| times | s d1 d2 -- | s n1 n2 -- (as of 16.04) |
Sets the access time |
|
| tmpspit | x -- s (as of 21.03) |
Uses |
|
| trash | s -- T |
Try to move the named file or folder named to the OS-specific "trash". On success, returns |
|
| truncate | f n -- f | s n -- s (as of 19.02) |
Changes the length of the file or string naming a file to be |
|
| ungetb | f b -- f |
| needs file/getc Take the given byte and "unget" it, so that the next f:getb will return it. |
|
| ungetc | f c -- f |
| needs file/getc Take the given Unicode character and "unget" it, so that the next f:getc will return it. |
|
| unzip | f s T -- f (as of 16.04) |
Unpacks the entire ZIP file to the named destination folder. If See also: f:unzip-entry |
|
| unzip-entry | f s ix T -- f (as of 16.04) |
Unpacks one item from the ZIP file designated by the index into the named destination folder. If See also: f:unzip |
|
| watch | m -- X (as of 18.06) |
Watches files or sockets listed in the key "files" of the map, for events listed in the "events" key. Returns an item which when refcounted to 0 (or when |
|
| write | f sb -- f n |
Write the string or buffer See also: f:open f:read f:create f:writen |
|
| writen | f sb n -- f n |
Write See also: f:write |
|
| zip+ | f s x -- f |
Add item See also: f:zipnew f:zipsave f:zipopen f:zip@ |
|
| zip@ | f x -- f b |
Read item See also: f:zipnew f:zipsave f:zip+ f:zipopen |
|
| zipentry | f ix -- f d n s |
Returns information about the entry at index |
|
| zipnew | -- f |
Create a new zip-file in-memory. The file can be saved to disk using See also: f:zipsave f:zip+ f:zipopen f:zip@ |
|
| zipopen | sb -- f |
Open the zip-file See also: f:zipnew f:zipsave f:zip+ f:zip@ |
|
| zipsave | f s -- |
Save the in-memory zip-file See also: f:zipnew f:zip+ f:zipopen f:zip@ |
Namespace: font
Description: Font utilities
| word | sed/description | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| atlas! | font s -- n (as of 21.06) | ||||||||||||||||||||||
Adds the font to the global font-atlas under the given name. Returns a number which can be used as an alternative to the name to access this specific font. The name might also be |
|||||||||||||||||||||||
| atlas@ | n -- font | s -- font (as of 21.06) | ||||||||||||||||||||||
Retrieves a font from the font-atlas. The parameter is either a number (as returned by |
|||||||||||||||||||||||
| default-size | n -- (as of 21.06) | ||||||||||||||||||||||
Sets the default font size (if not otherwise specified) to |
|||||||||||||||||||||||
| default-size@ | -- n (as of 21.09) | ||||||||||||||||||||||
Gets the default font size (in pixels) |
|||||||||||||||||||||||
| info | font -- font m (as of 17.04) | ||||||||||||||||||||||
Returns a map containing information about the given font (if
If any codepages have been loaded, the key "pages" is an array of maps:
|
|||||||||||||||||||||||
| ls | -- a | ||||||||||||||||||||||
Returns an array of strings containing the names of all fonts known to the system. |
|||||||||||||||||||||||
| measure | font s -- font n | ||||||||||||||||||||||
Returns the width in pixels of the string using that font. |
|||||||||||||||||||||||
| new | null -- font | s -- font | b -- font | n -- font | a -- font | font -- font | m -- font | ||||||||||||||||||||||
Creates a new font. If it is passed a:
|
|||||||||||||||||||||||
| oversample | hor ver -- (as of 21.06) | ||||||||||||||||||||||
Sets the "oversampling" values (horizontal, vertical) for succeeding font declarations. These oversampling values are used when rendering the font into bitmaps for display. The values may be between 1 and 8, inclusive. Large values increase the size of the font bitmaps, but may make the image more legible. The default values are 3 and 1, meaning horizontal oversampling only, which produces reasonably sized bitmaps with nice quality. |
|||||||||||||||||||||||
| pixels | font n -- font | ||||||||||||||||||||||
Changes the size of the font to |
|||||||||||||||||||||||
| pixels? | font -- font n | ||||||||||||||||||||||
Returns the font's height in pixels. |
|||||||||||||||||||||||
| system | n -- s | ||||||||||||||||||||||
| DEFFERED needs font/loaded Returns a string for a 'system font' in the given pixel size. The default fonts are searched; if none of them are found, the first font returned by |
|||||||||||||||||||||||
| system | -- a | ||||||||||||||||||||||
| needs font/loaded Returns an array containing all the fonts present in the system's usual font locations. |
Namespace: G
Description: Catch-all class
| word | sed/description | ||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ! | x v -- | v x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Put the item See also: G:@ G:var G:var, |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| !if | -- (as of 22.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Same as See also: if else then not |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| #! | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Like See also: G:SED: G:-- G:\ G:(* |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ## | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Set the precision, e.g. the number See also: G:n# |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| #if | f -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Analogous to See also: G:if |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ' | |||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Returns the word whose name is See also: w:find |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ( | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Begin compiling a new anonymous word. The See also: G:) G:: G:; G:;; |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (* | <*)> -- (as of 17.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Multi-line comment. This word parses until it finds a "*)" sequence in the input, and will drop all that text. Handles nested comments of its own type, e.g. See also: \ -- |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (:) | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Begin defining the word named |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (code) | -- used allocated | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the number of bytes of code space |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (defer) | s -- (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: w:undo w:is G:defer G:deferred: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (dump) | x -- s (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a string containing a hex-dump of the contents of |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (getc) | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns one character from stdin or the console. Reads as an ASCII character from stdin, or a Unicode character from the console. See also: G:(gets) con:accept con:accept-pwd |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (gets) | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Read a string from stdin or the console. See also: G:(getc) con:accept con:accept-pwd |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (interp) | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Start the "REPL loop". Used internally. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (log) | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Write the item |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (needs) | s -- (as of 17.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Load the named 8th library. This is a factor of |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (parseln) | |||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: G:parse G:parsews G:parsech |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (putc) | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Print the Unicode character to stdout. See also: G:putc G:. G:(puts) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (puts) | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Print the string to stdout. See also: G:putc G:. G:(putc) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (stat) | n -- a | ||||||||||||||||||||||||||||||||||||||||||||||||||
For the namespace identifier
If an invalid namespace number is given, returns Note: this only returns valid information if you've turned on allocation counting with |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| (with) | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Internal factor of |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | -- w | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE End compilation of a new anonymous word, leaving it on TOS. If there is no matching See also: G:( G:: G:; G:;; |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| +hook | w -- n (as of 19.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a "last-gasp handler". It gets the name of any item the interpreter cannot handle. It returns the index of this gasp-handler, which may be passed to The SED for See also: G:-hook G:.hook |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| +ref | x -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Increase the "reference-count" of the item See also: G:-ref G:ref@ |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ,# | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the thousands separator for printing numbers to the ASCII character given by the number See also: G:.# G:n# G:c# s:strfmt s:fmt |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| -- | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Same as See also: G:SED: G:#! G:\ G:(* |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| -----BEGIN | <...> -- (as of 18.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs crypto/pgp Ignores everything from the "-----BEGIN " until and including "-----END PGP SIGNATURE-----". This allows you to embed PGP signatures in your scripts, allowing your users to be confident the script has not been modified and that it is from you. See also: cr:validate-pgp-sig |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| -Inf | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Put the number with value See also: G:Inf G:NaN |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| -Inf? | o -- o f | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs math/isa Return f which is true if the item o is -Inf, or false otherwise. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| -hook | n -- (as of 19.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Removes a "last-gasp handler" added with See also: G:+hook G:.hook |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| -ref | x -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Decrease the "reference-count" of the item See also: G:+ref G:ref@ |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| -rot | a b c -- c a b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Move the item in TOS to the third position on the stack. See also: G:rot G:swap G:over G:drop G:nip G:tuck |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| . | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Print the item See also: G:putc G:(putc) G:(puts) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .# | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the decimal separator for printing numbers to the ASCII character given by the number See also: G:,# G:n# G:c# s:strfmt s:fmt |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .hook | -- (as of 19.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Displays active hooks installed via See also: G:+hook G:-hook |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .needs | -- (as of 16.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Prints the names of all libraries loaded by See also: G:needs |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .r | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Print the top 10 items in the "r-stack", in the same manner that |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .s | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Display up to The first item (TOS) also shows the depth of the stack, e.g. See also: G:.r G:depth |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .s-truncate | T -- (as of 20.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Controls whether or not |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .stats | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/stats Display system statistics. The first line shows how much code space has been used vs. how much is allocated (in bytes). Then, for each namespace it shows its name followed by how many words are currently defined in it, how many data items of that type are in use, how large the pool is for that namespace and finally, how many pools have been allocated. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .ver | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Print the version of 8th, including build number, OS and bit-size, and customer id. Does nothing, in mobile builds. See also: G:8thver? G:buildver? G:build? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| .with | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Displays the current "with list". See also: G:with: G:;with |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 0; | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 2dip | a b c w -- w(a) b c | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs combinators/2dip Implementation of Factor's "2dip" combinator. Invokes w on the items in position 3 (etc.) on the stack, moving the items in positions 1 and 2 out of the way and restoring them afterwords to TOS. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 2drop | a b c d -- a b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Drop the two top items from the stack. See also: G:dup G:2dup G:2over G:2swap |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 2dup | a b -- a b a b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Duplicate the two top items on the stack. See also: G:dup G:2drop G:2over G:2swap |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 2nip | a b c -- c (as of 22.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Drops the two items under TOS. See also: G:tuck G:drop G:dup G:swap G:over G:nip |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 2over | a b c d -- a b c d a b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Copy items in positions 3 and 4 to TOS. See also: G:dup G:2dup G:2drop G:2swap |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 2swap | a b c d -- c d a b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Like See also: G:dup G:2dup G:2drop G:2over |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 2tuck | a b c d -- c d a b c d (as of 23.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 3drop | a b c d -- a (as of 22.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Drops the three top items from the stack. See also: G:dup G:2dup G:2over G:2swap |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 3drop | x y z -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs stack/3drop Drops three items off the data stack |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 3dup | a b c -- a b c a b c (as of 22.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Duplicates the three top items on the stack. See also: G:dup G:2dup G:2drop G:2over G:2swap |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 3rev | a b c -- c b a (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same effect as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 4drop | x y z a -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs stack/3drop Drops four items off the data stack |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 8thdt? | -- s (as of 18.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a readable string containing the build date of 8th. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 8thsku | -- n (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the running 8th's SKU: 0 = Free, 1 = Hobbyist, 2 = Professional, 3 = Enterprise |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 8thver? | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a string of the 8th version. e.g.: "23.08" or the like. See also: G:buildver? G:build? G:.ver |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| 8thvernum? | -- n (as of 21.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the 8th version as a number in the format major, minor, patch, e.g. '210100'. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| : | |||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Begin defining the word named See also: G:; G:( G:) G:;; |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ; | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Terminate a word definition which was started with See also: G:: G:( G:) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ;; | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Exits the current word immediately, prior to the usual terminating See also: G:; G:;then G:break |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ;;; | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Immediately exit the word which invoked the current one (as opposed to See also: G:;; G:; G:break |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ;then | -- (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE The equivalent of |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ;with | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Drops the last See also: G:with: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| >clip | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Take an item |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| >json | x -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Take an item Note: this does not work with all namespaces. It only works with the JSON standard types of number, boolean, string, array, map, and null. If you've put e.g. a word in the array or map, it will be converted to the name of the word, which standard JSON parsers will not accept. See also: G:json> |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| >kind | x -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the numeric namespace identifier of the item See also: G:ns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| >n | sb -- n | n -- n | T -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Convert the string or buffer to the number See also: G:>s |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| >r | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Pop the item See also: G:r> G:r@ G:rswap G:rdrop |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| >s | x -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Convert the item See also: G:>n |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ?: | x1 x2 -- x' (as of 18.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns 'x2' if |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ?@ | x1 x2 -- x3 (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Similar to |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| @ | v -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the contents of the variable See also: G:! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| BITMAP: | bits |
||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/bitmap Create a set of words for each 'bits' value, assuming 'little-endian' order. That is, the first values will be at the least-significant end. For each 'name', creates 'name_bits', 'name_mask', 'name_shift', 'name@', and 'name!' |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ENUM: | startfrom |
||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/enums Same as G:enum: but stops at ";" instead of "enum;" |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| FLAG: | startfrom |
||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/enums Like G:ENUM:, but creates a value of 1 shifted left the number of the enum. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| I | -- n (as of 22.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Inside Note: the loop index is a singleton, so if you want to store it, clone it first. See also: G:J G:K G:X |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| Inf | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Put the number with value See also: G:-Inf G:NaN |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| Inf? | o -- o t | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs math/isa Return true if the item o is Inf, or false otherwise. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| J | -- n (as of 22.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Inside Note: the loop index is a singleton, so if you want to store it, clone it first. See also: G:I G:K G:X |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| K | -- n (as of 22.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Inside Note: the loop index is a singleton, so if you want to store it, clone it first. See also: G:I G:J G:X |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| NaN | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Put the number with value See also: G:Inf G:-Inf |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| NaN? | o -- o t | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs math/isa Return true if the item o is the same as NaN, or false otherwise. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| SED-CHECK | f -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs debug/sed Enable (if f is true) or disable SED checking. The check depends on proper use of SED: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| SED: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| needs debug/sed Overwrites the built-in SED: (which is simply a comment). If true SED-CHECK has been invoked, then any word using this to declare a stack-effect-diagram will have it checked on entry and exit. The SED must use namespace identifiers (e.g. "s" or "n" etc) in order for SED: to properly check data types. If the SED doesn't match the stack at runtime, an exception will be thrown. This can also be enabled by using the '-g' CLI option to 8th. NOTE: use of this word will slow performance, so it should not be enabled in production code. NOTE: does not check the r-stack, and the SED declaration must be simple. e.g.: SED: n n -- n or something like that. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| SED: | -- (as of 18.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
The builtin version is just a "comment to end of line". It is intended to be overwritten by the version in the "debug/sed" library, which can check the stack-effect diagram against runtime conditions. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| TODO: | -- (as of 20.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
A comment word, which makes it easier to see items needing to be taken care of. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| X | n -- n (as of 22.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Inside Note: the loop index is a singleton, so if you want to store it, clone it first. See also: G:I G:J G:K |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ** | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Comment to end-of-line: everything after the "\\" is ignored. See also: G:SED: G:-- G:#! G:(* |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| _dup | a b -- a a b (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same effect as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| _swap | a b c -- b a c (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same effect as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| actor: | x w |
||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE needs utils/actor Similar to a var, but an "actor" takes an item x as its value, and a word w to invoke. As with var, the |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| again | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Unconditional return to the most recent unpaired If no See also: G:while G:repeat G:while! G:break G:break? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ahead | -- (as of 17.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Compiles an unconditional "jump" instruction at the current PC, to be resolved with |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| and | T T -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the boolean "AND" of the top two items on the stack. See also: G:or G:not G:xor |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| apropos | |||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Looks for any word whose description or name contains See also: G:help G:words G:words/ app:opts |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| argc | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the number of command-line arguments to the running program. Always 0 on mobile. See also: G:args |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| args | n -- s | null -- a | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the command-line argument number A value of Note: On macOS, Linux, and RPI, a 'backslash' on the command line is ignored unless the argument is enclosed in quotes. Forgetting that may lead to unexpected consequences. See also: G:argc |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| array? | x -- x T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| assert | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Assert that the value |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| base | n -- n' | ||||||||||||||||||||||||||||||||||||||||||||||||||
Set the numeric base to the See also: G:decimal G:hex |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| base>n | s n -- n' (as of 22.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: G:>s G:>n |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| bi | x w1 w2 -- w1(x) w2(x) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs combinators/bi Implementation of Factor's "bi" combinator. Invokes w1 and w2 on x, leaving the results. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| bits | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns 32 or 64: the "bit-size" of the current build of 8th (not the OS native bit-size!) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| break | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Flags the current loop or iterator to stop at the next iteration point. Does not leave the loop or iterator at the point it is invoked! In addition, if invoked in interpret-mode, will cause the script being evaluated to stop evaluation at that point. Affected loops: Affected iterators: Other affected words: See also: G:break? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| break? | -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
See also: G:break |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| breakif | x -- x (as of 20.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same effect as See also: G:break? G:break |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| build? | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a string containing the OS/bits. e.g.: "LIN64" or the like. See also: G:8thver? G:buildver? G:.ver |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| buildver? | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a string of the 8th build version. e.g.: "6973156a" or the like. See also: G:8thver? G:build? G:.ver |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| bye | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Quit 8th in the normal manner. The words in the See also: G:die G:onexit |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| c/does | x dw cw |
||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/create-does Similar to ANS Forth "CREATE... DOES>". Takes an item x which is the default value, a word dw which is the "run-time" behavior, a word cw which is the "create-time" behavior and a string |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| case | s table -- | n table -- | table s -- | table n -- (as of 16.12) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Similar to See also: G:caseof |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| case: | -- (as of 19.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/case Begins a "case:... case;" block, similar to the C "switch" statement. Use with of: ... of; and default: ... of; to define the cases. Uses caseof internally, but provides a more "friendly" syntax. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| caseof | a n -- x | n a -- x | m s -- x | s m -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
A "case" construct which takes an array or map, and a number or string, as appropriate. It looks up the value in the container, and then if
The order of the container vs scalar isn't important, thus eliminating the need to invoke See also: G:case |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| catch | w -- x true | w --false (as of 20.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Invokes the word. If an exception was thrown, returns the exception and |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| chdir | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Change the current directory. See also: G:getcwd |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| clip> | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the current contents of the system clipboard. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| clone | x1 -- x1 x2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
Create a "clone" Modifying the clone does not change the value of the original item Note: some item types cannot be cloned: "db", "sql", "hw", and "X". See also: G:clone-shallow G:same? G:dup |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| clone-shallow | x1 -- x1 x2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
The same as See also: G:clone G:dup G:same? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| cold | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
The default system startup, begins the interpreter loop. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| compile | w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Compiles an invocation of the word into the word currently being compiled. When that word is subsequently invoked, the word See also: G:literal G:compile? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| compile? | w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Same as See also: G:literal G:compile |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| compiling? | -- n (as of 19.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns non-zero if 8th is currently in "compile mode", 0 otherwise. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| conflict | s -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Determine how 8th responds if a new |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| const | x1 -- x2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
Equivalent of See also: G:clone |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| constant | x |
||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a "constant" value. This is essentially syntactic sugar for the prior method of creating a new word containing the value |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| container? | x -- x T (as of 19.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| counting-allocations | T -- (as of 19.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
If See also: G:.stats |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| cr | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Print an OS-specific 'newline' sequence. See also: G:. G:puts G:putc s:strfmt G:space |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| critical: | -- (as of 23.09) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Begins a "critical section" within a word. Locks that section of code so that another task cannot execute it simultaneously. May not cross word boundaries and must be paired with See also: G:critical: G:lock G:unlock |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| critical; | -- (as of 23.09) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Ends a "critical section" started with See also: G:critical: G:lock G:unlock |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| curlang | -- v | ||||||||||||||||||||||||||||||||||||||||||||||||||
A var containing a string determining the current language used by See also: s:intl s:lang |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| curry | x w -- w' (as of 18.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a new anonymous word which takes a parameter See also: G:curry: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| curry: | x w |
||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: G:curry |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| decimal | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Set the numeric base to 10. Equivalent to See also: G:base G:hex |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| default: | -- (as of 19.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/case Used with G:case: to enumerate the default case. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| defer: | |||||||||||||||||||||||||||||||||||||||||||||||||||
Create a deferred word See also: w:undo w:is |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| deferred: | w |
||||||||||||||||||||||||||||||||||||||||||||||||||
Just like See also: w:undo w:is G:defer: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| deg>rad | n -- n' | ||||||||||||||||||||||||||||||||||||||||||||||||||
Converts from degrees to radians. See also: G:rad>deg |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| depth | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Current depth of the data-stack, e.g. the number of items it contains (before pushing the depth to TOS). |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| die | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Stop 8th abnormally, with See also: G:bye |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| dip | a b w -- w(a) b | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs combinators/dip Implementation of Factor's "dip" combinator. Invokes w on the items in position 2 (etc.) on the stack, moving the item in position 1 out of the way and restoring it afterwords to TOS. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| drop | a b -- a | ||||||||||||||||||||||||||||||||||||||||||||||||||
Drop the item on TOS. See also: G:dup G:2drop |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| dstack | -- st | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a reference to this task's "data-stack", similar to See also: G:rstack |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| dump | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Do a hex-dump of the contents of the item |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| dup | x -- x x | ||||||||||||||||||||||||||||||||||||||||||||||||||
"duplicate" the item on TOS. This makes an additional reference to that item, it does not create a separate copy. If you wish to make a separate copy, use See also: G:dup? G:clone G:drop |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| dup>r | x -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Duplicates TOS and pushes it onto the r-stack. Same effect as See also: G:r> G:r@ G:rswap G:rdrop |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| dup? | x -- x x | null -- null | ||||||||||||||||||||||||||||||||||||||||||||||||||
Duplicate the item on TOS if and only if it is not See also: G:dup |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| e# | T -- (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| else | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Begin alternate branch in a See also: G:if G:then |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| enum: | startfrom |
||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/enums Create an "enumeration", e.g. words which return a numeric (increasing) value. Give a value to start from, and each name thereafter becomes a new "enum" -- up until the word "enum;', which ends the sequence. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| error? | -- n (as of 19.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the task-specific errno. A non-zero value means something is amiss. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| eval | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Interpret the string (or buffer) as if it were typed into the interpreter. If See also: G:eval! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| eval! | s -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: G:eval |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| eval0 | s -- (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Similar to See also: G:eval |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| exit | n -- (as of 24.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Causes a return of |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| expect | a x -- a flag | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/expect Tests the >kind of a against the number or array of numbers x. If a is not one of the listed types, puts false on TOS otherwise, puts true on TOS. In either case, the original item a is left under TOS. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| extra! | x x' -- x (as of 18.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the item Note: An item may not be associated with itself. See also: G:extra@ |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| extra@ | x -- x x' (as of 18.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Gets any "extra" data associated with a particular item. Any item may have "extra" data associated with it. If no item is currently associated with See also: G:extra! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| false | -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the boolean value See also: G:true |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| fnv | s -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the FNV1a hash of the given string. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| fourth | a b c d -- a b c d a (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Copies the fourth item on the stack to TOS. Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| free | x -- (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Frees the item |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| func: | param s |
||||||||||||||||||||||||||||||||||||||||||||||||||
Create a word called At runtime, the parameter string The parameter string contains the return value as its first character, followed by one character for each parameter to the function, with a maximum of 12 parameters total. Please view the manual's chapter on FFI for a complete description of the parameters. See also: G:lib w:cb |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| getc | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Read one character from the input (standard input or console) and return as a number See also: G:gets G:(getc) con:accept con:accept-pwd |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| getcwd | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the current working directory. See also: G:chdir |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| getenv | s -- s' | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the value of the environment variable, or See also: G:setenv |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| gets | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Read from standard input or the console, up to a newline and return a string See also: G:getc G:(gets) con:accept con:accept-pwd |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| goto | n -- (as of 24.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Compiles a non-returning jump to the 8th code address |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| handler | x -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Handle an exception. Receives item See also: G:throw |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| header | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a new dictionary entry named See also: G:: G:( G:(:) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| help | |||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Looks for any word If a fully-qualified name is given, only that word's help is shown. Otherwise, all matching words' help is shown. See also: G:apropos G:words G:words/ app:opts |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| help_db | -- v | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/help Variable containing the name of the help database. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| here | -- n (as of 24.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the execution address/token to be compiled next. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| hex | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the numeric base to 16. Equivalent to See also: G:base G:decimal |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| i: | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Immediately cause the action of the next word. Ensures the next word is run immediately rather than compiled in. Only use on non-"immediate" words. See also: G:p: G:l: G:i; |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| i; | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE When used instead of See also: G:p: G:l: G:i: G:; |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| if | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Begins a conditional Otherwise, the code after the See also: G:else G:then |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| if; | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| isa? | x n -- x T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| items-used | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/stats Returns an array of arrays, each containing the name of the namespace and a count of how many items of each namespace have been used. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| jcall | X a -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Takes an X returned from Note: Android only! See also: G:jclass G:jmethod |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| jclass | s -- X | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns an X given a string containing the fully qualified name of a Java class (such as "java.lang.Thread"), which may be passed to Note: Android only! See also: G:jmethod G:jcall |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| jmethod | X name params -- X' | ||||||||||||||||||||||||||||||||||||||||||||||||||
Takes a string containing the name Note: Android only! See also: G:jclass G:jcall |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| json! | ma s x -- x (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Analogous to See also: G:json@ |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| json-8th> | sb -- x (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Takes a JSON string or buffer and converts it to an equivalent of the original item given to See also: G:>json G:json> |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| json-nesting | n -- (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the limit of nesting JSON when converting items to a string. This affects |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| json-pretty | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Tell the |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| json-throw | T -- (as of 18.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| json> | s -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Take a JSON string (or buffer containing JSON) on TOS and convert it to an equivalent of the original item given to Note: 8th-specific enhancements to JSON are not permitted for security reasons, and will appear as Note: Using See also: G:>json G:json-8th> |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| json@ | ma s -- ma x true | ma s -- ma false (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Accesses elements from the map or array using a subset of "JSONPath" syntax, returning See also: G:json! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| k32 | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Windows only: Returns the |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| keep | a b w -- w(a,b) b | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs combinators/keep Implementation of Factor's "keep" combinator. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| l: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE needs utils/latebind Makes the next word "delayed lookup". Compiles the string See also: G:p: G:i: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| last | -- w | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the last word compiled. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| lib | s |
||||||||||||||||||||||||||||||||||||||||||||||||||
Create a word named The library name If an array is given (instead of a string), it should be an array of strings, which will be tried in the order they appear in the array. The first one to be a valid library on the system is used. Sets Ex: See also: G:func: w:cb |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| libbin | |||||||||||||||||||||||||||||||||||||||||||||||||||
Similar to Ex: It also flags the "build" utility that it needs to copy that library file into the asset folder so that invoking the new word in a packaged application will work properly. Because this word is intended to allow you to incorporate binary data from libraries, it will silently ignore repeated invocations with the same name. See also: G:needs |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| libc | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Linux, RPI and macOS: Returns the |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| literal | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Compiles the item See also: G:compile G:compile? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| locals: | -- (as of 17.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Flags the word about-to-be-defined as using local variables. This is required if the word will use See also: w:@ w:! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| lock | x -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Acquire a lock on the item See also: G:unlock G:locked? G:lock-to |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| lock-to | x n -- x T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: G:unlock G:locked? G:lock |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| locked? | x -- x T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Queries the lock state of the item See also: G:unlock G:lock-to G:lock |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| log | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Prints to the "log". That will be the controlling terminal, in a console app (or one which has a console), and to the system log facility (unless |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| log-syslog | T -- (as of 21.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| log-task | T -- (as of 18.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| log-time | T -- (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| log-time-local | T -- (as of 18.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Makes |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| long-days | -- v | ||||||||||||||||||||||||||||||||||||||||||||||||||
A var containing a map, mapping language names (e.g. "en") to an array of long names of the week-days. The default contains the English names of the week-days. It may be set using the appropriate "lang/xx" asset. See also: s:intl s:lang G:curlang G:long-months G:short-days G:short-months |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| long-months | -- v | ||||||||||||||||||||||||||||||||||||||||||||||||||
A var containing a map, mapping language names (e.g. "en") to an array of long names of the months. The default contains the English names of the months. It may be set by the appropriate "lang/xx" asset. See also: s:intl s:lang G:curlang G:long-days G:short-days G:short-months |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| longjmp | n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Performs a non-local jump to the word given to Note: you can only do a non-local jump within the same task! See also: G:setjmp |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| lookup | m s -- x | a n -- x | s m -- x | n a -- x (as of 20.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: G:case G:caseof |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| loop | w low hi -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Invoke the word Note: the loop index is a singleton, so if you want to store it, clone it first. See also: G:times G:loop- G:repeat G:while |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| loop- | w low hi -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as Note: the loop index is a singleton, so if you want to store it, clone it first. See also: G:times G:loop G:repeat G:while |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| map? | x -- x T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| mark | x T -- x (as of 18.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
If See also: G:mark? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| mark? | x -- x T (as of 18.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the "marked" flag of the item. See also: G:mark |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| mobile? | -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
| n# | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Set the accuracy, e.g. the number of significant digits kept after certain big floating-point calculations. It affects at least: See also: G:## |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| name>os | s -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/os-names Convert an OS name to an os value. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| name>sem | s -- x (as of 16.11) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the semaphore of the name created by See also: G:sem>name G:sem |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ndrop | a1 a2... aN N -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs stack/utils Drop 'n' items from the data stack |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| needs | |||||||||||||||||||||||||||||||||||||||||||||||||||
Parses the white-space-delimited string
The file searched for
See also: f:include app:asset G:.needs f:slurp G:private G:public G:requires |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| needs-throws | -- v (as of 24.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Variable which, if |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| needs[ | |||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| new | n -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Create a new item If the item being created is a "user-defined" item, e.g. from a namespace not built-in to 8th, then the word |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| next-arg | -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/args-common Gets the next argument after the currently processed one. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| nip | a b -- b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Drop the item under TOS. See also: G:tuck G:drop G:dup G:swap G:over |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| noop | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Literally: "do nothing". |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| not | T -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Convert See also: G:and G:or G:xor |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| nothrow | w -- x (as of 20.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Invokes the word while forcing exceptions to be ignored. If there were any exceptions during the execution of |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ns | ns -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Make the namespace identified by the number or string See also: G:ns: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ns: | |||||||||||||||||||||||||||||||||||||||||||||||||||
Use See also: G:ns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ns>ls | n -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Convert the namespace identifier to its long string representation. See also: G:ns>s G:ns G:ns: |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ns>s | n -- s | s -- s' | ||||||||||||||||||||||||||||||||||||||||||||||||||
Convert a namespace identifier, to its short string representation. That is, it converts the number given by It may also be given a string, e.g. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ns? | -- s (as of 16.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the name of the currently active namespace. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| null | -- null | ||||||||||||||||||||||||||||||||||||||||||||||||||
Put the value |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| null; | x -- x | null -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| null? | x -- x T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| nullvar | |||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Same as See also: G:! G:@ G:var |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| number? | x -- x T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| of: | x -- (as of 19.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/case Used with G:case: to enumerate cases to be handled. Parses up to "of;" and evaluates that into a word for caseof |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| off | v -- (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the var to the numeric value 0. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| on | v -- (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the var to the numeric value -1, equivalent to "all bits set". |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| onexit | w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Adds the word to the list of words to be executed, in reverse order, upon program termination. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| only | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Makes the namespace designated by the number |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| op! | v w -- (as of 17.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Invokes |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| or | T T -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the boolean "OR" of the top two items on the stack. See also: G:and G:not G:xor |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| os | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a number indicating the operating system:
See also: G:os>name |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| os-names | -- v (as of 17.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a var containing an array of names of OSes 8th supports, in order of the return value of See also: G:os |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| os>long-name | n -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/os-names Convert an OS value to the OS long name. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| os>name | n -- s (as of 16.12) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a string corresponding to value as returned from See also: G:os G:os-names |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| over | a b -- a b a | ||||||||||||||||||||||||||||||||||||||||||||||||||
"Duplicate" the item underneath TOS and make it TOS. See also: G:2over |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| p: | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Postpone the action of the next word. Ensures the next word is compiled, rather than run immediately. Only really affects "immediate" words. See also: G:l: G:i: G:i; |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| pack | a s -- b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Takes the items in the array If The format string may have any of:
Size overrides:
Ex: See also: G:unpack |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| parse | n |
||||||||||||||||||||||||||||||||||||||||||||||||||
Parse a string See also: G:parsews G:parseln G:parsech |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| parse-csv | m -- m (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Takes a map with information about what kind of parsing to do. Keys are:
The "first" and "next" words have the SED The "row" word has the SED A line beginning with the "comment" character is ignored. "cols" is an optimization so 8th only allocates an array of the expected size (instead of a much smaller one, and then resizing). If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| parse-date | T -- (as of 22.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Controls whether or not the interpreter, if it fails to parse a number, attempts to then parse a date. The default is |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| parsech | |||||||||||||||||||||||||||||||||||||||||||||||||||
Parse the next non-whitespace character from the input stream into a string one character long. See also: G:parsews G:parseln G:parse |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| parseln | |||||||||||||||||||||||||||||||||||||||||||||||||||
Parse See also: G:parse G:parsews G:parsech |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| parsews | |||||||||||||||||||||||||||||||||||||||||||||||||||
Parse See also: G:parse G:parseln G:parsech |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| pick | n -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Duplicates the item TOS is 0, item under is 1, etc. If you try to pick beyond the limits of the stack, an exception will be thrown. See also: G:over G:rot G:rpick |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| poke | x y -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs stack/utils Pokes the value 'y' into postion x on the stack, numbered as TOS=0, before the parameters are added. So: 10 20 30 40 2 200 poke will give: 10 200 30 40. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| pool-clear | n -- (as of 17.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Walks the pool for the given namespace identifier, and frees the entire "free" list. This might be used, for example, after having used a large number of items (e.g. a big array of numbers) and releasing it. If you know the application will not require a similar number of items in the future, you can invoke |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| pool-clear-all | -- (as of 19.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Clears all pools in the current task. Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| prior | w1 -- w2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
If a word with the same name as an existing word was created in the same namespace, this returns the prior version of that word, which would otherwise be inaccessible by name. If there is no prior word it returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| private | -- (as of 18.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Puts the following words or vars in the See also: G:public G:needs f:include |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| process-args | m -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/args Pass it a map containing the argument name as a key, and the action to perform as its value, e.g.: { "-h" : ' do-help } If the action needs to grab the next argument to use, it should use next-arg to get the next argument to process. An argument which is not in the map will cause the processing to stop. All remaining (non-processed) arguments can be retrieved with **remaining-args ***. The processor of an argument can issue break which will stop further processing. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| process-args-fancy | m T -- m (as of 21.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/args-fancy Pass it a map containing the argument name as a key, whose value is another map with 'cmd' -- the action to perform or 'var' -- the variable to put the 'nextarg' in also 'msg' -- help text to display if an unknown option is given. The map's keys are entered into a trie so any unique initial prefix of options will work. The T value is true if you want the options to ignore case. The following options are added unless they already exist: '--' 'stop processing' '-h' and '-?' 'display help' The map returned contains any 'var' options processed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| process-args-help | -- (as of 21.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/args-fancy Invoke the default argument-processor's help screen, which displays help text based on the 'msg' key for each option. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| prompt | s -- s' | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED word which returns the REPL's See also: dbg:prompt |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| public | -- (as of 18.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Restores the namespace which was current prior to the previous See also: G:private G:needs f:include |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| putc | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Print the character See also: G:puts G:. G:(putc) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| puts | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Print the string See also: G:putc G:. G:(puts) |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| quote | |||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Parses one character from the input stream, then parses the rest of the input stream up to the next instance of that character, returning a string. This is useful if you have embedded double-quotes, for instance. Note: the standard 8th "string-escapes" (for example "\n") are not processed by See also: G:" |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| r! | x -- (as of 18.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Replaces the r-stack TOS with the data-stack's TOS item. Equivalent to See also: G:r@ G:>r G:r> |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| r> | -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Pop the item See also: G:>r G:r@ G:rswap G:rdrop |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| r@ | -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Pushes the top of the r-stack onto the data-stack, without removing it. Note: this is not the same as See also: G:>r G:r> G:rswap G:rdrop |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rad>deg | n -- n' | ||||||||||||||||||||||||||||||||||||||||||||||||||
Converts from radians to degrees. See also: G:deg>rad |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rand-jit | -- n (as of 19.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a random number from the "Jitter RNG". See also: cr:rand G:rand-pcg |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rand-jsf | -- n (as of 19.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Generates a 64-bit pseudo-random number using the "JSF" PRNG. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rand-native | -- n (as of 19.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Generates a 64-bit pseudo-random number using the OS-specific entropy provider. Not guaranteed to be available, cryptographically secure, or fast. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rand-normal | mean sigma -- n (as of 19.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs rand/normal Returns a Gaussian "normal" distributed random number given a mean and standard-deviation sigma desired. How good the distribution is depends on the random number generator chosen. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rand-pcg | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Generate a 64-bit pseudo-random number using the "PCG" generator. This is much faster than See also: cr:rand G:rand-pcg-seed G:rand-jsf G:rand-jit |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rand-pcg-seed | n n2 -- | null -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the 'seed' for the PCG PRNG to the given numbers. Using See also: G:rand-pcg |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rand-range | low high -- n (as of 19.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs rand/range Returns a random integer in the range [low,hi] |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rand-select | s -- (as of 19.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs rand/util Sets whether G:random is cr:rand, G:rand-pcg, G:rand-native, or G:rand-jit. The default is G:rand-pcg. The choices for s are: "crypto" -- selects rand "pcg" -- selects rand-pcg, the default "jsf" -- selects rand-jsf, "jitter" -- selects rand-jit, a very slow CPU-jitter based one, and "native" -- selects rand-native, the OS-native entropy provider |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| randbuf-pcg | n -- b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Generates a buffer of size See also: G:randbuf |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| random | -- n (as of 19.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Returns a random number, initially from |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rdrop | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Drop TOS of the "r-stack". Same effect as See also: G:>r G:>r G:r@ G:rswap |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| recurse | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Invoke the last word created (e.g. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| recurse-stack | n -- (as of 17.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Set the "recursion stack size" (e.g. the hardware stack for return addresses). |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| ref@ | x -- x n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the "reference-count" See also: G:+ref G:-ref |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| reg! | s x -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the value of a Windows Registry key. The value may be a string, a number, or a buffer. Returns Note: Windows only! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| reg@ | s -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the value of a Windows Registry key. Returns Note: Windows only! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| regbin@ | s -- b n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Get the value of a Windows Registry key, as a buffer containing whatever data is in the key, and a number which indicates the kind of item (the value for Note: Windows only! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| remaining-args | -- v (as of 18.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/args-common A var which contains an array of the remaining arguments to be processed. Once process-args has returned, contains arguments which have not been processed, either because break was invoked during processing, or because the argument was not known. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| repeat | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Begin a repeated block of code terminated with either See also: G:again G:while G:while! G:break G:break? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| requires | |||||||||||||||||||||||||||||||||||||||||||||||||||
Ensures that support for the required resources is loaded. " If the required resource isn't present ( The thrown message has an explanation of what exactly happened to cause a failure. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| reset | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Remove all items from the data stack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| roll | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Moves the item at position See also: G:rot G:-rot G:rroll |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rop! | w -- (as of 18.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Invokes See also: st:op! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rot | a b c -- b c a | ||||||||||||||||||||||||||||||||||||||||||||||||||
Move the item in the third position to TOS. See also: G:-rot G:swap G:over G:drop G:nip G:tuck |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rpick | n -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs stack/rstack Returns the item at position See also: G:pick |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rreset | -- (as of 23.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Equivalent of See also: G:reset |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rroll | n -- st | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs stack/rstack Same as See also: G:roll st:roll |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rstack | -- st | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns an item which references the "r-stack". This permits you to operate on the r-stack using any stack word. See also: G:dstack |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rswap | {x y -- y x} | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: G:swap |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| rusage | -- m | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a map containing the values of various resources used by the running program. Keys may be: "rss", "swap", "fault", "ixrss", "isrss", "load1", "load5", "load15", "idrss". The meanings of the values are OS-specific. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| s>ns | s -- n (as of 18.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the numeric id of the named namespace. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| same? | x y -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Compares the two items
See also: n:= s:= |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| scriptdir | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the directory from which the script is running. Only applies when the script is sourced from the command-line, unlike |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| scriptfile | -- a | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns an array containing the full path name of the script being run as well as scripts leading up to it (e.g. via Index -1 is the currently running script. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sem | s n -- X | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns an named IPC semaphore, with an initial count of See also: G:sem-post G:sem-wait G:sem-wait? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sem-post | X -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Increments the count of the semaphore returned from See also: G:sem G:sem-wait G:sem-wait? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sem-rm | X -- (as of 18.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Removes the named semaphore (created by See also: G:sem |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sem-wait | X -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Waits until the semaphore's count becomes non-zero, then continue. See also: G:sem G:sem-post G:sem-wait? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sem-wait? | X -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns See also: G:sem G:sem-post G:sem-wait |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sem>name | X -- X s (as of 16.11) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the name used when creating the semaphore with See also: G:sem G:name>sem |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| semi-throw | T -- (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| set-wipe | sb -- sb | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets "wipe" flag on a string or a buffer. That ensures that when the item's refcount has gone to zero, the data it holds is wiped before being released. This means the user does not have to manually use See also: s:clear b:clear |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| setenv | var val -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Set the value See also: G:getenv |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| setjmp | w -- n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a non-local jump point. The return value is a number passed subsequently to Note: you can only do a non-local jump within the same task! See also: G:longjmp |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| settings! | key val -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/settings Save the key,val pair in the settings database. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| settings![] | [key,val,...] -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/settings Save the array of key,val pairs in the settings database. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| settings@ | key -- val | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/settings Get the setting named by the string 'key', and return its value or 'null' Note the use of the r-stack to transfer the result! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| settings@? | key default -- val | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/settings Get a settings value and if it is null, use 'default' instead. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| settings@[] | [key,...] -- [val,...] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/settings Get the values corresponding to an array of keys in the settings database. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sh | s w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Execute the external command string, invoking the word See also: I:sh G:sh$ |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sh$ | s w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: I:sh G:sh |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| short-days | -- v | ||||||||||||||||||||||||||||||||||||||||||||||||||
A var containing a map, mapping language names (e.g. "en") to an array of short names of the week-days. The default contains the English names of the week-days. It may be set by the appropriate "lang/xx" asset. See also: s:intl s:lang G:curlang G:long-days G:long-months G:short-months |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| short-months | -- v | ||||||||||||||||||||||||||||||||||||||||||||||||||
A var containing a map, mapping language names (e.g. "en") to an array of short names of the months. The default contains the English names of the months. It may be set by the appropriate "lang/xx" asset. See also: s:intl s:lang G:curlang G:long-days G:long-months G:short-days |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sleep | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sleeps the current task for that number of seconds, which does not have to be an integer. Fractional seconds are broken into milliseconds. A negative number means 'wait forever', or until See also: t:notify t:wait t:q-wait |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sleep-msec | n -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sleep-until | d -- (as of 19.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/sleep Sleep the current task until the date d. Contast with G:sleep which sleeps for a number of seconds. NOTE: will respond to t:notify by waking up perhaps prematurely. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| slog | x s -- (as of 21.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same effect as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| space | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Print a space character, ASCII 32. See also: G:. G:cr G:puts G:putc s:strfmt |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| stack-check | T -- (as of 16.13) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Determines whether or not type and bounds-checking are performed on stack operations. The default is |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| stack-size | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the main data-stack size to the given number It also resizes the current task's data-stack and moves data if necessary to the resized stack. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| step | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Increment the current loop counter by See also: G:loop G:loop- a:map a:map= a:2map+ a:map+ a:each a:each! a:2each a:x-each a:x a:reduce+ s:map s:each s:each! b:each b:each! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| sthrow | x s -- (as of 20.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Like |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| string? | x -- x T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| struct: | -- str | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs utils/structs Begin definition of a "struct", which is actually a map containing field and type information about the struct. The struct ends with See also: struct:struct; |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| swap | a b -- b a | ||||||||||||||||||||||||||||||||||||||||||||||||||
Exchange position of top two items on the stack. See also: G:2swap G:rot G:-rot |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| tab-hook | s -- a | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED This is the word responsible for console tab-completion. It receives a string which is the text entered in the console before the TAB key was pressed. Returns an array of strings (possibly empty) matching the initial string. This word is lazy-loaded on first use in the REPL, and is implemented in the |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| tell-conflict | -- v | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a var which controls whether or not 8th will complain when overwriting an existing word. It contains |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| tempdir | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the directory where temporary files will be created. See also: G:tempfilename |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| tempfilename | -- s | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a string suitable for a temporary file name in the directory See also: G:tempdir |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| then | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Ends a conditional See also: G:if G:else |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| third | a b c -- a b c a (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Copies the third item on the stack to TOS. Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| throw | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Throw an exception. Quits the current word and passes In the latter case, 8th does not quit, on the assumption that you made a typo or other error, and the stack is left in an unpredictable state; so use See also: G:handler |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| thrownull | x y -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| times | w n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Invoke the See also: G:loop G:loop- G:repeat G:while |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| tlog | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs debug/log Same as log, but prepends a date-time stamp, including milliseconds, to the output. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| toggle | v -- T (as of 24.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Toggles the value in the var from |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| tri | x w1 w2 -- w1(x) w2(x) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| needs combinators/tri Implementation of Factor's "tri" combinator. Invokes w1 and w2 and w3 on x, leaving the results. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| true | -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the boolean value See also: G:false |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| tuck | a b -- b a b | ||||||||||||||||||||||||||||||||||||||||||||||||||
Duplicate the item on TOS under the item under TOS. See also: G:nip G:drop G:dup G:swap G:over |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| type-check | T -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| typeassert | n1 n2 -- (as of 17.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Invoked by the system when The default behavior is to throw an exception saying what is wrong, e.g. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| uid | x -- x s (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a string uniquely identifying the item. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| uname | -- m (as of 19.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a map with information about the system:
Note: not all are available on every platform. |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| unlock | x -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
Release the lock on the item See also: G:locked? G:lock-to G:lock |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| unpack | sb s -- a n | sb n s -- a n | ||||||||||||||||||||||||||||||||||||||||||||||||||
Takes the items in the string or buffer If a number is provided under the format string and above the buffer, it indicates an offset in bytes from the beginning of the buffer, from which to start unpacking. Format string same as for See also: G:pack |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| until | x -- x (as of 18.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same effect as See also: G:until! G:while G:while! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| until! | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
Same effect as See also: G:until G:while G:while! |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| var | |||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Create a var named See also: G:! G:@ G:var, |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| var, | x |
||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Same as See also: G:! G:@ G:var |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| while | x -- x | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE At runtime, peeks at TOS; if Note: this does not pop TOS! If you want that behavior, use Only available in compile-mode, throws an exception otherwise. It also throws an exception if you forgot to invoke See also: G:again G:repeat G:while! G:break G:break? |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| while! | x -- (as of 16.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE The same as See also: G:while |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | |||||||||||||||||||||||||||||||||||||||||||||||||||
| IMMEDIATE Add the namespace See also: G:;with |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| word? | x -- x T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| words | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED needs utils/words List all currently known words, alphabetically by ns |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| words-like | s -- a | null -- a | ||||||||||||||||||||||||||||||||||||||||||||||||||
Like See also: G:words/ G:words |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| words/ | |||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED needs utils/words Like words, but matches only words which match the string " |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| xchg | x v -- x' (as of 17.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Puts the item |
|||||||||||||||||||||||||||||||||||||||||||||||||||
| xor | T T -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the boolean "EXCLUSIVE OR" of the top two items on the stack. See also: G:or G:not G:and |
Namespace: gr
Description: Graph data type: nodes, edges, weights
| word | sed/description | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| +edge | gr n1 n2 n3 -- gr (as of 18.08) | ||||||||||||||||||
Adds an See also: gr:+edge+w |
|||||||||||||||||||
| +edge+w | gr n1 n2 n3 n4-- gr (as of 18.08) | ||||||||||||||||||
Same as See also: gr:+edge |
|||||||||||||||||||
| +node | gr x -- gr (as of 18.08) | ||||||||||||||||||
Adds a node to the graph's list of nodes. |
|||||||||||||||||||
| connect | gr -- gr (as of 18.08) | ||||||||||||||||||
Connects each node to every other node in the graph, creating an edge for each combination. If a |
|||||||||||||||||||
| edges | gr -- gr a (as of 18.08) | ||||||||||||||||||
Returns an array with all the edges of the graph. Each 'edge' is an array: [from, to, weight, direction]. Note: modifying the returned array will NOT modify the nodes in the graph; to do that, use |
|||||||||||||||||||
| edges! | gr a -- gr (as of 20.05) | ||||||||||||||||||
Sets the edges of the graph. Each entry in the array must contain [from, to, direction, weight]. |
|||||||||||||||||||
| m! | gr s x -- gr (as of 18.08) | ||||||||||||||||||
Associates the value |
|||||||||||||||||||
| m@ | gr s -- gr x (as of 18.08) | ||||||||||||||||||
Returns the value associated with the key |
|||||||||||||||||||
| neighbors | gr ix -- gr a (as of 18.08) | ||||||||||||||||||
Returns an array with all the nodes which share an edge with the node with index |
|||||||||||||||||||
| new | m -- gr (as of 18.08) | ||||||||||||||||||
Creates a new graph defined by the map. The keys in
In the case of an unweighted graph, 'weight' is 0. 'direction' is 0 for undirected, 1 source->dest, 2 dest->source, 3 source<->dest. |
|||||||||||||||||||
| node-edges | gr ix -- gr a (as of 18.08) | ||||||||||||||||||
Returns an array with all the edges connected to the node with index |
|||||||||||||||||||
| nodes | gr -- gr a (as of 18.08) | ||||||||||||||||||
Returns an array with all the nodes of the graph, in the order inserted. Note: modifying the returned array will modify the nodes in the graph, so be cautious. |
|||||||||||||||||||
| traverse | gr T ix w -- gr (as of 18.08) | ||||||||||||||||||
Traverse the given graph starting at the "root node" given by the The word The traversal continues until there are no more nodes which can be visited, or |
|||||||||||||||||||
| weight! | gr w -- gr (as of 20.08) | ||||||||||||||||||
Assigns the word as the graph's weight function. |
Namespace: g
Description: GUI Widgets and utilities
| word | sed/description |
|---|---|
| media? | n -- s (as of 24.04) |
| needs gui/media Returns one of the following values, if the value passed in (in pixels) is below the threshold (and above the preceding one). The values correspond to the media query values used by "Pure CSS", as expanded using typical display resolution standards. Use the return value to decide UI layout parameters. |
Namespace: hw
Description: Hardware abstraction layer
| word | sed/description | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| arm? | -- T | ||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||
| camera | fmt -- hw | ||||||||||||||||||||||||||
Takes an array from the "fmts" member of one of the camera maps returned from |
|||||||||||||||||||||||||||
| camera-img | hw -- hw img | ||||||||||||||||||||||||||
Grabs an image from the camera hw, or Not currently on mobile. |
|||||||||||||||||||||||||||
| camera-limits | hw n -- hw a (as of 20.05) | ||||||||||||||||||||||||||
Given a property from the enumerations in the "hw/camera" library, returns an array of the mininum, maximum, and default values for the property. If the property isn't available for the given hardware, or the camera has not been opened, returns |
|||||||||||||||||||||||||||
| camera? | -- a | ||||||||||||||||||||||||||
Queries the system for information on available cameras. Returns an array of maps, one per detected camera. Because of "plug-n-play", the list of attached cameras may change, so it is necessary to invoke The map returned per camera has the "name", a "uuid", the camera's "index" in the original array, and an array called "fmts", which contains a list of the video resolution and formats the camera can produce. Each "fmts" array contains, in order, the format's width, height, "fourcc" format code, FPS, the camera index of the camera it belongs to, and the format index in the "fmts" *array. |
|||||||||||||||||||||||||||
| cpu? | -- m | ||||||||||||||||||||||||||
Returns a map which identifies the properties of the CPU. Possible values returned:
|
|||||||||||||||||||||||||||
| device? | -- s | ||||||||||||||||||||||||||
Returns a string which is a description of the device on which 8th is currently running. |
|||||||||||||||||||||||||||
| displays? | -- n | ||||||||||||||||||||||||||
Returns the number of displays (monitors) attached to this device. |
|||||||||||||||||||||||||||
| displaysize? | n -- wide high | ||||||||||||||||||||||||||
Returns the dimensions of display number |
|||||||||||||||||||||||||||
| finger-match | w to -- (as of 19.03) | ||||||||||||||||||||||||||
| Professional version Takes a word and a number Android only. |
|||||||||||||||||||||||||||
| finger-support | -- m (as of 19.03) | ||||||||||||||||||||||||||
| Professional version Returns a map with two keys: "hw" is Android only for now… |
|||||||||||||||||||||||||||
| gpio | n T -- X | ||||||||||||||||||||||||||
| Hobbyist version Creates a new GPIO item which will be used subsequently for I/O on the GPIO pin See also: hw:gpio@ hw:gpio! hw:gpio-mmap |
|||||||||||||||||||||||||||
| gpio! | X n -- | ||||||||||||||||||||||||||
| Hobbyist version Writes to the GPIO pin (returned from See also: hw:gpio hw:gpio@ hw:gpio-mmap |
|||||||||||||||||||||||||||
| gpio-mmap | n -- | ||||||||||||||||||||||||||
| Hobbyist version Determines how to access GPIO. If passed "0", it turns off the memory-map accessors for GPIO (the default is to use the OS accessors). If it is "1", it tries to use the Raspberry Pi specific memory-map accessors. Note: If the hardware you are running on is not RPI, bad things might happen. You've been warned!. See also: hw:gpio@ hw:gpio! hw:gpio |
|||||||||||||||||||||||||||
| gpio@ | X -- X m | ||||||||||||||||||||||||||
| Hobbyist version Reads from the GPIO pin (returned from See also: hw:gpio hw:gpio! hw:gpio-mmap |
|||||||||||||||||||||||||||
| i2c | bus addr -- hw | ||||||||||||||||||||||||||
| Hobbyist version Given two numbers Note: this functionality is currently only available on Linux, Android, and Raspberry Pi, and requires "root" (or appropriate "group") access. See also: hw:i2c@ hw:i2c@reg hw:i2c! hw:i2c!reg |
|||||||||||||||||||||||||||
| i2c! | hw b -- hw n | ||||||||||||||||||||||||||
| Hobbyist version Writes the data in the buffer to the I2C device from See also: hw:i2c hw:i2c@ hw:i2c@reg hw:i2c!reg |
|||||||||||||||||||||||||||
| i2c!reg | hw reg val T -- hw T | ||||||||||||||||||||||||||
| Hobbyist version Writes the number See also: hw:i2c hw:i2c@ hw:i2c@reg hw:i2c! |
|||||||||||||||||||||||||||
| i2c@ | hw n -- hw b | ||||||||||||||||||||||||||
| Hobbyist version Reads See also: hw:i2c hw:i2c@reg hw:i2c! hw:i2c!reg |
|||||||||||||||||||||||||||
| i2c@reg | hw reg T -- hw n | ||||||||||||||||||||||||||
| Hobbyist version Reads from the hw returned from See also: hw:i2c hw:i2c@ hw:i2c! hw:i2c!reg |
|||||||||||||||||||||||||||
| isround? | -- T (as of 18.06) | ||||||||||||||||||||||||||
| Professional version Android wear OS only: returns |
|||||||||||||||||||||||||||
| iswatch? | -- T (as of 18.06) | ||||||||||||||||||||||||||
| Professional version Android: returns |
|||||||||||||||||||||||||||
| mac? | -- a | ||||||||||||||||||||||||||
Returns this computer's network-cards' MAC addresses as an array of strings. |
|||||||||||||||||||||||||||
| mem? | -- n | ||||||||||||||||||||||||||
Returns the amount of RAM installed as a number in MB. |
|||||||||||||||||||||||||||
| model? | -- s (as of 19.04) | ||||||||||||||||||||||||||
Returns a string containing the model of the board (RPI etc); or |
|||||||||||||||||||||||||||
| poll | hw -- m | ||||||||||||||||||||||||||
Poll the current state of the hw sensor See also: hw:sensor |
|||||||||||||||||||||||||||
| sensor | s -- hw | ||||||||||||||||||||||||||
Returns a new hw corresponding to the sensor type giving in the string
Returns See also: hw:start hw:poll hw:stop |
|||||||||||||||||||||||||||
| start | hw -- | ||||||||||||||||||||||||||
Activate the hw sensor which was created using See also: hw:sensor |
|||||||||||||||||||||||||||
| stop | hw -- | ||||||||||||||||||||||||||
Stop the hw sensor from requesting updates from the hardware. See also: hw:sensor |
|||||||||||||||||||||||||||
| uid? | -- s (as of 19.05) | ||||||||||||||||||||||||||
Returns a unique hardware UUID, or |
Namespace: h
Description: Ordered container
| word | sed/description |
|---|---|
| + | h h2 -- h |
Moves all items from the heap |
|
| clear | h -- h |
Remove all items from the heap. |
|
| cmp! | h w -- h (as of 20.08) |
Assigns the word as the heap's comparator function. |
|
| len | h -- h n |
Returns the number of items on the heap. |
|
| max! | h T -- h (as of 19.06) |
If |
|
| new | w -- h |
Create a new heap using the word See also: h:push h:pop h:peek |
|
| peek | h -- h x |
Like See also: h:pop h:peek |
|
| pop | h -- h x |
Returns the "largest" item See also: h:push h:peek |
|
| push | h x -- h |
Push the item See also: h:pop h:peek |
|
| unique | h T -- h (as of 18.05) |
If |
Namespace: html
Description: html
| word | sed/description |
|---|---|
| parse | s -- DOM (as of 21.09) |
| needs dom/html-parse Parses a string containing HTML, returning a DOM |
Namespace: HTTP
Description: HTTP
| word | sed/description |
|---|---|
| >auth | username password -- authstring |
| needs net/basic-auth Given a username and password as strings, return another string which is an appropriately crafted string for "HTTP basic authentication". |
Namespace: img
Description: JPEG, PNG and BMP images
| word | sed/description | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| >file | img s -- | ||||||||||||||||||||||||||||||
Write the image to a file named by the string |
|||||||||||||||||||||||||||||||
| >fmt | img n -- img' (as of 20.01) | ||||||||||||||||||||||||||||||
Takes the source img and creates a new one with the given format. The number is one of:
|
|||||||||||||||||||||||||||||||
| copy | img dest src -- img (as of 18.01) | ||||||||||||||||||||||||||||||
Similar to Note: the original img itself is modified! |
|||||||||||||||||||||||||||||||
| crop | img x y wide high -- img' (as of 16.12) | ||||||||||||||||||||||||||||||
Returns a sub-image taken from the starting point ( |
|||||||||||||||||||||||||||||||
| data | img T -- img m (as of 17.03) | ||||||||||||||||||||||||||||||
Returns a map containing:
The |
|||||||||||||||||||||||||||||||
| desat | img -- img' (as of 16.12) | ||||||||||||||||||||||||||||||
Desaturate (convert to grayscale) the img. |
|||||||||||||||||||||||||||||||
| draw | img rect img2 -- img (as of 22.04) | ||||||||||||||||||||||||||||||
Draws |
|||||||||||||||||||||||||||||||
| draw-sub | img pt img2 rect -- img (as of 22.06) | ||||||||||||||||||||||||||||||
Draws the subimage at |
|||||||||||||||||||||||||||||||
| fill | img clr -- img (as of 17.07) | ||||||||||||||||||||||||||||||
Fill the img with the color. |
|||||||||||||||||||||||||||||||
| fillrect | img x y w h clr -- img (as of 20.01) | ||||||||||||||||||||||||||||||
Fill the given img with the color within the rectangle, modifying the img. |
|||||||||||||||||||||||||||||||
| filter | img a -- img' | img m -- img' (as of 16.12) | ||||||||||||||||||||||||||||||
Apply the convolution matrix defined by the array or map to the img. The array should have a size which is a perfect square; it will be treated as if it is (so if it has for example 10 numbers, the first 9 will be used to make a 3x3 convolution kernel). If a map is given, it must contain a key "mat" which is the matrix to use, and it may optionally contain the keys "mode" which is a number: 0 means ignore edge (the default); 1 = wrap edge; 2 = extend edge; 3 = treat edge as transparent black; and "normalize" which is a number to which the sum of the values in the matrix will be adjusted. So |
|||||||||||||||||||||||||||||||
| flip | img T -- img' (as of 16.13) | ||||||||||||||||||||||||||||||
Returns an img which is the first one flipped end for end (mirrored). If |
|||||||||||||||||||||||||||||||
| from-svg | sb -- img | m -- img | ||||||||||||||||||||||||||||||
Loads an SVG image. If passed a string or buffer, then if it begins with "<" it is treated as SVG XML; otherwise, it is treated as the name of a file containing SVG. If passed a map, then it may contain any of these keys (one of 'file' or 'svg' is required):
|
|||||||||||||||||||||||||||||||
| line | img x0 y0 x1 y1 clr -- img | img pt0 pt1 clr -- img (as of 22.04) | ||||||||||||||||||||||||||||||
Draws a line on the image from |
|||||||||||||||||||||||||||||||
| new | s -- img | b -- img | img -- img' | wide high -- img | ||||||||||||||||||||||||||||||
Load an img. Allowable formats are PNG, GIF, JPEG, and SVG. If given a:
|
|||||||||||||||||||||||||||||||
| pikchr | s class flags -- s w h | s class flags -- null (as of 22.04) | ||||||||||||||||||||||||||||||
Parses "pikchr" code and returns a corresponding SVG string and its width and height, or |
|||||||||||||||||||||||||||||||
| pix! | img row col clr -- img | ||||||||||||||||||||||||||||||
Set the pixel color in the image at See also: meta:color img:pix@ |
|||||||||||||||||||||||||||||||
| pix@ | img row col -- img n | ||||||||||||||||||||||||||||||
Returns the pixel color at See also: meta:color img:pix! |
|||||||||||||||||||||||||||||||
| qr-gen | sb n -- m (as of 17.07) | ||||||||||||||||||||||||||||||
| Hobbyist version Generates a map with a QR-code from a string or buffer, with ECC level |
|||||||||||||||||||||||||||||||
| qr-parse | img -- a | img -- n (as of 16.13) | ||||||||||||||||||||||||||||||
| Hobbyist version Scans a black and white img for QR codes and returns
See also: img:qr-gen |
|||||||||||||||||||||||||||||||
| rect | img x0 y0 x1 y1 clr -- img | img pt0 pt1 clr -- img (as of 22.04) | ||||||||||||||||||||||||||||||
Draws a rectangle on the image from |
|||||||||||||||||||||||||||||||
| rotate | img n -- img' (as of 16.13) | ||||||||||||||||||||||||||||||
Returns an img which is the first one rotated by |
|||||||||||||||||||||||||||||||
| scale | img wide high -- img' | ||||||||||||||||||||||||||||||
Resize the image to |
|||||||||||||||||||||||||||||||
| scroll | img n1 clr n2 -- img (as of 18.01) | ||||||||||||||||||||||||||||||
Scrolls the source img, by moving the image data The Note: the original img itself is modified! |
|||||||||||||||||||||||||||||||
| size | img -- img wide high | ||||||||||||||||||||||||||||||
Returns width and height of the image in pixels. |
Namespace: imap
Description: IMAP access words
| word | sed/description |
|---|---|
| fetch-full | imap ix uid (r: arr) -- imap (r: arr) |
| needs net/imap Fetch an IMAP message into the array on the rstack. |
|
| fetch-uid-mail | imap uid -- imap result |
| needs net/imap Fetch an IMAP message by uid. |
|
| login | imap -- imap flag |
| needs net/imap Log-in to the given imap. Returns true on success, or fail otherwise. |
|
| logout | imap -- imap |
| needs net/imap Log-out of the IMAP connection. After logout, the connection "hangs", so parse-response is not possible |
|
| new | m -- imap |
| needs net/imap Connects to an IMAP server using the options given in the map. Returns an 'imap' which is used for further communications:
|
|
| search | imap s-query -- imap A |
| needs net/imap Search IMAP e-mail and return array of e-mail objects. |
|
| select-inbox | imap -- imap stats |
| needs net/imap Returns the IMAP inbox as a map. |
Namespace: iso
Description: Various ISO things
| word | sed/description |
|---|---|
| countries | -- m (as of 18.06) |
| needs iso/countries Returns a map containing (abbrev, name) pairs with the current ISO 3166-1 alpha-2 country codes and their expanded names and codes. Each two-character code (e.g. "US") key's value is a map containing at least "a3" (the alpha-3 code), "num", the ISO numeric code, "name" (the usual country name), "name2" (the "official" name if there is one) and "name3", the "common name", if there is one. |
|
| languages | -- m (as of 22.03) |
| needs iso/languages Returns a map whose keys are the two-letter ISO language names, and the contents are maps of (name, native); where 'name' is the English name of the language, and 'native' is the name of the language for native speakers. |
Namespace: JSONRPC
Description: JSON-RPC access words
| word | sed/description |
|---|---|
| call | rpc opts -- result |
| needs net/json-rpc Make a JSON-RPC call. |
Namespace: loc
Description: Description of a location's information
| word | sed/description |
|---|---|
| bearing | a1 a2 -- n (as of 24.03) |
| needs geo/bearing Calculates the great-circle bearing between two geographic locations. Given two arrays containing |
|
| find | loc -- |
| needs geo/location Find the given location loc by name. Tries both the English and Hebrew names. Returns a map with the location information, or null if it failed. The search is not case-sensitive. |
|
| sort | hebrew? -- |
| needs geo/location Sort the locations collection by name. Use the Hebrew location name ("loch") for sorting if hebrew? evaluates true; otherwise, use the English name ("loc"). |
Namespace: m
Description: Maps are unordered containers accessed by a string key
| word | sed/description |
|---|---|
| ! | m s x -- m | m n x -- m |
Put the item If the key is anything but a string or a number, then the item itself will be used as a key, and that item will be returned with See also: m:@ |
|
| !? | m s x -- m (as of 16.10) |
Sets the value for the key, if there isn't already a value for that key. |
|
| + | m1 m2 -- m1 |
Insert the keys and their current values from map |
|
| +? | m m2 -- m (as of 17.05) |
The same as See also: m:+ |
|
| - | m s -- m |
Remove the key |
|
| <> | m s1 s2 -- m (as of 22.07) |
Swap the values of the keys "s1" and "s2" in the map. Ex: |
|
| = | m1 m2 w -- m1 m2 T (as of 22.08) |
Compares the two maps, using the word to determine equality. The maps are considered equal if they have the same number of keys, and each key's value is equal to the same key's value in the other map (including its type), according to the comparator word. That word's SED is |
|
| >arr | m -- a (as of 21.03) |
Converts the map into an array of See also: m:arr> |
|
| @ | m s -- m x | m n -- m x | m a -- m a' |
Returns the item See also: m:! |
|
| @? | m s x -- m x' | m a x -- m a' (as of 16.10) |
Gets the value for the key in the given map, if it exists. If it doesn't exist, returns the default value See also: m:@ |
|
| []! | m s x -- m (as of 20.03) |
Same as |
|
| _! | m x key -- m (as of 19.05) |
Same as See also: m:! |
|
| _@ | m s -- x (as of 19.07) |
Same as See also: m:@ |
|
| _@? | m s x -- x' | m a x -- a' (as of 24.03) |
Same as See also: m:@? |
|
| alias | m s1 s2 -- m (as of 23.05) |
Adds the key |
|
| arr> | a -- m (as of 21.03) |
Converts the array of See also: m:>arr |
|
| bitmap | m a n -- n' (as of 19.09) |
Given a map with keys whose values are numbers, and an array of strings which are some subset of those keys, returns the values ORed together in a single number. The Ex: |
|
| clear | m -- m |
Remove all elements from the map. |
|
| data | m -- m m' |
Returns the internal map of a user-defined type. If |
|
| each | m w -- m |
Iterate over the map and invoke The map is not available on the stack while |
|
| exists? | m s -- m T | m a -- m T |
Returns An array of strings may be passed, in which case each of them which must exist as a key with a value in the map for the return value to be |
|
| filter | m w -- m' (as of 19.05) |
Filters a map. The SED for |
|
| ic | m T -- m (as of 21.09) |
If |
|
| iter | map keys wrd -- map |
| needs map/iter Iterate over a map, in the order of the array of keys given. Do not iterate over any other keys. 'wrd' has the SED \ map key -- map |
|
| iter-all | map keys wrd -- map |
| needs map/iter-all Similar to m:iter, but first iterates over the keys in the given order, and then iterates over the remaining keys in alpha order. |
|
| keys | m -- m a |
Returns all the keys of the map See also: m:vals |
|
| len | m -- m n |
Returns the length of the map, e.g. the number of keys it currently contains. Equivalent to |
|
| map | m w -- m' |
Create a map whose elements are formed by invoking |
|
| merge | m1 m2 -- m1 |
| needs map/merge Merge the contents of m2 into m1. Iterates the keys of m2 (assumed to be maps), and merges into same key of m1, creating a map for the key, if needed |
|
| new | -- m (as of 17.05) |
Create a new, empty map. |
|
| op! | m s w -- m | m a w -- m (as of 17.01) |
Invokes |
|
| open | m -- a1 a2 (as of 18.01) |
Opens the map See also: m:zip |
|
| slice | m a -- m' (as of 19.05) |
Returns a map which is a "slice" of the original map consisting of the keys in the array. Items which don't exist will appear as |
|
| vals | m -- m a (as of 18.04) |
Returns all the values of the map, in the same order See also: m:keys |
|
| xchg | m s x -- m x' (as of 18.04) |
Stores a new value in the map at the key See also: G:xchg a:xchg |
|
| zip | a1 a2 -- m (as of 20.04) |
Creates a map from two arrays, where See also: m:open |
Namespace: md
Description: Markdown text processing
| word | sed/description |
|---|---|
| 2console | s m -- f (as of 19.09) |
| needs md/2console Takes an input string containing Markdown formatted text and writes to the console. Returns true if it was able to parse the MD |
|
| 2html | m s -- s (as of 19.09) |
| needs md/2html Takes an input string containing Markdown formatted text, and a map with options, produces an HTML string as output. The map can have the keys: "css" (a string which is a file-name of CSS, or a buffer containing CSS; "num" - boolean which if true, means to number H tags; "frag" - boolean which if true means the HTML is not a whole document. |
|
| 2nk | m s -- f (as of 21.01) |
| needs md/2nk Takes an input string containing Markdown formatted text and writes to the GUI. Returns true if it was able to parse the MD |
Namespace: mat
Description: Numbers: matrices (native double or complex, only)
| word | sed/description |
|---|---|
| ! | mat a n -- mat | n1 n2... nN n mat -- mat (as of 18.08) |
Puts See also: mat:new mat:@ |
|
| * | mat1 mat2 -- mat3 (as of 18.08) |
Returns the result of a matrix-multiplication of the 2D input matrices. If the first matrix column dimension is not the same as the second's row dimension, See also: mat:new |
|
| + | m1 m2 -- m3 (as of 18.08) |
Adds the input matrices. They must be of the same type and dimensions, otherwise the result is See also: mat:new |
|
| = | mat1 mat2 -- T (as of 18.08) |
Returns See also: mat:new |
|
| @ | mat a -- mat n | n1 n2... nN mat -- mat n (as of 18.08) |
Retrieves the value of the matrix at the position given by either the array or the numbers See also: mat:new mat:! |
|
| affine | a -- mat (as of 20.01) |
Creates an affine-transformation matrix from an array of 6 numbers. If there are not 6 numbers, See also: mat:transform |
|
| col | mat n -- mat' (as of 18.08) |
Returns the column See also: mat:new |
|
| data | mat -- mat a (as of 18.08) |
Returns the data values of the matrix. See also: mat:new |
|
| det | mat -- n (as of 18.08) |
Returns the determinant of the matrix. If See also: mat:new |
|
| dim? | m -- m a (as of 18.08) |
Returns an array of numbers, the dimensions of the matrix. See also: mat:new |
|
| get-n | mat ix -- mat n (as of 18.08) |
Gets the number or complex at offset See also: mat:new |
|
| ident | n -- mat (as of 18.08) |
Creates a 2D "identity matrix" of dimension See also: mat:new |
|
| inv | mat -- mat' (as of 19.02) |
Returns the inverse of the matrix, or See also: mat:new |
|
| m. | mat -- (as of 18.08) |
Pretty-prints a matrix. See also: mat:new |
|
| minor | mat n1 n2 -- mat' (as of 18.08) |
Returns the "minor" of the matrix, with column See also: mat:new |
|
| n* | mat n -- mat (as of 18.08) |
Performs scalar multiplication of See also: mat:new |
|
| new | a1 a2 -- mat (as of 18.08) |
Creates a new matrix, whose initial values are given in the array See also: mat:get-n mat:+ mat:dim? mat:same-size? mat:@ mat:! mat:n* mat:ident mat:row mat:col mat:trans mat:* mat:minor mat:det mat:= mat:m. mat:data |
|
| new-minor | mat -- mat' (as of 19.02) |
Returns the "matrix of minors" of the original, or See also: mat:new |
|
| rotate | n -- m (as of 20.01) |
| needs math/affine Returns an affine-transformation matrix rotating clockwise by n radians |
|
| row | mat n -- mat' (as of 18.08) |
Returns the row See also: mat:new |
|
| same-size? | mat1 mat2 -- mat1 mat2 T (as of 18.08) |
Returns See also: mat:new |
|
| scale | x y -- m (as of 20.01) |
| needs math/affine Returns an affine-transformation matrix scaling (x,y) |
|
| shear | x y -- m (as of 20.01) |
| needs math/affine Returns an affine-transformation matrix shearing (x,y) |
|
| trans | mat -- mat' (as of 18.08) |
Transposes a 2D matrix with dimensions column,row into a new matrix with dimensions row,column. See also: mat:new |
|
| translate | x y -- m (as of 20.01) |
| needs math/affine Returns an affine-transformation matrix translating (x,y) |
|
| xform | pt mat -- a | a mat -- a' (as of 20.01) |
Applies the affine-transformation matrix (created by See also: mat:affine |
Namespace: net
Description: Internet and sockets
| word | sed/description | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ! | net key val -- net | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils Insert a key,val into the opts map of a 'net'. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| !? | net key value -- net | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| - | net key -- net | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils remove the key from the net opts |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| >base64url | x -- s (as of 23.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/base64url Convert a buffer or string to "base64url" format |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| >url | s -- s' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
URL-encode the string as per RFC 3986. See also: net:url> |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| @ | net key -- net val | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils Get the 'key' from the opts map of a 'net'. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| @? | net key default -- net val | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| CGI | -- T (as of 23.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/cgi |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| DGRAM | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a number to pass to See also: net:INET4 net:INET6 net:STREAM net:socket |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| INET4 | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a number to pass to See also: net:INET6 net:STREAM net:DGRAM net:socket |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| INET6 | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a number to pass to See also: net:INET4 net:STREAM net:DGRAM net:socket |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| PROTO_TCP | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a number to pass to the |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| PROTO_UDP | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a number to pass to the |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| REMOTE_IP | -- s (as of 23.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/cgi If |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| REMOTE_IP | -- s (as of 23.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/cgi Returns the IP address of the connecte client. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| STREAM | -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a number to pass to See also: net:INET4 net:INET6 net:DGRAM net:socket |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| accept | net -- net' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Waits for a connection on net after invoking See also: net:bind net:listen net:connect |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| active? | -- m (as of 23.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/active Returns a map with a key IPV4 and/or IPV6 pointing to a map with information from |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| addrinfo>o | X -- a | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Convert the X returned from
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| again? | net -- net T (as of 17.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| alloc-and-read | net -- net buf|net null | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils Allocates a suitable buffer, and reads from the net into it. Set the 'wait-to' value to the number of msecs to wait for input from the remote side (default is 1000) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| alloc-buf | net -- net buf | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils Allocate a new buffer based on the 'bufsize' the user set. This is a buffer which can be used to read into for the net. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| avail? | -- T (as of 24.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/avail Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| base64url> | s -- b (as of 23.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/base64url Convert a string from "base64url" format to a buffer |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| bind | X net -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Binds the net to the X returned from See also: net:connect net:accept net:listen |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| cgi-get | s -- m (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/cgi Parse input string as GET |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| cgi-http-header | T -- (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/cgi Control whether or not an "HTTP" header is output. Defaults |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| cgi-init | T -- m (as of 23.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/cgi Reads the CGI data. If |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| cgi-init-stunnel | -- s m (as of 23.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/cgi Like |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| cgi-out | mime charset data -- (as of 23.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/cgi Prints |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| close | net -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Close the net. It may not be read from or written to after this. See also: net:socket |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| closed? | net -- net T (as of 19.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| connect | X net -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Connects to the net with the X returned from See also: net:bind net:accept net:listen |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| curnet | -- net (as of 22.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils Get the |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| debug? | net -- net T | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils Determine if the user is wanting to debug the connection (prints RECV/SEND and data) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| delete | url -- opts buf true | opts false (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/http Same as net:get, but with HTTP DELETE. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| dns | m -- m' (as of 24.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Makes a DNS query according to the values passed in the map. Input keys are:
The only required keys are 'dns' and 'host'. The others default as indicated (type defaults to A). The returned map contains keys corresponding to the DNS packet's values. Generally, "QUESTION" and "ANSWER" will appear. The ANSWER key is an array of returned "pretty-printed" values. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| get | url -- opts buf true | false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/http Retrieve the web page given by the string or map url using HTTP GET. If successful, true is on TOS, and a buffer b with the retrieved data is below it, and the opts map with headers etc is below that. If unsuccessful connecting, false is on TOS, and the Note that true will be returned even if the item requested was not found on the server. It is the programmer's responsibility to check the "retcode" and "response" keys in the RAWHEADERS key of the returned opts map to validate the expected data were returned. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| getaddrinfo | addr service -- X | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Given a string |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| getpeername | net -- net s n (as of 17.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Return the IP address string, and port number, for the connected |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| head | url -- opts buf true | opts false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/http Same as net:get, but with HTTP HEAD. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| ifaces? | -- a (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns an array containing one map for each network interface known to the system. Each map contains one or more of the following keys:
It is not an error for some of these keys to be absent (in particular: "addr" and "addr6" are mutually exclusive). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| ipv6? | net -- net T (as of 23.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| launch | s -- (as of 24.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
"Opens" the URL given in a separate OS-specific process (browser). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| listen | net -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Given a net which has been bound to an address using The default is to allow a backlog of 10 connections; you can set that by creating the socket with a map having the key See also: net:bind net:accept net:connect |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| map>url | s -- m (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/urlencode Converts a map into application/x-www-form-urlencoded format so it can be transmitted in a POST request Inverse of net:map>url: converts urlencoded form to a map NOTE: all values are re-encoded as strings |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| mime-type | s -- s s2 T (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/mime Takes a file name and returns it and its "mime-type" (based upon file-extension) on TOS. If the type isn't recognized, assumes binary data. TOS is true if the type is binary (not text). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| net-socket | opts -- net true | false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/utils From the options, create a suitable 'net', open to that server and 'true', or just 'false' if unable to open a socket. Takes into account proxy settings. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| opts | net -- net m (as of 16.12) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Retrieve the map used to initialize the net, which is also known as the "options map" of the net. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| port-is-ssl? | m -- m | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/url Given a parsed URL, determine the port to use and whether it's ssl. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| post | url -- opts buf true | opts false | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/http Same as net:get, but with HTTP POST. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| proxy! | opts -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/http Pass a string like "abc.com:900", or a map like { "proxy-server" : "abc.com", "proxy-port": 900} to set the HTTP proxy parameters. You can also set a proxy on a per-connection basis by setting the proxy-server and proxy-port keys in the options map before making the connection. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| put | url -- opts buf true | opts false (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/http Same as net:get, but with HTTP PUT. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| read | net s n -- net s n | net n -- net b n | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Same semantics as See also: net:socket net:write net:close |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| read-all | net n1 n2 -- net b (as of 19.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Similar to See also: net:read |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| read-buf | net n -- net b (as of 22.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as See also: net:read net:write |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| recvfrom | net b n -- net X b n2 | net b n -- net null (as of 17.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Receive a message on the net into the buffer Note: The size of the buffer is |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| s>url | s -- m | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/url Breaks a string s representing a URL into a map with the keys
Missing values will be null, except for 'port' which may be set by 'scheme'. A URL may have the form: http://joe@google.com:80/index.html and some of the components may be missing. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| sendto | net X sb n -- net n' (as of 17.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Sends a message to another socket, with no guarantee of delivery. See also: net:getaddrinfo net:recvfrom |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| server | m -- net | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a net which is a TCP server processing network requests. The default port number is 8080, if one is not provided using the key "port". The Valid keys are:
If present, the "cert" and "key" keys contain either a file-name with a PEM certificate or private key, or a buffer containing them. An exception will be thrown if "tls" is The SED for The SED for |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| setsockopt | net m -- net (as of 17.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Calls the 'setsockopt' function on the socket handled by the given See also: net:socket |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| socket | domain type -- net | m -- net | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Create a new socket with the given parameters. You may instead pass a map, which will create an socket using "INET4 STREAM" as well as set the 'options' for further net activity to the map. You can change the defaults using the keys:
See also: net:write net:read net:close |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| tcp-connect | x -- net (as of 23.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/connect Takes a URL (including port, possibly) or a map with connection information, and attempts to create a TCP connection. Returns the connected net, or |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| tlserr | net -- net s (as of 23.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the TLS error string recorded for the last action on that net. Will return |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| tlshello | net m -- net T | net -- net T (as of 17.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Initiates a TLS connection over the. If the map is omitted, the options map given the net on creation is used. If the TLS handshake is successful, returns See also: net:socket |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| udp-connect | x -- net (as of 23.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/connect Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| url> | s -- s' | ||||||||||||||||||||||||||||||||||||||||||||||||||||
URL-decode the string as per RFC 3986. See also: net:>url |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| user-agent | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/http Sets the "user agent" which the HTTP library will use. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| valid-email? | s -- T (as of 22.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/validemail Checks a string for possible validity. It first checks for a single '@' character and if there is one, it assumes the part after is a domain, and checks for an MX record. If both those tests pass, |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| vpncheck | ip apikey -- m (as of 21.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/vpncheck Given an IP address and your VPNAPI.io API key, returns a map containing information about the IP address. Keys returned are 'ip', 'security', 'location', and 'network' (as of 21.08, might change in future) Will return 'null' on failure. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| wait | net T n -- net T | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Wait to see if the net |
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| webserver | m -- net (as of 22.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs net/webserver A wrapper around The SED for every non websocket callback is
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||
| write | net s -- net n | ||||||||||||||||||||||||||||||||||||||||||||||||||||
Same semantics as See also: net:socket net:read net:close |
Namespace: nk
Description: Low-level Nuklear Interface
| word | sed/description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| (begin) | m -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts a new window based on the map. It needs to be invoked every frame for every window (unless hidden), otherwise the window gets removed. Returns
See also: nk:(end) nk:get nk:set |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (chart-begin) | n1 n2 n3 n4 -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts a chart of type |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (chart-begin-colored) | n1 n2 n3 n4 clr1 clr2 -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (chart-end) | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ends a chart after |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (end) | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Terminates a window definition started using See also: nk:(begin) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (group-begin) | name title flags -- n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts a new group with internal scrollbar handling. Calls nk_group_begin_titled internally. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (group-end) | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ends a group. Should only be called if |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (property) | s min max step inc T v -- v (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a "property" control named |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| >img | -- img (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Takes a 'snapshot' of the current screen window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| addfont | font s -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds the font to the current context with a name so it can be found by |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| anti-alias | T -- (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Turns on anti-aliasing for lines and shapes. Default is |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| any-clicked? | rect -- T (as of 21.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bounds | -- rect (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the bounds of the currently active NK window |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| bounds! | rect -- | null -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the bounds of the currently active NK window. If given |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button | m -- | label align img symbol style w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Takes a map describing what the button should display (or a series of parameters):
The "style" map, if present, is defined as follows. Default values are taken from the current context style:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button-color | clr w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
A button with the given color; invokes |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button-label | s w -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/buttons Creates a button with the label s. If button is pushed, invoke w. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button-set-behavior | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Controls whether or not the button repeats. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button-symbol | sym w -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/buttons A button with the given symbol (nk:SYMBOL_TRIANGLE_RIGHT etc); invokes w when pressed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| button-symbol-label | lbl align sym w -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/buttons A symbol button with a label; invokes w when pressed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chart-add-slot | type count min max -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a number slot to the chart. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chart-add-slot-colored | type count min max clr1 clr2 -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a number slot to the chart, with normal and active colors. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chart-push | n -- n' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pushes a number to a chart. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| chart-push-slot | value slot -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pushes |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checkbox | s T -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a checkbox with label |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| circle | -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws a filled circle at the current position with radius set by |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| clicked? | btn rect down -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| close-this! | nk -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Forces the specified screen window to be closed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| close-this? | nk -- nk T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| close? | -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color-chooser | rect m -- T (as of 24.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs gui/color Displays a 'drop down' color chooser, initially filling |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| color-picker | v -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Selects a color using an initial color. The color is placed back in the variable, as an array of [R,G,B,A] in the range [0-1]. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| combo | a n high pt -- n' (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a combo-box whose values in the dropdown are taken from an array of strings. The initial selection is |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| combo-begin-color | clr a -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts a combo box with the given color and size |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| combo-begin-label | s a -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Start a combo box with the label and size |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| combo-cb | m cnt n high pt -- n2 (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as The map |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| combo-end | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ends a combo box. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextual-begin | flags pt rect -- n (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts a contextual menu with the given flags, of size |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextual-close | -- (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Closes the contextual menu. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextual-end | -- (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ends the contextual menu definition started with |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextual-item-image-text | img s align -- (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a text item along with an image to the contextual menu, with specific text alignment. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextual-item-symbol-text | sym s align -- (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a text item with a built-in symbol to the contextual menu, with specific text alignment. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contextual-item-text | s align -- (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a text item to the contextual menu with specific text alignment. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cp! | xpos ypos -- (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the current position (x,y) where the next widget will be placed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cp@ | -- xpos ypos (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Get the current position (x,y) where the next widget will be placed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| curpos | -- pt (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the current position. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cursor-load | img xofs yofs -- X (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a new cursor from the given image. The "hot spot" of the cursor is at (xofs,yofs) in the image. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cursor-set | n -- | X -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Set the cursor. If given is a number, then 0: arrow, 1: I-beam, 2: wait, 3: crosshair, 4: waitarrow, 5: size-nw-se, 6: size-ne-sw, 7: size-we, 8: size-ns, 9: size-all, 10: no, 11: hand. Numbers outside that range are ignored. It may also be given an item created by |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cursor-show | T -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display-info | -- a (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns information about each connected physical display on the system. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| display@ | -- n (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the display index of the current screen-window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| do | x -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Passes the item to the GUI (main) task for processing. If it is a:
Any other type is ignored. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| down? | n -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| draw-image | rect img clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws the image in the given rectangle, filling as needed with the color. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| draw-image-at | pt whence img clr -- (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws the image without resizing it, at the point.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| draw-image-centered | rect img clr -- (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| draw-sub-image | rect1 img clr rect' -- (as of 21.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws the portion of the image given by the rectangle |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| draw-text | rect s font clr1 clr2 -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws the text using the font in the rectangle. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| draw-text-centered | rect s font clr1 clr2 -- (as of 22.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| draw-text-high | rect s font clr1 clr2 high -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| draw-text-wrap | rect n s font clr1 clr2 high -- rect' xofs yofs | [rect,n,s,font,clr1,clr2,high,show] -- rect' xofs yofs (as of 21.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Like
Returns the unused portion of The input parameter The Also accepts an array of the parameters; if "show" is present, it determines whether or not the text is actually output. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| drivers | -- a (as of 21.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns an array containing the SDL2 video drivers. The first entry is the current driver, or null if no driver is being used. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dropped | nk s T -- (as of 21.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Invoked when a file name or text is dropped. The string is the name of the item and |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| dropping | nk T -- (as of 21.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED Invoked when a "drop" event begins or ends, passed |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| edit-focus | x -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets focus (if |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| edit-string | s n1 n2 n3 -- s n3 (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| event | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Checks for and processes events. "Events" can be mouse input or motion, keyboard input, OS window messages, etc. See also: nk:event-msec |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| event-boost | -- (as of 20.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Temporarily sets the nk:event-msec value to 1 msec, for 1 second. This is necessary in some scenarios (such as orientation change if msec was -1, in which case it's done automatically) to ensure events gets properly processed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| event-msec | n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the number of milliseconds See also: nk:event nk:event-wait |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| event-wait | n -- (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the number of milliseconds See also: nk:event nk:event-msec |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| event? | -- n (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a bitmap of the event(s) which occurred for the current render. Values are some combination of:
See also: nk:event-msec nk:event |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fill-arc | pt n a clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fills the given arc with a center at |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fill-circle | rect clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fills the circle fitting in the rect with the clr. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fill-color | n -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the "pen color" for drawing with line-to, move-to etc. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fill-poly | a clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fills in a polygon from an array of points [x,y] which are its vertices. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fill-rect | rect n clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fills the rectangle, with corners of a radius |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fill-rect-color | rect n l t r b -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fills the rectangle, with the colors [l,t,r,b] for 'left', 'top', 'right', and 'bottom'. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fill-triangle | pt1 pt2 pt3 clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Fills the triangle defined by the three pts with the clr. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| finger | m -- (as of 23.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED If the system detects a finger motion, this is invoked with m:
A finger-down event gets translated as well into a left-mouse-down, and finger-up into left-mouse-up. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flags! | n -- (as of 21.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the Nuklear window flags for the current active widget/window. Use with caution, as it might have unexpected side-effects! See also: nk:flags@ |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flags@ | -- n (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the Nuklear window flags for the current active widget/window. See also: nk:flags! |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| flash | nk n -- (as of 21.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Flashes the specified system-window (the current one if 'nk' is null). The parameter 'n' is 0 for "stop flashing", 1 for "flash briefly" and 2 for "flash until focused". |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fullscreen | T -- (as of 20.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gesture | m -- (as of 21.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED If the system supports gestures, then if a gesture is input by the user, a map containing information on the gesture is received:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| get | s -- x | a -- x (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the item |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| get-row-height | -- n (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the current minimum layout row-height (including padding). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| getfont | s -- font | null -- font | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a font of the given name in the current NK context. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| getmap | -- m | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a map of the current window's backing store. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| getmap! | nk -- nk m (as of 21.09) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the entire map of the specified window's backing store. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gl? | -- m (as of 20.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns either |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| grid | row #rows col #cols -- rect | a -- rect (as of 21.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the rectangle corresponding to the given (row,col), for as many #rows high and #cols wide. A negative row or col means take that row or col from the end of the grid; that is, row -1 corresponds to the last row of the grid. Note that the values given are not checked, so if you want valid rectangles you need to make sure the (row,col) is less than the (rows,cols) given to |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| grid-peek | -- rect (as of 24.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the current grid passed to |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| grid-push | rect -- (as of 21.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Like |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group-scroll-ofs | s -- xofs yofs (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the scroll offset of the named group. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| group-scroll-ofs! | s xofs yofs -- (as of 21.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the scroll offset of the named group. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hovered? | rect -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| hrule | clr T -- (as of 23.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a "horizontal rule" filling the current space, in the given color. If TOS is |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| image | img -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws the image in the layout area. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| init | -- n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Initializes the NK (e.g. GUI) subsystem; returns 0 on failure, otherwise 1. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input-button | id xofs yofs T -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Presses the mouse button |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input-key | n T -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Inputs a key as if it were typed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input-motion | xofs yofs -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Moves the mouse to position (xofs,yofs). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input-scroll | pt -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Scrolls to the given position. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| input-string | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Inputs the string as if it were typed. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key-down? | n -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key-pressed? | n -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| key-released? | n -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| knob | min max step n dir dead T -- n' (as of 24.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws a "knob control". If |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label | s flags -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws a label using the given |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label-colored | s flags clr -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label-wrap | s -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label-wrap-colored | s clr -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-bounds | -- rect (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the bounds rectangle allocated after |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-grid-begin | rect rows cols -- | rect m -- (as of 21.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Begins a "grid layout", with as many evenly-spaced rows and columns as indicated. If "rect" is
Arrays of numbers for 'rows' and 'cols': the length of the array determines the number of rows or columns. If the number is greater than 1, it means the item should be that many pixels wide (or high). If it is between 0 and 1, it means it should be that percentage of the space. If it is negative, it means it should take up the rest of the available space (after the other items have been allocated). Note that grids may be nested, so that you may use the result of The "margin" is taken around the enclosing rectangle, not around each grid item. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-grid-end | -- (as of 21.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Terminates the current grid layout. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-push-dynamic | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a column to a templated row that dynamically grows and can go to zero if not enough space. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-push-static | n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a static column that does not grow and will always have the same size. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-push-variable | n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Adds a column that dynamically grows but does not shrink below specified pixel width. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-ratio-from-pixel | n -- n' (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Utility function to calculate window percentage from a width in pixels. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-reset-row-height | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Resets the currently used minimum row height to the font height. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row | fmt h [ratio] -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts layout rows where the column widths are determined by an array. There are as many columns as elements in the array, and the width is determined to be a number of pixels, if it's ≥ 1, or a percentage of the window width otherwise. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row-begin | fmt high cols -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Begin layout of rows using |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row-dynamic | hi n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets current row layout to share horizontal space evenly between |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row-end | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Finishes previously started row. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row-height | n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the currently used minimum row height. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row-push | n -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pushes the ratio or width |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row-static | hi wide n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the current row layout to fill |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row-template-begin | n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Begins the row template declaration with a row-height of |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-row-template-end | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Marks the end of the row template. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-space-begin | fmt hi n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Begins a new layout space that allows specifying each widget's position and size. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-space-end | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Marks the end of the layout space. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-space-push | a -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pushes the position and size of the next widget in own coordinate space either as pixel or ratio. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| layout-widget-bounds | -- rect (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Calculates the bounds a static layout row can fit inside the current window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| line-rel | pt -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws a line to the See also: nk:line-to |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| line-to | pt -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws a line from the "current position" set with |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| list-begin | id flgs high total b -- (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts a list. See also: nk:list-end nk:list-new |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| list-end | b -- (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ends a list. See also: nk:list-begin nk:list-new |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| list-new | -- b (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Allocates a buffer big enough to serve as a 'nk_list_view' See also: nk:list-begin nk:list-end |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| list-ofs | s n -- (as of 24.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/loaded Sets the scrollbar offset |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| list-range | b -- begin end count (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the numbers for the given list's current begin, end, and count. See also: nk:list-begin nk:list-end |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| m! | s x -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Puts the item |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| m@ | s -- x | a -- x (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the item corresponding to the key in the nk's backing store. If passed an array, gets all associated values. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| make-style | m -- X (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a new item containing style information from the map. Use it with See also: nk:use-style |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| max-vertex-element | n1 n2 -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the maximum number of "elements" |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| maximize | T -- (as of 23.09) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Maximizes the screen window if |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| measure | s -- pt (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a pt containing the height and width the string would take in the current font. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| measure-font | s font -- pt | s s' -- pt (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns a pt containing the height and width the string would take with the font (either a string naming a defined font, or a font*). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menu-begin | s align pt -- T | s align pt img -- T | s align pt sym -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Begins a menu with a given size |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menu-close | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Closes an open menu. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menu-end | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ends a menu definition. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menu-item-image | s flg img w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Begins a menu item with an image and label, with a given alignment. Invokes |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menu-item-label | s flg w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Begins a menu item with a label, with a given alignment. Invokes |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menu-item-symbol | s flg sym w -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Begins a menu item with a symbol and label, with a given alignment. Invokes |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menubar-begin | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts menu layout. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| menubar-end | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ends menu layout. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| minimize | T -- (as of 23.09) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Minimizes the screen window if |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mouse-pos | -- xpos ypos (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the (x,y) position of the mouse in the currently focused screen window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| move-back | pt -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Moves the "current position" to the previously set one. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| move-rel | pt -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Moves the "current position" to a new position relative to the current one. See also: nk:line-to |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| move-to | pt -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Moves the "current position" for drawing to the point See also: nk:line-to |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| msg | title msg -- (as of 23.07) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Prints a simple message box (usually for errors). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| msgdlg | opts -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/msgdlg Display a message dialog with parameters from the map opts. Keys:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ontop | nk T -- (as of 22.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Makes that system window 'topmost' and keeps it above the rest (if |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| option | s T -- T | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates an option (radio-button) with the label |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pen-color | n -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the "pen color" for stroke-drawing with line-to, move-to etc. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pen-width | n -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the "pen width" for drawing with line-to, move-to etc. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plot | type a -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Plots an array of numbers with the type of chart (CHART_LINES, CHART_COLUMN). |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| plot-fn | x type w count offset -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Plots an array of numbers with the type of chart (CHART_LINES, CHART_COLUMN), invoking |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| polygon | a -- (as of 24.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws a filled polygon using the current position as one vertex, and the array of other vertices as relative positions. Uses the current fill color and if a pen width is given, an outline stroke. Current position remains the starting vertex. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pop-font | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pops the font which was set with See also: nk:push-font |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| popup-begin | kind title flag size -- n | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Starts a popup definition. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| popup-close | -- (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Closes the popup. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| popup-end | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Ends a popup definition. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| popup-scroll-ofs | -- xofs yofs (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returnss the current scroll offsets of the popup. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| popup-scroll-ofs! | xofs yofs -- (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the scroll offsets of the current popup. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| progress | max T v -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a progress bar from [0.. See also: nk:slider |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| prop-int | min max step v -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/property Creates a slider which modifies the |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pt-in? | rect pt -- T (as of 22.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pt>local | pt -- pt' (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Converts the point from screen coordinates to local ones. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| pt>screen | pt -- pt' (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Converts the point from local coordinates to screen ones. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push-font | s -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uses the named font (as defined in the fonts atlas). Paired with See also: nk:pop-font |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| raise | nk -- (as of 22.08) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Raises that system window above others, and gives it focus. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rect-rel | pt -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes and fills a rectangle relative to the current position. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rect-to | pt -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes and fills a rectangle from the current position to |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rect>local | rect -- rect' (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Converts the rectangle from screen coordinates to local ones. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rect>screen | rect -- rect' (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Converts the rectangle from local coordinates to screen ones. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| released? | n -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| render | -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Invokes the Nuklear GL rendering routine, which iterates the list of items "drawn" and causes them to be output to the screen. In most systems, the output will be to the hardware-accelerated renderer (via GL or Metal etc.). On some systems, a much slower software renderer will be used because the hardware doesn't support accelerated rendering. It is invoked by the default See also: nk:render-loop nk:frame |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| render-timed | w n -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/render-timed A render-loop which creates a separate task for timing the loop. Within the render loop, invoke |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rendering | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED needs nk/loaded Invoked when the rendering loop is first started. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| restore | -- (as of 21.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Restores the previously saved GL transformation matrix. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rotate | angle x y z -- (as of 21.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Rotates the GL canvas through the given angle around the vector (x,y,z) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rotate-rel | angle -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Rotates the canvas by |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rtl! | T -- (as of 24.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the "RTL" (right-to-left) value for the current NK window. This inverts the meaning of "left" and "right" so that you needn't have code to switch between LEFT and RIGHT alignment if you print RTL language text (Hebrew/Arabic/Farsi etc). The default is to output LTR (e.g. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rtl? | -- T (as of 24.04) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Gets the "RTL" (right-to-left) value for the current NK window. Useful in widgets/libraries to determine proper RTL orientation. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| save | -- (as of 21.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Saves the GL transformation matrix. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scale | x y z -- (as of 21.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Scales the GL canvas by the given amounts along the (x,y,z) axes. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scancode? | n -- T | a -- a' (as of 20.03) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| screen-saver | T -- (as of 21.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Enables the screen-saver (if |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| screen-size | -- a (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the screen's size [w,h] in pixels. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| screen-win-close | nk -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Lets the given screen window know that it should close. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| selectable | str align img val -- val | str align n val -- val | str align null val -- val (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a "selectable" with a label given by |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set | s x -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Puts the item |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set-font | s -- (as of 21.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uses the font with the given name. Unlike See also: nk:push-font |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set-num-vertices | n1 n2 n3 -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the number of vertices used to draw a circle |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set-radius | n -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the radius of a subsequent |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setpos | pt -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the position of NK window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setwin | s -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the current screen window to the named one. Returns See also: nk:win nk:win? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| show | nk T -- (as of 21.09) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Shows (if |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| slider | min max step val T -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a slider control. If See also: nk:progress |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| slider-int | min max step v -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/sliders Creates a slider which modifies the |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| space | -- (as of 21.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Takes the place of the item which was supposed to have been inserted in a row, allowing the item to appear or not, without changing the layout. That is, allows you to omit an item from a layout. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| spacing | n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the number of columns in this layout. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stroke-arc | pp1 n1 a n2 clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes an arc of thickness |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stroke-circle | rect n clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes a circle fitting the rectangle, with line thickness |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stroke-curve | pt1 pt2 pt3 pt4 n clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes a cubic-Bézier curve from point |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stroke-line | pt1 pt2 n clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes a line of thickness |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stroke-polygon | a n clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Stroke an array of points as a polygon, with line thickness |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stroke-polyline | a n clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes an array of points, with line thickness |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stroke-rect | rect n1 n2 clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes a rectangle with corners of radius |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| stroke-tri | pt1 pt2 pt3 n clr -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Strokes a triangle between the given points, with line thickness |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| style-from-table | a -- | null -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If given an array of numbers with |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| swipe | m -- (as of 23.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DEFFERED If a finger-swipe motion occurs, this is invoked with m:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| swipe-dir-threshold | n -- (as of 23.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the threshold below which the difference between x and y values makes it impossible to choose a "direction" of swipe. The default is 0.1. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| swipe-threshold | n -- (as of 23.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the threshold below which a finger motion will not be considered a swipe event. The default is 0.02. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text | s -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Outputs the text using the |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text-align | n -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the text alignment for |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text-font | s -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the font for drawing. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text-pad | rect -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the padding |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| text? | -- s (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns any text which has been entered (key-presses). If there's no input, an empty string is returned. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timer-delay | n -- (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/render-timed Set / change the number of milliseconds the timer-task delays, and notify the timer task of the change. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| timer? | -- T (as of 23.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/render-timed Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| toast | s n -- (as of 24.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/toast Displays the given text in a notice at the bottom of the screen for |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tooltip | s -- (as of 20.10) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Presents a tooltip. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| translate | x y z -- (as of 21.06) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Translates the GL canvas by the given amounts along the (x,y,z) axes. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tree-pop | -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pops the most recent tree state; only invoke if |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tree-state-push | kind img s state -- newstate | kind s state -- newstate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Pushes a new tree node. See also: nk:tree-pop nk:tree-push |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| triangle | pt pt -- (as of 24.02) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Draws a filled triangle using the current position as one vertex, and the other two (relative) points as the other vertices. Uses the current fill color and if a pen width is given, an outline stroke. Current position remains the starting vertex. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| use-style | X -- | m -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uses the style created by See also: nk:make-style |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| vsync | T -- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget | -- rect n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates space for a new widget in the current layout. Returns the allocated bounds |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-bounds | -- a (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the bounds [x,y,w,h] of the current widget. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-disable | T -- (as of 23.09) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
If |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-fitting | pt -- rect n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-high | -- n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/widgets Returns the height of the current widget. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-hovered? | -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-mouse-click-down? | n T -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-mouse-clicked? | n -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-pos | -- pt (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/widgets Returns the local position [x,y] of the current widget. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-size | -- pt (as of 23.09) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the size allocated for the current widget. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-size-allot | -- pt (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/widgets Returns the size [w,h] of the current widget. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| widget-wide | -- n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/widgets Returns the width of the current widget. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win | m -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Creates a screen window from the map. A "screen window" is an OS-specific window, an outermost container for
The x, y, wide, and high values are in pixels, unless they are in the range (0,1]. In that case they represent a fraction of the screen size. The 'fonts' map keys are meaningful identifiers, like "buttonfont", while the values are font descriptor strings (the full path to the TTF file, with an optional colon and pixel size), or a buffer containing a font (e.g. from an asset). An exception will be thrown if no valid fonts were given. See also: nk:win? nk:setwin nk:close? |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-bounds | -- rect (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the bounds [x,y,w,h] of the currently processed window. Use only within begin... end. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-bounds! | n a -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the position and size of the named window. Changing the bounds of the window currently being processed is not permitted. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-close | s -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Closes the named window. Does not work on the currently active window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-closed? | s -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-collapse | s n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Collapses the named window. Does not work on the currently active window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-collapsed? | s -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-content-bounds | -- rect (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the bounds [x,y,w,h] of the currently processed window's currently visible and non-cliped |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-focus | s -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Makes the named window the active one. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-focused? | -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-hidden? | s -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-high | -- n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/win Returns the height of the currently processed window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-hovered? | -- T (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Return |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-icon! | img -- (as of 24.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the icon of the current screen-window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-pos | -- pt (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/win Returns the screen position [x,y] of the currently processed window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-scroll-ofs | -- xofs yofs (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the x,y offsets which are the currently processed window's scrollbar offsets |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-scroll-ofs! | xofs yofs -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the currently processed window's scrollbar offsets. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-show | s n -- (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Shows the named window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-size | -- pt (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/win Returns the width and height [w,h] of the currently processed window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-title! | s -- (as of 24.05) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Sets the title-bar title of the current screen-window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win-wide | -- n (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs nk/win Returns the width of the currently processed window. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| win? | -- nk (as of 20.01) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Returns the current screen window (or See also: nk:win nk:setwin nk:close? |
Namespace: n
Description: Numbers: integers or floating-point
| word | sed/description |
|---|---|
| ! | n -- n! |
| needs math/factorial Returns the factorial of the number n, non-recursively. |
|
| * | n n2 -- n' |
Multiplies the numbers. See also: n:/ n:+ n:- n:*/ |
|
| */ | n x y -- n' |
Calculates See also: n:* n:/ |
|
| + | n n2 -- n' |
Adds two numbers. See also: n:- n:1+ n:* n:/ |
|
| +! | n v -- |
Adds the number |
|
| - | n n2 -- n' |
Subtracts See also: n:+ n:* n:/ n:1- |
|
| / | n n2 -- n' |
Divides See also: n:* n:+ n:- n:*/ n:/mod n:mod |
|
| /mod | n n2 -- rem quo |
Divides The reason for this is that we want If one of the arguments is not an 'int', then while the relation holds, the remainder could be negative. See also: n:mod n:/ |
|
| 1+ | n -- n' |
Increments the number by 1. See also: n:1- n:+ |
|
| 1- | n -- n' |
Decrements the number by 1. See also: n:1+ n:- |
|
| < | n n2 -- T |
Compares two numbers, returning See also: n:= n:> n:cmp n:sgn n:~= |
|
| = | n n2 -- T |
Compares two numbers, returning See also: n:cmp n: n: n:sgn n:~= |
|
| > | n n2 -- T |
Compares two numbers, returning See also: n:= n:< n:cmp n:sgn n:~= |
|
| >bool | n -- T (as of 22.06) |
Converts a number (or anything, actually) to explicitly |
|
| BIGE | -- e |
| needs math/big Returns the number "e" (2.7182...) as a big-float with 130 digits precision. |
|
| BIGPI | -- pi |
| needs math/big Returns the number "pi" (3.1415...) as a big-float with 130 digits precision. |
|
| E | -- n |
The mathematical constant "e" (2.71828...) as a "float". If you want an extended "bfloat", accurate to 130 decimal places, use See also: n:PI n:BIGE |
|
| PI | -- n |
The mathematical constant "pi" (π = 3.14159...) as a "float". If you want an extended "bfloat", accurate to 130 decimal places, use See also: n:E n:BIGPI |
|
| ^ | n n2 -- n' |
Raises See also: n:* n:exp |
|
| _mod | x y -- n (as of 21.06) |
| needs math/fmod "floored modulo", like the C "fmod()" function, but result has same sign as divisor. |
|
| abs | n -- n' |
Returns the absolute-value of |
|
| acos | n -- n' |
Calculates the arc-cosine of the number See also: n:cos |
|
| acosd | cos(n) -- n |
| needs math/trigd Returns the angle n in degrees, whose cosine is given. |
|
| acosh | n -- n' (as of 24.03) |
Returns the hyperbolic arc-cosine of the input number. |
|
| andor | n1 n2 n3 -- n4 |
n4 is the result of |
|
| asin | n -- n' |
Calculates the arc-sine of the number See also: n:sin |
|
| asind | sin(n) -- n |
| needs math/trigd Returns the angle n in degrees, whose sin is given. |
|
| asinh | n -- n' (as of 24.03) |
Returns the hyperbolic arc-sine of the input number. |
|
| atan | n -- n' |
Calculates the principle value of the arc-tangent of See also: n:atan2 n:tan |
|
| atan2 | x y -- n |
Calculates the principle value of the arc-tangent of y/x, in radians. See also: n:atan n:tan |
|
| atand | tan(n) -- n |
| needs math/trigd Returns the principle angle n in degrees, whose tangent is given. |
|
| atanh | n -- n' (as of 24.03) |
Returns the hyperbolic arc-tangent of the input number. |
|
| band | n n2 -- n' |
Returns the bitwise AND of two numbers. See also: n:bor n:bxor |
|
| between | n low hi -- T |
Returns |
|
| bfloat | n -- n' |
Converts the number to a big floating-point representation, if possible. See also: n:int n:bint n:float |
|
| bic | n ix -- n' (as of 18.06) |
Clears the bits in the number which are set in the bitmap number |
|
| bint | n -- n' |
Converts the number to a big integer representation, if possible. Floating-point See also: n:int n:float n:bfloat |
|
| binv | n -- n' (as of 18.06) |
Inverts all bits of the number. |
|
| bnot | n -- n' |
Returns the bitwise NOT of the number |
|
| bor | n n2 -- n' |
Returns the bitwise OR of two numbers. See also: n:band n:bxor |
|
| bxor | n n2 -- n' |
Returns the bitwise XOR of two numbers. See also: n:band n:bor |
|
| cast | n bits T -- n2 (as of 20.02) |
Ensures that the number is (in binary form) an integer of |
|
| ceil | n -- n' |
Returns the nearest integer, See also: n:floor n:round n:ceil |
|
| clamp | n low hi -- n' |
Ensure that the number See also: n:min n:max |
|
| cmp | n n2 -- n' |
Compares the two numbers, returning -1 if See also: n:= n:sgn |
|
| comb | p k -- comb(p,k) |
| needs math/comb-perm Returns the unique combination of p items taken k at a time. |
|
| cos | n -- n' |
Calculates the cosine of See also: n:sin n:tan n:acos |
|
| cosd | n -- cos(n) |
| needs math/trigd Returns the cosine of the angle n, specified in degrees. |
|
| cosh | n -- n' (as of 24.03) |
Returns the hyperbolic cosine of the input number. |
|
| emod | x y -- n (as of 21.06) |
| needs math/fmod "Euclidian modulo", result is always positive |
|
| erf | n -- n' (as of 24.03) |
Returns the "error function" of the input. |
|
| erfc | n -- n' (as of 24.03) |
Returns the "complementary error function" of the input, equivalent to |
|
| exp | n -- n' |
Exponential of See also: n:ln |
|
| expm1 | n -- n' (as of 19.09) |
Returns expm1(n), e.g.: |
|
| expmod | n n2 n3 -- n' (as of 17.05) |
Calculates the value of Note: |
|
| float | n -- n' |
Converts the number to a (native IEEE double) floating-point representation, if possible. See also: n:int n:bint n:bfloat |
|
| floor | n -- n' |
Returns the nearest integer, See also: n:trunc n:round n:ceil |
|
| fmod | n n2 -- n' (as of 21.06) |
Remainder of n divided by |
|
| frac | n -- n' |
Returns the fractional part of the number |
|
| gcd | n n2 -- n' (as of 17.05) |
Calculates the greatest-common-divisor of the two numbers. Returns |
|
| int | n -- n' |
Converts the number to a (native 64-bit) integer representation, if possible. This is equivalent to casting to an "int" in C-like languages. If the conversion is not possible (because it is outside the range of an integer), the original number is returned. See also: n:bint n:float n:bfloat |
|
| invmod | n n2 -- n' (as of 17.05) |
Calculates the value of the inverse of |
|
| kind? | n -- n n' |
Returns a number corresponding to the given number's "kind":
If |
|
| lcm | n n2 -- n' (as of 17.05) |
Calculates the least-common-multiple of the tow numbers. Returns |
|
| lerp | lo hi t -- n (as of 23.06) |
Linear interpolation between See also: n:lnerp |
|
| ln | n -- n' |
Natural logarithm (log base "e") of See also: n:exp |
|
| ln1p | n -- n' (as of 19.09) |
Returns |
|
| lnerp | lo hi t -- n (as of 23.06) |
Logarithm interpolation between See also: n:lerp |
|
| logistic | n -- n' (as of 24.03) |
| needs math/sigmoid Returns the "logistic" sigmoid value of the input number, normalizing it to the range 0..1. The returned value is a 'float' though intermediate values may be promoted to 'bfloat' for accuracy reasons. |
|
| max | n n2 -- n' |
Returns the larger of two numbers. See also: n:min |
|
| median | a -- a n |
| needs math/median Calculate the median (middle) value of an array of numberS. |
|
| min | n n2 -- n' |
Returns the smaller of two numbers. See also: n:max |
|
| mod | n n2 -- n' |
Divides See also: n:/mod n:/ |
|
| neg | n -- n' |
Negate the number |
|
| odd? | n -- n' (as of 18.06) |
Returns 0 if the number is even, 1 if it is odd. |
|
| perm | p k -- perm(p,k) |
| needs math/comb-perm Returns the permutation of p items taken k at a time. |
|
| prime? | n -- n T (as of 17.05) |
Determines probabilistically whether or not the number |
|
| quantize | val quantum -- qval |
| DEFFERED needs math/quantize Accept a number val and a number quantum, which is the boundary to which you wish to quantize. Returns qval, which is the quantized number. See also: n:quantize!. |
|
| quantize! | n -- |
| needs math/quantize Sets the kind of quantization to do. A value of n of 0=none, 1=up, 2=down, 3=nearest. |
|
| r+ | n -- (as of 18.05) |
Add the number to the number on the r-stack. |
|
| range | low high -- arr |
| needs math/range Returns an array of integer numbers in the range [low,high]. So 1 3 n:range returns [1,2,3]. Handles incorrect low vs. high by rearranging the values so the lower is first. |
|
| rot32l | n1 cnt -- n2 |
| needs math/rot Rotate the number n1 as a 32-bit integer, cnt times left. Bits passed "off the end" are replaced on the right. |
|
| rot32r | n1 cnt -- n2 |
| needs math/rot Rotate the number n1 as a 32-bit integer, cnt times right. Bits passed "off the end" are replaced on the left. |
|
| round | n -- n' |
Round to the nearest integer. By default, if the fractional part is 0.5 or greater, rounds up (down, if Rounding algorithm can be controlled using See also: n:rounding n:trunc n:floor n:ceil |
|
| round2 | n n2 -- n (as of 16.08) |
Rounds the number according to
So See also: n:round |
|
| rounding | s -- (as of 19.09) |
Takes a string of "NEAREST", "ZERO", "INF", or "NEGINF" and sets the rounding method used for floating-point operations. See also: n:round |
|
| running-variance | a n -- a |
| needs math/mean Calculates mean and variance of a "stream" of numbers. TOS is an array which should be [0,0,0] initially, so that the values accumulate correctly. The value to add is under TOS. Returns the modified array. When finished collecing values, use n:running-variance-finalize |
|
| running-variance-finalize | a -- a |
| needs math/mean Finalizes calculations done by n:running-variance, and returns an array with [sample variance, mean, count, population variance, stddev] The original accumulator array is not modified, so this can be used periodically on a data stream to gather interim values. |
|
| sgn | n -- n' |
Returns a -1 if See also: n:cmp n:= |
|
| shl | n n2 -- n' |
Returns the value of See also: n:shr n:* n:/ |
|
| shr | n n2 -- n' |
Returns the value of See also: n:shl n:* n:/ |
|
| sin | n -- n' |
Calculates the sine of See also: n:cos n:tan n:asin |
|
| sincos | n -- n1 n2 (as of 24.04) |
Returns simultaneously the sin and cos of n: n1=sin(n), n2=cos(n) |
|
| sind | n -- sin(n) |
| needs math/trigd Returns the sin of the angle n, specified in degrees. |
|
| sinh | n -- n' (as of 24.03) |
Returns the hyperbolic sine of the input number. |
|
| sqr | n -- n' |
Returns the square of the number, e.g. See also: n:sqrt n:* |
|
| sqrt | n -- n' |
Returns the square-root of the number. See also: n:sqr n:/ |
|
| tan | n -- n' |
Calculates the tangent of See also: n:sin n:cos n:atan n:atan2 |
|
| tand | n -- tan(n) |
| needs math/trigd Returns the tangent of the angle n, specified in degrees. |
|
| tanh | n -- n' (as of 24.03) |
Returns the hyperbolic tangent of the input number. |
|
| trunc | n -- n' |
Truncate the number See also: n:floor n:round n:ceil |
|
| ~= | n1 n2 eps -- T |
Returns See also: n:= n:cmp |
Namespace: OAuth
Description: Words for OAuth authentication
| word | sed/description |
|---|---|
| auth-string | map url post? csec tsec -- sig |
| needs net/oauth Actually generate the OAuth signature from the parameters given. See samples/net/twitter.8th for an example. |
|
| gen-nonce | key token -- key token nonce |
| needs net/oauth Generate an OAuth nonce from the given key and token strings. |
|
| params | key token nonce hashtype -- params |
| needs net/oauth From the given key, token, nonce and hashtype, produce a params map. |
Namespace: o
Description: Object (OOP)
| word | sed/description |
|---|---|
| ! | o s x -- o (as of 21.01) |
Stores the item |
|
| + | o m -- o | o o' -- o (as of 21.02) |
Takes the variables in the map or object, and puts them in the object |
|
| +? | o m | o | o o' | o (as of 21.02) |
Same as |
|
| ??? | s -- (as of 21.01) |
Word invoked by default for an unknown object method. |
|
| @ | o s -- o x | o a -- o a' (as of 21.01) |
Gets the item stored by name in the object. If passed an array, it will return an array of the items stored in the string keys passed in. |
|
| class | o -- o s (as of 21.01) |
Returns the 'class' of this object. |
|
| exec | o ... s -- (as of 21.01) |
Invokes the "method" If the neither that object nor its supers has that method, then if a method called |
|
| isa | o s -- o T (as of 21.01) |
Determines whether the object or its supers is of the kind denoted by the string. |
|
| method | o s w | o m -- o (as of 21.01) |
Installs the word as a "method" for the object, under the name |
|
| mutate | o -- o (as of 21.01) |
Allows the given object to modify methods without affecting other members of its class. |
|
| new | o s -- o' (as of 21.01) |
Creates a new object based on an existing object. The string is the 'type' of the object. If If the name "Methods" are object-specific words which are invoked by name, using |
|
| super | -- (as of 21.01) |
Within a method, invokes the object's super's method of the same name. |
Namespace: os
Description: OS-specific functionality
| word | sed/description |
|---|---|
| POSIX | -- T (as of 24.03) |
Returns |
|
| chroot | s -- T (as of 22.02) |
Changes the root directory accessible to the program to the given directory. Returns Not on Windows, obviously. |
|
| devname | x -- name (as of 19.06) |
Given an open file or a string naming a file, return the device name (EVIOCGNAME). Linux and RPI only. |
|
| docker? | -- T (as of 22.06) |
| needs utils/docker Returns |
|
| env | -- m (as of 20.03) |
Returns a (read-only!) map with all the environment variables. Might return |
|
| lang | -- s (as of 19.05) |
Returns the language of the user's locale as reported by the OS. The return value should be a 2 or 3 letter language code (ISO 639-1 or ISO 639-2). |
|
| locales | -- a (as of 21.08) |
Returns an array of |
|
| notify | m -- (as of 21.02) |
| needs os/notify Send a 'desktop notification'. |
|
| power-state | -- (as of 22.01 |
Returns the best estimate of the system's power status. The map keys are "state" (one of "Battery", "No battery", "Charging" or "Charged), "pct" (the percentage charge, and "secs" (the number of seconds estimated runtime on the charge). The latter two might be "-1" for "not available". |
|
| region | -- s (as of 19.05) |
Returns the region of the user's locale as reported by the OS. The return value should be a 2 letter country code (ISO 3166-1 alpha-2). |
|
| waitpid | n -- n' |
Wait for the process with pid |
Namespace: pdf
Description: PDF Document
| word | sed/description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| bezier | pdf pt1 pt2 pt3 pt4 wide color -- pdf (as of 22.03) | |||||||||||||||
| Professional version Draws a cubic Bézier curve on the current PDF page from pt1 to pt2, with control points p3 and p4, in the given (point) width and color. |
||||||||||||||||
| bezierq | pdf pt1 pt2 pt3 wide color -- pdf (as of 22.03) | |||||||||||||||
| Professional version Draws a quadratic Bézier curve on the current PDF page from pt1 to pt2, with control point p3, in the given (point) width and color. |
||||||||||||||||
| circle | pdf pt1 radius wide color fillcolor -- pdf (as of 22.03) | |||||||||||||||
| Professional version Draws a circle on the current PDF page centered at pt1 with radius, in the given (point) width, line color and fill color. |
||||||||||||||||
| color | pdf clr -- pdf (as of 22.03) | |||||||||||||||
| Professional version Sets the text color for subsequent |
||||||||||||||||
| ellipse | pdf pt1 pt2 wide color fillcolor -- pdf (as of 22.03) | |||||||||||||||
| Professional version Draws an ellipse on the current PDF page centered at pt1 with x,y radii pt2, in the given (point) width, line color and fill color. |
||||||||||||||||
| font | pdf s -- pdf (as of 22.03) | |||||||||||||||
| Professional version Sets the font to use, currently restricted to the standard PDF fonts: "Courier", "Courier-Bold", "Courier-BoldOblique", "Helvetica", "Helvetica-Bold", "Helvetica-BoldOblique", "Helvetica-Oblique", "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", "Symbol", or "ZapfDingbats". |
||||||||||||||||
| img | pdf pt1 pt2 img -- pdf (as of 22.03) | |||||||||||||||
| Professional version Draws an image at pt1, with size pt2. The image could be an |
||||||||||||||||
| line | pdf pt1 pt2 wide color -- pdf (as of 22.03) | |||||||||||||||
| Professional version Draws a line on the current PDF page from pt1 to pt2, in the given (point) width and color. |
||||||||||||||||
| new | m -- pdf (as of 22.03) | |||||||||||||||
| Professional version Create a new PDF document in memory, with the options given in the map. The map may contain the meta-data keys
|
||||||||||||||||
| page | pdf -- pdf (as of 22.03) | |||||||||||||||
| Professional version Creates a new blank page in the PDF and makes it the current page for output. |
||||||||||||||||
| page-size | pdf -- pdf wide high (as of 22.03) | |||||||||||||||
| Professional version Gets the size of the PDF document current page in points. |
||||||||||||||||
| rect | pdf pt1 pt2 wide color fillcolor -- pdf (as of 22.03) | |||||||||||||||
| Professional version Draws a rectangle from pt1, with width pt2.x and height pt2.y, border width |
||||||||||||||||
| save | pdf s -- pdf | pdf f -- pdf | pdf null -- pdf (as of 22.03) | |||||||||||||||
| Professional version Save the PDF. If |
||||||||||||||||
| size | pdf -- pdf wide high (as of 22.03) | |||||||||||||||
| Professional version Gets the size of the PDF document in points. |
||||||||||||||||
| text | pdf s xofs yofs -- pdf (as of 22.03) | |||||||||||||||
| Professional version Write the string at position (xofs,yofs) on the current page in the PDF. |
||||||||||||||||
| text-rotate | pdf s x y angle -- pdf n (as of 23.06) | |||||||||||||||
| Professional version Same as |
||||||||||||||||
| text-size | pdf n -- pdf (as of 22.03) | |||||||||||||||
| Professional version Sets the size of the font to use. |
||||||||||||||||
| text-width | pdf s -- pdf n (as of 22.03) | |||||||||||||||
| Professional version Calculates the width of the given string using the current font and size. The number returned is points. Returns 0 and sets |
||||||||||||||||
| text-wrap | pdf s x y w align -- pdf n (as of 22.03) | |||||||||||||||
| Professional version Same as |
||||||||||||||||
| text-wrap-rotate | pdf s x y w align angle -- pdf n (as of 23.06) | |||||||||||||||
| Professional version Same as |
Namespace: ptr
Description: A pointer value, used with the FFI
| word | sed/description |
|---|---|
| cast | ptr s -- ptr | ptr n s -- ptr (as of 17.07) |
When Note: This word has no effect on a ptr whose type is actually known (you cannot coerce a "string" to a "number" for instance). See also: G:pack G:unpack ptr:pack ptr:unpack ptr:unpack_orig ptr:len |
|
| deref | -- (as of 24.01 |
Assuming the ptr is a pointer to something (e.g. |
|
| len | ptr -- ptr n (as of 17.07) |
Returns the number of bytes allotted the contents of this ptr*. For a string or buffer, will be the allocated size. See also: G:pack G:unpack ptr:pack ptr:unpack ptr:unpack ptr:unpack_orig |
|
| null? | ptr -- ptr T (as of 21.03) |
Returns |
|
| pack | x s -- ptr (as of 17.07) |
Converts an 8th type
See also: G:pack G:unpack ptr:unpack ptr:cast ptr:unpack_orig ptr:len |
|
| unpack | ptr -- x (as of 17.07) |
Inverse of See also: G:pack G:unpack ptr:pack ptr:cast ptr:unpack_orig ptr:len |
|
| unpack_orig | ptr -- x (as of 17.07) |
Same as See also: G:pack G:unpack ptr:pack ptr:unpack ptr:unpack ptr:len |
Namespace: pubsub
Description: Publish/Subscribe messaging framework
| word | sed/description |
|---|---|
| publish | t msg -- |
| needs utils/pubsub Enqueues the message msg (which can be any data type) to subscribers of the topic t (a string). The queued message will be dispatched to all subscribers of that topic in the order they subscribed, on the task of the message dispatcher. |
|
| qsize | n -- |
| needs utils/pubsub Sets the size of the queue used by the subscribe task. The default is 100 |
|
| subscribe | t wrd -- |
| needs utils/pubsub Subscribes the word wrd to the topic given by the string t. wrd will be invoked whenever a message is published to that topic. Subscriber SED: \ topic message -- |
Namespace: q
Description: FIFO Queue
| word | sed/description |
|---|---|
| + | q q2 -- q |
Moves as many items as will fit from the queue Modifies both queues. |
|
| clear | q -- q |
Remove all items from the queue. |
|
| len | q -- q n |
Returns the number of items in the queue. |
|
| new | n -- q |
Create a new queue with a maximum capacity See also: q:push q:pop |
|
| notify | q -- q (as of 17.07) |
Notifies anyone waiting on that queue that it should awaken and process the data. See also: G:sleep q:wait t:q-wait t:q-notify |
|
| overwrite | q T -- q |
Set the queue to "overwrite" mode (if See also: q:push q:pop |
|
| peek | q -- q x |
Same as See also: q:pop q:push |
|
| pick | q ix -- q x (as of 17.04) |
Returns the item |
|
| pop | q -- q x |
Pop the first item off the queue See also: q:push q:peek |
|
| push | q x -- q |
Push the item See also: q:pop q:peek |
|
| remove | q x -- q n (as of 20.01) |
Removes all instances of the item |
|
| shift | q -- q x |
Remove the item See also: q:slide q:pop q:push |
|
| size | q -- q n (as of 16.11) |
Returns the size of the given queue, which is the maximum number of items the queue may contain. |
|
| slide | q x -- q |
Add the item See also: q:shift q:pop q:push |
|
| throwing | q T -- q |
If |
|
| wait | q n -- q (as of 17.07) |
Waits See also: G:sleep q:notify t:q-wait t:q-notify |
Namespace: rat
Description: Rational big-number processing
| word | sed/description |
|---|---|
| * | r1 r2 -- r1*r2 (as of 19.04) |
| needs math/rational Multiply two rationals |
|
| + | r1 r2 -- r1+r2 (as of 19.04) |
| needs math/rational Add two rationals |
|
| - | r1 r2 -- r1-r2 (as of 19.04) |
| needs math/rational Subtract two rationals |
|
| / | r1 r2 -- r1/r2 (as of 19.04) |
| needs math/rational Divide two rationals |
|
| >n | r -- n (as of 20.07) |
| needs math/rational Convert a rational to a regular number |
|
| >s | r -- s (as of 19.04) |
| needs math/rational Convert the rational number to its string representation. |
|
| new | num denom -- rat (as of 19.04) |
| needs math/rational Given a numerator and a denominator in integral values (not floats!), produce a new "rational number" |
|
| proper | r -- n r (as of 19.04) |
| needs math/rational Given a (possibly) "improper" rational, e.g. where the numerator is greater than the denominator, convert it to a "proper" pair of whole number and rational remainder. Either or both of the pair may be 0. |
Namespace: rect
Description: Rectangles
| word | sed/description |
|---|---|
| ! | rect ix n -- rect (as of 22.03) |
For a rect or pt, sets the value |
|
| /high | rect n -- rect1 rect2 (as of 20.01) |
Splits the rectangle into two such that the sum of the heights of the new ones is the same as the height of the original. If See also: rect:/wide |
|
| /wide | rect n -- rect1 rect2 (as of 20.01) |
Splits the rectangle into two such that the sum of the widths of the new ones is the same as the width of the original. If See also: rect:/high |
|
| = | rect1 rect2 -- rect1 rect2 T (as of 22.02) |
Return |
|
| >a | X -- a (as of 22.02) |
Converts an X containing the internal rectangle format to an array [x,y,w,h]. |
|
| >pts | rect -- pt1 pt2 (as of 20.01) |
Converts the rectangle to its start and end points |
|
| >pts4 | rect -- pt1 pt2 pt3 pt4 (as of 22.03) |
Converts the rectangle to its four corner points |
|
| @ | rect ix -- rect x | rect a -- rect a' (as of 22.03) |
For a rect or pt: if given a number, retrieves the value at index 'x', where 0=xpos, 1=ypos, 2=wide, 3=high. If the index is out of range, 0 is returned. If passed an array, returns an array of the corresponding values. |
|
| center | rect1 rect2 -- rect3 (as of 22.03) |
Creates a new rectangle which is |
|
| center-pt | rect -- rect pt (as of 20.01) |
Returns a point in the center of the rectangle. |
|
| intersect | rect1 rect2 -- rect' (as of 20.01) |
Returns the "intersection" of the two rects passed in. If they don't intersect, a rectangle of [0,0,0,0] is returned. |
|
| new | a -- X (as of 22.02) |
Converts a rectangle which is an array of [x,y,w,h] to internal format. |
|
| new-pt | a -- X (as of 22.02) |
Converts a point which is an array [x,y] to internal format. |
|
| ofs | rect pt -- rect' (as of 21.01) |
Adds the point to the rectangle, moving the rectangle's upper-left by |
|
| open | rect -- xpos ypos wide high (as of 22.03) |
Use instead of |
|
| pad | rect pt -- rect2 (as of 20.01) |
Pads the rectangle with the [x,y] values from |
|
| pos | rect -- pt (as of 20.01) |
Converts a rectangle to a point which is its |
|
| pt-open | pt -- xpos ypos (as of 22.03) |
Use instead of |
|
| pt>a | X -- a (as of 22.02) |
Converts an X containing the internal format to a point which is an array [x,y]. |
|
| pt>rect | pt -- rect (as of 22.07) |
Converts the point |
|
| pts> | pt1 pt2 -- rect (as of 20.01) |
Returns a rectangle starting at point |
|
| restrict | rect1 rect2 -- rect2 (as of 24.04) |
Modifies |
|
| shrink | rect n -- rect' | rect a -- rect' (as of 20.01) |
Shrinks (if |
|
| size | rect -- pt (as of 20.01) |
Converts a rectangle to an point |
|
| union | rect1 rect2 -- rect' (as of 20.01) |
Returns the "union" of the two rects passed in: e.g., the bounding box containing both rectangles. |
Namespace: r
Description: PCRE regular-expression
| word | sed/description |
|---|---|
| ++match | r -- r n |
Same as See also: r:new r:match r:+match r:@ |
|
| +/ | s r -- a (as of 18.02) |
Same as See also: r:/ |
|
| +match | r -- r n |
Match the regex See also: r:new r:match r:++match r:@ |
|
| / | s r -- a |
Splits the string on a regex and returns an array containing the matches, or Ex: See also: r:@ r:match |
|
| @ | r n -- r s | r a -- r a' |
Returns a string which is match number Note: do not confuse with See also: r:new r:match r:+match r:++match |
|
| len | r -- r n (as of 17.02) |
Returns the number of matches currently matched by the regex. |
|
| match | x r -- r n |
Match the regex See also: r:new r:+match r:++match r:@ |
|
| match[] | x r -- a (as of 25.06) |
| needs regex/match Returns an array of all matched values, or |
|
| matchall[] | x r -- a (as of 25.06) |
| needs regex/match Same as |
|
| new | s -- r |
Create a new regex from the string, or See also: r:match r:+match r:@ |
|
| rx | r -- r s (as of 17.06) |
Returns the string which is the regular-expression represented by the regex, or |
|
| str | r -- r s (as of 17.06) |
Returns the string against which the regex |
Namespace: sio
Description: Serial I/O
| word | sed/description |
|---|---|
| close | sio -- |
| Hobbyist version Closes a previously opened sio, and terminates any connections. See also: sio:open sio:opts@ sio:opts! sio:enum sio:read sio:write |
|
| enum | -- a |
| Hobbyist version Returns an array of paths to valid serial devices. One of these may be passed to See also: sio:open sio:opts@ sio:opts! sio:write sio:read sio:close |
|
| open | s -- sio |
| Hobbyist version Returns a sio which represents an opened serial port named by the string, or null if it was unable to do so. See also: sio:opts@ sio:opts! sio:read sio:write sio:enum sio:close |
|
| opts! | sio m -- sio |
| Hobbyist version Sets the sio's options based on the map (as returned by sio:opts@). See also: sio:open sio:opts@ sio:read sio:write sio:enum sio:close |
|
| opts@ | sio -- sio m |
| Hobbyist version Returns a map containing the sio's current settings. All known settings will be returned as a key in the map, and all values are either numeric or boolean. See also: sio:open sio:opts! sio:read sio:write sio:enum sio:close |
|
| read | sio sb n -- sio sb n' |
| Hobbyist version Reads See also: sio:open sio:opts@ sio:opts! sio:write sio:enum sio:close |
|
| write | sio sb -- sio n |
| Hobbyist version Writes the string or buffer See also: sio:open sio:opts@ sio:opts! sio:enum sio:read sio:close |
Namespace: smtp
Description: SMTP access words
| word | sed/description |
|---|---|
| new | opts -- smtp T |
| needs net/smtp Takes a map opts with network options and returns a new smtp item which is used to communicate with an SMTP server. Immediately tries to connect to the given server, returns true if successful. |
|
| send | smtp msg -- smtp T |
| needs net/smtp Sends the message msg to the SMTP server smtp. The message is a map with "from", "to", "cc", "bcc" keys -- which may be single strings or arrays of string. "subject", "body" are required and must be strings. Returns true on success, or false and sets the "err" key. |
Namespace: SOAP
Description: SOAP
| word | sed/description |
|---|---|
| call | map -- xml|errs |
| needs net/soap Performs a SOAP call based on the information in the given map. See samples/net/soap.8th for how it's used. |
Namespace: slv
Description: Constraint solver
| word | sed/description | ||||||
|---|---|---|---|---|---|---|---|
| @ | slv x -- slv (as of 21.01) | ||||||
Gets the value of the variable |
|||||||
| auto | slv T -- slv (as of 21.01) | ||||||
If |
|||||||
| build | m -- slv (as of 21.01) | ||||||
Creates a new solver set up according to the map. Keys are:
|
|||||||
| constant | slv x n -- slv (as of 21.01) | ||||||
Adds a constant |
|||||||
| constraint | slv n -- slv n' (as of 21.01) | ||||||
Creates a new constraint for the constraint-solver. Returns the index of the constraint. The number |
|||||||
| dump | slv -- slv (as of 21.01) | ||||||
For debugging: dumps the state of the solver. |
|||||||
| edit | slv s str -- slv | slv n str -- slv (as of 21.01) | ||||||
Adds an edit to the variable, with strength |
|||||||
| named-variable | slv s -- slv n (as of 21.01) | ||||||
Creates a new named variable for the constraint-solver. Returns the index of the variable. |
|||||||
| new | -- slv (as of 21.01) | ||||||
Creates a new constraint-solver. |
|||||||
| relation | slv x n -- slv (as of 21.01) | ||||||
Adds a relation |
|||||||
| reset | slv T -- slv (as of 21.01) | ||||||
Resets the solver. If |
|||||||
| suggest | slv x n -- slv | slv a1 a2 -- slv (as of 21.01) | ||||||
Adds a suggested value for the variable |
|||||||
| term | slv x1 x2 n -- slv | slv n1 n2 n -- slv (as of 21.01) | ||||||
Adds a term to the constraint |
|||||||
| update | slv -- slv (as of 21.01) | ||||||
Makes the |
|||||||
| v[] | slv -- slv a (as of 21.01) | ||||||
Returns an array of the values of all variables in the solver, in order of insertion. |
|||||||
| variable | slv -- slv n (as of 21.01) | ||||||
Creates a new variable for the constraint-solver. Returns the index of the variable. |
|||||||
| v{} | slv -- slv m (as of 21.01) | ||||||
Returns a map of the values of all named variables in the solver. |
Namespace: snd
Description: Playing and recording sounds
| word | sed/description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apply-filter | x -- snd2 (as of 18.06) | |||||||||||||||||||||
| Hobbyist version Applies the filter created by See also: snd:filter |
||||||||||||||||||||||
| devices? | -- a (as of 18.06) | |||||||||||||||||||||
| Hobbyist version Returns an array of supported sound devices on the current system. |
||||||||||||||||||||||
| end-record | X -- (as of 18.03) | |||||||||||||||||||||
| Hobbyist version Stops the audio recording. See also: snd:record |
||||||||||||||||||||||
| filter | m -- X (as of 18.06) | |||||||||||||||||||||
| Hobbyist version Creates a new biquad filter based on the parameters given in the map. The result may be used with Possible keys are:
See also: snd:apply-filter |
||||||||||||||||||||||
| freq | snd n -- snd (as of 18.06) | |||||||||||||||||||||
| Hobbyist version For a snd created with a frequency (a number, generating a continuous sine wave tone), this changes its frequency. |
||||||||||||||||||||||
| gain | snd n -- (as of 18.06) | |||||||||||||||||||||
| Hobbyist version Sets the gain of the snd to |
||||||||||||||||||||||
| gain? | snd -- snd n (as of 18.06) | |||||||||||||||||||||
| Hobbyist version Returns the gain of the snd. |
||||||||||||||||||||||
| init | -- T (as of 19.09) | |||||||||||||||||||||
| Hobbyist version Ensures the sound system is running. Returns |
||||||||||||||||||||||
| len | snd -- snd n | |||||||||||||||||||||
| Hobbyist version Returns the length of the sound in seconds. This may be used on a snd whether it is playing currently or not. |
||||||||||||||||||||||
| loop | snd T -- snd | |||||||||||||||||||||
| Hobbyist version If |
||||||||||||||||||||||
| loop? | snd -- snd T (as of 20.01) | |||||||||||||||||||||
| Hobbyist version Returns |
||||||||||||||||||||||
| mix | snd -- (as of 18.06) | |||||||||||||||||||||
| Hobbyist version Plays the snd, mixing it with other sounds in the mixer queue. |
||||||||||||||||||||||
| new | x -- snd | |||||||||||||||||||||
| Hobbyist version Creates a new snd. If passed a:
To play the sound, invoke Note: you must invoke Note: only WAV, MP3, FLAC, and OGG formats are supported. See also: snd:play snd:stop snd:volume |
||||||||||||||||||||||
| pause | snd T -- snd (as of 18.08) | |||||||||||||||||||||
| Hobbyist version If |
||||||||||||||||||||||
| play | snd -- | |||||||||||||||||||||
| Hobbyist version Plays the snd created by See also: snd:volume snd:new snd:stop |
||||||||||||||||||||||
| played | snd -- (as of 18.03) | |||||||||||||||||||||
| DEFFERED Hobbyist version Invoked when the snd has finished playing. |
||||||||||||||||||||||
| rate | snd n -- snd | |||||||||||||||||||||
| Hobbyist version Set the sample rate of the snd. |
||||||||||||||||||||||
| ready? | -- n1 n2 (as of 20.01) | |||||||||||||||||||||
| Hobbyist version Returns the number of sounds: currently playing |
||||||||||||||||||||||
| record | s -- X | m -- X (as of 18.03) | |||||||||||||||||||||
| Hobbyist version Starts recording audio at 44.1KHz, 32-bit floating pt, WAV format, into the file named by the string. The return value may be used to control the recording. When If given a map, then it contains some of the keys:
See also: snd:end-record |
||||||||||||||||||||||
| resume | -- (as of 20.01) | |||||||||||||||||||||
| Hobbyist version Resumes sound playback. |
||||||||||||||||||||||
| seek | snd n -- snd (as of 18.08) | |||||||||||||||||||||
| Hobbyist version For a sound which is initialized from a file or buffer, sets the next play position to the |
||||||||||||||||||||||
| stop | snd -- | |||||||||||||||||||||
| Hobbyist version Stops that sound from being played. See also: snd:volume snd:new snd:play |
||||||||||||||||||||||
| stopall | -- (as of 18.03) | |||||||||||||||||||||
| Hobbyist version Stops all sound playback. See also: snd:resume |
||||||||||||||||||||||
| volume | n -- | |||||||||||||||||||||
| Hobbyist version Sets the system sound volume to a value between 0 and 1, where 1 is 'full volume'. See also: snd:new snd:play snd:volume? |
||||||||||||||||||||||
| volume? | -- n | |||||||||||||||||||||
| Hobbyist version Returns the system sound volume as a number between 0 and 1, where 1 is 'full volume'. See also: snd:volume snd:new snd:play |
Namespace: st
Description: Fixed-size stack
| word | sed/description |
|---|---|
| + | st st2 -- st | null st2 -- |
Moves as many items as will fit from the stack If Modifies both stacks. |
|
| . | st -- |
Print the top See also: G:.s st:dot-depth |
|
| clear | st -- st |
Removes all the items currently on the given stack. Functionally equivalent to invoking Note: to clear the main data-stack, use See also: G:reset |
|
| dot-depth | -- v (as of 24.02) |
Variable containing the maximum depth of stack items to print with See also: G:.s st:. |
|
| len | st -- st n |
Returns the number of items currently on the given stack. |
|
| list | st n -- a (as of 24.02) |
Returns an array of strings, at most If the array is not empty, the first item is a number, the depth of that stack. See also: G:.s st:. |
|
| ndrop | st n -- st (as of 18.03) |
Drops |
|
| new | n -- st |
Create a new stack of capacity |
|
| op! | st w -- (as of 18.04) |
Invokes See also: G:rop! |
|
| peek | st -- st x |
Peeks at the top of the given stack without removing the top item. Returns that item from the stack or See also: st:throwing st:push st:pop |
|
| pick | st n -- st x |
Same as See also: G:pick G:rpick |
|
| pop | st -- st x |
Pops the item See also: st:throwing st:push st:peek |
|
| push | st x -- st |
Push the item See also: st:throwing st:pop st:peek |
|
| roll | st n -- st |
Same semantics as See also: G:roll G:rroll |
|
| shift | st -- st x |
Remove the item See also: st:slide st:pop st:push |
|
| size | st -- st n (as of 16.11) |
Returns the size of the given stack, which is the maximum number of items the stack may contain. |
|
| slide | st x -- st |
Add the item See also: st:shift st:pop st:push |
|
| swap | st -- st |
Same as See also: G:swap |
|
| throwing | st T -- st |
If |
Namespace: s
Description: Arrays of UTF-8 encoded characters
| word | sed/description | ||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ! | s ix n -- s' | ||||||||||||||||||||||||||||||||||||
Replace the character at index Ex: See also: s:@ |
|||||||||||||||||||||||||||||||||||||
| * | s n -- s' | ||||||||||||||||||||||||||||||||||||
Creates a new string by replicating the initial string See also: s:+ |
|||||||||||||||||||||||||||||||||||||
| + | s s2 -- s' | s n -- s' | ||||||||||||||||||||||||||||||||||||
Appends the string See also: s:append |
|||||||||||||||||||||||||||||||||||||
| - | s ix n -- s' | ||||||||||||||||||||||||||||||||||||
Remove |
|||||||||||||||||||||||||||||||||||||
| / | s n -- a | s a1 -- a2 | s pat -- a | s null -- a | ||||||||||||||||||||||||||||||||||||
Split the string If an array of numbers If string or a regex If Returns an array of results, or an array with the entire string as the only element, if there are no matches. See also: b:/ a:join |
|||||||||||||||||||||||||||||||||||||
| /scripts | s -- a | ||||||||||||||||||||||||||||||||||||
Breaks the string into an array of runs of characters with the same script and direction characteristics (LTR vs RTL). See also: s:script? |
|||||||||||||||||||||||||||||||||||||
| /ws | s -- a (as of 24.05) | ||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||
| <+ | s s2 -- s' | s n -- s' (as of 16.08) | ||||||||||||||||||||||||||||||||||||
Prepends the string or Unicode character to the string. |
|||||||||||||||||||||||||||||||||||||
| <> | s ix1 ix2 -- s' (as of 22.07) | ||||||||||||||||||||||||||||||||||||
Swaps the string characters at those indices. Ex: |
|||||||||||||||||||||||||||||||||||||
| = | s1 s2 -- T | ||||||||||||||||||||||||||||||||||||
Compare the strings See also: s:cmp s:cmpi |
|||||||||||||||||||||||||||||||||||||
| =ic | s1 s2 -- T (as of 16.12) | ||||||||||||||||||||||||||||||||||||
Same as See also: s:= s:cmp |
|||||||||||||||||||||||||||||||||||||
| >base64 | s -- s' | ||||||||||||||||||||||||||||||||||||
Encode a string in base64 encoding. See also: s:base64> |
|||||||||||||||||||||||||||||||||||||
| >ucs2 | s -- b (as of 17.04) | ||||||||||||||||||||||||||||||||||||
Converts the string to its UCS2 representation. |
|||||||||||||||||||||||||||||||||||||
| @ | s ix -- s n | ||||||||||||||||||||||||||||||||||||
Returns the Unicode character Ex: See also: s:! |
|||||||||||||||||||||||||||||||||||||
| append | s1 s2 -- s1 | s n -- s (as of 18.04) | ||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||
| base64> | s -- s' | ||||||||||||||||||||||||||||||||||||
Decode a string from base64 encoding. See also: s:>base64 |
|||||||||||||||||||||||||||||||||||||
| clear | s -- s | ||||||||||||||||||||||||||||||||||||
Overwrites the contents of Note: this modifies the original string itself! See also: b:clear |
|||||||||||||||||||||||||||||||||||||
| cmp | s1 s2 -- n | ||||||||||||||||||||||||||||||||||||
Compare two strings, returning See also: s:cmpi s:= |
|||||||||||||||||||||||||||||||||||||
| cmpi | s1 s2 -- n | ||||||||||||||||||||||||||||||||||||
Same as See also: s:cmp s:= |
|||||||||||||||||||||||||||||||||||||
| compress | s -- s' | ||||||||||||||||||||||||||||||||||||
Compress a string using "zlib". See also: s:expand |
|||||||||||||||||||||||||||||||||||||
| count-match | s s1 -- s n (as of 22.06) | ||||||||||||||||||||||||||||||||||||
Returns the number of non-overlapping times the string |
|||||||||||||||||||||||||||||||||||||
| days! | short long -- | ||||||||||||||||||||||||||||||||||||
Takes two arrays: See also: G:long-days G:short-days |
|||||||||||||||||||||||||||||||||||||
| dist | s1 s2 T -- n (as of 20.07) | ||||||||||||||||||||||||||||||||||||
Return the "Levenshtein" distance between the strings (number of insertions, deletions, and transpositions to convert one to the other). If |
|||||||||||||||||||||||||||||||||||||
| each | s w -- | ||||||||||||||||||||||||||||||||||||
Invokes Modifying the string while it is being iterated may throw an exception. Use See also: s:each! |
|||||||||||||||||||||||||||||||||||||
| each! | s w -- (as of 19.04) | ||||||||||||||||||||||||||||||||||||
Same as Note: Modifying the string while it is being iterated may throw an exception. Use See also: s:each |
|||||||||||||||||||||||||||||||||||||
| eachline | sb w -- | ||||||||||||||||||||||||||||||||||||
Invokes the word NOTE: the same actual string is passed to the callback, so if you want to store the data you need to clone it (or use See also: s:each |
|||||||||||||||||||||||||||||||||||||
| escape | s1 s2 s3 -- s' (as of 19.08) | ||||||||||||||||||||||||||||||||||||
Given a source string, a string of characters Ex: |
|||||||||||||||||||||||||||||||||||||
| expand | s n -- s' | ||||||||||||||||||||||||||||||||||||
Expand a "zlib"-compressed string, where the number See also: s:compress |
|||||||||||||||||||||||||||||||||||||
| fill | s rep -- s' | s n -- s' | ||||||||||||||||||||||||||||||||||||
Fill the contents of the See also: b:fill |
|||||||||||||||||||||||||||||||||||||
| fold | s T -- s' (as of 20.07) | ||||||||||||||||||||||||||||||||||||
Lowercases the string, removing diacritics if |
|||||||||||||||||||||||||||||||||||||
| gen-uid | n -- s (as of 24.02) | ||||||||||||||||||||||||||||||||||||
| needs rand/ident Create a string of random characters, suitable for an identifier. The first character is chosen from a limited palette so the result should not be confused with a number. The first character is randomly chosen from among 19 characters; the rest are randomly chosen from 36. It uses the |
|||||||||||||||||||||||||||||||||||||
| globmatch | s1 s2 -- T (as of 16.02) | ||||||||||||||||||||||||||||||||||||
Using the See also: f:glob f:rglob |
|||||||||||||||||||||||||||||||||||||
| hexupr | T -- | ||||||||||||||||||||||||||||||||||||
Controls how hexadecimal numbers are converted to strings. If |
|||||||||||||||||||||||||||||||||||||
| insert | s1 s2 ix -- s3 | ||||||||||||||||||||||||||||||||||||
Insert the string |
|||||||||||||||||||||||||||||||||||||
| intl | s -- s' | ||||||||||||||||||||||||||||||||||||
| needs string/i18n Returns the translation of the string, based on the language set by See also: s:lang s:intl! G:curlang |
|||||||||||||||||||||||||||||||||||||
| intl! | m -- | ||||||||||||||||||||||||||||||||||||
| needs string/i18n Sets the map to use for translating strings for the language G:curlang. See also: s:lang s:intl G:curlang |
|||||||||||||||||||||||||||||||||||||
| lang | s -- | ||||||||||||||||||||||||||||||||||||
| needs string/i18n Set the current language for s:intl to the string s, which is the name of a sub-asset. For example, if the language is given as "de", there must be an asset called If the requested language asset does not exist, the current language is not changed. See also: s:intl s:intl! G:curlang |
|||||||||||||||||||||||||||||||||||||
| lc | s -- s' | ||||||||||||||||||||||||||||||||||||
Convert the string See also: s:uc |
|||||||||||||||||||||||||||||||||||||
| lc? | s -- s T | n -- n T (as of 20.07) | ||||||||||||||||||||||||||||||||||||
Returns See also: s:uc s:lc s:uc? |
|||||||||||||||||||||||||||||||||||||
| len | s -- s n | ||||||||||||||||||||||||||||||||||||
Returns the length of the string in characters it currently contains (takes UTF-8 into account, so may be less than what See also: s:size |
|||||||||||||||||||||||||||||||||||||
| len' | s -- n (as of 24.03) | ||||||||||||||||||||||||||||||||||||
Same as |
|||||||||||||||||||||||||||||||||||||
| len2 | s1 s2 -- s1 s2 n1 n2 (as of 24.03) | ||||||||||||||||||||||||||||||||||||
Given two strings, returns their respective lengths (of characters, not bytes). Much faster and more efficient than the hard way. |
|||||||||||||||||||||||||||||||||||||
| lsub | s n -- s' | ||||||||||||||||||||||||||||||||||||
Returns the leftmost See also: s:rsub |
|||||||||||||||||||||||||||||||||||||
| ltrim | s -- s' | ||||||||||||||||||||||||||||||||||||
Remove whitespace from the left end of the string. See also: s:rtrim s:trim |
|||||||||||||||||||||||||||||||||||||
| map | s w -- s' | ||||||||||||||||||||||||||||||||||||
Create a string whose elements are formed by executing the word
|
|||||||||||||||||||||||||||||||||||||
| months! | short long -- | ||||||||||||||||||||||||||||||||||||
Takes two arrays: See also: G:long-months G:short-months |
|||||||||||||||||||||||||||||||||||||
| n> | n -- s | a -- s (as of 22.02) | ||||||||||||||||||||||||||||||||||||
Converts a single number, or an array of numbers, representing Unicode code points, to a string. |
|||||||||||||||||||||||||||||||||||||
| new | n -- s | s -- s' | b -- s (as of 18.05) | ||||||||||||||||||||||||||||||||||||
Creates a new string
|
|||||||||||||||||||||||||||||||||||||
| norm | s n -- s' (as of 20.07) | ||||||||||||||||||||||||||||||||||||
Normalizes the string in the manner specified by
|
|||||||||||||||||||||||||||||||||||||
| reduce | s w x -- x' (as of 19.07) | ||||||||||||||||||||||||||||||||||||
Analogous to |
|||||||||||||||||||||||||||||||||||||
| repinsert | s n s2 -- s' | ||||||||||||||||||||||||||||||||||||
| needs string/repinsert Inserts the string |
|||||||||||||||||||||||||||||||||||||
| replace | s pat rep -- s' | ||||||||||||||||||||||||||||||||||||
Create a new string by replacing the pattern See also: s:replace! |
|||||||||||||||||||||||||||||||||||||
| replace! | s pat rep -- s' | ||||||||||||||||||||||||||||||||||||
Same as See also: s:replace |
|||||||||||||||||||||||||||||||||||||
| rev | s -- s' | ||||||||||||||||||||||||||||||||||||
Returns the string with its characters in reverse order. It is semantically the same as |
|||||||||||||||||||||||||||||||||||||
| rsearch | haystack {ofs} needle -- haystack n | ||||||||||||||||||||||||||||||||||||
Same as See also: s:search |
|||||||||||||||||||||||||||||||||||||
| rsub | s n -- s' | ||||||||||||||||||||||||||||||||||||
Returns the rightmost See also: s:lsub |
|||||||||||||||||||||||||||||||||||||
| rtl | s -- s' (as of 24.03) | ||||||||||||||||||||||||||||||||||||
Does an "RTL fixup" on the string, swapping position of any RTL (Hebrew/Arabic, etc) so they draw correctly. |
|||||||||||||||||||||||||||||||||||||
| rtrim | s -- s' | ||||||||||||||||||||||||||||||||||||
Remove whitespace from the right end of the string. See also: s:ltrim s:trim |
|||||||||||||||||||||||||||||||||||||
| scan-match | s s1 s2 -- s ix (as of 22.06) | ||||||||||||||||||||||||||||||||||||
Scans the string and returns the offset of the instance of |
|||||||||||||||||||||||||||||||||||||
| script? | s -- s m | ||||||||||||||||||||||||||||||||||||
Returns information about a string's scripts and directionality in a map. The "dir" key will be either "LTR" or "RTL". The "script" key in the map returned will be one of "mixed", "latin", "greek", "cyrillic", "armenian", "hebrew", "arabic", "syriac", "thaana", "nko", "indic", "cjk", "number", "whitespace" or "symbol". If "mixed", then more than one script is present in the string. See also: s:/scripts |
|||||||||||||||||||||||||||||||||||||
| search | haystack needle -- haystack n | haystack ofs needle -- haystack n | ||||||||||||||||||||||||||||||||||||
Search the string See also: s:rsearch b:search |
|||||||||||||||||||||||||||||||||||||
| size | s -- s n | ||||||||||||||||||||||||||||||||||||
Returns the size of the string in bytes. Not necessarily the same as the number of characters given by See also: s:len |
|||||||||||||||||||||||||||||||||||||
| slice | s ix n -- s' | ||||||||||||||||||||||||||||||||||||
Returns a new string representing a "slice" of the string See also: b:slice |
|||||||||||||||||||||||||||||||||||||
| soundex | s -- s' (as of 20.07) | ||||||||||||||||||||||||||||||||||||
Returns a "Soundex" code for the given string. Handles diacritics by ignoring them. |
|||||||||||||||||||||||||||||||||||||
| strfmap | m a m2 -- m s | ||||||||||||||||||||||||||||||||||||
| needs string/strfmap Utility to format like s:strfmt does, but taking named keys from the a array and pulling the values from the map m2. Still positional, unlike s:tsub. |
|||||||||||||||||||||||||||||||||||||
| strfmt | a fmt -- s | x1 x2 ... xn fmt -- s | ||||||||||||||||||||||||||||||||||||
Like the "printf" function in C. Takes a string
Width, filler, and alignment options precede the format character:
Ex: See also: G:.# G:n# G:c# s:strfmt G:,# G:e# |
|||||||||||||||||||||||||||||||||||||
| term | s n -- s' (as of 22.07) | ||||||||||||||||||||||||||||||||||||
Ensure the string |
|||||||||||||||||||||||||||||||||||||
| text-wrap | s font n -- a (as of 20.01) | ||||||||||||||||||||||||||||||||||||
Takes a string and breaks it into sections which will display in an area at most |
|||||||||||||||||||||||||||||||||||||
| tr | s1 s2 s3 -- s (as of 23.08) | ||||||||||||||||||||||||||||||||||||
Translate the characters in The length (in characters) of s2 and s3 must be the same and non-zero, otherwise the original s1 is returned. |
|||||||||||||||||||||||||||||||||||||
| translate | s1 s2 s3 -- s (as of 22.05) | ||||||||||||||||||||||||||||||||||||
| needs string/translate Translate the characters in |
|||||||||||||||||||||||||||||||||||||
| trim | s -- s' | ||||||||||||||||||||||||||||||||||||
Remove whitespace from both ends of the string. See also: s:ltrim s:rtrim |
|||||||||||||||||||||||||||||||||||||
| tsub | s x -- s' | ||||||||||||||||||||||||||||||||||||
| needs string/tsub Takes a string with replacement parameters such as %0%, %1% or %name%, %address%, and values x in an array (if using %0% etc) or map (if using %name% etc) containing items to replace the parameters in s. The sequence "%%" in s produces a literal "%" in the new string. If the value being substituted is a word, it is invoked and the result is used as a substitute. Otherwise, the item is converted to a string and inserted. |
|||||||||||||||||||||||||||||||||||||
| uc | s -- s' | ||||||||||||||||||||||||||||||||||||
Convert the string See also: s:lc |
|||||||||||||||||||||||||||||||||||||
| uc? | s -- s T | n -- n T (as of 20.07) | ||||||||||||||||||||||||||||||||||||
Returns See also: s:uc s:lc s:lc? |
|||||||||||||||||||||||||||||||||||||
| ucs2> | b -- s (as of 17.04) | ||||||||||||||||||||||||||||||||||||
Converts from a UCS2 representation to the UTF8 string. |
|||||||||||||||||||||||||||||||||||||
| utf8? | s -- s T (as of 16.11) | ||||||||||||||||||||||||||||||||||||
Determines if the string is a valid UTF-8 sequence or not. Returns |
|||||||||||||||||||||||||||||||||||||
| zt | s -- s | ||||||||||||||||||||||||||||||||||||
Ensure the string |
Namespace: struct
Description: Interface for easy FFI structures
| word | sed/description |
|---|---|
| >buf | str -- str buf | throw |
| needs utils/structs Converts a struct to a buffer. |
|
| arr> | str1 buf -- str2 | throw |
| needs utils/structs Using the struct str1 as a pattern, and an array arr of data, create a new struct str2. |
|
| buf | str len |
| needs utils/structs Create a field of type "buffer" ("len" bytes, or if "0" as many bytes as the buffer or string) with the given name. |
|
| buf> | str1 buf -- str2 | throw |
| needs utils/structs Using the struct str1 as a pattern, and a buffer buf of encoded data, create a new struct str2. |
|
| byte | str |
| needs utils/structs Create a field of type "byte" (1 bytes integer) with the given name. |
|
| double | str |
| needs utils/structs Create a field of type "double" (8 bytes) with the given name. |
|
| field! | str fld val -- str |
| needs utils/structs Using the struct str, the name of a field fld, and the value of that field val, store the value in the struct. |
|
| field@ | str fld -- str val |
| needs utils/structs Using the struct str and the name of a field fld, get the value of that field val. |
|
| float | str |
| needs utils/structs Create a field of type "float" (4 bytes) with the given name. |
|
| ignore | str num -- |
| needs utils/structs Create a field to ignore num bytes (e.g. skip that many bytes). |
|
| int | str |
| needs utils/structs Create a field of type "int" (4 bytes) with the given name. |
|
| long | str |
| needs utils/structs Create a field of type "long" (8 bytes) with the given name. |
|
| struct; | str |
| needs utils/structs End the definition of a "struct", creating a new word |
|
| word | str |
| needs utils/structs Create a field of type "word" (2 bytes integer) with the given name. |
Namespace: t
Description: Task (Thread)
| word | sed/description | |||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ! | x s -- (as of 17.06) | |||||||||||||||||||||
Stores the value See also: t:@ w:! w:@ |
||||||||||||||||||||||
| @ | s -- x | a -- a' (as of 17.06) | |||||||||||||||||||||
Returns the value of the task-local variable named by the string. If passed an array, returns the named values. See also: t:! w:! w:@ |
||||||||||||||||||||||
| by-name | s -- a (as of 19.08) | |||||||||||||||||||||
Returns an array of the task(s) named by the string. |
||||||||||||||||||||||
| curtask | -- t (as of 16.11) | |||||||||||||||||||||
Returns the identifier for the current task. |
||||||||||||||||||||||
| def-queue | n -- | |||||||||||||||||||||
Sets the default size of the queue to give new tasks to |
||||||||||||||||||||||
| def-stack | n -- | |||||||||||||||||||||
Sets the size of the stack to give new tasks to |
||||||||||||||||||||||
| done? | t -- t T | |||||||||||||||||||||
Returns |
||||||||||||||||||||||
| dtor | w -- (as of 21.09) | |||||||||||||||||||||
Sets a word invoked when the task terminates. Not on Windows. |
||||||||||||||||||||||
| err! | n s -- (as of 19.01) | |||||||||||||||||||||
Sets the value to be returned from See also: t:err? |
||||||||||||||||||||||
| err? | -- m (as of 19.01) | |||||||||||||||||||||
Returns a map containing "errno" and "msg", which are the integer error code, and a text representation of it, of the last error which occurred in the current task. See also: t:err! |
||||||||||||||||||||||
| errno? | -- m (as of 19.04) | |||||||||||||||||||||
Sets the task error according to the current value of "errno", and returns the map with the error information just as See also: t:err? |
||||||||||||||||||||||
| extra | -- x (as of 23.05) | |||||||||||||||||||||
Gets the task-specific 'extra' value, used internally; but for |
||||||||||||||||||||||
| getq | -- q (as of 17.07) | |||||||||||||||||||||
Gets the current task's queue. |
||||||||||||||||||||||
| handler | w -- (as of 18.07) | |||||||||||||||||||||
Install an exception handler for a task.
Any value other than those will invoke the default handler. The default is 0. |
||||||||||||||||||||||
| handler@ | -- w (as of 20.05) | |||||||||||||||||||||
Returns the current value of |
||||||||||||||||||||||
| kill | t n -- | |||||||||||||||||||||
Kill the task, waiting Note: the timeout is not implemented for Android. See also: t:task t:task-n |
||||||||||||||||||||||
| list | -- a (as of 17.08) | |||||||||||||||||||||
Retrieves a array of tasks which are currently "alive". Might not be valid at any subsequent time. |
||||||||||||||||||||||
| main | -- t | |||||||||||||||||||||
Returns the identifier for the REPL, or main, task (there is always at least one task, which the main interpreter runs on). |
||||||||||||||||||||||
| max-exceptions | n -- (as of 20.01) | |||||||||||||||||||||
Allows up to |
||||||||||||||||||||||
| name! | s -- (as of 17.08) | |||||||||||||||||||||
Sets the name of the current task. |
||||||||||||||||||||||
| name@ | -- s (as of 17.08) | |||||||||||||||||||||
Gets the name of the current task. |
||||||||||||||||||||||
| notify | t -- | |||||||||||||||||||||
Notify the task See also: t:wait t:q-wait G:sleep |
||||||||||||||||||||||
| parent | -- t (as of 19.08a) | |||||||||||||||||||||
Returns the task which launched the current one. |
||||||||||||||||||||||
| pop | -- x | |||||||||||||||||||||
Pops an item (or See also: t:task t:push |
||||||||||||||||||||||
| priority | t n -- | |||||||||||||||||||||
Set the priority of the task |
||||||||||||||||||||||
| push | t x -- | |||||||||||||||||||||
Pushes the item onto the task's queue. The size of that queue is determined by See also: t:task t:pop |
||||||||||||||||||||||
| push! | t x -- (as of 22.06) | |||||||||||||||||||||
Pushes See also: t:task t:pop t:push |
||||||||||||||||||||||
| q-notify | t -- t (as of 17.07) | |||||||||||||||||||||
Notifies the queue of the task that data awaits. Same as See also: G:sleep q:notify t:wait t:q-wait |
||||||||||||||||||||||
| q-wait | n -- (as of 17.07) | |||||||||||||||||||||
Waits See also: G:sleep q:notify t:wait t:q-notify |
||||||||||||||||||||||
| qlen | -- n | |||||||||||||||||||||
Returns the number of items in the current task's queue. |
||||||||||||||||||||||
| result | t -- t x | |||||||||||||||||||||
Returns the last value |
||||||||||||||||||||||
| set-affinity | n -- | a -- (as of 19.05) | |||||||||||||||||||||
Attempts to set the CPU affinity for the current task to the CPU number |
||||||||||||||||||||||
| setq | q -- (as of 20.01) | |||||||||||||||||||||
Sets the current task's queue, moving items from the current queue to the new one. |
||||||||||||||||||||||
| task | w -- t | m -- t | |||||||||||||||||||||
Create a new "task", which is an independent thread of execution. It receives its own data stack and invokes the word you provide as its its starting point. When that word exits, the task goes away. You may also pass a map instead of a word, in which case the keys are:
The word See also: t:task-n |
||||||||||||||||||||||
| task-n | xn... x2 x1 n w -- t | xn... x2 x1 m -- t | |||||||||||||||||||||
Same as See also: t:task |
||||||||||||||||||||||
| task-stop | -- | |||||||||||||||||||||
Terminates the running task, with prejudice. Normally, a task terminates when the word passed to |
||||||||||||||||||||||
| ticks | -- n (as of 23.04) | |||||||||||||||||||||
Returns how many "ticks" (e.g. |
||||||||||||||||||||||
| wait | t -- | a -- (as of 17.06) | |||||||||||||||||||||
Waits for the single task (or array of tasks) to complete. If an array, waits for all tasks in the array to complete. |
Namespace: tree
Description: Tree data structures
| word | sed/description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| add | tree x -- tree (as of 20.07) | ||||||||||
Adds the item |
|||||||||||
| binary | w -- tree (as of 20.07) | ||||||||||
Creates a new binary-search-tree with a word which implements the comparison function. The tree is implemented as a balanced AA-tree. |
|||||||||||
| bk | w n -- tree (as of 20.07) | ||||||||||
Creates a new BK-tree with a max distance
A typical implementation of The |
|||||||||||
| btree | w n -- tree (as of 21.04) | ||||||||||
Creates a new BTREE of order |
|||||||||||
| cmp! | tree w -- tree (as of 20.07) | ||||||||||
Sets |
|||||||||||
| data | X -- x (as of 20.07) | ||||||||||
Returns the data held in the node, not implemented for BTREE. See also: tree:find tree:next tree:prev tree:parent |
|||||||||||
| del | tree x -- tree (as of 20.07) | ||||||||||
Removes the node (if an X) or item (otherwise) from the tree. Not currently implemented for BK or BTREE trees. See also: tree:find tree:next tree:prev tree:data tree:add |
|||||||||||
| find | tree x -- tree X (as of 20.07) | ||||||||||
Does Not implemented for BTREEs. See also: tree:next tree:prev tree:data tree:parent |
|||||||||||
| iter | tree w n -- tree (as of 20.07) | ||||||||||
Traverses the tree, invoking
The SED of |
|||||||||||
| next | X -- X' (as of 20.07) | ||||||||||
Gives the next node in the tree, or See also: tree:find tree:prev tree:data tree:parent |
|||||||||||
| nodes | tree X -- tree a (as of 20.07) | ||||||||||
Returns an array of the nodes which are children of the node. |
|||||||||||
| parent | X -- X' (as of 20.07) | ||||||||||
Returns the node's parent, or See also: tree:find tree:next tree:prev tree:data |
|||||||||||
| parse | s -- tree (as of 20.07) | ||||||||||
Reconstitutes a tree from its string representation (from |
|||||||||||
| prev | X -- X' (as of 20.07) | ||||||||||
Gives the previous node in the tree, or See also: tree:find tree:next tree:data tree:parent |
|||||||||||
| root | tree -- tree X (as of 20.07) | ||||||||||
Returns the root node of the tree, or See also: tree:find tree:next tree:prev tree:data |
|||||||||||
| search | tree x n -- tree a (as of 20.07) | ||||||||||
Searches the tree for items matching |
|||||||||||
| trie | w T -- tree (as of 21.05) | ||||||||||
Creates a new TRIE. If If provided, the SED of |
Namespace: ws
Description: Web Socket utilities
| word | sed/description |
|---|---|
| close | T -- b |
| needs net/websocket Create a 'close' frame. |
|
| decode | b -- m |
| needs net/websocket Given a websocket packet in the buffer, return a map containing keys: "data" - the decoded data "op" - the websocket opcode "fin" - if 0, this is not the last packet of the message |
|
| encode | x op fin -- b |
| needs net/websocket Encode the buffer or string x with the opcode 'op' and final status 'fin'. |
|
| encode-nomask | x op fin -- b |
| needs net/websocket Encode the buffer or string x with the opcode 'op' and final status 'fin', but without masking; as appropriate for a server-to-client response. |
|
| gen-accept-header | s -- s |
| needs net/websocket Given the raw security key from the client, return an acceptance header |
|
| gen-accept-key | s -- s |
| needs net/websocket Convert the hashed 'Sec-Websocket-Key' we received into the expected response |
|
| opcodes | -- n |
| needs net/websocket Constants representing the opcodes for websocket packets: CONTINUATION, TEXT, BINARY, CLOSE, PING, PONG |
|
| open | s -- net true | false |
| needs net/websocket-client Try to open a websocket connection to the URL given. Returns 'true' followed by the |
Namespace: w
Description: Words are the smallest unit of execution
| word | sed/description |
|---|---|
| ! | x s -- (as of 17.06) |
Stores the value See also: w:@ t:@ t:! G:locals: |
|
| (is) | w s -- (as of 20.04) |
| IMMEDIATE Same as See also: G:defer: G:(defer) w:is |
|
| @ | s -- x | a -- x (as of 17.06) |
Gets the "local variable" named by the string. The value Before using this word you must have invoked See also: w:! t:@ t:! G:locals: |
|
| alias: | w |
Creates a new word named |
|
| cb | w s -- X (as of 17.03) |
Creates a new "callback" given a parameter specification string and a word which will be called-back by the FFI call. The parameter specification is in the same format as for You must use this if you need to pass a "callback function" to an FFI-invoked external function. If you do not, your callback will probably crash. |
|
| deprecate | w -- (as of 17.03) |
Marks the word as DEPRECATED. A word which is "deprecated" will print a warning message if it is invoked in interpret mode, or when it is compiled the first time into a new word. At runtime it will be silent; the warning is intended to alert the programmer that the word should be retired from use. The deprecation warning will appear only the first time the word is invoked or compiled. Note: A deprecated word may be removed from 8th at any time after it was marked as such, so it is best to heed the warning message. |
|
| dlcall | w -- x | w n -- x (as of 21.03) |
Calls the dynamic-library function encapsulated in the word |
|
| dlopen | s -- X | b -- X (as of 21.03) |
Loads the dynamic library indicated by Pro+: if given a buffer, it's a dynamic library in memory. The returned item can be used with |
|
| dlsym | X s nm s2 -- X w (as of 21.03) |
Given an X returned by |
|
| exec | w -- |
Invoke (call, run, execute) the word. Does nothing if See also: w:exec? |
|
| exec? | s -- T |
Try to invoke the word named by the string See also: w:exec |
|
| ffifail | s -- (as of 18.06) |
| DEFFERED Invoked if the FFI is unable to dynamically load the external function or library. The default behavior is to print a message and exit the app. |
|
| find | s -- w |
Look up the word named See also: w:forget G:' |
|
| forget | s -- | n -- |
Look up the word named by the string If a namespace is "forgotten", it is also wiped so it is actually impossible to find words which were in the namespace. However, any references to such words will still be alive. See also: w:find G:' |
|
| is | w |
| IMMEDIATE Assign the word See also: G:defer: |
|
| name | w -- w s (as of 19.09) |
Returns the word's name. |
|
| undo | w -- |
Undoes the last assignment from See also: w:is G:defer: |
|
| xt | w -- n (as of 24.06) |
| IMMEDIATE Returns the "xt", or execution address/token of the given word. |
|
| xt> | n -- w (as of 24.06) |
Returns the word corresponding to an address, if possible; otherwise returns |
Namespace: xml
Description: XML parsing
| word | sed/description | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| >s | x -- s | |||||||||||||||||||||||||||
| needs xml/parse Convert the xml x to a string representation s. This will not necessarily be a complete round-trip of a file parsed with xml:parse. |
||||||||||||||||||||||||||||
| >txt | x -- x s | |||||||||||||||||||||||||||
| needs xml/parse Given an xml x, return its text content, recursively, in a single string s. |
||||||||||||||||||||||||||||
| md-init | m -- X (as of 19.09) | |||||||||||||||||||||||||||
Prepares to parse "Markdown text" using a push parser. The map requires all the following keys: "enter_span", "leave_span", "enter_block", "leave_block", "text". They must be words with a SED of The map the callback receives will contain the keys "text" and "user" if it's a "text" callback, or "tag" and "user" for all others. See the libraries |
||||||||||||||||||||||||||||
| md-parse | X x sb -- X T (as of 19.09) | |||||||||||||||||||||||||||
Takes a parser created with |
||||||||||||||||||||||||||||
| parse | inp -- xml | xml null | |||||||||||||||||||||||||||
| needs xml/parse Take an item (string or buffer or map) inp possibly containing XML and parse it into a map xml. Return null on TOS if it failed to parse (and "error" in the map returned under will explain why it failed). If inp is a map, then its contents will override the default parse and it must provide either a "inp" key with text, or a "read" key with appropriate behavior. Currently requires that the XML be encoded in UTF-8 (or compatible). |
||||||||||||||||||||||||||||
| parse-html | o -- x | |||||||||||||||||||||||||||
| needs xml/parse Take an item (string or buffer) o containing HTML and parse it into a map, similar to xml:parse |
||||||||||||||||||||||||||||
| parse-stream | m -- (as of 18.04) | |||||||||||||||||||||||||||
Parses a stream of XML according to the options in the given map, with word values whose keys are:
|
Namespace: zmq
Description: ZeroMQ interface
| word | sed/description |
|---|---|
| getmsg[] | sock -- [buf]|null |
| needs net/zmq Get multi-part messages as an array of buffers. |
|
| sendmsg[] | sock arr -- |
| needs net/zmq Send (possibly) multi-part messages, given as an array of items to send. |