.he 'SYSVARS''Page %'
.fo 'Steven Hardy'- % -'January 1978'
.de fl
.bb
.so \\$1
..
.de he
..
.de fo
..
.ce 2
System variables in POP11
=========================

This document lists standard POP11 variables, including operations.
There are additional functions and operations defined in the library,
which are automatically loaded if your programs use them.  The SYNTAX
demo explains standard POP11 syntax words, like IF, FUNCTION, END, etc.
.bb
\&<	This operation (of precedence 7) takes as argument
two numbers and returns TRUE if 
the first is less than the second, otherwise it returns FALSE
It will cause ERROR 45 if either  
of its arguments is not a number.
.bb
\&>	As < except that it returns TRUE if its first argument is
greater than its second.
.bb
=<	As < except that it returns TRUE if its first argument is
less than or equal to its second.
.bb
\&>=	As < except that it returns TRUE is its first argument is
greater than or equal to its second.
.bb
+	This operation (of precendence 5) adds its two arguments.
If either of its arguments is not a number it will cause ERROR 45.
.bb
-	As + except that it subtracts its second argument from its
first.
This operation can be used without a first argument, thus:
 	: -X -> Y;
.br
This is equivalent to:
 	: 0-X -> Y;
.bb
/	This operation (of precedence 3) divides its first argument
by its second.
Unlike all other arithmetic operations (which always return an integer if given two integers
as argument) this function will return a real number if the division has a remainder, that is:
 	: 3 / 4 =>
 	** 0.75
.br
.bb
.tp 10
\&*	This operation (of precedence 3) multiplies its two
arguments.
.bb
//	This operation (of precedence 3) performs integer division
on two integers.  This means there will usually be a
remainder and so it returns two results - the number of times the second
argument divides its first and the remainder.
(0 if necessary).  If, for example, we execute 10//3 -> DIV -> REM;
then DIV will be 3 and REM 1. 
If we have executed X//Y -> D -> R then D * Y + R = X will return true and
R will be smaller than Y.
.bb
=	This operation (of precedence 7) returns TRUE if its two
arguments are similar data structures, for example:
 	: "A" = "A", [A B] = [A B], 3 = 2 + 1;
.br
are all TRUE, whilst
 	: "A" = "B", [A B] = [B A], 3 = 3 + 1;
.br
are all FALSE.
a
See "==" for a stricter equality test.
.bb
/=	This operation (of precedence 7) returns the opposite of 
=.  It is defined as:
 	: OPERATION 7 /= (X,Y);
 	:	NOT(X=Y)
 	: END;
.bb
/==	This operation (of precedence 7) returns the opposite of ==.
It could be defined as:
 	: OPERATION 7 /== (X, Y);
 	:	NOT(X == Y)
 	: END;
.br
\&::	This operation (of precedence 2) takes two arguments -
any object and a list - and returns a new list whose HD (i.e. first
element) is the given object and whose TL (i.e. list of remaining
elements) is the given list.  Thus "A":: [B C D] evaluates to
[A B C D].  No matter what the values of X and Y, X=HD(X::Y) and
Y=TL(X::Y) will always evaluate to TRUE.  Notice that [A B]::[C D]
evaluates to [[A B] C D] (i.e. a list whose first element is 
the list [A B] and whose remaining elements form the list [C D]).
Notice, also, that X::Y::Z is parsed as (X::Y)::Z - not
X::(Y::Z), so that "A"::"B"::[] does not evaluate to
[A\ B] but instead produces a weird object.
(Try it and see)
(See WAL ).
.bb
\&<>	This operation (of precedence 2) takes as argument two lists and
returns a list whose elements are the elements of the first argument
followed by the elements of the second, so that [A B]<>[C D] evaluates
to [A\ B\ C\ D].
This operation could be defined as:
 	: OPERATION <> (X,Y);
 	:	IF	X = []
 	:	THEN	Y
 	:	ELSE	HD(X) :: (TL(X) <> Y)
 	:	CLOSE
 	: END
.bb
\&><	This operation (of precedence 4) concatenates two strings, for example:
 	: 'THE CAT ' >< 'AND THE DOG' =>
 	** 'THE CAT AND THE DOG'
.br
\&>< can be applied to numbers and strings as well,
in which case it returns a string containing the appropriate characters.
 	: "CAT" >< 34 =>
 	** 'CAT34'
