The systemdict dictionary contains most of the operators that are of general use. Although there are no mechanisms that prevent modification of systemdict, programs should not normally need to modify systemdict, since globaldict provides a place for storing globally shared objects. All threads share the same systemdict, which is implicitly locked.
Input(s) | Op/Proc/Var | Output(s) | Description |
Operand stack operators | |||
- | mark | mark | Create a mark. |
,,,obj | aup | obj ,,, | Rotate stack up one position. |
obj ,,, | adn | ,,,obj | Rotate stack down one position. |
- | count | count | Get the number of objects on ostack. |
mark ... | counttomark | mark ...count | Get the depth of the topmost mark on ostack. |
obj | dup | obj dup | Duplicate an object. |
obj ,,, | bdup | obj ,,,dup | Duplicate bottom object. |
objects count | ndup | objects objects | Duplicate objects. |
obj ...index | idup | obj ... dup | Duplicate object on ostack at index. |
...obj ,,,index | ibdup | ... obj ,,,dup | Duplicate object on ostack at index from bottom. |
a b | tuck | b a b | Tuck duplicate of top object under second object. |
a b | under | a a b | Duplicate second object. |
a b | over | a b a | Duplicate second object. |
a b | exch | b a | Exchange top two objects. |
a b c | up | c a b | Roll top three objects up one. |
a ...b count | nup | b a ... | Roll count objects up one. |
a b c | dn | b c a | Roll top three objects down one. |
a ...b count | ndn | ...b a | Roll count objects down one. |
...amount | rot | ... | Rotate stack up by amount. |
region count amount | roll | rolled | Roll count objects up by amount. |
obj | pop | - | Remove object. |
obj ,,, | bpop | ,,, | Remove bottom object. |
objects count | npop | - | Remove count objects. |
objects ...count | nbpop | ... | Remove count objects from bottom. |
obj ...index | ipop | ... | Remove object at index. |
...obj ,,,index | ibpop | ... ,,, | Remove object at index from bottom. |
a b | nip | b | Remove second object. |
objects | clear | - | Pop all objects off ostack. |
mark ... | cleartomark | - | Remove objects from ostack through topmost mark. |
- | ostack | stack | Get a current ostack snapshot. |
thread | threadostack | stack | Get a reference to thread's ostack. |
Execution, control, and execution stack operators | |||
obj | eval | - | Evaluate object. |
boolean obj | if | - | Conditionally evaluate object. |
boolean a b | ifelse | - | Conditionally evaluate one of two objects. |
init inc limit proc | for | - | Iterate with a control variable. |
count proc | repeat | - | Iterate a set number of times. |
cond proc | while | - | Loop while cond is true. |
proc cond | until | - | Loop until cond is false. |
proc | loop | - | Loop indefinitely. |
array proc | foreach | - | Iterate on array elements. |
dict proc | foreach | - | Iterate on dictionary key/value pairs. |
stack proc | foreach | - | Iterate on stack elements. |
string proc | foreach | - | Iterate on string elements. |
- | exit | - | Terminate innermost looping context. |
file/string | token | false | Scan for a token. |
file/string | token | file/substring obj true | Scan for a token. |
obj | start | - | Evaluate object. |
- | quit | - | Unwind to innermost start context. |
obj | stopped | boolean | Evaluate object. |
- | stop | - | Unwind to innermost stopped or start context. |
name | throw | obj | Throw an error. |
- | estack | stack | Get a current estack snapshot. |
thread | threadestack | stack | Get a reference to thread's estack. |
- | countestack | count | Get current estack depth. |
- | istack | stack | Get a current istack snapshot. |
thread | threadistack | stack | Get a reference to thread's istack. |
status | die | - | Exit program. |
path symbol | modload | - | Load a module. |
file symbol | mrequire | - | Search for and load a module. |
file | require | - | Search for and evaluate a source file. |
args | exec | - | Overlay a new program and execute it. |
args | forkexec | pid | Fork and exec a new process. |
pid | waitpid | status | Wait for a program to terminate. |
args | system | status | Execute a program. |
- | pid | pid | Get process ID. |
- | ppid | pid | Get parent's process ID. |
- | uid | uid | Get the process's user ID. |
uid | setuid | boolean | Set the process's user ID. |
- | euid | uid | Get the process's effective user ID. |
uid | seteuid | boolean | Set the process's effective user ID. |
- | gid | gid | Get the process's group ID. |
gid | setgid | boolean | Set the process's group ID. |
- | egid | gid | Get the process's effective group ID. |
gid | setegid | boolean | Set the process's effective group ID. |
- | realtime | nsecs | Get the number of nanoseconds since the epoch. |
nanoseconds | nsleep | - | Nanosleep. |
Stack operators | |||
- | ( | fino | Begin a stack declaration. |
fino objects | ) | stack | Create a stack. |
- | stack | stack | Create a stack. |
stack obj | spush | - | Push object onto stack. |
stack obj | sbpush | - | Push object onto bottom of stack. |
stack | scount | count | Get the number of objects on a stack. |
stack | scounttomark | count | Get the depth of the topmost mark on stack. |
stack | sdup | - | Duplicate an object. |
stack | sbdup | - | Duplicate bottom object. |
stack count | sndup | - | Duplicate objects on stack. |
stack index | sidup | - | Duplicate object on stack at index. |
stack index | sibdup | - | Duplicate object on stack at index from bottom. |
stack | stuck | - | Tuck duplicate of top object on stack under next object on stack. |
stack | sunder | - | Duplicate second object on stack. |
stack | sover | - | Duplicate second object on stack. |
stack | sexch | - | Exchange top objects on stack. |
stack | sup | - | Roll top three objects on stack up one. |
stack count | snup | - | Roll count objects on stack up one. |
stack | saup | - | Roll objects on stack up one. |
stack | sdn | - | Roll top three objects on stack down one. |
stack count | sndn | - | Roll count objects on stack down one. |
stack | sadn | - | Roll objects on stack down one. |
stack amount | srot | - | Rotate objects on stack up by amount. |
stack count amount | sroll | - | Roll objects on stack. |
stack | spop | obj | Pop object off stack. |
stack | sbpop | obj | Pop object off bottom of stack. |
stack count | snpop | array | Pop count objects off stack. |
stack count | snbpop | array | Pop count objects off bottom of stack. |
stack index | sipop | obj | Remove object on stack at index. |
stack index | sibpop | obj | Remove object on stack at index from bottom. |
stack | snip | obj | Remove second object on stack. |
stack | sclear | - | Remove all objects on stack. |
stack | scleartomark | - | Remove objects from stack down through topmost mark. |
(a) (b) | cat | (a b) | Catenate two stacks. |
stacks count | ncat | stack | Catenate stacks. |
srcstack dststack | copy | dststack | Copy stack contents. |
Number (integer, real) and math operators | |||
a b | add | r | Add a and b. |
a | inc | r | Add 1 to a. |
a b | sub | r | Subtract b from a. |
a | dec | r | Subtract 1 from a. |
a b | mul | r | Multiply a and b. |
a b | div | r | Divide a by b. |
a b | idiv | r | Divide a by b (integers). |
a b | mod | r | Mod a by b (integers). |
a b | exp | r | Raise a to the power of b. |
a | sqrt | r | Square root. |
a | ln | r | Natural log. |
a | log | r | Base 10 log. |
a | abs | r | Get the absolute value of a. |
a | neg | r | Get the negative of a. |
a | ceiling | r | Integer ceiling of a real. |
a | floor | r | Integer floor of a real. |
a | round | r | Real rounded to integer. |
a | trunc | r | Integer from real with truncated fractional. |
a | sin | r | Sine in radians. |
a | cos | r | Cosine in radians. |
y x | atan | r | Arctangent in radians of
![]() |
seed | srand | - | Seed pseudo-random number generator. |
- | rand | integer | Get a pseudo-random number. |
String operators | |||
length | string | string | Create a string. |
string | length | count | Get string length. |
string index | get | integer | Get string element. |
string index integer | put | - | Set string element. |
string index length | getinterval | substring | Get a string interval. |
string index substring | putinterval | - | Copy substring into string. |
`a' `b' | cat | `ab' | Catenate two strings. |
strings count | ncat | string | Catenate strings. |
srcstring dststring | copy | dstsubstring | Copy string. |
obj depth | sprints | string | Create syntactical string from object. |
obj flags | outputs | string | Create formatted string from object. |
string pattern | search | post pattern pre true | Successfully search for pattern. |
string pattern | search | string false | Unsuccessfully earch for pattern. |
Name operators | |||
name | length | count | Get name length. |
Array operators | |||
- | argv | args | Get program arguments. |
- | [ | mark | Begin an array declaration. |
mark objects | ] | array | Construct an array. |
length | array | array | Create an array. |
array | length | count | Get array length. |
array index | get | obj | Get array element. |
array index obj | put | - | Set array element. |
array index length | getinterval | subarray | Get an array interval. |
array index subarray | putinterval | - | Copy subarray into array. |
[a] [b] | cat | [a b] | Catenate two arrays. |
arrays count | ncat | array | Catenate arrays. |
srcarray dstarray | copy | dstsubarray | Copy array. |
Dictionary and dictionary stack operators | |||
- | gcdict | dict | Get gcdict. |
- | userdict | dict | Get userdict. |
- | globaldict | dict | Get globaldict. |
- | systemdict | dict | Get systemdict. |
- | onyxdict | dict | Get onyxdict. |
- | sprintsdict | dict | Get sprintsdict. |
- | outputsdict | dict | Get outputsdict. |
- | envdict | dict | Get envdict. |
- | threadsdict | dict | Get threadsdict. |
key val | setenv | - | Set environment variable. |
key | unsetenv | - | Unset environment variable. |
- | < | mark | Begin a dictionary declaration. |
mark kvpairs | > | dict | Construct a dictionary. |
- | dict | dict | Create a dictionary. |
dict | begin | - | Pust dict onto dstack. |
- | end | - | Pop a dictionary off dstack. |
key val | def | - | Define key/value pair. |
dict key | undef | - | Undefine key in dict. |
key | load | val | Look up a key's value. |
dict key | known | boolean | Check for key in dict. |
key | where | false | Get topmost dstack dictionary that defines key. |
key | where | dict true | Get topmost dstack dictionary that defines key. |
dict | length | count | Get number of dictionary key/value pairs. |
dict key | get | value | Get dict value associate with key. |
dict key value | put | - | Set dict key/value pair. |
srcdict dstdict | copy | dstdict | Copy dictionary contents. |
- | currentdict | dict | Get topmost dstack dictionary. |
- | dstack | stack | Get dstack snapshot. |
thread | threaddstack | stack | Get a reference to thread's dstack. |
- | countdstack | count | Get number of stacks on dstack. |
File and filesystem operators | |||
filename flags | open | file | Open a file. |
filename flags mode | open | file | Open a file, creation mode specified. |
- | pipe | rfile wfile | Create a pipe. |
file | close | - | Close file. |
file | read | integer boolean | Read from file. |
file string | read | substring boolean | Read from file. |
file | readline | string boolean | Read a line from file. |
<file dict ...> timeout | poll | [file ...] | Wait for file(s) to change status. |
file | bytesavailable | count | Get number of buffered readable bytes. |
file | iobuf | count | Get size of I/O buffer. |
file count | setiobuf | - | Set size of I/O buffer. |
file | nonblocking | boolean | Get non-blocking mode. |
file boolean | setnonblocking | - | Set non-blocking mode. |
file integer/string | write | false | Write to file. |
file integer/string | write | integer/substring true | Write to file. |
string | - | Print string to stdout. | |
obj depth | sprint | - | Syntactically print object to stdout. |
obj flags | output | - | Formatted print to stdout. |
- | pstack | - | Syntactically print ostack elements. |
file | flushfile | - | Flush file buffer. |
- | flush | - | Flush stdout buffer. |
file length | truncate | - | Truncate file. |
file offset | seek | - | Move file position pointer. |
file | tell | offset | Get file position pointer offset. |
path | mkdir | - | Create a directory. |
path mode | mkdir | - | Create a directory, mode specified. |
path | mkfifo | - | Create a named pipe. |
path mode | mkfifo | - | Create a named pipe, mode specified. |
old new | rename | - | Rename a file or directory. |
file/filename mode | chmod | - | Change file permissions. |
file/filename uid gid | chown | - | Change file owner and group. |
filename linkname | link | - | Create a hard link. |
filename linkname | symlink | - | Create a symbolic link. |
filename | unlink | - | Unlink a file. |
path | rmdir | - | Remove an empty directory. |
file/filename flag | test | boolean | Test a file. |
file/filename | status | dict | Get file information. |
linkname | readlink | string | Get symbolic link data. |
path proc | dirforeach | - | Iterate on directory entries. |
- | pwd | path | Get present working directory. |
path | cd | - | Change present working directory. |
path | chroot | - | Change root directory. |
- | stdin | file | Get thread's stdin. |
- | stdout | file | Get thread's stdout. |
- | stderr | file | Get thread's stderr. |
- | gstdin | file | Get global stdin. |
- | gstdout | file | Get global stdout. |
- | gstderr | file | Get global stderr. |
file | setstdin | - | Set thread's stdin. |
file | setstdout | - | Set thread's stdout. |
file | setstderr | - | Set thread's stderr. |
file | setgstdin | - | Set global stdin. |
file | setgstdout | - | Set global stdout. |
file | setgstderr | - | Set global stderr. |
Socket and networking operators | |||
family type proto | socket | sock | Create a socket. |
family type | socket | sock | Create a socket. |
sock addr port | bindsocket | - | Bind socket to address/port. |
sock addr | bindsocket | - | Bind socket to address. |
sock path | bindsocket | - | Bind socket to port. |
sock backlog | listen | - | Listen for socket connections. |
sock | listen | - | Listen for socket connections. |
sock | accept | sock | Accept a socket connection. |
sock addr port | connect | - | Connect a socket. |
sock path | connect | - | Connect a socket. |
service | serviceport | port | Get port number for service name. |
sock | sockname | dict | Get socket information. |
sock level optname | sockopt | optval | Get socket option. |
sock optname | sockopt | optval | Get socket option. |
sock level optname optval | setsockopt | - | Set socket option. |
sock optname optval | setsockopt | - | Set socket option. |
sock | peername | dict | Get peer socket information. |
sock mesg flags | send | nsend | Send a message. |
sock mesg | send | count | Send a message. |
sock string flags | recv | substring | Receive a message. |
sock string | recv | substring | Receive a message. |
family type proto | socketpair | sock sock | Create a socket pair. |
family type | socketpair | sock sock | Create a socket pair. |
Logical and bitwise operators | |||
a b | lt | boolean | a less than b? (integer/real, string) |
a b | le | boolean | a less than or equal to b? (integer/real, string) |
a b | eq | boolean | a equal to b? (any type) |
a b | ne | boolean | a not equal to b? (any type) |
a b | ge | boolean | a greater than or equal to b? (integer/real, string) |
a b | gt | boolean | a greater than b? (integer/real, string) |
a b | and | r | Logical/bitwise and. (boolean/integer) |
a b | or | r | Logical/bitwise or. (boolean/integer) |
a b | xor | r | Logical/bitwise exclusive or. (boolean/integer) |
a | not | r | Logical/bitwise not. (boolean/integer) |
a shift | shift | integer | Bitwise shift. |
- | false | false | Return true. |
- | true | true | Return false. |
Type, conversion, and attribute operators | |||
obj | type | name | Get object type. |
obj | echeck | boolean | Evaluatable? |
obj | xcheck | boolean | Executable? |
obj | cve | obj | Set evaluatable attribute. |
obj | cvx | obj | Set executable attribute. |
obj | cvlit | obj | Set literal attribute. |
string | cvn | name | Convert string to name. |
obj | cvs | string | Convert object to string. |
integer radix | cvrs | string | Convert integer to radix string. |
real precision | cvds | string | Convert real to decimal string. |
real precision | cves | string | Convert real to exponential string. |
hook | hooktag | tag | Get hook tag. |
Threading and synchronization operators | |||
stack entry | thread | thread | Create and run a thread. |
- | self | thread | Get a thread object for the running thread. |
thread | join | - | Wait for thread to exit. |
thread | detach | - | Detach thread. |
- | yield | - | Voluntarily yield the processor. |
- | mutex | mutex | Create a mutex. |
mutex proc | monitor | - | Evaluate an object under the protection of a mutex. |
mutex | lock | - | Acquire mutex. |
mutex | trylock | boolean | Try to acquire mutex. |
mutex | unlock | - | Release mutex. |
- | condition | condition | Create a condition variable. |
condition mutex | wait | - | Wait on condition. |
condition mutex timeout | timedwait | boolean | Wait on condition with timeout. |
condition | signal | - | Signal a condition waiter. |
condition | broadcast | - | Signal all condition waiters. |
- | currentlocking | boolean | Get implicit locking mode. |
boolean | setlocking | - | Set implicit locking mode. |
obj | lcheck | boolean | Implicitly locked? |
Miscellaneous operators | |||
- | product | string | Get the product string. |
- | version | string | Get the version string. |
proc | bind | proc | Bind names to operators. |
- | null | null | Create a null object. |
onyx:0> ( onyx:1> pstack -fino- onyx:1>
onyx:0> () onyx:1> 1 sprint () onyx:0> (1 2 onyx:3> pstack 2 1 -fino- onyx:3> ) onyx:1> 1 sprint (1 2) onyx:0>
onyx:0> < 1 sprint -mark- onyx:0>
onyx:0> < onyx:1> $foo `foo' onyx:3> $bar `bar' onyx:5> $biz `biz' onyx:7> $pop ~pop onyx:9> > onyx:1> pstack <$pop --pop-- $biz `biz' $bar `bar' $foo `foo'> onyx:1>
onyx:0> [ 1 sprint -mark- onyx:0>
onyx:0> mark 1 2 3 ] 1 sprint [1 2 3]
onyx:0> 5 abs 1 sprint 5 onyx:0> -5 abs 1 sprint 5 onyx:0> 3.14 abs 1 sprint 3.140000e+00 onyx:0> -3.14 abs 1 sprint 3.140000e+00 onyx:0>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> dup `localhost' 7777 bindsocket onyx:1> dup listen onyx:1> dup accept onyx:2> dup peername 1 sprint <$family $AF_INET $address 2130706433 $port 33742> onyx:2>
onyx:0> 2 2 add 1 sprint 4 onyx:0> -1 3 add 1 sprint 2 onyx:0> 2.0 3.1 add 1 sprint 5.100000e+00 onyx:0> -1.5 +3e1 add 1 sprint 2.850000e+01 onyx:0>
onyx:0> 1 2 3 adn pstack 1 3 2 onyx:3>
onyx:0> false true and 1 sprint false onyx:0> true true and 1 sprint true onyx:0> 5 3 and 1 sprint 1 onyx:0>
onyx:0> argv 1 sprint [`/usr/local/bin/onyx'] onyx:0>
onyx:0> 3 array 1 sprint [null null null] onyx:0> 0 array 1 sprint [] onyx:0>
onyx:0> 1 1 atan 1 sprint 7.853982e-01 onyx:0> 0 1 atan 1 sprint 0.000000e+00 onyx:0> -1.0 0 atan 1 sprint -1.570796e+00 onyx:0>
onyx:0> 1 2 3 aup pstack 2 1 3 onyx:3>
onyx:0> 1 2 3 onyx:3> bdup pstack 1 3 2 1 onyx:4>
onyx:0> <$foo `foo'> begin onyx:0> foo 1 sprint `foo' onyx:0>
Binding has a large positive impact on performance, since name lookups are thereafter avoided. However, binding is not done by default because there are situations where it is useful to leave procedures unbound:
onyx:0> {pop sprint {pop sprint}} onyx:1> dup 2 sprint {pop sprint {pop sprint}} onyx:1> bind onyx:1> dup 2 sprint {--pop-- _{sprints --print-- `\n' --print-- --flush--}_ {--pop-- -array-}} onyx:1>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> dup `localhost' 7777 bindsocket onyx:1> dup sockname 1 sprint <$family $AF_INET $address 2130706433 $port 7777> onyx:1> close onyx:0> $AF_LOCAL $SOCK_STREAM socket onyx:1> dup `/tmp/socket' bindsocket onyx:1> dup sockname 1 sprint <$family $AF_LOCAL $path `/tmp/socket'> onyx:1>
onyx:0> 1 2 onyx:2> bpop pstack 2 onyx:1>
onyx:0> condition mutex dup lock ostack onyx:3> {dup lock exch broadcast unlock} onyx:4> thread 3 1 roll onyx:3> dup 3 1 roll onyx:4> wait unlock join onyx:0>
onyx:0> `/tmp/foo' `w+' open onyx:1> dup `Hello\n' write onyx:1> dup `Goodbye\n' write onyx:1> dup 0 seek onyx:1> dup readline 1 sprint 1 sprint false `Hello' onyx:1> dup bytesavailable 1 sprint 8 onyx:1>
onyx:0> [`a'] [`b'] cat onyx:1> 1 sprint [`a' `b'] onyx:0> (`a') (`b') cat onyx:1> 1 sprint (`a' `b') onyx:0> `a' `b' cat onyx:1> 1 sprint `ab' onyx:0>
onyx:0> pwd 1 sprint `/usr/local' onyx:0> `bin' cd onyx:0> pwd 1 sprint `/usr/local/bin' onyx:0>
onyx:0> -1.51 ceiling 1 sprint -1 onyx:0> -1.49 ceiling 1 sprint -1 onyx:0> 0 ceiling 1 sprint 0 onyx:0> 1.49 ceiling 1 sprint 2 onyx:0> 1.51 ceiling 1 sprint 2 onyx:0>
onyx:0> `/tmp/tdir' 8@755 mkdir onyx:0> `/tmp/tdir' status $mode get 1 sprint 16877 onyx:0> `/tmp/tdir' `r' open onyx:1> dup 8@555 chmod onyx:1> `/tmp/tdir' status $mode get 1 sprint 16749 onyx:1>
onyx:0> `/tmp/tdir' 8@755 mkdir onyx:0> `/tmp/tdir' status onyx:1> dup $uid get 1 sprint 1001 onyx:1> $gid get 1 sprint 0 onyx:0> `/tmp/tdir' 1001 1001 chown onyx:0> `/tmp/tdir' status onyx:1> dup $uid get 1 sprint 1001 onyx:1> $gid get 1 sprint 1001 onyx:0>
onyx:0> pwd 1 sprint `/home/jasone/cw/devroot' onyx:0> `/home/jasone' chroot onyx:0> pwd 1 sprint `/cw/devroot' onyx:0>
onyx:0> 1 2 3 pstack 3 2 1 onyx:3> clear pstack onyx:0>
onyx:0> 3 mark 1 0 pstack 0 1 -mark- 3 onyx:4> cleartomark pstack 3 onyx:1>
onyx:0> `/tmp/foo' `w' open onyx:1> close onyx:0>
onyx:0> condition 1 sprint -condition- onyx:0>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> dup `localhost' 7777 connect onyx:1>
onyx:0> [`a'] [`b' `c'] copy 1 sprint [`a'] onyx:0> <$foo `foo'> <$bar `bar'> copy 1 sprint <$bar `bar' $foo `foo'> onyx:1> (1 2) (3 4) copy 1 sprint (3 4 1 2) onyx:1> `a' `bc' copy 1 sprint `a' onyx:1>
onyx:0> 0 cos 1 sprint 1.000000e+00 onyx:0> 3.14 cos 1 sprint -9.999987e-01 onyx:0> 3.1415927 cos 1 sprint -1.000000e+00 onyx:0>
onyx:0> 2 1 0 count pstack 3 0 1 2 onyx:4>
onyx:0> countdstack 1 sprint 4 onyx:0> dict begin onyx:0> countdstack 1 sprint 5 onyx:0>
onyx:0> countestack 1 sprint 3 onyx:0> estack 1 sprint (--start-- -file- --estack--) onyx:0>
onyx:0> 4 mark 2 1 0 counttomark 1 sprint 3 onyx:5>
onyx:0> <$foo `foo'> begin onyx:0> currentdict 1 sprint <$foo `foo'> onyx:0>
onyx:0> currentlocking 1 sprint false onyx:0> true setlocking onyx:0> currentlocking 1 sprint true onyx:0>
onyx:0> 42.3 0 cvds 1 sprint `42' onyx:0> 42.3 1 cvds 1 sprint `42.3' onyx:0> -42.3 4 cvds 1 sprint `-42.3000' onyx:0>
onyx:0> [1 2 3] cve 1 sprint _{1 2 3}_ onyx:0>
onyx:0> 42.3 0 cves 1 sprint `4e+01' onyx:0> 42.3 1 cves 1 sprint `4.2e+01' onyx:0> 42.3 2 cves 1 sprint `4.23e+01' onyx:0> -42.3 5 cves 1 sprint `-4.23000e+01' onyx:0>
onyx:0> {1 2 3} cvlit 1 sprint [1 2 3] onyx:0>
onyx:0> `foo' cvn 1 sprint $foo onyx:0>
onyx:0> 42 2 cvrs 1 sprint `101010' onyx:0> 42 16 cvrs 1 sprint `2a' onyx:0>
onyx:0> true cvs 1 sprint `true' onyx:0> $foo cvs 1 sprint `foo' onyx:0> 42 cvs 1 sprint `42' onyx:0> ~pop cvs 1 sprint `pop' onyx:0> 42.0 cvs 1 sprint `4.200000e+01' onyx:0> `foo\nbar\\biz\`baz' cvs 1 sprint `\`foo\\nbar\\\\biz\\\`baz\'' onyx:0> mutex cvs 1 sprint `--nostringval--' onyx:0>
onyx:0> [1 2 3] cvx 1 sprint {1 2 3} onyx:0>
onyx:0> 1 dec 1 sprint 0 onyx:0>
onyx:0> $foo `foo' def onyx:0> foo 1 sprint `foo' onyx:0> $foo `FOO' def onyx:0> foo 1 sprint `FOO' onyx:0>
onyx:0> (1 2) {add 1 sprint self detach} thread 3 onyx:1>
onyx:0> dict 1 sprint <> onyx:0>
onyx:0> 1 die
onyx:0> pwd {1 sprint} dirforeach `CVS' `.cvsignore' `Cookfile' `Cookfile.inc' `latex' `Cookfile.inc.in' onyx:0> pwd {`Cookfile.inc' search {pop `Yes: ' print 1 sprint pop exit} {`Not: ' print 1 sprint} ifelse } dirforeach Not: `CVS' Not: `.cvsignore' Not: `Cookfile' Yes: `Cookfile.inc' onyx:0>
onyx:0> 4 2 div 1 sprint 2.000000e+00 onyx:0> 5 2.0 div 1 sprint 2.500000e+00 onyx:0> 5.0 0 div Error $undefinedresult ostack: (5.000000e+00 0) dstack: (-dict- -dict- -dict- -dict-) estack/istack trace (0..2): 0: --div-- 1: -file- 2: --start-- onyx:3>
onyx:0> `a' `b' `c' `d' dn pstack `b' `d' `c' `a' onyx:4>
onyx:0> dstack 1 sprint (-dict- -dict- -dict- -dict-) onyx:0>
onyx:0> 1 dup pstack 1 1 onyx:2>
onyx:0> {1 2 3} cve onyx:1> dup 1 sprint _{1 2 3}_ onyx:1> echeck 1 sprint true onyx:0> {1 2 3} echeck 1 sprint false onyx:0> [1 2 3] echeck 1 sprint false onyx:0>
onyx:0> egid 1 sprint 1001 onyx:0>
onyx:0> <$foo `foo'> begin onyx:0> foo 1 sprint `foo' onyx:0> end onyx:0> foo 1 sprint Error $undefined ostack: () dstack: (-dict- -dict- -dict- -dict-) estack/istack trace (0..2): 0: foo 1: -file- 2: --start-- onyx:1>
onyx:0> envdict 0 sprint -dict- onyx:0>
onyx:0> mutex mutex eq 1 sprint false onyx:0> mutex dup eq 1 sprint true onyx:0> $foo `foo' eq 1 sprint true onyx:0> true true eq 1 sprint true onyx:0> true false eq 1 sprint false onyx:0> 1 1 eq 1 sprint true onyx:0> 1 2 eq 1 sprint false onyx:0> 1.0 1 eq 1 sprint true onyx:0> 1.0 1.1 eq 1 sprint false onyx:0>
onyx:0> estack 1 sprint (--start-- -file- --estack--) onyx:0>
onyx:0> euid 1 sprint 1001 onyx:0>
onyx:0> ``hi' 1 sprint' cvx eval `hi' onyx:0>
onyx:0> 1 2 pstack 2 1 onyx:2> exch pstack 1 2 onyx:2>
onyx:0> `Old program' onyx:1> [`/usr/local/bin/onyx'] exec Canonware Onyx, version 1.0.0. onyx:0>
onyx:0> {`hi' 1 sprint exit `bye' 1 sprint} loop `hi' onyx:0>
onyx:0> 5 0 exp 1 sprint 1 onyx:0> 5 1 exp 1 sprint 5 onyx:0> 5 2 exp 1 sprint 25 onyx:0> -5 3 exp 1 sprint -125 onyx:0> 5 -3 exp 1 sprint 8.000000e-03 onyx:0> 2.1 3.5 exp 1 sprint 1.342046e+01 onyx:0> 100 .01 exp 1 sprint 1.000000e+02 onyx:0>
onyx:0> false 1 sprint false onyx:0>
onyx:0> -1.51 floor 1 sprint -2 onyx:0> -1.49 floor 1 sprint -2 onyx:0> 0 floor 1 sprint 0 onyx:0> 1.49 floor 1 sprint 1 onyx:0> 1.51 floor 1 sprint 1 onyx:0>
onyx:0> `Hi\n' print onyx:0> flush Hi onyx:0>
onyx:0> `Hi\n' print onyx:0> stdout flushfile Hi onyx:0>
onyx:0> 0 1 3 {1 sprint} for 0 1 2 3 onyx:0> 0 -1 -3 {1 sprint} for 0 -1 -2 -3 onyx:0> 0 2 7 {1 sprint} for 0 2 4 6 onyx:0> 0 1 1000 {dup 1 sprint 3 eq {exit} if} for 0 1 2 3 onyx:0>
onyx:0> [1 2] {1 sprint} foreach 1 2 onyx:0> <$foo `foo' $bar `bar'> {pstack clear} foreach `bar' $bar `foo' $foo onyx:0> (1 2) {pstack clear} foreach 2 1 onyx:0> `ab' {pstack clear} foreach 97 98 onyx:0>
onyx:0> [`/bin/date'] forkexec dup 1 sprint waitpid 1 sprint 6516 Sat Jul 13 20:47:54 PDT 2002 0 onyx:0>
onyx:0> gcdict 0 sprint -dict- onyx:0>
onyx:0> 1 2 ge 1 sprint false onyx:0> 1 1 ge 1 sprint true onyx:0> 2 1 ge 1 sprint true onyx:0> 1 1.1 ge 1 sprint false onyx:0> 1.1 1.1 ge 1 sprint true onyx:0> 1.1 1 ge 1 sprint true onyx:0> `a' `b' ge 1 sprint false onyx:0> `a' `a' ge 1 sprint true onyx:0> `b' `a' ge 1 sprint true onyx:0>
onyx:0> [`a' `b' `c'] 1 get 1 sprint `b' onyx:0> <$foo `foo' $bar `bar'> $bar get 1 sprint `bar' onyx:0> `abc' 1 get 1 sprint 98 onyx:0>
onyx:0> [0 1 2 3] 1 2 getinterval 1 sprint [1 2] onyx:0> `abcd' 1 2 getinterval 1 sprint `bc' onyx:0>
onyx:0> gid 1 sprint 1001 onyx:0>
onyx:0> globaldict 1 sprint <> onyx:0>
onyx:0> gstderr pstack -file- onyx:1>
onyx:0> gstdin pstack -file- onyx:1>
onyx:0> gstdout pstack -file- onyx:1>
onyx:0> 1 1 gt 1 sprint false onyx:0> 2 1 gt 1 sprint true onyx:0> 1.1 1.1 gt 1 sprint false onyx:0> 1.1 1 gt 1 sprint true onyx:0> `a' `a' gt 1 sprint false onyx:0> `b' `a' gt 1 sprint true onyx:0>
onyx:4> 2 ibdup pstack 2 3 2 1 0 onyx:5>
onyx:0> 0 1 2 3 onyx:4> 2 ibpop pstack 3 1 0 onyx:3>
onyx:0> 4 2 idiv 1 sprint 2 onyx:0> 5 2 idiv 1 sprint 2 onyx:0> 5 0 idiv Error $undefinedresult ostack: (5 0) dstack: (-dict- -dict- -dict- -dict-) estack/istack trace (0..2): 0: --idiv-- 1: -file- 2: --start-- onyx:3>
onyx:0> 3 2 1 0 2 idup pstack 2 0 1 2 3 onyx:5>
onyx:0> true {`yes' 1 sprint} if `yes' onyx:0> false {`yes' 1 sprint} if onyx:0>
onyx:0> true {`yes'}{`no'} ifelse 1 sprint `yes' onyx:0> false {`yes'}{`no'} ifelse 1 sprint `no' onyx:0>
onyx:0> 1 inc 1 sprint 2 onyx:0>
onyx:0> stdout iobuf 1 sprint 512 onyx:0> stderr iobuf 1 sprint 0 onyx:0>
onyx:0> 2 1 0 onyx:3> 1 ipop pstack 0 2 onyx:2>
onyx:0> istack 1 sprint (0 0 0) onyx:0>
onyx:0> (1 2) {add 1 sprint} thread join `Done\n' print flush 3 Done onyx:0>
onyx:1> <$foo `foo'> $foo known 1 sprint true onyx:1> <$foo `foo'> $bar known 1 sprint false onyx:1>
onyx:0> false setlocking onyx:0> [1 2 3] lcheck 1 sprint false onyx:0> true setlocking onyx:0> [1 2 3] lcheck 1 sprint true onyx:0>
onyx:0> 1 2 le 1 sprint true onyx:0> 1 1 le 1 sprint true onyx:0> 2 1 le 1 sprint false onyx:0> 1 1.1 le 1 sprint true onyx:0> 1.1 1.1 le 1 sprint true onyx:0> 1.1 1 le 1 sprint false onyx:0> `a' `b' le 1 sprint true onyx:0> `a' `a' le 1 sprint true onyx:0> `b' `a' le 1 sprint false onyx:0>
onyx:0> [1 2 3] length 1 sprint 3 onyx:0> <$foo `foo' $bar `bar'> length 1 sprint 2 onyx:0> $foo length 1 sprint 3 onyx:0> `foo' length 1 sprint 3 onyx:0>
onyx:0> `/tmp/foo' `w' open onyx:1> dup `Hello\n' write onyx:1> dup flushfile onyx:1> close onyx:0> `/tmp/foo' `/tmp/bar' link onyx:0> `/tmp/bar' `r' open onyx:1> readline onyx:2> pstack false `Hello' onyx:2>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> dup `localhost' 7777 bindsocket onyx:1> dup listen onyx:1>
onyx:0> 5 ln 1 sprint 1.609438e+00 onyx:0> 8.5 ln 1 sprint 2.140066e+00 onyx:0>
onyx:1> <$foo `foo'> begin onyx:1> <$foo `FOO'> begin onyx:1> $foo load 1 sprint `FOO' onyx:1>
onyx:0> mutex dup lock unlock onyx:0>
onyx:0> 5 log 1 sprint 6.989700e-01 onyx:0> 8.5 log 1 sprint 9.294189e-01 onyx:0>
onyx:0> 0 {1 add dup 1 sprint dup 3 eq {pop exit} if} loop 1 2 3 onyx:0>
onyx:0> 1 2 lt 1 sprint true onyx:0> 1 1 lt 1 sprint false onyx:0> 1 1.1 lt 1 sprint true onyx:0> 1.1 1.1 lt 1 sprint false onyx:0> 1.1 1 lt 1 sprint false onyx:0> `a' `b' lt 1 sprint true onyx:0> `a' `a' lt 1 sprint false onyx:0>
onyx:0> mark pstack -mark- onyx:1>
onyx:0> `/tmp/tdir' 8@755 mkdir onyx:0> `/tmp/tdir' {1 sprint} dirforeach `.' `..' onyx:0>
onyx:0> `/tmp/fifo' mkfifo onyx:0>
onyx:0> 4 2 mod 1 sprint 0 onyx:0> 5 2 mod 1 sprint 1 onyx:0> 5 0 mod Error $undefinedresult ostack: (5 0) dstack: (-dict- -dict- -dict- -dict-) estack/istack trace (0..2): 0: --mod-- 1: -file- 2: --start-- onyx:3>
All objects that refer to code and/or data that are part of the module must directly and/or indirectly maintain a reference to the hook that is evaluated by this operator, since failing to do so would allow the garbage collector to unload the module, which could result in dangling pointers to unmapped memory regions.
Loadable modules present a problem for the garbage collector during the sweep phase. All objects that refer to memory that is dynamically mapped as part of the module must be destroyed before the module is unloaded. Destruction ordering constraints show up in other situations as well, but in the case of loadable modules, there is no reasonable solution except to explicitly order the destruction of objects. Therefore, by default, the hook that is evaluated by modload is destroyed during the second sweep pass. It is possible for a module to override what sweep pass the hook is destroyed on, in cases where there are additional ordering constraints for the objects created by a module. This isn't important from the Onyx language perspective, but is important to understand when implementing modules.
onyx:0> `/usr/local/share/onyx/nxmod/mdprompt.nxm' `modprompt_init' onyx:2> modload onyx:0>
onyx:0> mutex {`hello\n' print} monitor flush hello onyx:0>
onyx:0> `modgtk.nxm' `modgtk_init' mrequire onyx:0>
onyx:0> 3 17 mul 1 sprint 51 onyx:0> -5 -6 mul 1 sprint 30 onyx:0> 3.5 4.0 mul 1 sprint 1.400000e+01 onyx:0> -1.5 3 mul 1 sprint -4.500000e+00 onyx:0>
onyx:0> mutex 1 sprint -mutex- onyx:0>
onyx:0> `a' `b' `c' 2 nbpop pstack `c' onyx:1>
onyx:0> [`a'] [`b'] [`c'] 3 ncat 1 sprint [`a' `b' `c'] onyx:0> (`a') (`b') (`c') 3 ncat 1 sprint (`a' `b' `c') onyx:0> `a' `b' `c' 3 ncat 1 sprint `abc' onyx:0>
onyx:0> `a' `b' `c' `d' `e' 4 ndn pstack `b' `e' `d' `c' `a' onyx:5>
onyx:0> `a' `b' `c' 2 ndup pstack `c' `b' `c' `b' `a' onyx:5>
onyx:0> mutex mutex ne 1 sprint true onyx:0> mutex dup ne 1 sprint false onyx:0> $foo `foo' ne 1 sprint false onyx:0> $foo $bar ne 1 sprint true onyx:0> true false ne 1 sprint true onyx:0> true true ne 1 sprint false onyx:0> 1 1 ne 1 sprint false onyx:0> 1 2 ne 1 sprint true onyx:0> 1.0 1 ne 1 sprint false onyx:0> 1.0 1.1 ne 1 sprint true onyx:0>
onyx:0> 0 neg 1 sprint 0 onyx:0> 5 neg 1 sprint -5 onyx:0> -5 neg 1 sprint 5 onyx:0> 3.14 neg 1 sprint -3.140000e+00 onyx:0> -3.14 neg 1 sprint 3.140000e+00 onyx:0>
onyx:0> `a' `b' `c' onyx:3> nip pstack `c' `a' onyx:2>
onyx:0> `/tmp/foo' `w' open onyx:1> dup nonblocking 1 sprint false onyx:1> dup true setnonblocking onyx:1> dup nonblocking 1 sprint true onyx:1>
onyx:0> true not 1 sprint false onyx:0> false not 1 sprint true onyx:0> 1 not 1 sprint -2 onyx:0>
onyx:0> `a' `b' `c' 2 npop pstack `a' onyx:1>
onyx:0> 1000 nsleep onyx:0>
onyx:0> null pstack null onyx:1>
onyx:0> `a' `b' `c' `d' `e' 4 nup pstack `d' `c' `b' `e' `a' onyx:5>
onyx:0> onyxdict 1 sprint <$rpath_pre -array- $rpath_post -array- $mpath_pre -array- $mpath_post -array-> onyx:0>
onyx:0> `/tmp/foo' `w' open pstack -file- onyx:1>
onyx:0> false false or 1 sprint false onyx:0> true false or 1 sprint true onyx:0> 5 3 or 1 sprint 7 onyx:0>
onyx:0> 1 2 3 ostack pstack (1 2 3) 3 2 1 onyx:4>
onyx:0> [1 [2 3] 4] <$w 20 $p `_' $j $c $r 1> output `\n' print flush ___[1 -array- 4]____ onyx:0> [1 [2 3] 4] <$w 20 $p `_' $j $c $r 2> output `\n' print flush ____[1 [2 3] 4]_____ onyx:0> 4242 <$s $+> output `\n' print flush +4242 onyx:0> `0x' print 4242 <$b 16> output `\n' print flush 0x1092 onyx:0> `0x' 4242 <$b 16> outputs cat <$w 10 $p `.'> onyx:2> output `\n' print flush ....0x1092 onyx:0> `0x' print 4242 <$w 8 $p `0' $b 16> output `\n' print flush 0x00001092 onyx:0>
onyx:0> [1 [2 3] 4] <$w 20 $p `_' $j $c $r 1> outputs print `\n' print flush ___[1 -array- 4]____ onyx:0> [1 [2 3] 4] <$w 20 $p `_' $j $c $r 2> outputs print `\n' print flush ____[1 [2 3] 4]_____ onyx:0> 4242 <$s $+> outputs print `\n' print flush +4242 onyx:0> `0x' print 4242 <$b 16> outputs print `\n' print flush 0x1092 onyx:0> `0x' 4242 <$b 16> outputs cat <$w 10 $p `.'> outputs onyx:1> print `\n' print flush ....0x1092 onyx:0> `0x' print 4242 <$w 8 $p `0' $b 16> outputs print `\n' print flush 0x00001092 onyx:0>
onyx:0> outputsdict 0 sprint -dict- onyx:0>
onyx:0> 0 1 2 over pstack 1 2 1 0 onyx:4>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> dup `localhost' 7777 bindsocket onyx:1> dup listen onyx:1> dup accept onyx:2> dup peername 1 sprint <$family $AF_INET $address 2130706433 $port 33746> onyx:2>
onyx:0> pid 1 sprint 80624 onyx:0>
onyx:0> pipe onyx:2> $wfile exch def onyx:1> $rfile exch def onyx:0> wfile `foo\n' write onyx:0> wfile flushfile onyx:0> rfile readline pop 1 sprint `foo' onyx:0>
onyx:0> 1 2 onyx:2> pstack 2 1 onyx:2> pop onyx:1> pstack 1 onyx:1>
onyx:0> <stdout <$POLLOUT null> stderr <$POLLWRNORM null>> dup 0 poll onyx:2> 2 sprint 2 sprint [-file- -file-] <-file- <$POLLWRNORM true> -file- <$POLLOUT true>> onyx:0>
onyx:0> ppid 1 sprint 352 onyx:0>
onyx:0> `Hi\n' print flush Hi onyx:0>
onyx:0> product pstack `Canonware Onyx' onyx:1>
onyx:0> `a' 1 mark $foo [1 2 3] (4 5 6) onyx:6> pstack (4 5 6) [1 2 3] $foo -mark- 1 `a' onyx:6>
onyx:0> 3 array dup 1 `a' put 1 sprint [null `a' null] onyx:0> dict dup $foo `foo' put 1 sprint <$foo `foo'> onyx:0> 3 string dup 1 97 put 1 sprint `\x00a\x00' onyx:0>
onyx:0> 4 array dup 1 [`a' `b'] putinterval 1 sprint [null `a' `b' null] onyx:0> 4 string dup 1 `ab' putinterval 1 sprint `\x00ab\x00' onyx:0>
onyx:0> pwd onyx:1> pstack `/usr/local/bin' onyx:1>
onyx:0> stdin cvx start onyx:0> estack 1 sprint (--start-- -file- --start-- -file- --estack--) onyx:0> quit onyx:0> estack 1 sprint (--start-- -file- --estack--) onyx:0>
onyx:0> 0 srand onyx:0> rand 1 sprint 9018578418316157091 onyx:0> rand 1 sprint 8979240987855095636 onyx:0>
onyx:0> `/tmp/foo' `w+' open onyx:1> dup `Hello\n' write onyx:1> dup flushfile onyx:1> dup 0 seek onyx:1> dup 10 string read onyx:3> pop 1 sprint `Hello\n'
onyx:0> `/tmp/foo' `w+' open onyx:1> dup `Hello\n' write onyx:1> dup `Goodbye\n' write onyx:1> dup 0 seek onyx:1> dup readline 1 sprint 1 sprint false `Hello' onyx:1> dup readline 1 sprint 1 sprint false `Goodbye' onyx:1> dup readline 1 sprint 1 sprint true `' onyx:1>
onyx:0> `bar' `foo' symlink onyx:0> `foo' readlink 1 sprint `bar' onyx:0>
onyx:0> realtime 1 sprint 993539837806479000 onyx:0>
onyx:0> $AF_INET $SOCK_DGRAM socket onyx:1> dup `localhost' 7777 bindsocket onyx:1> dup true setnonblocking onyx:1> dup 10 string recv onyx:2> 1 sprint `hello' onyx:1>
onyx:0> `/tmp/tdir' 8@755 mkdir onyx:0> `/tmp/tdir' `/tmp/ndir' rename onyx:0> `/tmp/ndir' {1 sprint} dirforeach `.' `..' onyx:0>
onyx:0> 3 {`hi' 1 sprint} repeat `hi' `hi' `hi' onyx:0>
onyx:0> `modgtk/modgtk_defs.nx' require onyx:0>
onyx:0> `/tmp/tdir' 8@755 mkdir onyx:0> `/tmp/tdir' rmdir onyx:0>
onyx:0> 3 2 1 0 onyx:4> pstack 0 1 2 3 onyx:4> 3 1 roll onyx:4> pstack 1 2 0 3 onyx:4> 3 -2 roll onyx:4> pstack 2 0 1 3 onyx:4> 4 0 roll onyx:4> pstack 2 0 1 3 onyx:4>
onyx:0> -1.51 round 1 sprint -2 onyx:0> -1.49 round 1 sprint -1 onyx:0> 0 round 1 sprint 0 onyx:0> 1.49 round 1 sprint 1 onyx:0> 1.51 round 1 sprint 2 onyx:0>
onyx:0> 1 2 3 4 5 2 rot pstack clear 3 2 1 5 4 onyx:0> 1 2 3 4 5 -2 rot pstack clear 2 1 5 4 3 onyx:0>
onyx:0> (1 2 3 4) dup sadn 1 sprint (2 3 4 1) onyx:0>
onyx:0> (1 2 3 4) dup saup 1 sprint (4 1 2 3) onyx:0>
onyx:0> (2 1 0) dup sbdup pstack (2 1 0 2) onyx:1>
onyx:0> (1 2 3) dup sbpop pstack 1 (2 3) onyx:2>
onyx:0> (0) dup 1 sbpush onyx:1> pstack (1 0) onyx:1>
onyx:0> (1 2 3 4) dup sclear pstack () onyx:1>
onyx:0> (3 mark 1 0) dup scleartomark pstack (3) onyx:1>
onyx:0> (1 2) scount 1 sprint 2 onyx:0>
onyx:0> (3 mark 1 0) scounttomark 1 sprint 2 onyx:0>
onyx:0> (3 2 1 0) dup sdn pstack (3 1 0 2) onyx:1>
onyx:0> (1) dup sdup 1 sprint (1 1) onyx:0>
onyx:0> `abcabc' `ab' search pstack clear true `' `ab' `cabc' onyx:0> `abcabc' `ca' search pstack clear true `ab' `ca' `bc' onyx:0> `abcabc' `cb' search pstack clear false `abcabc' onyx:0>
onyx:0> `/tmp/foo' `w+' open onyx:1> dup `Hello\n' write onyx:1> dup 0 seek onyx:1> readline pstack false `Hello' onyx:2>
onyx:0> self 1 sprint -thread- onyx:0>
onyx:0> $AF_INET $SOCK_DGRAM socket onyx:1> dup `localhost' 7777 connect onyx:1> dup `hello' send onyx:2> 1 sprint 5 onyx:1>
onyx:0> `ftp' serviceport 1 sprint 21 onyx:0>
onyx:0> 1001 setegid 1 sprint false onyx:0> 0 setegid 1 sprint true onyx:0>
onyx:0> $foo `foo' setenv onyx:0> envdict $foo known 1 sprint true onyx:0> envdict $foo get 1 sprint `foo' onyx:0> $foo unsetenv onyx:0> envdict $foo known 1 sprint false onyx:0>
onyx:0> 1001 seteuid 1 sprint false onyx:0> 0 seteuid 1 sprint true onyx:0>
onyx:0> 1001 setgid 1 sprint false onyx:0> 0 setgid 1 sprint true onyx:0>
onyx:0> `/tmp/stderr' `w' open dup 0 setiobuf setgstderr onyx:0> () {stderr `Some text\n' write} thread join onyx:0> `/tmp/stderr' `r' open readline pop 1 sprint `Some text' onyx:0>
lawine:~> cat /tmp/stdin 1 2 3 pstack lawine:~> onyx Canonware Onyx, version 3.1.0. onyx:0> `/tmp/stdin' `r' open cvx setgstdin onyx:0> () {stdin eval} thread join 3 2 1 onyx:0>
onyx:0> `/tmp/stdout' `w' open dup 0 setiobuf setgstdout onyx:0> () {`Some text\n' print} thread join onyx:0> `/tmp/stdout' `r' open readline pop 1 sprint `Some text' onyx:0>
onyx:0> stdout iobuf 1 sprint 512 onyx:0> stdout 0 setiobuf onyx:0> stdout iobuf 1 sprint 0 onyx:0>
onyx:0> currentlocking 1 sprint false onyx:0> true setlocking onyx:0> currentlocking 1 sprint true onyx:0>
onyx:0> `/tmp/foo' `w' open onyx:1> dup nonblocking 1 sprint false onyx:1> dup true setnonblocking onyx:1> dup nonblocking 1 sprint true onyx:1>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> dup $SO_OOBINLINE sockopt 1 sprint 0 onyx:1> dup $SO_OOBINLINE 1 setsockopt onyx:1> dup $SO_OOBINLINE sockopt 1 sprint 1 onyx:1>
onyx:0> `/tmp/stderr' `w' open dup 0 setiobuf setstderr onyx:0> stderr `Some text\n' write onyx:0> `/tmp/stderr' `r' open readline pop 1 sprint `Some text' onyx:0>
lawine:~> cat /tmp/stdin 1 2 3 pstack lawine:~> onyx Canonware Onyx, version 3.1.0. onyx:0> `/tmp/stdin' `r' open cvx setstdin onyx:0> stdin eval 3 2 1 onyx:3>
onyx:0> `/tmp/stdout' `w' open dup 0 setiobuf setstdout onyx:0> `Some text\n' print onyx:0> gstdout setstdout onyx:0> `/tmp/stdout' `r' open readline pop 1 sprint `Some text' onyx:0>
onyx:0> 1001 setuid 1 sprint false onyx:0> 0 setuid 1 sprint true onyx:0>
onyx:0> (1 2 3) dup sexch pstack (1 3 2) onyx:1>
onyx:0> 4 1 shift 1 sprint 8 onyx:0> 4 -1 shift 1 sprint 2 onyx:0>
onyx:0> (3 2 1 0) dup 2 sibdup pstack (3 2 1 0 1) onyx:1>
onyx:0> (0 1 2 3) dup 2 sibpop pstack 2 (0 1 3) onyx:2>
onyx:0> (3 2 1 0) dup 2 sidup onyx:1> 1 sprint (3 2 1 0 2) onyx:0>
onyx:0> condition mutex dup lock ostack onyx:3> {dup lock exch signal unlock} onyx:4> thread 3 1 roll onyx:3> dup 3 1 roll onyx:4> wait unlock join onyx:0>
onyx:0> 0 sin 1 sprint 0.000000e+00 onyx:0> 1.570796 sin 1 sprint 1.000000e+00 onyx:0> 0.7853982 sin 1 sprint 7.071068e-01 onyx:0>
onyx:0> (3 2 1 0) dup 2 sipop pstack 2 (3 1 0) onyx:2>
onyx:0> (1 2 3 4) dup 2 snbpop pstack [1 2] (3 4) onyx:2>
onyx:0> (5 4 3 2 1 0) dup 4 sndn pstack (5 4 2 1 0 3) onyx:1>
onyx:0> (3 2 1 0) dup 2 sndup pstack (3 2 1 0 1 0) onyx:1>
onyx:0> (2 1 0) dup snip pstack 1 (2 0) onyx:2>
onyx:0> (1 2 3 4) dup 2 snpop pstack [3 4] (1 2) onyx:2>
onyx:0> (5 4 3 2 1 0) dup 4 snup pstack (5 4 0 3 2 1) onyx:1>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> $AF_LOCAL $SOCK_DGRAM socket onyx:2>
onyx:0> $AF_LOCAL $SOCK_STREAM socketpair onyx:2> pstack -file- -file- onyx:2>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> dup `localhost' bindsocket onyx:1> dup sockname 1 sprint <$family $AF_INET $address 2130706433 $port 33745> onyx:1> close onyx:0> $AF_LOCAL $SOCK_STREAM socket onyx:1> dup `/tmp/socket' bindsocket onyx:1> dup sockname 1 sprint <$family $AF_LOCAL $path `/tmp/socket'> onyx:1>
onyx:0> $AF_INET $SOCK_STREAM socket onyx:1> dup $SO_SNDBUF sockopt 1 sprint 16384 onyx:1>
onyx:0> (2 1 0) dup sover pstack (2 1 0 1) onyx:1>
onyx:0> (1 2) dup spop onyx:2> pstack 2 (1) onyx:2>
onyx:0> [1 [2 3] 4] onyx:1> dup 0 sprint -array- onyx:1> dup 1 sprint [1 -array- 4] onyx:1> dup 2 sprint [1 [2 3] 4] onyx:1>
onyx:0> [1 [2 3] 4] onyx:1> dup 0 sprints print `\n' print flush -array- onyx:1> dup 1 sprints print `\n' print flush [1 -array- 4] onyx:1> dup 2 sprints print `\n' print flush [1 [2 3] 4] onyx:1>
onyx:0> sprintsdict 0 sprint -dict- onyx:0>
onyx:0> (0) dup 1 spush onyx:1> pstack (0 1) onyx:1>
onyx:0> 4 sqrt 1 sprint 2.000000e+00 onyx:0> 2.0 sqrt 1 sprint 1.414214e+00 onyx:0>
onyx:0> 5 srand onyx:0>
onyx:0> (3 2 1 0) onyx:1> dup 3 1 sroll pstack (3 0 2 1) onyx:1> dup 3 -2 sroll pstack (3 1 0 2) onyx:1> dup 4 0 sroll pstack (3 1 0 2) onyx:1>
onyx:0> (1 2 3 4 5) dup 2 srot 1 sprint (4 5 1 2 3) onyx:0> (1 2 3 4 5) dup -2 srot 1 sprint (3 4 5 1 2) onyx:0>
onyx:0> stack onyx:1> pstack ()
onyx:0> stdin cvx start onyx:0> quit onyx:0>
onyx:0> `/tmp' status 1 sprint <$dev 134405 $ino 2 $mode 17407 $nlink 5 $uid 0 $gid 0 $rdev 952 $size 3584 $atime 994883041000000000 $mtime 994883041000000000 $ctime 994883041000000000 $blksize 0 $blocks 8> onyx:0>
onyx:0> stderr pstack -file- onyx:1>
onyx:0> stdin pstack -file- onyx:1>
onyx:0> stdout pstack -file- onyx:1>
onyx:0> {stop} stopped 1 sprint true onyx:0>
onyx:0> {stop} stopped 1 sprint true onyx:0> {} stopped 1 sprint false onyx:0>
onyx:0> 3 string 1 sprint `\x00\x00\x00' onyx:0> onyx:0> 0 string 1 sprint `' onyx:0>
onyx:0> (2 1 0) dup stuck pstack (2 0 1 0) onyx:1>
onyx:0> 5 3 sub 1 sprint 2 onyx:0> -3 4 sub 1 sprint -7 onyx:0> 5.1 1.1 sub 1 sprint 4.000000e+00 onyx:0> 5 1.0 sub 1 sprint 4.000000e+00 onyx:0> -3.0 4.1 sub 1 sprint -7.100000e+00 onyx:0>
onyx:0> (2 1 0) dup sunder pstack (2 1 1 0) onyx:1>
onyx:0> (3 2 1 0) dup sup pstack (3 0 2 1) onyx:1>
onyx:0> `/tmp/foo' `w' open onyx:1> dup `Hello\n' write onyx:1> dup flushfile onyx:1> close onyx:0> `/tmp/foo' `/tmp/bar' symlink onyx:0> `/tmp/bar' `r' open onyx:1> readline onyx:2> pstack false `Hello' onyx:2>
onyx:0> [`/usr/bin/which' `onyx'] system /usr/local/bin/onyx onyx:1> 1 sprint 0 onyx:0>
onyx:0> systemdict 0 sprint -dict- onyx:0>
onyx:0> `/tmp/foo' `w+' open onyx:1> dup tell 1 sprint 0 onyx:1> dup `Hello\n' write onyx:1> dup tell 1 sprint 6 onyx:1>
onyx:0> `/blah' `e' test 1 sprint false onyx:0> `/tmp' `e' test 1 sprint true onyx:0>
onyx:0> (1 2) {add 1 sprint} thread join `Done\n' print flush 3 Done onyx:0>
onyx:0> self threaddstack 1 sprint (-dict- -dict- -dict- -dict-) onyx:0>
onyx:0> self threadestack 1 sprint (-file- -array- --eval-- --ifelse-- -array- --for-- -array-) onyx:0>
onyx:0> self threadistack 1 sprint (0 0 0 0 7 0 3) onyx:0>
onyx:0> self threadostack 1 sprint (-stack- -stack- -stack- -stack-) onyx:0>
onyx:0> threadsdict 1 sprint <-thread- null> onyx:0>
onyx:0> $unregistered throw Error $unregistered ostack: () dstack: (-dict- -dict- -dict- -dict-) estack/istack trace (0..1): 0: -file- 1: --start-- onyx:1> pstack -file- onyx:1>
onyx:0> condition mutex dup lock ostack onyx:3> {dup lock exch signal unlock} onyx:4> thread 3 1 roll onyx:3> dup 3 1 roll onyx:4> 1000000000 timedwait 1 sprint unlock join false onyx:0> mutex condition 1 idup dup lock 1000000000 timedwait 1 sprint unlock true onyx:0>
onyx:0> `1 2' token pstack clear true 1 `2' onyx:0> `foo' token pstack clear true foo `' onyx:0> `foo ' token pstack clear true foo `' onyx:0> `foo ' token pstack clear true foo ` ' onyx:0> `foo$bar' token pstack clear true foo `$bar' onyx:0> `foo{}' token pstack clear true foo `{}' onyx:0> ` ' token pstack clear false onyx:0>
onyx:0> -1.51 trunc 1 sprint -1 onyx:0> -1.49 trunc 1 sprint -1 onyx:0> 0 trunc 1 sprint 0 onyx:0> 1.49 trunc 1 sprint 1 onyx:0> 1.51 trunc 1 sprint 1 onyx:0>
onyx:0> `/tmp/foo' `w+' open onyx:1> dup `Hello\n' write onyx:1> dup flushfile onyx:1> dup 0 seek onyx:1> dup 10 string read onyx:3> pop 1 sprint `Hello\n' onyx:1> dup 3 truncate onyx:1> dup 0 seek onyx:1> dup 10 string read onyx:3> pop 1 sprint `Hel' onyx:1>
onyx:0> true 1 sprint true onyx:0>
onyx:0> mutex dup onyx:2> trylock 1 sprint false onyx:1> trylock 1 sprint true onyx:0>
onyx:0> `a' `b' `c' oonyx:3> tuck pstack `c' `b' `c' `a' onyx:4>
onyx:0> true type 1 sprint booleantype onyx:0>
onyx:0> uid 1 sprint 1001 onyx:0>
onyx:0> 8@777 umask <$b 8 $w 3 $p `0'> output `\n' print flush 022 onyx:0>
onyx:0> $foo `foo' def onyx:0> currentdict $foo undef onyx:0> currentdict $foo undef onyx:0>
onyx:0> 0 1 2 under pstack 2 1 1 0 onyx:4>
onyx:0> `/tmp/foo' `w' open onyx:1> dup `Hello\n' write onyx:1> dup flushfile onyx:1> close onyx:0> `/tmp/foo' unlink onyx:0> `/tmp/foo' `r' open Error $invalidfileaccess ostack: (`/tmp/foo' `r') dstack: (-dict- -dict- -dict- -dict-) estack/istack trace (0..2): 0: --open-- 1: -file- 2: --start-- onyx:3>
onyx:0> mutex dup lock unlock onyx:0>
onyx:0> $foo `foo' setenv onyx:0> envdict $foo known 1 sprint true onyx:0> envdict $foo get 1 sprint `foo' onyx:0> $foo unsetenv onyx:0> envdict $foo known 1 sprint false onyx:0>
onyx:0> 0 {inc dup 1 sprint}{dup 3 lt} until pop 1 2 3 onyx:0> 0 {inc dup 1 sprint exit}{dup 3 lt} until pop 1 onyx:0>
onyx:0> `a' `b' `c' `d' up pstack `c' `b' `d' `a' onyx:4>
onyx:0> userdict 1 sprint <> onyx:0>
onyx:0> version pstack `1.0.0' onyx:1>
onyx:0> condition mutex dup lock ostack onyx:3> {dup lock exch signal unlock} onyx:4> thread 3 1 roll onyx:3> dup 3 1 roll onyx:4> wait unlock join onyx:0>
onyx:0> [`/bin/date'] forkexec dup 1 sprint waitpid 1 sprint 6516 Sat Jul 13 20:47:54 PDT 2002 0 onyx:0>
onyx:0> $foo where pstack clear false onyx:0> $threaddict where pstack clear true <$threaddict -dict- $userdict -dict- $currenterror -dict- $errordict -dict- $resume --stop--> onyx:0>
onyx:0> 0 {dup 3 lt}{inc dup 1 sprint} while pop 1 2 3 onyx:0> 0 {dup 3 lt}{inc dup 1 sprint exit} while pop 1 onyx:0>
onyx:0> `/tmp/foo' `w+' open onyx:1> dup `Hello\n' write pop onyx:1> dup 0 seek onyx:1> dup readline 1 sprint 1 sprint false `Hello' onyx:1>
onyx:0> {1 2 3} xcheck 1 sprint true onyx:0> [1 2 3] xcheck 1 sprint false onyx:0>
onyx:0> true false xor 1 sprint true onyx:0> true true xor 1 sprint false onyx:0> 5 3 xor 1 sprint 6 onyx:0>
onyx:0> 0 100000 {1 add yield} repeat 1 sprint 100000 onyx:0>