The A Project->Overview of A->System Fns and Vars->System variables
System variables
Home
  First Encounter
  Current Status
  GNU License
Downloads
Getting Started
  Examples
  Mississippi
Overview of A
  Structure of Data
  Syntax
  Relation to other APLs
  Language Reference
  System Fns and Vars
    System variables
    System functions
    System commands
  Functions
Where next
  Quibbles
  Materials

Vector Home

System Variables

This page has been reproduced from original A+ documentation provided by Morgan Stanley at www.aplusdev.org. Copyright remains with the authors.


Classification of System Variables

Although they are listed alphabetically by English name in this chapter, for convenient reference, the A+ system variables can be grouped, among many other ways, in five categories, dealing with:
  • error handling and debugging: Bus Error Flag, Callback Flag, Core File Size Limit, Dependency Flag, Execution Suspension Flag, Floating Point Exception Flag, K Stack, Protected Execute Flag, Segv Error Flag, Stack Information, Stop, X Events Flag;
  • versions: Compiler, Dynamic Environment, Language Level, Major Release Number, Minor Release Number, Phase of the Release, Release Code, Version;
  • implicit arguments to primitive functions: Context, Printing Precision, Random Link;
  • handling of input: Input Mode, Standard Input, Terminal Flag;
  • files: File Being Loaded.

Setting and Referencing System Variables

System variables cannot be set or referenced directly. The system functions Set System Variable, _ssv, and Get System Variable, _gsv, are used for this purpose. Most system variables can be set and referenced in this way; exceptions are noted in the individual descriptions.

In A+, variables and system variables are in completely distinct domains, with overlapping name spaces; a name's reference is determined not only by the name itself but also sometimes by the situation in which it occurs. As an example, consider the printing precision, `pp: _gsv is willing to accept 'pp' for it, whereas % considers `pp just a way of referring to pp:

     ppû5
     pp
 5
     _gsv `pp
 10
     %`pp
 5
     (_gsv 'pp'),â'pp'
 10 5

Definitions of System Variables

Bus Error Flag `busexit

This flag controls the action when a bus error occurs. If it is 0 (the default), then the usual error message is issued and execution is suspended. If it is 1 or 2, A+ exits and a core dump is taken. On Sun machines, 1 and 2 have the same effect. On AIX machines, 2 causes the FULLDUMP flag to be set, whereas 1 produces a smaller dump. If `corelim is too small to allow a dump, only the exit occurs. A Monadic Do or Protected Execute is overridden when this flag is 1 or 2.
To set up an exit and core dump on bus and segv errors, execute
     Ý `busexit `segvexit `corelim _ssv¡ (1;1;Inf)
or
     Ý `busexit `segvexit `corelim _ssv¡ (2;2;Inf)
or the like, and to re-establish the defaults, execute
     Ý `busexit `segvexit `corelim _ssv¡ 0
All messages from users reporting core files should be sent to email id aplusdev and should contain:
  • The A+ release number involved.

  •  
  • The machine on which it happened, and the machine's domain.

  •  
  • The location of the core file.

  •  
  • The output of the "where" stack. See instructions below for obtaining this output.

  •  
  • All other information you would normally include in a bug report: the application, $si, what you were doing at the time, repeatability, etc.
To get the "where" information:
  • From an XTerm, issue the command

  • dbx `which a+` corefile
    with corefile replaced by the actual filename.
     
  • After a minute or so, you'll see a (dbx) prompt. Enter

  • (dbx) where
    and grab the ensuing output, sometimes quite lengthy, and cut and paste it into your message.
     
  • Issue the command (dbx) quit to exit from dbx.

Callback Flag `Sf

The value of `Sf is either 0 or 1 (the default). See "Callback Flag" ($Sf) for the meaning of these values.

Compiler `CCID

Corresponding to the MSDE convention, identifies the compiler used to build A+. This variable is primarily intended for use by the tidyld{} tool to distinguish future 32 and 64 bit dyload objects.

Context `cx

The value of `cx is a symbol holding the name of the current context.

Core File Size Limit `corelim

The value of `corelim is the size of the largest permissible core file created by a failing A+ process; if the file size would be larger than this value the core file will not be created. A core file will always be created if the value is Inf. The default is 0, so that a core file is never created when the default setting is in effect.

Dependency Flag `Df

The value of `Df is 0 or 1 (the default). See "Dependency Flag" ($Df) for the meaning of these values.

Dynamic Environment `dyme

`dyme has the value -1 if Dynamic Load, _dyld, is not available. Otherwise, it has the value 0 in a Sun OS environment, except as noted below, 1 in an AIX environment, and 2 in Solaris and Irix.

The value is 2 for sunos.4.1.3, reflecting the use of the new Lexa compiler and support for dynamically loaded code. For developers and maintainers of _dylded functions, this change means that shared library versions will need to be built to work with this version.

