next up previous contents
Next: 4.1.6 Library registry Up: 4.1 Structure CM Previous: 4.1.4 Path anchors   Contents

4.1.5 Setting CM variables

CM variables are used by the conditional compilation system (see Section 7.1). Some of these variables are predefined, but the user can add new ones and alter or remove those that already exist.


  val symval : string -> int option controller

Function CM.symval returns a get- set-pair for the symbol whose name string was specified as the argument. Note that the get- set-pair operates over type int option; a value of NONE means that the variable is not defined.

Examples:


  #get (CM.symval "X") ();       (* query value of X *)
  #set (CM.symval "Y") (SOME 1); (* set Y to 1 *)
  #set (CM.symval "Z") NONE;     (* remove definition for Z *)

Some care is necessary as CM.symval does not check whether the syntax of the argument string is valid. (However, the worst thing that could happen is that a variable defined via CM.symval is not accessible6 because there is no legal syntax to name it.)



Matthias Blume
2001-07-19