Get value from the standard input stream

get-instruction = get input-target {[,] input-target}
input-target = target | name : type-expression

The get instruction is a simple means of reading in values from the standard input stream. It is not meant to replace a comprehensive input/output routine library. The instruction is not expected to survive in future versions of Slim.

The get instruction forms an input item by skipping characters until a non-separator character (not a blank, tab, comma, semi-colon or end-of-line) is found. The subsequent characters are then parsed into a numeric, set, list or string value, depending on whether the starting character is a digit, left curly bracket, left square bracket or open quote, respectively.

Numeric input items have to conform to the syntax rules that would apply if the corresponding values were written as part of the program. Sets and lists must be specified by simple enumeration of values acceptable to get and separated by spaces. String values may not include escape sequences. A character sequence that cannot be parsed, is scanned until the next separator character is encountered. The characters between the separators are then treated as a string value.

The value corresponding to the input item is then assigned to the first target, following the same rules as apply to assignments. The next input item is then formed and assigned to the next target, and so on.

If a target used in a get instruction includes a name that has not been defined prior to the get instruction, the name is implicitly defined to belong to a variable of type Entity. Target variables can be defined as part of the get instruction by following the name of the variable by a colon and a type expression.


Herman Venter

This is Slim documentation as snarfed on 27 May 1999 by dB.