To ease the conversion, the _dyld{} code will attempt to create a temporary shared library using the "old" nonshared object files, so simple uses of _dyld{} should continue to work, e.g., "xxx.o" _dyld ("_xxx";"xxx";0 0).  This automatic creation of shared libraries will most likely fail with a more complex left argument that contains libraries or other linker options. Please send aplusdev a mail message if you need any assistance with dynamically loaded code or creating shared libraries.

`dyme cannot be set.

Execution Suspension Flag `Ef

The value of `Ef is 0 or 1 (the default). See "Execution Suspension Flag" ($Ef) for the meaning of these values.

File Being Loaded `loadfile

`loadfile is a character string giving the name of the file currently being loaded. It is null if no file is in the process of being loaded. (Typing _gsv `loadfile in an Emacs session yields the Null, since the statement won't be executed while a $load is underway.)

Note that, in the case of nested loads, only the name of the innermost file is returned. Also, if the file is $loaded with a relative pathname, _gsv `loadfile returns a relative pathname.

Floating Point Exception Flag `Xfpef

The value of `Xfpef is 0 (the default) or 1. When it is 1, domain errors that result when external routines generate SIGPFEs (floating point exceptions) are suppressed. When it is 0, they are not suppressed.

Input Mode `mode

The value of `mode is either `apl (the default) or `ascii. See "Input Mode" ($mode) for their meaning.

K Stack `si

The value of `si is a nested vector. It cannot be set. It represents the K stack, which is used by the State Indicator command, $si, and whose contents are subject to change, to improve debugging; furthermore, the format of `si is likewise subject to change. This variable includes all suspensions, unlike State Indicator, which displays only the latest. At present, there are two elements for each level of suspension: an enclosed Null (as a separator between levels) and a nested vector whose (character) elements are indicators, like 'expr', and expressions, like '0ß0'.

Language Level `language

The value of `language is either `a or `aplus. It cannot be set. It is the recommended way for toolkits that are used by A+ to determine the environment.

Major Release Number `majorRelease

The value of `majorRelease is the major release number of the currently running version of A+. See "Invoking A+". It cannot be set.

Mapped Files Limit `maplim

The value of `maplim is the number of files that can be mapped concurrently; the default is 2000.

Minor Release Number `minorRelease

The value of `minorRelease is the minor release number of the currently running version of A+. See "Invoking A+". It cannot be set.

Phase of the Release `phaseOfRelease

The value of `phaseOfRelease is `alpha, `beta, or `prod, according to the currently running version of A+. See "Invoking A+ from the Shell". It cannot be set.

Printing Precision `pp

The value of `pp is a nonnegative integer less than 100; its default value is ten. It specifies the maximum total number of digits to be used in the display of a number, not counting the two digits following the e in exponential notation, with two exceptions:

If `pp is zero, then it is treated as if it were one.

If `pp is less than ten, integers are nevertheless displayed with up to ten digits.

See "Printing Precision", Format (î) "Examples", and Default Format "Examples".

Protected Execute Flag `Gf

The value of `Gf is 0 or 1 (the default). See "Protected Execute Flag" ($Gf) for the meaning of these values.

Random Link `rl

The value of `rl is a nonnegative integer. It cannot be referenced. See "Random Link" ($rl).

Release Code `releaseCode

The value of `releaseCode is a character vector composed of the characters following a+_ in the value of ATREE for the currently running version of A+. See "Invoking A+". It cannot be set.

Segv Error Flag `segvexit

This flag is exactly like the Bus Error Flag, except that it controls the action when a segv error occurs.

Stack Information `doErrorStack

Enable (1) or disable(0) the stack information on error facility. See _doErrorStack{}.

Standard Input `stdin

The values of `stdin are 1 for normal terminal input mode (the default, of course), and 0 to get the effect of Terminal Flag ($Tf). Unlike $Tf, when `stdin is 0, keyboard entries are queued to be processed when `stdin is subsequently reset to 1. Cf. the Terminal Flag system variable, `Tf.

Stop `stop

The values of `stop are 0, 1, or 2 (the default). See "Stop" ($stop) for the meaning of these values.

Terminal Flag `Tf

The value of `Tf is either 0 or 1 (the default). If 1, terminal input is normal. If 0, terminal input is ignored; see the Terminal Flag command, $Tf. Cf. the system variable `stdin, Standard Input.

Version `vers

The value of `vers is a character vector describing the currently running version of A+; it is the text following the phrase This version is that appears when A+ is invoked. It cannot be set.

X Events Flag `Xf

The value of `Xf is either 0 (the default) or 1. See "X Events Flag" ($Xf) for the meaning of these values.

Back to Home page

doc@aplusdev.org© Copyright 1995–2001 Morgan Stanley Dean Witter & Co. All rights reserved.

© British APL Association 2001
Please send any comments to Adrian Smith via adrian@causeway.co.uk - thank you.