About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: December 2006

URL: http://cxc.harvard.edu/ciao3.4/slangrtl.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 slangrtl Context: slangrtl

Synopsis

S-Lang Run Time Library

Description

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.

Example 1

ahelp -c slangrtl

This command lists all the functions in the S-lang Run Time Library, together with this file.

Example 2

ahelp slangrtl /array/

This command lists all the functions in the S-lang Run Time Library which contain the string "array".

Example 3

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.

Example 4

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.

CHANGES IN CIAO 3.2

New functions

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.

CHANGES IN CIAO 3.1

Availability of cumsum

The cumsum function is now available from ChIPS and Sherpa. Prior to CIAO 3.1 only code evaluated by slsh could use this function.

New documentation

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.

ACKNOWLEDGEMENTS

The information for the ahelp pages on the S-Lang Run-Time Library functions and variables was taken from the Intrinsic Function Reference document.

See Also

slang
slsh
Hardcopy (PDF): A4 | Letter
Last modified: December 2006



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.