Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_SRC_3_19910112 - tvedit/define.sai
There are no other files named define.sai in the archive.
COMMENT  SOURCE!FILE "library" of Pentti's favorite SAIL definitons;

EXTERNAL INTEGER  !skip!;

DEFINE
	! = "COMMENT",
	SUBROUTINE = "SIMPLE PROCEDURE",
	FOREVER = "WHILE TRUE",
	NIL = "NULL",
	ANDIF = "AND", ORIF = "OR";

		COMMENT  The above two logical connectives are intended 
		!	to be used as a reminder of the fact that the 
		!	order of evaluating the expression matters.  
		!	Admittedly they sound funny if the expression 
		!	is not the condition of a conditional what-not.
		;

DEFINE
	inc(n) = "n _ n+1",
	dec(n) = "n _ n-1",

		COMMENT  WARNING:  Use extra parentheses when using 
		!	INC and DEC as part of a condition such as 
		!		IF  (dec(n)) < 0  THEN  ...
		!	It expands to
		!		IF  (n _ n-1) < 0  THEN  ...
		!	whereas
		!		IF  dec(n) < 0  THEN  ...
		!	expands to
		!		IF  n _ n-1 < 0  THEN  ...
		!	meaning
		!		IF  n _ (n-1 < 0)  THEN  ...
		;

	lh (x) = "((x) LSH -18)",
 	rh (x) = "((x) LAND '777777)",

	upto = "STEP 1 UNTIL",
	downto = "STEP -1 UNTIL",

	empty = "NOT length",
	nonEmpty = "length",

	first (str)= "(str)[1 FOR 1]",
	rest (str) = "(str)[2 TO INF]",
	most (str) = "(str)[1 FOR INF-1]",
	last (str) = "(str)[INF FOR 1]",

        zillion = '765432;
DEFINE
	BEL =	  '7,
	TAB  =	 '11,
	LF =  	 '12,
	FF =  	 '14,
	CR =  	 '15,
	ESC = 	 '33,
	tnxEOL=  '37,
	space =  '40,
	DECALTM='175,		COMMENT  %] = };
	DEL = 	'177, 		COMMENT  DEL or RUBOUT;
	CRLF =  "(CR&LF)";

DEFINE
	acDef = "DEFINE rf='12, sp='16, p='17, user='15";

		COMMENT  P, SP, and RF are holy SAIL AC's.
		!	These definitions are used in START/QUICK!CODE 
		!	blocks only.
		;

DEFINE
	closeFile = "cFile",	COMMENT  To match OPENFILE;
	halt.f = "START!CODE HALTF END";