The S-Lang interpreter comes with a pre-defined set of functions
for many common operations. This set of functions is known
as the S-Lang Run Time Library and is documented
in ahelp - where the functions are labelled with a context of slangrtl,
so "ahelp -c slangrtl" will list them - and in the
slangrtl reference guide of the S-Lang library.
The version of S-Lang included in CIAO 3.2 is 1.4.9.
For more information on S-Lang try "ahelp slang" and
the "Guide to the S-Lang Language" available at
http://www.s-lang.org/docs.html.
The functions in the S-Lang Run Time Library are available
from ChIPS, Sherpa, and slsh.
This command lists all the functions in the S-lang Run Time
Library, together with this file.
This command lists all the functions in the S-lang Run Time
Library which contain the string "array".
chips> vmessage( "The time is %s", time() )
The time is Fri Jun 13 09:52:57 2003
Here we call two functions from the library - vmessage()
and time() - to print out the current time.
Since the code was being run from ChIPS - it could have been run
unchanged from Sherpa - there was no need to
terminate the line with a semi-colon, as required by S-Lang,
since this is automatically added for you.
The same routines can also be used with slsh. Here we have a
text file containing the above line - this time with a
trailing semi-colon since it is not being evaluated from
ChIPS or Sherpa - which we then execute using slsh.
unix% cat time.sl
vmessage( "The time is %s", time );
unix% slsh time.sl
The time is Fri Jun 13 09:56:35 2003
Since the time() function does not take any arguments we
do not need to include "()" after its name.
The provide(), require(), append_to_slang_load_path(), prepend_to_slang_load_path(), reverse(), shift(), and _featurep() functions have been added to the S-Lang Run-Time Library in CIAO 3.2. Use "ahelp <name>" for information on each of these functions.
The cumsum function is now available from ChIPS and Sherpa.
Prior to CIAO 3.1 only code evaluated by slsh could use
this function.
The ahelp documentation was updated in CIAO 3.1 to include
the variables provided by the S-Lang run-time library. The
following variables are now documented (use "ahelp variable" to
view):
_NARGS; _auto_declare; _debug_info; _slang_doc_dir; _slang_version;
_slang_version_string; _slangtrace; _traceback; and errno.
The information for the ahelp pages on the S-Lang Run-Time Library
functions and variables was taken from the
Intrinsic Function Reference document.
|