IAT command line usage guide
The Interactive AmbientTalk shell understands several command line parameters. This can be helpful to make executable scripts to directly run your Ambienttalk program. The scripts iat.bat or iat.sh already make use of this.
The following is an exhaustive list of possible command line options.
iat evaluates the code in the argument
file, if one is given, then enters a read-eval-print loop.
Unless -p was specified, then it prints out the last evaluated expression and quits.
iat [options] [file] [arguments]
|-i, --init||init-file: specifies which file to load as the preamble of the language (the content of this file is evaluated in the context of the global lexical root). The default initiatisation code file is located at ''at/init/init.at''. This is useful for defining your own "language extensions".|
|-o, --objectpath||specifies the objectpath, a list of 'name=directory' pairs separated by ':' (UNIX/Mac) or ';' (Windows) which bind global namespace names to the necessary libraries. The objectpath is for AmbientTalk what the classpath is for Java. For each 'name=directory' pair, a slot named ''name'' is added to the global ''lobby'' object, bound to a namespace pointing to the given directory. Hence, evaluating ''lobby.name.foo'' in AmbientTalk enables access to the file ''directory/foo.at''. Thanks to the objectpath, AmbientTalk programs remain free of absolute path names when loading other AmbientTalk files. If this option is present, any setting of the environment variable
|-e, --eval||codestring: evaluates the given codestring and ignores the filename.|
|-p, --print||print value of last evaluated expression, then quit instead of entering REPL.|
|-n, --network||specify the name of the overlay network to join. Only AmbientTalk VMs started using the same name will be discoverable and will be able to discover this VM. This is primarily useful for debugging or demo purposes, if you don't want other programs to interfere.|
|-a, --ip||specify the ip address used for service discovery|
|-h, --help||display help, then quit|
|-v, --version||display version information, then quit|
|-q, --quiet||quiet mode - don't print welcome message or any prompts|
|-j, --nojline||disables http://jline.sourceforge.net JLine support, useful on platforms that do not support this library such as Android.|
|-d, --Xdebug||enables debugging support for all actors created within this AmbientTalk virtual machine.|
|-l, --log||specifies the logging priorities for the interpreter execution. Similar to -o option it expects a list of 'loggerName=priority' pairs separated by ':' (UNIX/Mac) or ';' (Windows), where priority is one of DEBUG, WARN, INFO, ERROR, FATAL and logName is one of
The contents of this file will be evaluated by AmbientTalk in the context of an object whose lexical scope refers to the
root object and whose parent is
nil. The object is accessible by evaluating
self at top-level.
Arguments are passed to the AmbientTalk program. They can be accessed as a table of text values by evaluating
The following environment variables are used by iat:
|AT_HOME||path to the AmbientTalk distribution directory, used to derive init file and at libraries|
|AT_OBJECTPATH||the default objectpath to use, if none is specified using
-p was not specified on the command line, after evaluating the main argument file (if any),
iat goes into a read-eval-print loop (REPL). The REPL prompts the user to input a (single-line) expression, evaluates it upon an
ENTER key and prints the resulting value.
Additionally, the REPL recognizes the following "commands":
|:q or :quit||Quit the interpreter, a quicker alternative than evaluating
|:l or :load filename||Load
During execution of the
iat program, the AmbientTalk Lexical root contains an object called
system. Command-line arguments are available as a table of text values via
system.argv. The system object can be used to perform basic output (
system.println) and input (