.br
The function GENSYM uses >< and CONSWORD.
.fl /srce/usr/source/L/pop/demos/abs
.fl /srce/usr/source/L/pop/demos/alphabefore
.fl /srce/usr/source/L/pop/demos/appdata
.fl /srce/usr/source/L/pop/demos/applist
.fl /srce/usr/source/L/pop/demos/apply
.fl /srce/usr/source/L/pop/demos/ascii
.fl /srce/usr/source/L/pop/demos/atom
.fl /srce/usr/source/L/pop/demos/charin
.fl /srce/usr/source/L/pop/demos/charout
.fl /srce/usr/source/L/pop/demos/cons
.fl /srce/usr/source/L/pop/demos/consref
.fl /srce/usr/source/L/pop/demos/consword
.fl /srce/usr/source/L/pop/demos/cont
.fl /srce/usr/source/L/pop/demos/cucharout
.fl /srce/usr/source/L/pop/demos/datalist
.fl /srce/usr/source/L/pop/demos/dataword
.fl /srce/usr/source/L/pop/demos/dest
.fl /srce/usr/source/L/pop/demos/discin
.fl /srce/usr/source/L/pop/demos/discout
.fl /srce/usr/source/L/pop/demos/dl
.fl /srce/usr/source/L/pop/demos/erase
.fl /srce/usr/source/L/pop/demos/errfun
.fl /srce/usr/source/L/pop/demos/fill
.fl /srce/usr/source/L/pop/demos/false
.fl /srce/usr/source/L/pop/demos/fnprops
.fl /srce/usr/source/L/pop/demos/frozval
.fl /srce/usr/source/L/pop/demos/gensym
.fl /srce/usr/source/L/pop/demos/hd
.fl /srce/usr/source/L/pop/demos/identfn
.fl /srce/usr/source/L/pop/demos/identprops
.fl /srce/usr/source/L/pop/demos/incharitem
.fl /srce/usr/source/L/pop/demos/init
.fl /srce/usr/source/L/pop/demos/initc
.fl /srce/usr/source/L/pop/demos/isfunc
.fl /srce/usr/source/L/pop/demos/isinteger
.fl /srce/usr/source/L/pop/demos/isreal
.fl /srce/usr/source/L/pop/demos/itemread
.fl /srce/usr/source/L/pop/demos/length
.fl /srce/usr/source/L/pop/demos/maplist
.fl /srce/usr/source/L/pop/demos/member
.fl /srce/usr/source/L/pop/demos/negate
.fl /srce/usr/source/L/pop/demos/newanyarray
.fl /srce/usr/source/L/pop/demos/newarray
.fl /srce/usr/source/L/pop/demos/newassoc
.fl /srce/usr/source/L/pop/demos/newline
.fl /srce/usr/source/L/pop/demos/nil
.fl /srce/usr/source/L/pop/demos/nl
.fl /srce/usr/source/L/pop/demos/not
.fl /srce/usr/source/L/pop/demos/oneof
.fl /srce/usr/source/L/pop/demos/packword
.fl /srce/usr/source/L/pop/demos/partapply
.fl /srce/usr/source/L/pop/demos/popmess
.fl /srce/usr/source/L/pop/demos/popval
.fl /srce/usr/source/L/pop/demos/ppr
.fl /srce/usr/source/L/pop/demos/pr
.fl /srce/usr/source/L/pop/demos/prstring
.fl /srce/usr/source/L/pop/demos/random
.fl /srce/usr/source/L/pop/demos/readitem
.fl /srce/usr/source/L/pop/demos/readline
.fl /srce/usr/source/L/pop/demos/rev
.fl /srce/usr/source/L/pop/demos/setpop
.fl /srce/usr/source/L/pop/demos/sign
.fl /srce/usr/source/L/pop/demos/sp
==	This operation (of precedence 7) returns TRUE if given two identical data structures.
Thus X==X will always be TRUE. Notice that two independently created data structures may be similar
(and hence "=") but not identical.
"==" is much faster than "=" and for this reason is used in library files
where a strcit identity check is sufficient.
.bb
.fl /srce/usr/source/L/pop/demos/sort
.bb
.fl /srce/usr/source/L/pop/demos/space
.fl /srce/usr/source/L/pop/demos/subscr
.fl /srce/usr/source/L/pop/demos/subscrc
.fl /srce/usr/source/L/pop/demos/subscrl
.fl /srce/usr/source/L/pop/demos/syserr
.fl /srce/usr/source/L/pop/demos/termin
.fl /srce/usr/source/L/pop/demos/tl
.fl /srce/usr/source/L/pop/demos/true
.fl /srce/usr/source/L/pop/demos/undef
.fl /srce/usr/source/L/pop/demos/packword
.fl /srce/usr/source/L/pop/demos/updater
.fl /srce/usr/source/L/pop/demos/valof
