next up previous contents index
Next: The libonyx library Up: Contents Previous: Onyx Language Reference   Contents   Index

Subsections

The onyx program

onyx is a stand-alone Onyx interpreter, with an integrated command line editor. The Onyx language is documented in a separate chapter, so this chapter documents only the differences from the main Onyx language documentation.

Usage

onyx -h

onyx -V

onyx -e <expr>

onyx <file> [<args>]

Options

-e <expr>:
Execute <expr> as Onyx code.
-h:
Display usage information and exit.
-V:
Display the version number and exit.

Environment variables

ONYX_EDITOR:
By default, the command line editor uses emacs key bindings. Use this variable to explicitly set the key bindings to either ``emacs'' or ``vi''.
ONYX_MPATH:
A colon-separated list of additional paths that are searched by mrequire (documented in Section 2.3).
ONYX_RPATH:
A colon-separated list of additional paths that are searched by require (documented in Section 2.3).


Language differences

If onyx is being run interactively:

If onyx is being run non-interactively:

In addition, the following definitions exist regardless of execution mode:

path symbol modload -:
Input(s):
path:
A string that represents a module filename.
symbol:
A string that represents the symbol name of a module initialization function to be executed.
Output(s):
None.
Errors(s):
invalidfileaccess.
stackunderflow.
typecheck.
undefined.
Description:
Dynamically load a module, create a hook object that encapsulates the handle returned by dlopen(3) (hook data pointer) and the module initialization function (hook evaluation function), and evaluate the hook.
Example(s):
onyx:0> `/usr/local/share/canonware/onyx/nxmod/gtk.nxm' `_cw_modgtk_init'
onyx:2> modload
onyx:0>
module symbol mrequire -:
Input(s):
module:
A string that represents a module filename. The module is searched for in the directories listed in the ONYX_MPATH environment variable.
symbol:
A string that represents the symbol name of a module initialization function to be executed.
Output(s):
None.
Errors(s):
invalidfileaccess.
stackunderflow.
typecheck.
undefined.
undefinedfilename.
Description:
Load a module using the ONYX_MPATH environment variable.
Example(s):
onyx:0> `gtk.nxm' `_cw_modgtk_init' mrequire
onyx:0>
file require -:
Input(s):
file:
A string that represents an Onyx source filename. The file is searched for in the directories listed in the ONYX_RPATH environment variable.
Output(s):
None.
Errors(s):
stackunderflow.
typecheck.
undefinedfilename.
Description:
Execute an Onyx source file using the ONYX_RPATH environment variable.
Example(s):
onyx:0> `ls.nx' require flush
1001 1001 512 994886434000000000 .
1001 1001 512 994848629000000000 ..
1001 1001 512 994884381000000000 CVS
1001 1001 512 994884387000000000 bin
1001 1001 66 981033481000000000 .cvsignore
1001 1001 300 992069954000000000 COPYING
1001 1001 435 994831422000000000 ChangeLog
1001 1001 5084 994839465000000000 Cookfile.in
1001 1001 3633 993470163000000000 INSTALL
1001 1001 501 991968935000000000 README
1001 1001 3778 993470163000000000 aclocal.m4
1001 1001 26702 949579579000000000 config.guess
1001 1001 19814 949579579000000000 config.sub
1001 1001 101712 994840482000000000 configure
1001 1001 7812 994840477000000000 configure.in
1001 1001 5585 949579579000000000 install-sh
1001 1001 512 994845044000000000 doc
1001 1001 512 994754556000000000 lib
1001 1001 512 994830956000000000 mod
1001 1001 512 994884962000000000 test
1001 1001 3271 994884963000000000 config.log
1001 1001 3448 994884961000000000 config.cache
1001 1001 16934 994884961000000000 config.status
1001 1001 64838 994884988000000000 Cookfile.list
1001 1001 5985 994884961000000000 Cookfile
onyx:0>


next up previous contents index
Next: The libonyx library Up: Contents Previous: Onyx Language Reference   Contents   Index
Jason Evans 2001-08-21