Write values to the standard output

put expression {[,] expression} [&]

The put instruction is a simple means of writing out values to the standard output 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 put instruction can write numeric, string, set, list and map values to the output stream. Numbers are written using the shortest representations, strings without the enclosing quotes and sets and lists as simple enumerations. Maps are written out as sets of lists. Strings forming part of set or list enumerations are written out with enclosing quotes.

The characters used to separate the expressions in the put instruction are used to determine the characters used to separate the corresponding values. For example:

    put `a'`b' `c',`d', `e'
writes
    ab c,d, e
to the standard output stream. Only a single space will be used to separate output items, even if more than one is used to separate the corresponding expressions in the put instruction.

A put instruction will write a new-line sequence to the output stream, following the last output item, unless the last item is the & character.

See also: putcol and mkstr.


Herman Venter

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