perm filename SAIL.XGP[DOC,AIL]6 blob sn#177658 filedate 1975-09-23 generic text, type T, neo UTF8
/LMAR=0/XLINE=3/FONT#0=BDR30/FONT#1=BDR40/FONT#2=BDR30/FONT#3=LPT



␈↓ α∧␈↓STANFORD ARTIFICIAL INTELLIGENCE LABORATORY␈↓ 
,SEPTEMBER 1975






␈↓ α∧␈↓↓␈↓ ¬ESAIL USER MANUAL

␈↓ α∧␈↓␈↓ εPUPDATE



␈↓ α∧␈↓␈↓ ε3James R. Low
␈↓ α∧␈↓␈↓ ε/John F. Reiser
␈↓ α∧␈↓␈↓ ε,Hanan J. Samet
␈↓ α∧␈↓␈↓ ε%Robert L. Smith
␈↓ α∧␈↓␈↓ ε≤Robert F. Sproull
␈↓ α∧␈↓␈↓ εDaniel C. Swinehart
␈↓ α∧␈↓␈↓ ε≤Russell H. Taylor
␈↓ α∧␈↓␈↓ ε≡Kurt A. VanLehn










␈↓ α∧␈↓␈↓ ε?ABSTRACT

␈↓ α∧␈↓This␈α
document␈α
describes␈α
recent␈α
changes␈α
to␈α
the␈α
SAIL␈α
language␈α
since␈α
the␈α
"new"␈α∞manual␈α
(AIM-204)
␈↓ α∧␈↓was␈αpublished␈αin␈αJuly␈α1973.␈α It␈αreflects␈αthe␈αvarious␈αnew␈αfeatures␈αimplemented␈αas␈αof␈α
22␈αSeptember,
␈↓ α∧␈↓1975 for SAIL version 18 and corrects a number of minor errors in the earlier manual.
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	ZTABLE OF CONTENTS


␈↓ α∧␈↓  
␈↓ α∧␈↓␈↓ ∧0␈↓↓T A B L E   O F   C O N T E N T S␈↓



␈↓ α∧␈↓␈↓ βtSECTION␈↓ 	XPAGE



␈↓ α∧␈↓␈↓ βt1␈↓ ∧DINTRODUCTION␈↓ 
⊗1



␈↓ α∧␈↓␈↓ βt2␈↓ ∧DNUMERICAL ROUTINES␈↓ 
⊗2

␈↓ α∧␈↓␈↓ βt␈↓ ∧D1␈↓ ¬∀OVERFLOW␈↓ 
⊗3
␈↓ α∧␈↓␈↓ βt␈↓ ∧D2␈↓ ¬∀ENTRY POINTS␈↓ 
⊗3


␈↓ α∧␈↓␈↓ βt3␈↓ ∧DNEW PROCESS FEATURES␈↓ 
⊗4

␈↓ α∧␈↓␈↓ βt␈↓ ∧D1␈↓ ¬∀SPROUT APPLY␈↓ 
⊗4
␈↓ α∧␈↓␈↓ βt␈↓ ∧D2␈↓ ¬∀SPROUT_DEFAULTS␈↓ 
⊗4
␈↓ α∧␈↓␈↓ βt␈↓ ∧D3␈↓ ¬∀SUSPEND␈↓ 
⊗6
␈↓ α∧␈↓␈↓ βt␈↓ ∧D4␈↓ ¬∀FAIL AND SUCCEED␈↓ 
⊗6


␈↓ α∧␈↓␈↓ βt4␈↓ ∧DERROR HANDLING␈↓ 
⊗7

␈↓ α∧␈↓␈↓ βt␈↓ ∧D1␈↓ ¬∀ERROR MODES␈↓ 
⊗7
␈↓ α∧␈↓␈↓ βt␈↓ ∧D2␈↓ ¬∀ALTMODE RESPONSE␈↓ 
⊗7
␈↓ α∧␈↓␈↓ βt␈↓ ∧D3␈↓ ¬∀USER ERROR PROCEDURES␈↓ 
⊗7


␈↓ α∧␈↓␈↓ βt5␈↓ ∧DINEXHAUSTIBLE STRING SPACE␈↓ 
⊗9
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	ZTABLE OF CONTENTS


␈↓ α∧␈↓␈↓ βt6␈↓ ∧DRECORD STRUCTURES␈↓ 
λ11

␈↓ α∧␈↓␈↓ βt␈↓ ∧D1␈↓ ¬∀INTRODUCTORY REMARKS␈↓ 
λ11
␈↓ α∧␈↓␈↓ βt␈↓ ∧D2␈↓ ¬∀RECORD CLASS DECLARATIONS␈↓ 
λ11
␈↓ α∧␈↓␈↓ βt␈↓ ∧D3␈↓ ¬∀RECORD POINTER DECLARATIONS␈↓ 
λ12
␈↓ α∧␈↓␈↓ βt␈↓ ∧D4␈↓ ¬∀ALLOCATION␈↓ 
λ13
␈↓ α∧␈↓␈↓ βt␈↓ ∧D5␈↓ ¬∀SUBFIELDS␈↓ 
λ13
␈↓ α∧␈↓␈↓ βt␈↓ ∧D6␈↓ ¬∀GARBAGE COLLECTION␈↓ 
λ15
␈↓ α∧␈↓␈↓ βt␈↓ ∧D7␈↓ ¬∀INTERNAL REPRESENTATIONS ␈↓ 
λ15
␈↓ α∧␈↓␈↓ βt␈↓ ∧D8␈↓ ¬∀HANDLER PROCEDURES␈↓ 
λ17
␈↓ α∧␈↓␈↓ βt␈↓ ∧D9␈↓ ¬∀STRING SUBFIELDS␈↓ 
λ18
␈↓ α∧␈↓␈↓ βt␈↓ ∧D10␈↓ ¬∀MORE ABOUT GARBAGE COLLECTION␈↓ 
λ18


␈↓ α∧␈↓␈↓ βt7␈↓ ∧DSAVE/CONTINUE␈↓ 
λ20
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	ZTABLE OF CONTENTS


␈↓ α∧␈↓␈↓ βt8␈↓ ∧DMISCELLANEOUS NEW FEATURES␈↓ 
λ23

␈↓ α∧␈↓␈↓ βt␈↓ ∧D1␈↓ ¬∀NEW MTAPE OPTIONS␈↓ 
λ23
␈↓ α∧␈↓␈↓ βt␈↓ ∧D2␈↓ ¬∀INITIALIZATION PHASES␈↓ 
λ23
␈↓ α∧␈↓␈↓ βt␈↓ ∧D3␈↓ ¬∀CHNCDB␈↓ 
λ24
␈↓ α∧␈↓␈↓ βt␈↓ ∧D4␈↓ ¬∀ARRCLR␈↓ 
λ24
␈↓ α∧␈↓␈↓ βt␈↓ ∧D5␈↓ ¬∀SETPL␈↓ 
λ25
␈↓ α∧␈↓␈↓ βt␈↓ ∧D6␈↓ ¬∀EVALREDEFINE␈↓ 
λ25
␈↓ α∧␈↓␈↓ βt␈↓ ∧D7␈↓ ¬∀CVPS␈↓ 
λ25
␈↓ α∧␈↓␈↓ βt␈↓ ∧D8␈↓ ¬∀EXPRESSIONS IN REQUIRES␈↓ 
λ25
␈↓ α∧␈↓␈↓ βt␈↓ ∧D9␈↓ ¬∀RELEASE␈↓ 
λ26
␈↓ α∧␈↓␈↓ βt␈↓ ∧D10␈↓ ¬∀TTYUP␈↓ 
λ26
␈↓ α∧␈↓␈↓ βt␈↓ ∧D11␈↓ ¬∀BREAKSET MODES "K" AND "F"␈↓ 
λ26
␈↓ α∧␈↓␈↓ βt␈↓ ∧D12␈↓ ¬∀INOUT␈↓ 
λ27
␈↓ α∧␈↓␈↓ βt␈↓ ∧D13␈↓ ¬∀GETSTS & SETSTS␈↓ 
λ27
␈↓ α∧␈↓␈↓ βt␈↓ ∧D14␈↓ ¬∀CHANGES TO "OPEN" ERROR HANDLING␈↓ 
λ27
␈↓ α∧␈↓␈↓ βt␈↓ ∧D15␈↓ ¬∀ASH␈↓ 
λ28
␈↓ α∧␈↓␈↓ βt␈↓ ∧D16␈↓ ¬∀ARG_LIST␈↓ 
λ28
␈↓ α∧␈↓␈↓ βt␈↓ ∧D17␈↓ ¬∀CLOSE␈↓ 
λ28
␈↓ α∧␈↓␈↓ βt␈↓ ∧D18␈↓ ¬∀TYPEIT␈↓ 
λ29
␈↓ α∧␈↓␈↓ βt␈↓ ∧D19␈↓ ¬∀COMPARISON OF .REL FILES␈↓ 
λ29
␈↓ α∧␈↓␈↓ βt␈↓ ∧D20␈↓ ¬∀SCAN Optimizations␈↓ 
λ29
␈↓ α∧␈↓␈↓ βt␈↓ ∧D21␈↓ ¬∀BREAK TABLES␈↓ 
λ29
␈↓ α∧␈↓␈↓ βt␈↓ ∧D22␈↓ ¬∀CV6STR␈↓ 
λ30
␈↓ α∧␈↓␈↓ βt␈↓ ∧D23␈↓ ¬∀TENEX RUNTIMES␈↓ 
λ30
␈↓ α∧␈↓␈↓ βt␈↓ ∧D24␈↓ ¬∀CVASTR␈↓ 
λ31
␈↓ α∧␈↓␈↓ βt␈↓ ∧D25␈↓ ¬∀NEW SWITCHES␈↓ 
λ31
␈↓ α∧␈↓␈↓ βt␈↓ ∧D26␈↓ ¬∀EDFILE␈↓ 
λ32
␈↓ α∧␈↓␈↓ βt␈↓ ∧D27␈↓ ¬∀INIACS␈↓ 
λ32
␈↓ α∧␈↓␈↓ βt␈↓ ∧D28␈↓ ¬∀GOGTAB␈↓ 
λ33
␈↓ α∧␈↓␈↓ βt␈↓ ∧D29␈↓ ¬∀ARERR␈↓ 
λ33


␈↓ α∧␈↓␈↓ βt9␈↓ ∧DMINOR CORRECTIONS TO AIM-204␈↓ 
λ34
␈↓ α∧␈↓SAIL Addendum  1␈↓ 
1INTRODUCTION


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  1␈↓

␈↓ α∧␈↓␈↓ ¬m␈↓↓INTRODUCTION␈↓





␈↓ α∧␈↓The␈αfollowing␈αshort␈αmanual␈αdescribes␈αthe␈αchanges␈αthat␈αhave␈αhappened␈αto␈αSAIL␈αsince␈αthe␈αpublishing
␈↓ α∧␈↓of␈α∞the␈α∞Manual␈α∞in␈α∞July␈α∂1973.␈α∞It␈α∞accurately␈α∞reflects␈α∞the␈α∞state␈α∂of␈α∞SAIL,␈α∞version␈α∞18,␈α∞which␈α∂was␈α∞last
␈↓ α∧␈↓modified␈α
on␈α
September␈α∞22,␈α
1975.␈α
 The␈α
reader␈α∞should␈α
be␈α
warned␈α
that␈α∞many␈α
of␈α
these␈α∞new␈α
features
␈↓ α∧␈↓were designed for veteran SAIL hackers.

␈↓ α∧␈↓The reader may also want to refer to the following documents, which are usually kept updated.

␈↓ α∧␈↓MACLIE.WRU[DOC,AIL]␈↓ ∧DA␈α
summary␈α
of␈α
commonly␈αmade␈α
errors␈α
when␈α
using␈αmacros␈α
and␈α
what␈α
to␈αdo
␈↓ α∧␈↓␈↓ ∧Dabout them.

␈↓ α∧␈↓TUTOR.DOC[DOC,AIL]␈↓ ∧DIn introduction to LEAP.

␈↓ α∧␈↓LEAP.WRU[DOC,AIL]␈↓ ∧DA␈αdetailed␈αdescription␈αof␈αthe␈αruntime␈αenvironment␈αof␈αLEAP␈αfor␈αthe␈αhardy
␈↓ α∧␈↓␈↓ ∧Dfew who want to interface to LEAP in assembly language.

␈↓ α∧␈↓SAIL.DOC[AIM,DOC]␈↓ ∧DThe␈α
July␈α
'73␈α∞manual␈α
(AIM-204)␈α
in␈α
LPT␈α∞form.␈α
Warning:␈α
this␈α
version␈α∞is␈α
the
␈↓ α∧␈↓␈↓ ∧DStanford␈α∞character␈α∞set.␈α∞ It␈α∂is␈α∞also␈α∞almost␈α∞300␈α∂pages␈α∞long.␈α∞ You␈α∞can␈α∂get␈α∞a
␈↓ α∧␈↓␈↓ ∧D120␈α∩page␈α∩version,␈α∩set␈α∩in␈α∩two␈α∩columns␈α∩of␈α∩nice␈α∩type␈α∩from␈α∩the␈α⊃National
␈↓ α∧␈↓␈↓ ∧DTechnical Information Service, Springfield, Virginia 22151.

␈↓ α∧␈↓LIES[DOC,AIL]␈↓ ∧DThis␈α∩file␈α⊃contains␈α∩the␈α⊃know␈α∩mistakes␈α⊃in␈α∩the␈α⊃Manual.␈α∩Soon␈α⊃it␈α∩will␈α⊃also
␈↓ α∧␈↓␈↓ ∧Dcontain the known mistakes in this document.















␈↓ α∧␈↓␈↓ π¬1␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	NNUMERICAL ROUTINES


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  2␈↓

␈↓ α∧␈↓␈↓ ¬%␈↓↓NUMERICAL ROUTINES␈↓





␈↓ α∧␈↓A␈α∪collection␈α∪of␈α∩numerical␈α∪routines␈α∪has␈α∪been␈α∩added␈α∪to␈α∪SAIL.␈α∩ These␈α∪are␈α∪pre-declared␈α∪in␈α∩the
␈↓ α∧␈↓compiler,␈α∪and␈α∪are␈α∪loaded␈α∪from␈α∪the␈α∩standard␈α∪SAIL␈α∪library.␈α∪ The␈α∪functions␈α∪are␈α∪quite␈α∩standard;
␈↓ α∧␈↓following are the equivalent definitions:

␈↓ α∧␈↓1.␈↓ αDThe␈α⊂standard␈α⊂trigonometric␈α⊃functions.␈α⊂ ASIN,␈α⊂ACOS,␈α⊂ATAN␈α⊃and␈α⊂ATAN2␈α⊂return␈α⊃results␈α⊂in
␈↓ α∧␈↓␈↓ αDradians.␈α
 The␈α
ATAN2␈αcall␈α
takes␈α
arc-tangent␈αof␈α
the␈α
quotient␈αof␈α
its␈α
arguments;␈αin␈α
this␈α
way,␈αit
␈↓ α∧␈↓␈↓ αDcorrectly preserves sign information.

␈↓ α∧␈↓        REAL PROCEDURE SIN (REAL RADIANS);
␈↓ α∧␈↓        REAL PROCEDURE COS (REAL RADIANS);
␈↓ α∧␈↓        REAL PROCEDURE SIND (REAL DEGREES);
␈↓ α∧␈↓        REAL PROCEDURE COSD (REAL DEGREES);

␈↓ α∧␈↓        REAL PROCEDURE ASIN (REAL ARGUMENT);
␈↓ α∧␈↓        REAL PROCEDURE ACOS (REAL ARGUMENT);
␈↓ α∧␈↓        REAL PROCEDURE ATAN (REAL ARGUMENT);
␈↓ α∧␈↓        REAL PROCEDURE ATAN2 (REAL NUMERATOR,DENOMINATOR);


␈↓ α∧␈↓2.␈↓ αDThe hyperbolic trigonometric functions.

␈↓ α∧␈↓        REAL PROCEDURE SINH (REAL ARGUMENT);
␈↓ α∧␈↓        REAL PROCEDURE COSH (REAL ARGUMENT);
␈↓ α∧␈↓        REAL PROCEDURE TANH (REAL ARGUMENT);

␈↓ α∧␈↓3. ␈↓ αDThe square-root function:

␈↓ α∧␈↓        REAL PROCEDURE SQRT (REAL ARGUMENT);

␈↓ α∧␈↓4.␈↓ αDA␈αpseudo-random␈αnumber␈αgenerator.␈α The␈αargument␈αspecifies␈αa␈αnew␈αvalue␈αfor␈αthe␈αseed␈α(If␈αthe
␈↓ α∧␈↓␈↓ αDargument␈α∩is␈α∩0,␈α∩the␈α∪old␈α∩seed␈α∩value␈α∩is␈α∩used.␈α∪ Thus␈α∩to␈α∩get␈α∩differing␈α∩random␈α∪numbers,␈α∩this
␈↓ α∧␈↓␈↓ αDargument should be zero.)  Results are normalized to lie in the range [0,1].

␈↓ α∧␈↓        REAL PROCEDURE RAN (INTEGER SEED);



␈↓ α∧␈↓␈↓ π¬2␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	NNUMERICAL ROUTINES


␈↓ α∧␈↓5.␈↓ αDLogarithm␈α⊃and␈α⊃exponentiation␈α⊃functions.␈α⊃ These␈α⊃functions␈α⊃are␈α⊃the␈α⊃same␈α⊃ones␈α⊃used␈α⊃by␈α⊂the
␈↓ α∧␈↓␈↓ αDSAIL␈α
exponentiation␈α∞operator.␈α
 The␈α
base␈α∞is␈α
e␈α
(2.71828182845904).␈α∞ The␈α
logarithm␈α
to␈α∞the␈α
base
␈↓ α∧␈↓␈↓ αD10 of e is .4342944819.

␈↓ α∧␈↓        REAL PROCEDURE LOG (REAL ARGUMENT);
␈↓ α∧␈↓        REAL PROCEDURE EXP (REAL ARGUMENT);

␈↓ α∧␈↓These␈αfunctions␈αmay␈αoccasionally␈αbe␈αasked␈αto␈αcompute␈αnumbers␈αthat␈αlie␈αoutside␈αthe␈αrange␈αof␈αlegal
␈↓ α∧␈↓floating-point␈αnumbers␈αon␈αthe␈αPDP-10.␈α In␈αthese␈αcases,␈αthe␈αroutines␈αissue␈αsprightly␈αerror␈αmessages
␈↓ α∧␈↓that are continuable.



␈↓ α∧␈↓2.1 - ␈↓↓OVERFLOW␈↓


␈↓ α∧␈↓In␈α∂order␈α∂to␈α∂better␈α⊂perform␈α∂their␈α∂tasks,␈α∂these␈α∂routines␈α⊂enable␈α∂the␈α∂system␈α∂interrupt␈α⊂facility␈α∂for
␈↓ α∧␈↓floating-point␈αoverflow␈αand␈αunderflow␈αerrors.␈α If␈αan␈αunderflow␈αis␈αdetected,␈αthe␈αresults␈αare␈αset␈αto
␈↓ α∧␈↓0␈α∞(a␈α
feat␈α∞not␈α∞done␈α
by␈α∞the␈α∞PDP-10␈α
hardware,␈α∞alas).␈α∞ Be␈α
aware␈α∞that␈α∞such␈α
underflow␈α∞fixups␈α∞will␈α
be
␈↓ α∧␈↓done to every underflow that occurs in your program.

␈↓ α∧␈↓If you would like to be informed of any numerical exceptions, you can call the runtime:

␈↓ α∧␈↓        TRIGINI ( LOCATION(simple-procedure-name) );

␈↓ α∧␈↓Every␈α∪floating-point␈α∪exception␈α∪that␈α∪is␈α∪not␈α∪expected␈α∪by␈α∪the␈α∪interrupt␈α∪handler␈α∀(the␈α∪numerical
␈↓ α∧␈↓routines␈α∞use␈α∞a␈α∞special␈α∞convention␈α∞to␈α
indicate␈α∞that␈α∞arithmetic␈α∞exception␈α∞was␈α∞expected)␈α∞will␈α
cause
␈↓ α∧␈↓the␈α∪specified␈α∪simple␈α∩procedure␈α∪to␈α∪be␈α∪called.␈α∩ This␈α∪procedure␈α∪may␈α∩look␈α∪around␈α∪the␈α∪world␈α∩as
␈↓ α∧␈↓described␈α∞in␈α
the␈α∞Manual␈α∞for␈α
'export'␈α∞interrupt␈α∞handlers,␈α
page␈α∞79.␈α
 If␈α∞no␈α∞TRIGINI␈α
call␈α∞is␈α∞done,␈α
the
␈↓ α∧␈↓interrupt routine will simply dismiss unexpected floating-point interrupts.



␈↓ α∧␈↓2.2 - ␈↓↓ENTRY POINTS␈↓


␈↓ α∧␈↓In␈αorder␈αto␈αavoid␈αconfusion␈α(by␈αthe␈αloader)␈αwith␈αolder␈αtrig␈αpackages,␈αthe␈αentry␈αpoints␈αof␈αthe␈αSAIL
␈↓ α∧␈↓arithmetic␈α
routines␈α
all␈α
have␈α
a␈α
"$"␈α
appended␈α
to␈α
the␈α
end.␈α
 Thus,␈α
SIN␈α
has␈α
the␈α
entry␈α
point␈α∞SIN$,␈α
etc.
␈↓ α∧␈↓WARNING:␈αIf␈αa␈αprogram␈αplans␈αto␈αuse␈αthe␈αSAIL␈αintrinsic␈αnumerical␈αroutines,␈αit␈αshould␈αNOT␈αinclude
␈↓ α∧␈↓external␈αdeclarations␈αto␈αthem,␈αsince␈αthis␈αwill␈αprobably␈αcause␈αthe␈αFORTRAN␈αlibrary␈αroutines␈αto␈αbe
␈↓ α∧␈↓loaded.




␈↓ α∧␈↓␈↓ π¬3␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	*NEW PROCESS FEATURES


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  3␈↓

␈↓ α∧␈↓␈↓ ¬␈↓↓NEW PROCESS FEATURES␈↓







␈↓ α∧␈↓3.1 - ␈↓↓SPROUT APPLY␈↓


␈↓ α∧␈↓The␈α<procedure␈αcall>␈αin␈αa␈αSPROUT␈αstatement␈αmay␈αbe␈αan␈αAPPLY␈αconstruct.␈α In␈α this␈αcase␈αSPROUT
␈↓ α∧␈↓will␈α∂ do␈α∂the␈α⊂"right"␈α∂thing␈α∂ about␈α∂setting␈α⊂up␈α∂the␈α∂static␈α∂link␈α⊂for␈α∂ the␈α∂APPLY.␈α∂That␈α⊂is,␈α∂"up-level"
␈↓ α∧␈↓references␈α
by␈α
the␈αprocess␈α
will␈α
be␈αmade␈α
to␈α
the␈α
same␈αvariable␈α
instances␈α
that␈αwould␈α
be␈α
used␈α
if␈αthe
␈↓ α∧␈↓APPLY did not occur in a SPROUT statement. (See page 77 of the manual.)

␈↓ α∧␈↓However,␈α
there␈α
is␈α
a␈α
glitch.␈α
The␈α
sprout␈α
mechanism␈α∞is␈α
not␈α
yet␈α
smart␈α
enough␈α
to␈α
find␈α
out␈α∞the␈α
block
␈↓ α∧␈↓of␈αthe␈α
declaration␈αof␈αthe␈α
procedure␈αused␈α
to␈αdefine␈αthe␈α
procedure␈αitem.␈α
It␈αwould␈αbe␈α
nice␈αif␈α
it␈αdid,
␈↓ α∧␈↓since␈αthen␈αit␈αcould␈αwarn␈αthe␈αuser␈αwhen␈αthat␈αblock␈αwas␈αexited␈αand␈αyet␈αthe␈αprocess␈αwas␈αstill␈αalive,
␈↓ α∧␈↓and␈α
thus␈α
potentially␈α
able␈α
to␈α
refer␈α
to␈α
deallocated␈α
arrays␈α
and␈α
etc.␈α
What␈α
the␈α
sprout␈α
does␈α∞instead␈α
is
␈↓ α∧␈↓assume␈α
the␈α
procedure␈α
was␈α
declared␈α
in␈α
the␈α
outer␈α
block.␈α
This␈α
may␈α
be␈α
fixed␈α
 eventually,␈α
but␈α
in␈α
the
␈↓ α∧␈↓meantime␈α⊂ some␈α⊂extra␈α⊂care␈α⊂should␈α∂be␈α⊂taken␈α⊂ when␈α⊂using␈α⊂ apply␈α∂in␈α⊂sprouts␈α⊂to␈α⊂ avoid␈α⊂ exiting␈α∂a
␈↓ α∧␈↓block␈α∞ with␈α∞dependents.␈α∞   Similarly,␈α∞be␈α∞warned␈α∞ that␈α∞the␈α∞"DEPENDENTS␈α∞(<blockid>)"␈α∞construct
␈↓ α∧␈↓may␈α∪ not␈α∪give␈α∪ the␈α∪ "right"␈α∪result␈α∪ for␈α∩ sprout␈α∪applies.␈α∪Page␈α∪68␈α∪of␈α∪the␈α∪Manual␈α∪contains␈α∩the
␈↓ α∧␈↓description of this protection mechanism for non-APPLY Sprouts.



␈↓ α∧␈↓3.2 - ␈↓↓SPROUT_DEFAULTS␈↓


␈↓ α∧␈↓SAIL␈α
 now␈α∞provides␈α
 a␈α∞mechanism␈α
 by␈α
which␈α∞ the␈α
user␈α∞ may␈α
specify␈α
 the␈α∞"default"␈α
options␈α∞to␈α
be
␈↓ α∧␈↓used when individual procedures are sprouted.










␈↓ α∧␈↓␈↓ π¬4␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	*NEW PROCESS FEATURES



␈↓ α∧␈↓αSyntax:
␈↓ α∧␈↓α        PROCEDURE <procid> ...
␈↓ α∧␈↓α         BEGIN
␈↓ α∧␈↓α         <some declarations>;
␈↓ α∧␈↓α         SPROUT_DEFAULTS <integer constant>;
␈↓ α∧␈↓α         <perhaps some more declarations>;
␈↓ α∧␈↓α         :
␈↓ α∧␈↓α         :
␈↓ α∧␈↓α         <statements>
␈↓ α∧␈↓α         :
␈↓ α∧␈↓α         END;


␈↓ α∧␈↓In other words, SPROUT_DEFAULTS is a declaration.

␈↓ α∧␈↓Semantics:

␈↓ α∧␈↓If␈α⊃ one␈α⊂of␈α⊃the␈α⊃"allocation"␈α⊂fields␈α⊃of␈α⊃ the␈α⊂options␈α⊃word␈α⊂passed␈α⊃to␈α⊃the␈α⊂SPROUT␈α⊃routine␈α⊃--␈α⊂i.e.
␈↓ α∧␈↓QUANTUM,STRINGSTACK,PSTACK,␈α⊃or␈α⊃ PRIORITY␈α⊃--␈α⊃is␈α⊃zero,␈α⊃  then␈α⊃ SPROUT␈α⊃ will␈α∩look␈α⊃ at
␈↓ α∧␈↓the␈αcorresponding␈α field␈αof␈α the␈αspecified␈α<integer␈αconstant>␈αfor␈αthe␈αprocedure␈αbeing␈αsprouted.␈αIf
␈↓ α∧␈↓the␈α
field␈α
is␈α
 non-zero,␈α
  then␈α
 that␈α
value␈α
 will␈α
be␈α
 used;␈α
otherwise␈α
 the␈α
current␈α
"system"␈αdefault
␈↓ α∧␈↓will be used.

␈↓ α∧␈↓NOTE:␈α SPROUT_DEFAULTS␈α only␈αapplies␈α to␈α "allocations",␈αi.e.␈α  the␈αprocess␈αstatus␈αcontrol␈αbits
␈↓ α∧␈↓(e.g. SUSPME) are not affected.
␈↓ α∧␈↓αExample:

␈↓ α∧␈↓α        RECURSIVE PROCEDURE FOO;
␈↓ α∧␈↓α         BEGIN
␈↓ α∧␈↓α         SPROUT_DEFAULTS STRINGSTACK(10);
␈↓ α∧␈↓α         INTEGER XXX;
␈↓ α∧␈↓α         :
␈↓ α∧␈↓α         :
␈↓ α∧␈↓α         END;
␈↓ α∧␈↓α        :
␈↓ α∧␈↓α        SPROUT(P1,FOO,STRINGSTACK(3));
␈↓ α∧␈↓α        SPROUT(P2,FOO);
␈↓ α∧␈↓α        COMMENT P1 will have a string stack of 3*32 words.
␈↓ α∧␈↓α         P2 will have a string stack of 10*32 words;





␈↓ α∧␈↓␈↓ π¬5␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	*NEW PROCESS FEATURES


␈↓ α∧␈↓3.3 - ␈↓↓SUSPEND␈↓


␈↓ α∧␈↓SUSPEND now behaves like RESUME in that it returns an item.

␈↓ α∧␈↓        itm ← SUSPEND(<process item>)

␈↓ α∧␈↓Frequently,␈α∂one␈α∞is␈α∂suspending␈α∞some␈α∂other␈α∞process␈α∂than␈α∞the␈α∂one␈α∞that␈α∂is␈α∞executing␈α∂the␈α∞SUSPEND
␈↓ α∧␈↓statement. In this case, the item returned is ANY.   However, in cases like:

␈↓ α∧␈↓        X ← SUSPEND(MYPROC);

␈↓ α∧␈↓where␈α∪the␈α∀process␈α∪suspends␈α∪itself,␈α∀it␈α∪might␈α∪happen␈α∀that␈α∪this␈α∪process␈α∀is␈α∪made␈α∪running␈α∀by␈α∪a
␈↓ α∧␈↓RESUME␈α
from␈α
another␈α
process.␈α
If␈α
so,␈α
then␈α
X␈α
receives␈α
the␈α
<return_item>␈α
 that␈α
was␈α∞an␈α
argument
␈↓ α∧␈↓to the RESUME.



␈↓ α∧␈↓3.4 - ␈↓↓FAIL AND SUCCEED␈↓


␈↓ α∧␈↓FAIL␈α∂and␈α∂SUCCEED␈α∂now␈α∂behave␈α∂like␈α∂RESUME␈α∞and␈α∂SUSPEND␈α∂in␈α∂that␈α∂they␈α∂also␈α∂return␈α∂an␈α∞item.
␈↓ α∧␈↓The␈α
item␈αreturned␈α
is␈α
ANY␈αunless␈α
the␈α
Matching␈αProcedure␈α
containing␈α
the␈αFAIL␈α
or␈α
SUCCEED␈αwas
␈↓ α∧␈↓(1)␈α
sprouted␈α
as␈α∞a␈α
process,␈α
and␈α∞(2)␈α
made␈α
running␈α
by␈α∞a␈α
RESUME␈α
construct.␈α∞ In␈α
the␈α
latter␈α∞case,␈α
the
␈↓ α∧␈↓item␈α
returned␈α∞is␈α
the␈α∞<return_item>␈α
that␈α∞was␈α
an␈α∞argument␈α
to␈α∞the␈α
RESUME.␈α∞ [Note␈α
that␈α∞the␈α
only
␈↓ α∧␈↓case in which a Matching Procedure can be reactivated at a FAIL is by being RESUMEd.]



















␈↓ α∧␈↓␈↓ π¬6␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 
∀ERROR HANDLING


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  4␈↓

␈↓ α∧␈↓␈↓ ¬T␈↓↓ERROR HANDLING␈↓







␈↓ α∧␈↓4.1 - ␈↓↓ERROR MODES␈↓


␈↓ α∧␈↓SAIL's␈αerror␈α handler␈αhas␈αat␈α long␈αlast␈αbeen␈α modified␈αto␈αdo␈α what␈αis␈αclaimed␈αit␈αwill␈αdo␈α in␈αSection
␈↓ α∧␈↓20␈αof␈αthe␈αmanual␈α(pgs␈α95␈α-␈α97),␈αand␈αin␈αthe␈αdescription␈αof␈αUSERERR␈α(pg␈α42).␈α In␈αbrief,␈αit␈αallows␈αone
␈↓ α∧␈↓to␈α have␈αerror␈α messages␈αautomatically␈α sent␈α to␈α a␈α"log"␈α file␈α while␈αone␈α is␈αcompiling,␈αand␈αto␈αuse
␈↓ α∧␈↓USERERR as a trace statement.

␈↓ α∧␈↓The␈αdescription␈αgiven␈αin␈αthe␈α
manual␈αdiffers␈αfrom␈αreality␈αin␈α
two␈αways:␈α"Keep"␈αmode␈αhas␈α
not␈α been
␈↓ α∧␈↓implemented␈α(the␈αerror␈αhandler␈α will␈αflush␈αall␈αtype-ahead␈αexcept␈αa␈α<lf>);␈α  all␈αof␈αthe␈α other␈αmodes
␈↓ α∧␈↓("Quiet",␈α "Logging",␈αand␈α"Numbers")␈αare␈αimplemented␈αONLY␈α IN␈αTHE␈αCOMPILER.␈α  However,␈αone
␈↓ α∧␈↓can␈α⊂get␈α∂the␈α⊂effect␈α⊂of␈α∂error␈α⊂modes␈α⊂at␈α∂runtime␈α⊂by␈α⊂using␈α∂a␈α⊂brand␈α⊂new␈α∂feature␈α⊂called␈α⊂user␈α∂error
␈↓ α∧␈↓procedures.



␈↓ α∧␈↓4.2 - ␈↓↓ALTMODE RESPONSE␈↓


␈↓ α∧␈↓After␈α
an␈α
"E"␈α
or␈α
"T"␈α
response␈α
to␈α
the␈α∞error␈α
handler,␈α
an␈α
altmode␈α
will␈α
return␈α
to␈α
the␈α∞question␈α
loop;
␈↓ α∧␈↓i.e.,␈αyou␈αmay␈αchange␈αyour␈αmind␈αif␈αyou␈αdo␈αnot␈αwish␈αto␈αedit.␈α Normal␈αmonitor␈αline␈αediting␈αof␈αthe␈αfile
␈↓ α∧␈↓name is allowed.



␈↓ α∧␈↓4.3 - ␈↓↓USER ERROR PROCEDURES␈↓


␈↓ α∧␈↓A␈α user␈αerror␈α procedure␈αis␈αa␈α user␈αprocedure␈α that␈αis␈αrun␈α before␈αor␈αinstead␈αof␈α the␈α SAIL␈αerror
␈↓ α∧␈↓handler␈α⊂ everytime␈α⊂ an␈α⊃error␈α⊂ occurs␈α⊂ at␈α⊃runtime.␈α⊂ This␈α⊂ includes␈α⊃all␈α⊂array␈α⊂errors,␈α⊃IO␈α⊂ errors,
␈↓ α∧␈↓Leapish␈α∞errors␈α
and␈α∞all␈α
USERERWs.␈α∞ It␈α
does␈α∞not␈α
include␈α∞system␈α
errors,␈α∞such␈α
as␈α∞Ill␈α
Mem␈α∞Ref␈α∞or␈α
Ill
␈↓ α∧␈↓UUO.

␈↓ α∧␈↓The  procedure one uses  for a  user error procedure  must be  of the following type:

␈↓ α∧␈↓␈↓ π¬7␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 
∀ERROR HANDLING


␈↓ α∧␈↓␈↓ β7SIMPLE INTEGER PROCEDURE proc (INTEGER loc; STRING msg, rsp);


␈↓ α∧␈↓Only␈α∞the␈α∞names␈α∞ proc,␈α∞loc,␈α∞ msg,␈α∞and␈α∞rsp␈α∞ may␈α∞vary␈α∞ from␈α∞the␈α∞ example␈α∞above,␈α∞except␈α∞ that␈α∞one
␈↓ α∧␈↓may declare  the procedure  INTERNAL if  one wishes to use it across files.

␈↓ α∧␈↓Whenever␈α the␈α
external␈αinteger␈α
_ERRP_␈α is␈αloaded␈α
with␈αLOCATION(proc),␈α
the␈αerror␈α
handler␈αwill
␈↓ α∧␈↓call␈α
proc␈α∞before␈α
it␈α
 does␈α∞anything␈α
else.␈α
  It␈α∞will␈α
set␈α∞loc␈α
to␈α
 the␈α∞core␈α
location␈α
of␈α∞the␈α
call␈α∞ to␈α
the
␈↓ α∧␈↓error␈α∞handler.␈α∞ Msg␈α∞ will␈α∞be␈α∞ the␈α∞message␈α∞ that␈α∞it␈α∞ would␈α∞have␈α∞ printed.␈α∞ Rsp␈α∞will␈α∂be␈α∞non-NULL
␈↓ α∧␈↓only␈αif␈αthe␈αerror␈αwas␈αfrom␈αa␈αUSERERR␈αwhich␈αhad␈αresponse␈αstring␈αargument.␈α Proc␈αcan␈αdo␈αanything
␈↓ α∧␈↓that␈α⊂ a␈α∂simple␈α⊂procedure␈α∂can␈α⊂do.␈α∂ When␈α⊂it␈α∂exits,␈α⊂it␈α∂should␈α⊂ return␈α∂an␈α⊂ integer␈α∂which␈α⊂ tells␈α∂the
␈↓ α∧␈↓error␈αhandler␈α if␈α it␈αshould␈αdo␈αanything␈αmore.␈α If␈αthe␈αinteger␈αis␈α0,␈αthe␈αerror␈αhandler␈αwill␈α(1)␈α print
␈↓ α∧␈↓the␈α message,␈α(2)␈α print␈αthe␈αlocation,␈αand␈α(3)␈αquery␈αthe␈αtty␈αand␈αdispatch␈αon␈αthe␈αresponse␈αcharacter
␈↓ α∧␈↓(i.e␈αask␈αfor␈αa␈α<cr>,␈α<lf>,␈αetc.).␈α If␈αthe␈αright␈αhalf␈αof␈αthe␈αinteger␈αis␈αnon-zero,␈αit␈αis␈αtaken␈αas␈αthe␈αascii
␈↓ α∧␈↓for␈α
a␈α
character␈αto␈α
dispatch␈α
upon.␈α
 The␈αleft␈α
half␈α
may␈αhave␈α
two␈α
bits␈α
to␈αcontrol␈α
printing.␈α
  If␈α
bit␈α17
␈↓ α∧␈↓in␈α∂the␈α∂integer␈α∞is␈α∂on,␈α∂message␈α∂printing␈α∞is␈α∂inhibited.␈α∂ If␈α∞bit␈α∂16␈α∂is␈α∂on,␈α∞then␈α∂the␈α∂location␈α∂printing␈α∞is
␈↓ α∧␈↓inhibited.␈α⊃For␈α⊃example,␈α⊃"X"+(1␈α⊃LSH␈α⊂18)␈α⊃will␈α⊃cause␈α⊃the␈α⊃location␈α⊂to␈α⊃be␈α⊃printed␈α⊃and␈α⊃the␈α⊂program
␈↓ α∧␈↓exited. "C"+(3 LSH 18) will cause the error handler to continue without printing anything.

␈↓ α∧␈↓Note␈α∞that␈α∞simple␈α∞ procedures␈α∞can␈α
not␈α∞do␈α∞ a␈α∞non-local␈α∞GOTO.␈α
  However,␈α∞the␈α∞ effect␈α∞of␈α∞ a␈α
non-
␈↓ α∧␈↓local␈α∪ GOTO␈α∩ can␈α∪be␈α∩ achieved␈α∪in␈α∩ a␈α∪ user␈α∩error␈α∪procedure␈α∩by␈α∪loading␈α∩the␈α∪external␈α∩integer
␈↓ α∧␈↓_ERRJ_␈αwith␈αthe␈αLOCATION␈αof␈αa␈αlabel.␈αThe␈αlabel␈αshould␈αbe␈αa␈αon␈αa␈αcall␈αto␈αa␈αnon-simple␈αprocedure
␈↓ α∧␈↓which␈αdoes␈α
the␈αdesired␈α
GOTO.␈α The␈α
error␈αhandler␈αclears␈α
_ERRJ_␈αbefore␈α
calling␈αthe␈α
procedure␈αin
␈↓ α∧␈↓_ERRP_.␈α If␈α_ERRJ_␈α is␈αnon-zero␈αwhen␈α
the␈α user␈αprocedure␈αreturns,␈αand␈αcontinuing␈α
was␈αspecified,
␈↓ α∧␈↓then␈α
the␈α
error␈α
handler's␈α
exit␈α∞ consists␈α
of␈α
a␈α
simple␈α
transfer␈α∞to␈α
 that␈α
location.␈α
 Note␈α
that␈α∞for␈α
this
␈↓ α∧␈↓simple␈α
transfer␈α
to␈α
work␈α∞properly,␈α
the␈α
place␈α
where␈α
the␈α∞error␈α
occurred␈α
(or␈α
the␈α
call␈α∞to␈α
USERERR)
␈↓ α∧␈↓must␈αbe␈αin␈α
the␈αsame␈αstatic␈α(lexical)␈α
scope␈αas␈αthe␈α
label␈αwhose␈αLOCATION␈αis␈α
in␈α_ERRJ_.␈α If␈α
this␈αis
␈↓ α∧␈↓really important to you, see a SAIL hacker.

␈↓ α∧␈↓WARNING!␈α⊂Handling␈α⊂errors␈α⊂from␈α⊂strange␈α⊂places␈α⊂like␈α⊂the␈α⊂string␈α⊂garbage␈α⊂collector␈α⊂and␈α⊃the␈α⊂core
␈↓ α∧␈↓management routines will get you into deep trouble.














␈↓ α∧␈↓␈↓ π¬8␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ\INEXHAUSTIBLE STRING SPACE


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  5␈↓

␈↓ α∧␈↓␈↓ ∧L␈↓↓INEXHAUSTIBLE STRING SPACE␈↓





␈↓ α∧␈↓The␈αstring␈αgarbage␈αcollector␈αhas␈αbeen␈αmodified␈αto␈αexpand␈αstring␈αspace␈α(using␈αdiscontiguous␈αblocks)
␈↓ α∧␈↓whenever␈α
necessary␈α
to␈α
satisfy␈α
the␈α
demand␈α
for␈α∞places␈α
to␈α
put␈α
strings.␈α
To␈α
take␈α
advantage␈α∞ of␈α
 this
␈↓ α∧␈↓feature,  one need not change his programs.

␈↓ α∧␈↓Here are some points which might be of interest, however:

␈↓ α∧␈↓1)␈↓ αDAlthough␈α⊃ we␈α⊃ are␈α∩ going␈α⊃ to␈α⊃ provide␈α⊃ user␈α∩control␈α⊃over␈α⊃all␈α⊃size␈α∩parameters␈α⊃eventually,
␈↓ α∧␈↓␈↓ αDcurrently␈α∃only␈α∃ the␈α∃ initial␈α∃ string␈α∃ space␈α∃size␈α∃ is␈α∃ settable␈α∃ by␈α∃ the␈α∃ user,␈α⊗either␈α∃via
␈↓ α∧␈↓␈↓ αDREQUIRE␈α
or␈α
the␈α
ALLOC␈α
sequence,␈α
as␈α
before.␈α
 The␈α
size␈α
of␈α
each␈α
string␈α
space␈α
increment␈αwill
␈↓ α∧␈↓␈↓ αDbe␈α
 the␈α
same␈α
as␈α
the␈α
original␈α
size,␈α
which␈α
need␈α
not␈α
be␈α
monstrous␈α
any␈α
more␈α
unless␈α∞you␈α
 know
␈↓ α∧␈↓␈↓ αDthat␈α∃all␈α∃runs␈α∃of␈α∃your␈α∃program␈α⊗will␈α∃ need␈α∃ a␈α∃monstrous␈α∃ string␈α∃ space␈α⊗ anyhow.␈α∃  The
␈↓ α∧␈↓␈↓ αDthreshold␈α
(see␈α∞below)␈α
for␈α
expanding␈α∞will␈α
be␈α
set␈α∞at␈α
1/8␈α
 the␈α∞ string␈α
 space␈α∞ size␈α
 (increment
␈↓ α∧␈↓␈↓ αDsize).

␈↓ α∧␈↓2)␈↓ αDOne␈α∩can,␈α∩in␈α∩his␈α∩program,␈α∩modify␈α∩these␈α∩values␈α∩independently,␈α∩if␈α∩he␈α∩is␈α∩willing␈α∩to␈α∩use␈α∩the
␈↓ α∧␈↓␈↓ αDUSERCON function, and to follow this format:

␈↓ α∧␈↓β     USER TABLE ENTRY NAME              VALUE
␈↓ α∧␈↓β        STINCR          lh: number of chars. in increment
␈↓ α∧␈↓β                        rh: number of words in increment + 4

␈↓ α∧␈↓β        STREQD          lh: number of chars. in threshold
␈↓ α∧␈↓β                        rh: number of words in threshold.


␈↓ α∧␈↓3)␈↓ αDThe␈αthreshold.␈α After␈αgarbage␈αcollection,␈αlet␈αus␈αsay␈αthat␈αM-1␈αdiscontiguous␈αstring␈αspaces␈α are
␈↓ α∧␈↓␈↓ αDfull,␈α
 and␈α the␈α
 M'th␈α
 has␈α n␈α
 free␈α characters␈α
in␈α
it␈α(available␈α
for␈αnew␈α
strings).␈α
 The␈α garbage
␈↓ α∧␈↓␈↓ αDcollector␈α was␈α called␈αbecause␈α some␈αroutine␈αwanted␈αto␈αcreate␈αa␈αstring␈αR␈αcharacters␈αlong,␈αand
␈↓ α∧␈↓␈↓ αDthere␈α
were␈α
not␈αthat␈α
many␈α
 available␈α(free).␈α
    After␈α
 garbage␈αcollection,␈α
 the␈α
new␈αalgorithm
␈↓ α∧␈↓␈↓ αDrequires␈α
that␈α
N␈α
be␈α
greater␈α
than␈α
R+LH(STREQD).␈α If␈α
it␈α
is␈α
not,␈α
expansion␈α
takes␈α
place␈α
(to␈αM+1
␈↓ α∧␈↓␈↓ αDspaces),␈α∞to␈α∞ satisfy␈α
 this␈α∞requirement.␈α∞   In␈α∞other␈α
words,␈α∞if␈α∞STREQD␈α∞is␈α
1/8␈α∞the␈α∞size␈α∞of␈α
the
␈↓ α∧␈↓␈↓ αDcurrent␈α⊃space,␈α⊂that␈α⊃space␈α⊂will␈α⊃not␈α⊃be␈α⊂ allowed␈α⊃ to␈α⊂become␈α⊃ more␈α⊂ than␈α⊃ about␈α⊃ 7/8␈α⊂ full.
␈↓ α∧␈↓␈↓ αDThis␈αhelps␈αavoid␈α
frequent,␈αnearly␈αuseless␈α
calls␈αon␈αthe␈αgarbage␈α
collector␈αwhen␈α space␈α
is␈αabout
␈↓ α∧␈↓␈↓ αDgone.   All but the current space are allowed to become as full as possible, however.



␈↓ α∧␈↓␈↓ π¬9␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ\INEXHAUSTIBLE STRING SPACE


␈↓ α∧␈↓4)␈↓ αDNew␈α∞statistics␈α∞are␈α∞maintained␈α∞by␈α∞the␈α∞ garbage␈α∞ collector.␈α∞    Soon␈α∞there␈α∞ will␈α∞ be␈α∂a␈α∞built-in
␈↓ α∧␈↓␈↓ αDroutine␈α∪you␈α∪can␈α∩use␈α∪to␈α∪print␈α∩them.␈α∪ For␈α∪now,␈α∩you␈α∪may␈α∪look␈α∩at␈α∪them␈α∪using␈α∩USERCON,
␈↓ α∧␈↓␈↓ αDalthough␈α
this␈α∞ document␈α
 does␈α∞not␈α
 say␈α∞ what␈α
 they␈α
 are.␈α∞    In␈α
 order␈α∞to␈α
activate␈α∞timing␈α
of
␈↓ α∧␈↓␈↓ αDthe garbage collector (slows it down), set SGCTIME in the  user  table to -1.

␈↓ α∧␈↓5)␈↓ αDFuture␈α∂plans.␈α∂ The␈α∂ new␈α∂ structure␈α∂ not␈α∂only␈α∂allows␈α∂expansion␈α∂of␈α∂string␈α∂space,␈α∂it␈α∂also␈α∞will
␈↓ α∧␈↓␈↓ αDallow␈α
 for␈α
 partial␈α
 garbage␈α
 collections␈α (no␈α
 visible␈α
benefits␈α
 except␈α
 increased␈α
speed,␈αsince
␈↓ α∧␈↓␈↓ αDa␈αpartial␈αcollection␈αwill␈αbe␈αalmost␈αas␈αeffective␈αas␈αa␈αcomplete␈αone,␈αand␈α much␈α faster),␈α and␈αthe
␈↓ α∧␈↓␈↓ αDability␈α∂ to␈α∂ move␈α∂ string␈α⊂ space␈α∂ blocks,␈α∂in␈α∂order␈α∂to␈α⊂compact␈α∂memory.␈α∂ Push␈α∂on␈α⊂your␈α∂local
␈↓ α∧␈↓␈↓ αDrepresentative  to  get  these  things done.



































␈↓ α∧␈↓␈↓ ε}10␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  6␈↓

␈↓ α∧␈↓␈↓ ¬-␈↓↓RECORD STRUCTURES␈↓







␈↓ α∧␈↓6.1 - ␈↓↓INTRODUCTORY REMARKS␈↓


␈↓ α∧␈↓Record␈α⊂structures␈α⊂are␈α∂a␈α⊂fairly␈α⊂recent␈α⊂addition␈α∂to␈α⊂SAIL.␈α⊂ Essentially,␈α∂they␈α⊂provide␈α⊂ a␈α⊂means␈α∂by
␈↓ α∧␈↓which␈αa␈α
 number␈αof␈α
closely␈αrelated␈α
variables␈αmay␈α
be␈αallocated␈α
and␈αmanipulated␈α
 as␈αa␈α
unit,␈αwithout
␈↓ α∧␈↓the␈α⊂overhead␈α∂ or␈α⊂limitations␈α∂associated|ε⊂ with␈α⊂using␈α∂parallel␈α⊂ arrays␈α∂and␈α⊂without␈α⊂the␈α∂restriction
␈↓ α∧␈↓that␈αthe␈αvariables␈αall␈αbe␈αof␈αthe␈αsame␈αdata␈αtype.␈α In␈α the␈αcurrent␈αimplementation,␈αeach␈α record␈αis␈αan
␈↓ α∧␈↓instance␈α⊂of␈α⊂a␈α⊂user-defined␈α⊂"record␈α⊂class",␈α⊃which␈α⊂serves␈α⊂as␈α⊂ a␈α⊂template␈α⊂describing␈α⊃the␈α⊂ various
␈↓ α∧␈↓subfields␈α∞of␈α∞the␈α∞record.␈α∞ Internally,␈α∞records␈α∞are␈α∞small␈α∞blocks␈α∞of␈α∞storage␈α∞which␈α∞contain␈α∞space␈α
for
␈↓ α∧␈↓the␈αvarious␈α subfields␈αand␈α a␈αpointer␈α to␈αa␈α class␈αdescriptor␈αrecord.␈α  Subfields␈α are␈αallocated␈α one
␈↓ α∧␈↓per␈α∪ word␈α∪and␈α∪ are␈α∩accessed␈α∪by␈α∪ constant␈α∪indexing␈α∩off␈α∪the␈α∪ record␈α∪pointer.␈α∪ Deallocation␈α∩is
␈↓ α∧␈↓performed␈αautomatically␈αby␈αa␈αgarbage␈αcollector␈αor␈αmanually␈αthrough␈αexplicit␈αcalls␈αto␈αa␈αdeallocation
␈↓ α∧␈↓procedure.

␈↓ α∧␈↓Records␈α
were␈α
originally␈α∞added␈α
 to␈α
SAIL␈α
to␈α∞ fullfill␈α
a␈α
number␈α
of␈α∞ very␈α
specific␈α
needs␈α∞at␈α
Stanford,
␈↓ α∧␈↓and␈α were␈αsubsequently␈αgeneralized␈αto␈αthe␈αform␈α seen␈α here.␈α   The␈αstructures␈α described␈α in␈α this
␈↓ α∧␈↓section␈α∃are␈α∀implemented␈α∃and,␈α∃so␈α∀far␈α∃as␈α∃is␈α∀known,␈α∃work␈α∃correctly.␈α∀ (They␈α∃have␈α∃been␈α∀used
␈↓ α∧␈↓successfully␈α
over␈α
the␈α∞ past␈α
3␈α
months␈α
by␈α∞several␈α
different␈α
people␈α
to␈α∞produce␈α
a␈α
number␈α∞of␈α
sizable
␈↓ α∧␈↓programs).␈α Readers␈αare␈αstrongly␈αurged␈αto␈αlook␈αat␈αthe␈α file␈αRECAUX.SAI[CSP,SYS],␈αwhich␈αcontains
␈↓ α∧␈↓a  number of useful examples and auxilliary functions.



␈↓ α∧␈↓6.2 - ␈↓↓RECORD CLASS DECLARATIONS␈↓


␈↓ α∧␈↓        RECORD_CLASS <classid> (<subfield declarations>)

␈↓ α∧␈↓For instance,

␈↓ α∧␈↓        RECORD_CLASS VECTOR (REAL X,Y,Z);
␈↓ α∧␈↓        RECORD_CLASS CELL (RECORD_POINTER(ANY_CLASS) CAR,CDR);
␈↓ α∧␈↓        RECORD_CLASS TABLEAU (REAL ARRAY A,B,C;INTEGER N,M);
␈↓ α∧␈↓        RECORD_CLASS FOO(LIST L;ITEMVAR A);

␈↓ α∧␈↓␈↓ ε}11␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓Generally,␈α the␈α<subfield␈α declarations>␈α have␈α the␈α same␈αform␈α as␈α a␈αprocedure's␈α formal␈αparamter
␈↓ α∧␈↓list,␈αexcept␈αthat␈α the␈αwords␈α VALUE␈αand␈αREFERENCE␈αshould␈α not␈α be␈αused.␈α   Each␈αrecord␈α class
␈↓ α∧␈↓declaration␈α∞is␈α
compiled␈α∞into␈α
 a␈α∞"record␈α∞ descriptor"␈α
which␈α∞is␈α
 a␈α∞record␈α
 of␈α∞constant␈α∞record␈α
class
␈↓ α∧␈↓$CLASS and is used by the runtime system for allocation, deallocation, garbage collection, etc.



␈↓ α∧␈↓6.3 - ␈↓↓RECORD POINTER DECLARATIONS␈↓


␈↓ α∧␈↓        RECORD_POINTER(<classid list>) <id list>
␈↓ α∧␈↓        RECORD_POINTER(ANY_CLASS) <id list>

␈↓ α∧␈↓For instance,

␈↓ α∧␈↓        RECORD_POINTER(VECTOR) V1,V2;
␈↓ α∧␈↓        RECORD_POINTER(VECTOR,TABLEAU) T1,T2;
␈↓ α∧␈↓        RECORD_POINTER(ANY_CLASS) R;


␈↓ α∧␈↓At␈α⊂runtime,␈α⊂these␈α⊂variables␈α⊂either␈α⊃contain␈α⊂the␈α⊂value␈α⊂NULL_RECORD␈α⊂(internally,␈α⊂zero)␈α⊃or␈α⊂else
␈↓ α∧␈↓contains␈α⊃a␈α⊃pointer␈α⊃to␈α⊃a␈α⊃record.␈α⊃ The␈α⊃<classid␈α⊃list>␈α⊃is␈α⊃used␈α⊃to␈α⊃make␈α⊃a␈α⊃compile-time␈α⊃check␈α⊂on
␈↓ α∧␈↓assignments␈α∀and␈α∪subfield␈α∀references.␈α∀ The␈α∪pseudo-class␈α∀ANY_CLASS␈α∪matches␈α∀all␈α∀classes,␈α∪and
␈↓ α∧␈↓effectively disables this compile-time check.  For instance:

␈↓ α∧␈↓        RECORD_POINTER(FOO,BAR) FB1,FB2;
␈↓ α∧␈↓        RECORD_POINTER(FOO) FB3;
␈↓ α∧␈↓        RECORD_POINTER(CELL) C;
␈↓ α∧␈↓        RECORD_POINTER(ANY_CLASS) RP;
␈↓ α∧␈↓        :
␈↓ α∧␈↓        COMMENT the following are all ok syntactically;
␈↓ α∧␈↓        C←NEW_RECORD(CELL);
␈↓ α∧␈↓        RP←C;
␈↓ α∧␈↓        FB2←NEW_RECORD(FOO);
␈↓ α∧␈↓        FB1←FB3;
␈↓ α∧␈↓        FB3←RP; COMMENT Note that this is most likely a runtime bug
␈↓ α∧␈↓                        Since RP will contain a cell record.  SAIL
␈↓ α∧␈↓                        won't catch it, however;
␈↓ α∧␈↓        CELL:CAR[RP]←FB1;
␈↓ α∧␈↓        CELL:CAR[RP]←FB1;

␈↓ α∧␈↓        COMMENT The compiler will complain about these: ;
␈↓ α∧␈↓        FB1←C;
␈↓ α∧␈↓        FB3←NEW_RECORD(CELL);

␈↓ α∧␈↓␈↓ ε}12␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓        RP←CELL:CAR[FB3];

␈↓ α∧␈↓NO␈α
runtime␈αclass␈α
information␈αis␈α
kept␈αwith␈α
the␈α
variable,␈αand␈α
no␈αruntime␈α
class␈αchecks␈α
are␈α
made␈αon
␈↓ α∧␈↓record␈αassignment␈αor␈αsubfield␈αaccess.␈α Record␈αpointer␈αvariables␈αare␈αallocated␈αquantities,␈αand␈αshould
␈↓ α∧␈↓not␈αappear␈αinside␈αSIMPLE␈αprocedures.␈α  They␈αresemble␈αlists␈αin␈αthat␈αthey␈αare␈αnot␈αgiven␈αany␈αspecial
␈↓ α∧␈↓value␈α⊂upon␈α⊂block␈α⊃entry␈α⊂and␈α⊂they␈α⊃are␈α⊂set␈α⊂to␈α⊃a␈α⊂null␈α⊂value␈α⊃(NULL_RECORD)␈α⊂when␈α⊂the␈α⊃block␈α⊂in
␈↓ α∧␈↓which␈αthey␈αare␈αdeclared␈αis␈αexited.␈α (This␈αis␈αso␈αthat␈αany␈αrecords␈αreferred␈αto␈αonly␈αin␈αthat␈αblock␈αcan
␈↓ α∧␈↓be reclaimed by the garbage collector.)



␈↓ α∧␈↓6.4 - ␈↓↓ALLOCATION␈↓


␈↓ α∧␈↓Records are allocated by means of the construct

␈↓ α∧␈↓        NEW_RECORD(<classid>)


␈↓ α∧␈↓which␈αreturns␈αa␈αnew␈αrecord␈αof␈αthe␈αspecified␈αclass.␈α All␈αsubfields␈αof␈αthe␈αnew␈αrecord␈αare␈αset␈αto␈αthe
␈↓ α∧␈↓"null"␈α
or␈α∞"zero"␈α
value␈α∞for␈α
that␈α∞subfield␈α
--␈α∞i.e.,␈α
real␈α
&␈α∞integer␈α
subfields␈α∞will␈α
be␈α∞set␈α
to␈α∞0,␈α
itemvar
␈↓ α∧␈↓subfields␈α∞will␈α∞be␈α∞set␈α∞to␈α∞ANY,␈α∂lists␈α∞will␈α∞be␈α∞set␈α∞to␈α∞PHI,␈α∂etc.␈α∞ Again,␈α∞note␈α∞that␈α∞entry␈α∞into␈α∂a␈α∞block
␈↓ α∧␈↓with␈αlocal␈αrecord␈αpointer␈αvariables␈αdoes␈αNOT␈αcause␈αrecords␈αto␈αbe␈αallocated␈αand␈αassigned␈αto␈αthose
␈↓ α∧␈↓variables.



␈↓ α∧␈↓6.5 - ␈↓↓SUBFIELDS␈↓


␈↓ α∧␈↓Record subfields are referenced by means of the construct

␈↓ α∧␈↓        <classid>:<fieldid>[<record pointer expression>]


␈↓ α∧␈↓and may be used wherever an array element may be used.  For example

␈↓ α∧␈↓        RECORD_POINTER(VECTOR) V;
␈↓ α∧␈↓        RECORD_POINTER(CELL) C;
␈↓ α∧␈↓        RECORD_POINTER(FOO) F;

␈↓ α∧␈↓        :
␈↓ α∧␈↓        VECTOR:X[V]←VECTOR:Y[V];
␈↓ α∧␈↓        CELL:CAR[C←NEW_RECORD(CELL)]←V;

␈↓ α∧␈↓␈↓ ε}13␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓        VECTOR:Z[V]←VECTOR:X[CELL:CAR[C]];
␈↓ α∧␈↓        SUBLIS ← FOO:L[F][1 TO 3];
␈↓ α∧␈↓        :


␈↓ α∧␈↓If␈α⊂the␈α⊂<record␈α⊂pointer␈α⊂expression>␈α⊂gives␈α⊂a␈α⊃null␈α⊂record,␈α⊂then␈α⊂a␈α⊂runtime␈α⊂error␈α⊂message␈α⊃will␈α⊂be
␈↓ α∧␈↓generated.␈α∞ This␈α∞is␈α∂the␈α∞only␈α∞runtime␈α∞check␈α∂that␈α∞is␈α∞made␈α∞at␈α∂present.␈α∞ I.e.,␈α∞no␈α∞runtime␈α∂checks␈α∞are
␈↓ α∧␈↓made␈α⊃to␈α⊃verify␈α⊃that␈α⊃the␈α⊃<classid>␈α⊃in␈α⊃the␈α⊃subfield␈α⊃statement␈α⊃matches␈α⊃the␈α⊃class␈α⊃of␈α⊃the␈α⊃record
␈↓ α∧␈↓whose subfield is being extracted.

␈↓ α∧␈↓An array subfield may be used as an array name, as in

␈↓ α∧␈↓        RECORD_POINTER(TABLEAU) T;
␈↓ α∧␈↓        :
␈↓ α∧␈↓        TABLEAU:A[T][I,J] ← 2.5;


␈↓ α∧␈↓provided␈α⊂that␈α⊂you␈α⊂have␈α⊂stored␈α⊂a␈α∂valid␈α⊂array␈α⊂descriptor␈α⊂into␈α⊂the␈α⊂subfield.␈α⊂ Unfortunately,␈α∂SAIL
␈↓ α∧␈↓does not provide any clean way to do this.  One unclean way is
␈↓ α∧␈↓        INTEGER PROCEDURE NEWARY(INTEGER LB,UB);
␈↓ α∧␈↓                BEGIN
␈↓ α∧␈↓                INTEGER ARRAY A[LB:UB];
␈↓ α∧␈↓                INTEGER AA;
␈↓ α∧␈↓                AA←MEMORY[LOCATION(A)];
␈↓ α∧␈↓                MEMORY[LOCATION(A)]←0;
␈↓ α∧␈↓                         COMMENT defeats deallocation;
␈↓ α∧␈↓                RETURN(AA);
␈↓ α∧␈↓                END;
␈↓ α∧␈↓        :
␈↓ α∧␈↓        RECORD_CLASS FUBAR(INTEGER ARRAY A);
␈↓ α∧␈↓        RECORD_POINTER(FUBAR) FB;
␈↓ α∧␈↓        :
␈↓ α∧␈↓        MEMORY[LOCATION(FUBAR:A[FB])]←NEWARY(1,100);

␈↓ α∧␈↓(Warning:␈αthe␈αabove␈α"advice"␈αis␈αprimarily␈αintended␈αfor␈αhackers;␈αwe␈αmake␈αno␈αpromisses␈αthat␈αit␈αwill
␈↓ α∧␈↓never␈α∞get␈α∞you␈α∞into␈α∞trouble,␈α
although␈α∞this␈α∞particular␈α∞trick␈α∞is␈α
unlikely␈α∞to␈α∞be␈α∞made␈α∞obsolete␈α∞in␈α
the
␈↓ α∧␈↓forseeable future).








␈↓ α∧␈↓␈↓ ε}14␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓6.6 - ␈↓↓GARBAGE COLLECTION␈↓


␈↓ α∧␈↓The␈αSAIL␈αrecord␈αservice␈αroutines␈αallocate␈αrecords␈αas␈α"small␈αblocks"␈αfrom␈αlarger␈α"buffers"␈αof␈αfree
␈↓ α∧␈↓storage␈αobtained␈αfrom␈αthe␈αnormal␈αSAIL␈αfree␈αstorage␈αsystem.␈α(The␈αformat␈αof␈αthese␈αrecords␈αwill␈αbe
␈↓ α∧␈↓discussed␈α⊂in␈α⊃a␈α⊂later␈α⊂section).␈α⊃ From␈α⊂time␈α⊃to␈α⊂time,␈α⊂a␈α⊃garbage␈α⊂collector␈α⊂is␈α⊃called␈α⊂to␈α⊃reclaim␈α⊂the
␈↓ α∧␈↓storage␈αfor␈αrecords␈αwhich␈αare␈αno␈αlonger␈αaccessible␈αby␈αthe␈αuser's␈αprogram␈α(i.e.,␈αare␈αnot␈α
pointed␈αto
␈↓ α∧␈↓by␈αany␈αvariables,␈αaren't␈αpointed␈αto␈αby␈αany␈αaccessible␈αrecords,␈αetc.).␈α The␈αgarbage␈αcollector␈αmay␈αbe
␈↓ α∧␈↓called␈α
explicitly␈α
from␈α
SAIL␈α
programs␈α
as␈α
external␈α
procedure␈α
$RECGC,␈α
and␈α
automatic␈α∞invocation␈α
of
␈↓ α∧␈↓the␈α∂garbage␈α∂collection␈α∞may␈α∂be␈α∂inhibited␈α∂by␈α∞setting␈α∂user␈α∂table␈α∂entry␈α∞RGCOFF␈α∂to␈α∂TRUE.␈α∂(In␈α∞this
␈↓ α∧␈↓case,␈αSAIL␈αwill␈αjust␈αkeep␈αallocating␈αmore␈αspace,␈αwith␈αnothing␈αbeing␈αreclaimed␈αuntil␈αRGCOFF␈αis␈αset
␈↓ α∧␈↓back␈α
to␈α∞FALSE␈α
or␈α
$RECGC␈α∞is␈α
called␈α
explicitly).␈α∞ In␈α
addition,␈α
SAIL␈α∞provides␈α
a␈α
number␈α∞of␈α
"hooks"
␈↓ α∧␈↓that␈α∪allow␈α∪a␈α∪user␈α∪to␈α∪control␈α∀the␈α∪automatic␈α∪invocation␈α∪of␈α∪the␈α∪garbage␈α∪collector.␈α∀ These␈α∪are
␈↓ α∧␈↓discussed in a subsequent section.



␈↓ α∧␈↓6.7 - ␈↓↓INTERNAL REPRESENTATIONS ␈↓


␈↓ α∧␈↓Each record has the following form:

␈↓ α∧␈↓       -1:  <pointers to ring of all records of class>
␈↓ α∧␈↓        0:  <garbage collector pointer>,,<pntr to class descriptor>
␈↓ α∧␈↓        +1:     <first subfield>
␈↓ α∧␈↓                      :
␈↓ α∧␈↓        +n:     <last subfield>

␈↓ α∧␈↓Record  pointer   variables  point  at   word  0  of   such  records.

␈↓ α∧␈↓The␈αpredefined␈αrecord␈αclass␈α$CLASS␈αis␈αused␈αto␈αdefine␈αall␈αrecord␈αclasses,␈αand␈αis␈αitself␈αa␈α
record␈αof
␈↓ α∧␈↓class $CLASS.

␈↓ α∧␈↓        RECORD_CLASS $CLASS (INTEGER RECRNG,HNDLER,RECSIZ;
␈↓ α∧␈↓                                INTEGER ARRAY TYPARR;
␈↓ α∧␈↓                                STRING ARRAY TXTARR);

␈↓ α∧␈↓where

␈↓ α∧␈↓RECRNG is a ring (bidirectional linked list) of all records         of the particular class,

␈↓ α∧␈↓HNDLER is a pointer to the handler procedure for the class         (default $REC$)

␈↓ α∧␈↓RECSIZ is the number of subfields in the class,

␈↓ α∧␈↓␈↓ ε}15␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓TYPARR is an array of subfield descriptors for each subfield of the         class.

␈↓ α∧␈↓TXTARR is an array of subfield names for the class.

␈↓ α∧␈↓The␈α∞normal␈α∂ value␈α∞for␈α∞the␈α∂ handler␈α∞procedure␈α∞is␈α∂ $REC$,␈α∞which␈α∞ is␈α∂the␈α∞standard␈α∂procedure␈α∞ for
␈↓ α∧␈↓such  functions as  allocation, deallocation, etc.

␈↓ α∧␈↓TYPARR␈α∩and␈α⊃TXTARR␈α∩are␈α⊃indexed␈α∩[0:RECSIZ].␈α⊃ TXTARR[0]␈α∩is␈α⊃the␈α∩name␈α⊃of␈α∩the␈α∩record␈α⊃class.
␈↓ α∧␈↓TYPARR[0] contains type bits for the record class.
␈↓ α∧␈↓Example:

␈↓ α∧␈↓        RECORD_CLASS FOO(LIST L;ITEMVAR A);

␈↓ α∧␈↓The record class descriptor for FOO would contain:

␈↓ α∧␈↓        FOO-1:  <pointers for ring of all records of $CLASS>
␈↓ α∧␈↓        FOO:    <pointer to $CLASS>
␈↓ α∧␈↓        FOO+1:  <pointers for ring of all records of class FOO
␈↓ α∧␈↓                        initialized to <FOO+2,,FOO+2> >.
␈↓ α∧␈↓        FOO+2:  <pointer to handler procedure: $REC$>
␈↓ α∧␈↓        FOO+3:  2
␈↓ α∧␈↓        FOO+4   <pointer to TYPARR>
␈↓ α∧␈↓        FOO+5:  <pointer to TXTARR>

␈↓ α∧␈↓The subfields of FOO will be:

␈↓ α∧␈↓        $CLASS:FOO[RECRNG] = <initialized to null ring,
␈↓ α∧␈↓                              i.e., xwd(loc(FOO)+2,loc(FOO)+22)>
␈↓ α∧␈↓        $CLASS:FOO[HNDLER] = $REC$
␈↓ α∧␈↓        $CLASS:FOO[RECSIZ] = 2
␈↓ α∧␈↓        $CLASS:FOO[TXTARR] [0] = "FOO"
␈↓ α∧␈↓        $CLASS:FOO[TXYARR] [1] = "L"
␈↓ α∧␈↓        $CLASS:FOO[TXTARR] [2] = "A"
␈↓ α∧␈↓        $CLASS:FOO[TYPARR] [0] = <magic bits for garbage collector>
␈↓ α∧␈↓        $CLASS:FOO[TYPARR] [1] = <descriptor for LIST>
␈↓ α∧␈↓        $CLASS:FOO[TYPARR] [2] = <descriptor for ITEMVAR>









␈↓ α∧␈↓␈↓ ε}16␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓6.8 - ␈↓↓HANDLER PROCEDURES␈↓



␈↓ α∧␈↓The␈α
normal␈α
value␈α∞for␈α
the␈α
handler␈α
procedure␈α∞is␈α
$REC$,␈α
which␈α
is␈α∞the␈α
standard␈α
procedure␈α∞for␈α
such
␈↓ α∧␈↓functions␈α∂as␈α∞allocation,␈α∂deallocation,␈α∂etc.␈α∞It␈α∂is␈α∞possible␈α∂for␈α∂a␈α∞user␈α∂to␈α∞substitute␈α∂his␈α∂own␈α∞handler
␈↓ α∧␈↓procedure␈α∂for␈α∂a␈α∂given␈α⊂class␈α∂of␈α∂records␈α∂by␈α∂including␈α⊂the␈α∂procedure␈α∂name␈α∂ in␈α∂brackets␈α⊂after␈α∂the
␈↓ α∧␈↓record class declaration:
␈↓ α∧␈↓        RECORD_CLASS <id> (<subfields>) [<handler>]

␈↓ α∧␈↓This handler must have the form

␈↓ α∧␈↓        RECORD_POINTER(ANY_CLASS) PROCEDURE <procid>
␈↓ α∧␈↓                        (INTEGER OP;RECORD_POINTER(ANY_CLASS) R);


␈↓ α∧␈↓Where␈αOP␈α will␈αbe␈αa␈α small␈αinteger␈α saying␈αwhat␈αis␈α to␈αbe␈α done.␈α The␈αcurrent␈αassignments␈αfor␈αOP
␈↓ α∧␈↓are:

␈↓ α∧␈↓        OP value        meaning

␈↓ α∧␈↓        0               invalid
␈↓ α∧␈↓        1               allocate a new record of record class R
␈↓ α∧␈↓        2               not used
␈↓ α∧␈↓        3               not used
␈↓ α∧␈↓        4               Mark all subfields of record R
␈↓ α∧␈↓        5               Delete all space for record R


␈↓ α∧␈↓$REC$(1,R)␈αallocates␈αa␈αrecord␈αof␈αthe␈αrecord␈αclass␈αspecified␈αby␈αR.␈α All␈αsubfields␈α(except␈αstring)␈αare
␈↓ α∧␈↓initialized␈α
to␈α
zero.␈α
 String␈α
subfields␈α
are␈α
initialized␈α
to␈α
a␈α
pointer␈α
to␈α
a␈α
string␈α
descriptor␈α
with␈αlength
␈↓ α∧␈↓zero (null string).

␈↓ α∧␈↓$REC$(4,R) is used for marking by the garbage collector and it not generally useful to the user.

␈↓ α∧␈↓$REC$(5,R)␈α
deallocates␈αrecord␈α
R,␈αand␈α
deallocates␈α
all␈αstring␈α
and␈αarray␈α
subfields␈αof␈α
record␈α
R.␈α Care
␈↓ α∧␈↓must␈α∞be␈α∞exercised␈α
to␈α∞prevent␈α∞multiple␈α
pointers␈α∞to␈α∞string␈α
and␈α∞array␈α∞subfields,␈α
ie.␈α∞DO␈α∞NOT␈α
store
␈↓ α∧␈↓the␈α
location␈α
of␈αan␈α
array␈α
in␈αsubfields␈α
of␈α
two␈αdifferent␈α
records␈α
unless␈αextreme␈α
caution␈α
is␈α
taken␈αto
␈↓ α∧␈↓handle␈α⊃deletion.␈α⊃ This␈α⊃can␈α⊃be␈α∩accomplished␈α⊃through␈α⊃user␈α⊃handler␈α⊃procedures␈α⊃which␈α∩zero␈α⊃array
␈↓ α∧␈↓subfields (without actually deleting the arrays) prior to the call on $REC$(5,R).





␈↓ α∧␈↓␈↓ ε}17␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓6.9 - ␈↓↓STRING SUBFIELDS␈↓


␈↓ α∧␈↓String␈α⊃subfields␈α∩presented␈α⊃an␈α∩implementation␈α⊃difficulty␈α⊃due␈α∩to␈α⊃the␈α∩fact␈α⊃that␈α∩string␈α⊃discriptors
␈↓ α∧␈↓require␈α
2␈αwords,␈α
but␈α
record␈αsubfields␈α
are␈αexactly␈α
one␈α
word.␈α This␈α
problem␈αwas␈α
solved␈α
by␈αmaking
␈↓ α∧␈↓string␈α⊃subfields␈α⊃contain␈α∩a␈α⊃pointer␈α⊃to␈α∩the␈α⊃descriptor␈α⊃for␈α∩the␈α⊃string␈α⊃(like␈α∩REFERENCE␈α⊃STRING
␈↓ α∧␈↓formal parameters).

␈↓ α∧␈↓When␈αa␈αrecord␈αwith␈αstring␈αsubfields␈αis␈αallocated␈αby␈αa␈αcall␈αto␈αNEW_RECORD,␈αthe␈αstring␈αdescriptor
␈↓ α∧␈↓blocks␈α(2␈α
words␈αeach)␈α
are␈αallocated␈α
from␈αa␈α
linked␈αlist␈α
of␈αfree␈α
string␈αdescriptors.␈α
 Likewise,␈αwhen
␈↓ α∧␈↓a␈α↔record␈α↔is␈α↔deallocated␈α↔either␈α↔explicitly␈α⊗or␈α↔by␈α↔the␈α↔garbage␈α↔collector,␈α↔the␈α↔string␈α⊗subfield
␈↓ α∧␈↓descriptors are released to the free list.  The free list is automatically expanded when exhausted.



␈↓ α∧␈↓6.10 - ␈↓↓MORE ABOUT GARBAGE COLLECTION␈↓


␈↓ α∧␈↓The␈α⊂information␈α∂used␈α⊂by␈α⊂the␈α∂system␈α⊂to␈α⊂decide␈α∂when␈α⊂to␈α∂call␈α⊂$RECGC␈α⊂on␈α∂its␈α⊂own␈α⊂is␈α∂accessible
␈↓ α∧␈↓through␈α∩global␈α∩array,␈α∩$SPCAR.␈α⊃ In␈α∩general,␈α∩$SPCAR[n]␈α∩points␈α⊃at␈α∩a␈α∩"descriptor␈α∩block"␈α∩used␈α⊃to
␈↓ α∧␈↓control the allocation of small blocks of n words.  This descriptor includes the following fields:
␈↓ α∧␈↓        BLKSIZ  -- number of words per block in this "space"
␈↓ α∧␈↓        TRIGGER -- a counter used to control when to garbage collect
␈↓ α∧␈↓        TGRMIN  -- described below.
␈↓ α∧␈↓        TUNUSED -- number of unused blocks on the "free list"
␈↓ α∧␈↓        TINUSE  -- total number of blocks "in use" for this space.
␈↓ α∧␈↓        CULPRIT -- the number of times this space has caused collection.


␈↓ α∧␈↓The␈α⊃appropriate␈α⊃macro␈α⊃definitions␈α⊃for␈α⊃access␈α⊃of␈α⊃these␈α⊃fields␈α⊃may␈α⊃be␈α⊃found␈α⊃in␈α⊃the␈α⊃source␈α⊂file
␈↓ α∧␈↓"SYS:RECORD.DEF".␈α As␈αone␈αmight␈α
expect,␈αthe␈αdecision␈αto␈α
invoke␈αthe␈αgarbage␈αcollector␈α
is␈α made
␈↓ α∧␈↓as part of the block allocation procedure, which works (roughly) as follows:
␈↓ α∧␈↓        INTEGER spc,size;
␈↓ α∧␈↓        size ← $CLASS:RECSIZ[classid]+2;
␈↓ α∧␈↓        IF size>16 THEN
␈↓ α∧␈↓                return a CORGET block;
␈↓ α∧␈↓        spc ← $SPCAR[size];
␈↓ α∧␈↓        L1: IF (MEMORY[spc+TRIGGER]←MEMORY[spc+TRIGGER]-1) < 0 THEN
␈↓ α∧␈↓                BEGIN
␈↓ α∧␈↓                IF ¬MEMORY[GOGTAB+RGCOFF] THEN
␈↓ α∧␈↓                        BEGIN
␈↓ α∧␈↓                        MEMORY[spc+CULPRIT]←MEMORY[spc+CULPRIT]+1;
␈↓ α∧␈↓                        $RECGC;
␈↓ α∧␈↓                        GO TO L1;

␈↓ α∧␈↓␈↓ ε}18␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 	WRECORD STRUCTURES


␈↓ α∧␈↓                        END;
␈↓ α∧␈↓                END;
␈↓ α∧␈↓        <allocate the block from space spc, update counters, etc.>


␈↓ α∧␈↓Once␈α
$RECGC␈α
has␈α
returned␈α
all␈α
unused␈α
records␈α
to␈α
the␈α
free␈α
lists␈α
associated␈α
with␈α
their␈αrespective
␈↓ α∧␈↓block␈α
sizes,␈α
it␈α
must␈α∞adjust␈α
the␈α
trigger␈α
levels␈α∞in␈α
the␈α
various␈α
spaces.␈α
 To␈α∞do␈α
this,␈α
it␈α
first␈α∞looks␈α
to
␈↓ α∧␈↓see␈α
if␈α
the␈α
user␈α
has␈α
specified␈α
the␈α∞location␈α
of␈α
an␈α
adjustment␈α
procedure␈α
in␈α
TGRADJ(USER).␈α∞ If␈α
this
␈↓ α∧␈↓cell␈αis␈αnon-zero,␈αthen␈α$RECGC␈αcalls␈αthat␈αprocedure␈α(which␈αmust␈αhave␈αno␈αparameters).␈α Otherwise,
␈↓ α∧␈↓it calls a default system procedure that works roughly like this:
␈↓ α∧␈↓        <set all TRIGGER levels to -1>
␈↓ α∧␈↓        FOR size ← 3 STEP 1 UNTIL 16 DO
␈↓ α∧␈↓                BEGIN
␈↓ α∧␈↓                spc ← $SPCAR[size];
␈↓ α∧␈↓                IF MEMORY[spc+TRIGGER]<0 THEN
␈↓ α∧␈↓                        BEGIN
␈↓ α∧␈↓                        t←MEMORY[spc+TINUSE]*RGCRHO(USER);
␈↓ α∧␈↓                        t←MAX(t,MEMORY[spc+TUNUSED],
␈↓ α∧␈↓                                MEMORY[spc+TGRMIN]);
␈↓ α∧␈↓                        END;
␈↓ α∧␈↓                END;


␈↓ α∧␈↓RGCRHO(USER)␈α⊂is␈α⊂a␈α⊂real␈α⊂number␈α⊂currently␈α⊃initialized␈α⊂by␈α⊂the␈α⊂system␈α⊂to␈α⊂0.33.␈α⊂ Thus,␈α⊃users␈α⊂can
␈↓ α∧␈↓modify the behavior or SAIL's automatic garbage collection by some combination of:

␈↓ α∧␈↓        (1) Setting RGCOFF(USER).
␈↓ α∧␈↓        (2) Supplying their own procedure in TGRADJ(USER).
␈↓ α∧␈↓        (3) Modifying RGCRHO(USER).
␈↓ α∧␈↓        (4) Modifying the TGRMIN entries in the space descriptors.


␈↓ α∧␈↓One␈α⊂word␈α⊂of␈α⊂caution:␈α⊂User␈α⊃procedures␈α⊂that␈α⊂set␈α⊂trigger␈α⊂levels␈α⊃must␈α⊂be␈α⊂sure␈α⊂not␈α⊂to␈α⊃leave␈α⊂the
␈↓ α∧␈↓trigger␈α∂level␈α∂of␈α∂the␈α∂space␈α⊂that␈α∂caused␈α∂collection␈α∂to␈α∂be␈α∂set␈α⊂to␈α∂zero.␈α∂ This␈α∂will␈α∂cause␈α⊂a␈α∂runtime
␈↓ α∧␈↓error message to be generated.










␈↓ α∧␈↓␈↓ ε}19␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 
≤SAVE/CONTINUE


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  7␈↓

␈↓ α∧␈↓␈↓ ¬e␈↓↓SAVE/CONTINUE␈↓





␈↓ α∧␈↓A␈α∪save/continue␈α∪facility␈α∪has␈α∪been␈α∪implemented␈α∪in␈α∪the␈α∪SAIL␈α∪compiler.␈α∪ This␈α∪allows␈α∪compiling
␈↓ α∧␈↓header␈α⊃files,␈α⊃saving␈α⊃the␈α⊃state␈α⊃of␈α⊃the␈α⊂compiler,␈α⊃and␈α⊃resuming␈α⊃compilation␈α⊃at␈α⊃a␈α⊃later␈α⊃time.␈α⊂ The
␈↓ α∧␈↓save/continue␈α∞facility␈α∞works␈α
with␈α∞files␈α∞as␈α∞the␈α
basic␈α∞unit;␈α∞compilation␈α
can␈α∞be␈α∞interrupted␈α∞only␈α
at
␈↓ α∧␈↓the end of a file.  The /X (eXtend) switch controls the new feature.

␈↓ α∧␈↓Example:
␈↓ α∧␈↓.R SAIL
␈↓ α∧␈↓*INTRMD.REL[PRJ,PRG]←A,B,C/X
␈↓ α∧␈↓ A.SAI 1 etc.

␈↓ α∧␈↓SAVE ME FOR USE AS XSAIL.
␈↓ α∧␈↓EXIT
␈↓ α∧␈↓.SAVE XSAIL
␈↓ α∧␈↓JOB SAVED IN 25K
␈↓ α∧␈↓UPPER NOT SAVED!

␈↓ α∧␈↓.RU XSAIL
␈↓ α∧␈↓*FINAL←D,E,F
␈↓ α∧␈↓ D.SAI
␈↓ α∧␈↓Copying DSK:INTRMD.REL[PRJ,PRG]
␈↓ α∧␈↓ 2 3 etc.

␈↓ α∧␈↓*↑C


␈↓ α∧␈↓The above is equivalent to
␈↓ α∧␈↓.R SAIL
␈↓ α∧␈↓*FINAL←A,B,C,D,E,F

␈↓ α∧␈↓Information␈αis␈αsaved␈αin␈αXSAIL.SAV␈αand␈αin␈αthe␈αbinary␈αfile␈αfrom␈αthe␈αfirst␈α"compilation"␈α(in␈αthis␈αcase
␈↓ α∧␈↓INTRMD.REL).␈α⊂ When␈α⊂compilation␈α⊂is␈α⊂resumed,␈α⊂the␈α⊃final␈α⊂binary␈α⊂file␈α⊂is␈α⊂initialized␈α⊂by␈α⊃copying␈α⊂the
␈↓ α∧␈↓intermediate file.

␈↓ α∧␈↓Save/continue␈α
is␈αnot␈α
allowed␈α
if␈αthe␈α
file␈αbreak␈α
occurs␈α
while␈αscanning␈α
false␈α
conditional␈αcompilation
␈↓ α∧␈↓or actual parameters to a macro call.


␈↓ α∧␈↓␈↓ ε}20␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 
≤SAVE/CONTINUE


␈↓ α∧␈↓A␈αhint␈αon␈αusing␈αthis␈αfeature:␈α If␈αthe␈αsource␈αterm␈αof␈αyour␈αcommand␈αstring␈αconsists␈αof␈αjust␈αone␈αfile,
␈↓ α∧␈↓and this one file does REQUIREs of other source files, the following setup works well.
␈↓ α∧␈↓Original file FOO.SAI:
␈↓ α∧␈↓        BEGIN "FOO"
␈↓ α∧␈↓          REQUIRE "[][]" DELIMITERS;
␈↓ α∧␈↓          DEFINE !=[COMMENT];
␈↓ α∧␈↓          REQUIRE "BAZ.SAI" SOURCE_FILE;
␈↓ α∧␈↓          REQUIRE "MUMBLE.SAI" SOURCE_FILE;
␈↓ α∧␈↓          :
␈↓ α∧␈↓          <rest of file>
␈↓ α∧␈↓          :
␈↓ α∧␈↓        END "FOO"


␈↓ α∧␈↓New file FOO.SAI:
␈↓ α∧␈↓    IFCR NOT DECLARATION(GARPLY) THENC
␈↓ α∧␈↓        BEGIN "FOO"
␈↓ α∧␈↓          REQUIRE "[][]" DELIMITERS;
␈↓ α∧␈↓    DEFINE GARPLY=TRUE;
␈↓ α∧␈↓          DEFINE !=[COMMENT];
␈↓ α∧␈↓          REQUIRE "BAZ.SAI" SOURCE_FILE;
␈↓ α∧␈↓          REQUIRE "MUMBLE.SAI" SOURCE_FILE;
␈↓ α∧␈↓    ENDC;
␈↓ α∧␈↓          :
␈↓ α∧␈↓          <rest of file>
␈↓ α∧␈↓          :
␈↓ α∧␈↓        END "FOO"


␈↓ α∧␈↓New file FOO.HDR:
␈↓ α∧␈↓    IFCR NOT DECLARATION(GARPLY) THENC
␈↓ α∧␈↓        BEGIN "FOO"
␈↓ α∧␈↓          REQUIRE "[][]" DELIMITERS;
␈↓ α∧␈↓    DEFINE GARPLY=TRUE;
␈↓ α∧␈↓          DEFINE !=[COMMENT];
␈↓ α∧␈↓          REQUIRE "BAZ.SAI" SOURCE_FILE;
␈↓ α∧␈↓          REQUIRE "MUMBLE.SAI" SOURCE_FILE;
␈↓ α∧␈↓    ENDC;


␈↓ α∧␈↓Initial compilation:
␈↓ α∧␈↓    .R SAIL
␈↓ α∧␈↓    *FOO.INT[PRJ,PRG]←FOO.HDR/X
␈↓ α∧␈↓    SAVE ME!

␈↓ α∧␈↓␈↓ ε}21␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ 
≤SAVE/CONTINUE


␈↓ α∧␈↓    .SAV XSAIL


␈↓ α∧␈↓Now the command string
␈↓ α∧␈↓    FOO←FOO
␈↓ α∧␈↓will work both in the case of .R SAIL and in the case .RU XSAIL.







































␈↓ α∧␈↓␈↓ ε}22␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  8␈↓

␈↓ α∧␈↓␈↓ ∧<␈↓↓MISCELLANEOUS NEW FEATURES␈↓







␈↓ α∧␈↓8.1 - ␈↓↓NEW MTAPE OPTIONS␈↓


␈↓ α∧␈↓        MTAPE(chan,NULL)


␈↓ α∧␈↓will␈αcause␈αan␈αMTAPE␈α0␈αto␈αbe␈αissued␈αfor␈αchannel␈αchan.␈α For␈αmag.␈αtapes,␈αthis␈αwill␈αcause␈αyou␈αto␈αwait
␈↓ α∧␈↓until␈α∞all␈α∞activity␈α
ceases.␈α∞ For␈α∞other␈α∞devices,␈α
various␈α∞random␈α∞things␈α
can␈α∞happen,␈α∞depending␈α∞on␈α
the
␈↓ α∧␈↓device and system.

␈↓ α∧␈↓In␈α∂export␈α⊂SAIL,␈α∂MTAPE(chnl,"I")␈α∂sets␈α⊂the␈α∂'IBM␈α∂compatible'␈α⊂mode␈α∂for␈α∂a␈α⊂tape␈α∂drive.␈α∂ (It␈α⊂does␈α∂an
␈↓ α∧␈↓MTAPE chnl,101.)

␈↓ α∧␈↓These␈αfeatures␈αdo␈αnot␈αwork␈αin␈αTENEX␈αSAIL.␈α Full␈αaccess␈αto␈αTENEX␈αmagtapes␈αis␈αobtained␈αthrough
␈↓ α∧␈↓the MTOPR, GDSTS and SDSTS routines, which are TENEX-only runtimes.



␈↓ α∧␈↓8.2 - ␈↓↓INITIALIZATION PHASES␈↓


␈↓ α∧␈↓User␈α
initializations␈α
 are␈α
 now␈αdone␈α
 in␈α
successive␈α
 phases,␈αwith␈α
 all␈α
initializations␈α
  required␈α  for
␈↓ α∧␈↓one   phase   being  done   before initializations required for the next phase.

␈↓ α∧␈↓Syntax:

␈↓ α∧␈↓        REQUIRE <procid> INITIALIZATION;
␈↓ α∧␈↓        REQUIRE <procid> INITIALIZATION [<phase no>];

␈↓ α∧␈↓where <phase no> is an integer constant.

␈↓ α∧␈↓Semantics:



␈↓ α∧␈↓␈↓ ε}23␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓<phase␈αno>␈αspecifies␈α the␈αnumber␈α of␈αthe␈αuser␈α initialization␈αphase.␈α If␈α it␈αis␈αleft␈αout,␈α then␈αone␈αis
␈↓ α∧␈↓used.␈α  Currently,␈αthere␈αare␈αthree␈α phases,␈αnumbered␈α0,␈α1,␈αand␈α 2.␈α If␈αthe␈α demand␈αis␈αgreat␈αenough,
␈↓ α∧␈↓additional␈α⊃phases␈α⊂may␈α⊃ be␈α⊂added␈α⊃later.␈α⊃  (Note␈α⊂for␈α⊃assembly␈α⊂ language␈α⊃hackers:␈α⊃internally,␈α⊂user
␈↓ α∧␈↓phases are numbered '400000, '400001, etc.)



␈↓ α∧␈↓8.3 - ␈↓↓CHNCDB␈↓


␈↓ α∧␈↓        val←CHNCDB(channel)

␈↓ α∧␈↓This␈α∂integer␈α∂procedure␈α∂returns␈α⊂a␈α∂pointer␈α∂to␈α∂the␈α∂three␈α⊂word␈α∂block␈α∂used␈α∂to␈α∂open␈α⊂the␈α∂ specified
␈↓ α∧␈↓channel.␈α∞  It␈α∞is␈α∞provided␈α∞ for␈α∞the␈α∞benefit␈α∞ of␈α∞assembly␈α∞language␈α∞procedures␈α∞that␈α∞may␈α∞want␈α∞to␈α
do
␈↓ α∧␈↓I/O␈αinside␈αsome␈αfast␈αinner␈αloop,␈αbut␈αwhich␈αmay␈αwant␈αto␈αlive␈αin␈αa␈αSAIL␈αcore␈αimage␈α&␈αuse␈αthe␈αSAIL
␈↓ α∧␈↓OPEN, etc.

␈↓ α∧␈↓This feature does not work in TENEX SAIL.  See a hacker if you want these features.



␈↓ α∧␈↓8.4 - ␈↓↓ARRCLR␈↓


␈↓ α∧␈↓        ARRCLR(arry)

␈↓ α∧␈↓This␈αnew␈αruntime␈αroutine␈αclears␈αany␈αkind␈αof␈αarray.␈αThat␈αis,␈αarthmetic␈αarrays␈αget␈αfilled␈αwith␈αzeros,
␈↓ α∧␈↓string␈α∞arrays␈α∂with␈α∞NULLs,␈α∞and␈α∂itemvar␈α∞arrays␈α∞with␈α∂ANYs.␈α∞ One␈α∞may␈α∂use␈α∞ARRCLR␈α∞with␈α∂set␈α∞and
␈↓ α∧␈↓list␈α⊂arrays,␈α⊂but␈α∂the␈α⊂set␈α⊂and␈α⊂list␈α∂space␈α⊂will␈α⊂be␈α∂lost␈α⊂(i.e.␈α⊂un-garbage-collectable).␈α⊂The␈α∂alternative
␈↓ α∧␈↓form:

␈↓ α∧␈↓        ARRCLR(arry,val)


␈↓ α∧␈↓where␈αval␈α
is␈αeither␈α
an␈αinteger␈αor␈α
a␈αreal␈α
number,␈αwill␈αfill␈α
arry␈αwith␈α
that␈αvalue.␈α Do␈α
not␈αdo␈α
this␈αto
␈↓ α∧␈↓string␈α∞or␈α∞list␈α∞arrays␈α∞unless␈α∞you␈α∞do␈α∞not␈α
care␈α∞whether␈α∞or␈α∞not␈α∞your␈α∞program␈α∞works.␈α∞ Also␈α∞using␈α
a
␈↓ α∧␈↓real␈α
val␈α
for␈α
an␈α
itemvar␈α
array␈α
is␈α
apt␈α
to␈α∞cause␈α
strange␈α
results.␈α
(If␈α
you␈α
use␈α
an␈α
integer,␈α
arry␈α∞will␈α
be
␈↓ α∧␈↓filled with CVI(val).)







␈↓ α∧␈↓␈↓ ε}24␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓8.5 - ␈↓↓SETPL␈↓


␈↓ α∧␈↓        SETPL(channel, @linnum, @pagnum, @sosnum)

␈↓ α∧␈↓This␈α∃new␈α⊗runtime␈α∃routine␈α⊗allows␈α∃one␈α⊗to␈α∃keep␈α∃track␈α⊗of␈α∃the␈α⊗string␈α∃input␈α⊗from␈α∃CHANNEL.
␈↓ α∧␈↓Whenever␈α∃a␈α∃'12␈α∃is␈α∃encountered,␈α⊗LINNUM␈α∃is␈α∃incremented.␈α∃ Whenever␈α∃a␈α∃'14␈α⊗is␈α∃encountered,
␈↓ α∧␈↓PAGNUM␈α
is␈αincremented,␈α
and␈α
LINNUM␈αis␈α
zeroed.␈α Whenever␈α
an␈α
SOS␈αline␈α
number␈α
is␈αencountered,
␈↓ α∧␈↓it␈α
is␈α
placed␈α
into␈α∞SOSNUM.␈α
 When␈α
fully␈α
implemented␈α
(soon),␈α∞this␈α
will␈α
work␈α
on␈α
the␈α∞INPUT,␈α
INTIN,
␈↓ α∧␈↓and REALIN functions as well.



␈↓ α∧␈↓8.6 - ␈↓↓EVALREDEFINE␈↓


␈↓ α∧␈↓EVALREDEFINE␈α⊃bears␈α⊂the␈α⊃same␈α⊂relationship␈α⊃to␈α⊂REDEFINE␈α⊃as␈α⊂EVALDEFINE␈α⊃does␈α⊃to␈α⊂DEFINE.
␈↓ α∧␈↓See pages 47 and 50 of the Manual.



␈↓ α∧␈↓8.7 - ␈↓↓CVPS␈↓


␈↓ α∧␈↓CVPS(<macro_parameter>)␈α∂converts␈α∂<macro_parameter>␈α∂to␈α∂a␈α∂string␈α∂and␈α∂returns␈α∂the␈α∂string.␈α∞See
␈↓ α∧␈↓about macro parameters on page 48 of the manual.



␈↓ α∧␈↓8.8 - ␈↓↓EXPRESSIONS IN REQUIRES␈↓


␈↓ α∧␈↓Previously,␈αall␈αREQUIRE␈αconstructs␈αhad␈αto␈αhave␈αonly␈αconstants␈αin␈αthem.␈αNow␈αSAIL␈αallows␈αcompile
␈↓ α∧␈↓time expressions as well. See about compile time expressions on page 47 of the Manual.











␈↓ α∧␈↓␈↓ ε}25␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓8.9 - ␈↓↓RELEASE␈↓


␈↓ α∧␈↓RELEASE␈αnow␈αtakes␈αan␈αoptional␈αsecond␈αargument,␈αthe␈αCLOSE␈αinhibit␈αbits.␈α These␈αare␈αdescribed␈αin
␈↓ α∧␈↓the␈α∞UUO␈α∞manual␈α∞(Stanford␈α∞System).␈α
These␈α∞are␈α∞defaulted␈α∞to␈α∞zero␈α
when␈α∞not␈α∞specified␈α∞so␈α∞that␈α
old
␈↓ α∧␈↓programs which did not specify them will work as before.

␈↓ α∧␈↓The CLOSE inhibit feature only works at SU-AI.



␈↓ α∧␈↓8.10 - ␈↓↓TTYUP␈↓


␈↓ α∧␈↓        oldval←TTYUP(newval)


␈↓ α∧␈↓This␈αroutine␈αcasuse␈αconversion␈αof␈αlower␈αcase␈αcharacters␈α(a-z)␈αto␈αtheir␈αupper␈αcase␈αequivalents␈αfor
␈↓ α∧␈↓strings␈α⊂read␈α∂by␈α⊂any␈α⊂of␈α∂the␈α⊂SAIL␈α⊂teletype␈α∂routines␈α⊂that␈α⊂do␈α∂not␈α⊂use␈α⊂break␈α∂tables.␈α⊂ If␈α⊂newval␈α∂is
␈↓ α∧␈↓TRUE,␈αthen␈αconversion␈αwill␈αtake␈αplace␈αon␈αall␈αsubsequent␈αinputs␈αuntil␈αTTYUP␈αis␈αcalled␈αwith␈αnewval
␈↓ α∧␈↓FALSE.␈α∞ Oldval␈α
will␈α∞always␈α
get␈α∞set␈α
to␈α∞the␈α
value␈α∞of␈α
newval␈α∞used␈α
in␈α∞the␈α
previous␈α∞call.␈α∞(If␈α
TTYUP
␈↓ α∧␈↓has␈α⊃never␈α⊃been␈α⊃called,␈α⊃then␈α⊂no␈α⊃conversions␈α⊃will␈α⊃take␈α⊃place,␈α⊂and␈α⊃the␈α⊃first␈α⊃call␈α⊃to␈α⊃TTYUP␈α⊂will
␈↓ α∧␈↓return FALSE).

␈↓ α∧␈↓In TENEX, TTYUP sets the system parameter using the STPAR jsys to convert to upper case.



␈↓ α∧␈↓8.11 - ␈↓↓BREAKSET MODES "K" AND "F"␈↓


␈↓ α∧␈↓A␈α∞"K"␈α∞specification␈α∞as␈α∞a␈α∞BREAKSET␈α∞mode␈α
will␈α∞cause␈α∞lower␈α∞to␈α∞upper␈α∞case␈α∞conversion␈α∞when␈α
that
␈↓ α∧␈↓break␈α⊂table␈α∂is␈α⊂used.␈α∂ Conversion␈α⊂takes␈α⊂place␈α∂before␈α⊂each␈α∂character␈α⊂is␈α∂checked␈α⊂for␈α⊂breaking␈α∂or
␈↓ α∧␈↓omission.  An "F" specification turns off the conversion -- i.e. it undoes the effects of "K".











␈↓ α∧␈↓␈↓ ε}26␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓8.12 - ␈↓↓INOUT␈↓


␈↓ α∧␈↓        INOUT(inchan,outchan,howmany)


␈↓ α∧␈↓INOUT␈αreads␈αhowmany␈αwords␈αfrom␈αchannel␈αinchan␈αand␈αwrites␈αthem␈αout␈αon␈αchannel␈αoutchan.␈α Each
␈↓ α∧␈↓channel␈α∂must␈α∂be␈α∂open␈α∞in␈α∂a␈α∂mode␈α∂between␈α∂8␈α∞and␈α∂12.␈α∂ on␈α∂return,␈α∞the␈α∂EOF␈α∂variables␈α∂for␈α∂the␈α∞two
␈↓ α∧␈↓channels␈α∂will␈α∂be␈α∞the␈α∂same␈α∂as␈α∞if␈α∂ARRYIN␈α∂&␈α∂ARRYOUT␈α∞had␈α∂been␈α∂used.␈α∞ If␈α∂howmany␈α∂is␈α∂less␈α∞than
␈↓ α∧␈↓zero, then transfer of data will cease only upon end of file or a device error.

␈↓ α∧␈↓(note: INOUT uses BLTs to transfer data directly from one set of buffers to the other)

␈↓ α∧␈↓INOUT is not available in TENEX SAIL.



␈↓ α∧␈↓8.13 - ␈↓↓GETSTS & SETSTS␈↓


␈↓ α∧␈↓        SETSTS(chan,new_status)

␈↓ α∧␈↓issues a SETSTS uuo on channel chan with the status value new_status.

␈↓ α∧␈↓        status←GETSTS(chan)


␈↓ α∧␈↓returns the results of a GETSTS uuo on channel chan.

␈↓ α∧␈↓These␈α∂functions␈α∞do␈α∂not␈α∞exist␈α∂in␈α∞TENEX␈α∂SAIL.␈α∞ Instead,␈α∂see␈α∞GTSTS,␈α∂GDSTS,␈α∞STSTS,␈α∂and␈α∞SDSTS
␈↓ α∧␈↓for analogous features.



␈↓ α∧␈↓8.14 - ␈↓↓CHANGES TO "OPEN" ERROR HANDLING␈↓


␈↓ α∧␈↓If␈αthe␈αEOF␈αvariable␈αsupplied␈αto␈αOPEN␈αis␈αnon-zero␈αand␈αthe␈αdevice␈αname␈αis␈αinvalid,␈αthen␈αOPEN␈αwill
␈↓ α∧␈↓fail␈αwithout␈αgiving␈αthe␈αerror␈αmessage␈α
"INVALID␈αDEVICE␈αNAME␈αFOR␈αOPEN",␈αand␈αthe␈α
EOF␈αvalue
␈↓ α∧␈↓will␈α
be␈α
unchanged.␈α
 If␈αa␈α
device␈α
is␈α
unavailable,␈αand␈α
EOF=0,␈α
then␈α
the␈αuser␈α
is␈α
now␈α
given␈α
the␈αoptions
␈↓ α∧␈↓of␈α∞trying␈α∞again␈α∞or␈α∞going␈α∞on␈α∞without␈α∞opening␈α∂the␈α∞device,␈α∞in␈α∞which␈α∞case␈α∞EOF␈α∞will␈α∞be␈α∞set␈α∂to␈α∞non-
␈↓ α∧␈↓zero as usual.



␈↓ α∧␈↓␈↓ ε}27␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓8.15 - ␈↓↓ASH␈↓


␈↓ α∧␈↓ASH␈α∪has␈α∩been␈α∪added␈α∩as␈α∪an␈α∪arithmetic␈α∩operator.␈α∪ Its␈α∩syntax␈α∪is␈α∪just␈α∩like␈α∪that␈α∩of␈α∪LSH,␈α∪and␈α∩it
␈↓ α∧␈↓generates similar code (except for putting out a PDP-10 ASH instruction instead of a LSH).



␈↓ α∧␈↓8.16 - ␈↓↓ARG_LIST␈↓


␈↓ α∧␈↓        ARG_LIST(<arg1>,...,<argn>)


␈↓ α∧␈↓where␈α∂each␈α⊂<arg>␈α∂may␈α∂be␈α⊂any␈α∂valid␈α∂argument␈α⊂to␈α∂the␈α∂REF_ITEM␈α⊂construct,␈α∂assembles␈α∂a␈α⊂list␈α∂of
␈↓ α∧␈↓"temporary"␈α
reference␈α
items␈α
that␈α∞will␈α
be␈α
deleted␈α
by␈α∞APPLY␈α
after␈α
the␈α
applied␈α∞procedure␈α
returns.
␈↓ α∧␈↓Thus

␈↓ α∧␈↓        APPLY(proc,ARG_LIST(foo,bar,VALUE baz))

␈↓ α∧␈↓is roughly equivalent to

␈↓ α∧␈↓        tmplst←{{REF_ITEM(foo),REF_ITEM(bar),REF_ITEM(VALUE baz)}};
␈↓ α∧␈↓        APPLY(proc,tmplst);
␈↓ α∧␈↓        WHILE LENGTH(tmplst) DO DELETE(LOP(tmplst));


␈↓ α∧␈↓but␈α∂is␈α∞somewhat␈α∂easier␈α∂to␈α∞type.␈α∂ Note␈α∞that␈α∂the␈α∂reference␈α∞items␈α∂created␈α∞by␈α∂ARG_LIST␈α∂are␈α∞just
␈↓ α∧␈↓like␈α∞those␈α
created␈α∞by␈α∞REF_ITEM,␈α
except␈α∞that␈α∞they␈α
are␈α∞marked␈α
so␈α∞that␈α∞APPLY␈α
will␈α∞know␈α∞to␈α
kill
␈↓ α∧␈↓them.



␈↓ α∧␈↓8.17 - ␈↓↓CLOSE␈↓


␈↓ α∧␈↓The␈α
CLOSE␈α
function␈α
now␈α
has␈α
an␈α
additional␈α
optional␈α
argument␈α
that␈α
allows␈α
the␈α
CLOSE␈α
inhibit␈α
bits
␈↓ α∧␈↓to␈α
be␈αturned␈α
on.␈α The␈α
second␈αargument␈α
is␈αthe␈α
bit␈αpattern␈α
for␈αthe␈α
inhibition,␈αand␈α
it␈αis␈α
defaulted␈α0.
␈↓ α∧␈↓See the UUO manual for details.

␈↓ α∧␈↓This feature is available only at SU-AI, and is not available in the TENEX version of SAIL.




␈↓ α∧␈↓␈↓ ε}28␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓8.18 - ␈↓↓TYPEIT␈↓


␈↓ α∧␈↓The␈α∂number␈α∂returned␈α∂by␈α∂the␈α∂TYPEIT␈α∂procedure␈α∂(which␈α∂identifies␈α∂the␈α∂type␈α∂of␈α∂the␈α∂datum␈α∂of␈α∂its
␈↓ α∧␈↓item␈α
expression␈α
argument)␈α
is␈α
now␈α∞changed␈α
for␈α
arrays.␈α
 Now␈α
it␈α
is␈α∞'24␈α
plus␈α
the␈α
scalar␈α
value␈α∞of␈α
the
␈↓ α∧␈↓type (e.g., INTEGER), whereas before it was '15 plus the scalar value.

␈↓ α∧␈↓Additional types added to TYPEIT are:  '16 for labels, '17 for record classes.



␈↓ α∧␈↓8.19 - ␈↓↓COMPARISON OF .REL FILES␈↓


␈↓ α∧␈↓Starting␈αwith␈αversion␈α18,␈αthe␈αcompiler␈αemits␈αinformation␈αinto␈αeach␈α.REL␈αfile␈αcontaining␈αthe␈αversion
␈↓ α∧␈↓of␈αthe␈αcompiler␈αused.␈α Then,␈αduring␈αthe␈αSAIL␈αinitialization␈αsequence,␈αthese␈αversions␈α
are␈αcompared,
␈↓ α∧␈↓and␈α
a␈α
warning␈αmessage␈α
is␈α
issued␈αif␈α
necessary.␈α
 Thus,␈αthe␈α
problem␈α
of␈αconverting␈α
from␈α
one␈αversion
␈↓ α∧␈↓of␈αthe␈αcompiler␈αto␈αa␈αnew␈αversion␈αis␈αlessened.␈α This␈αfeature␈αmay␈αnot␈αwork␈αas␈αwell␈αin␈α
the␈α current
␈↓ α∧␈↓changeover as it will in the future.



␈↓ α∧␈↓8.20 - ␈↓↓SCAN Optimizations␈↓


␈↓ α∧␈↓The␈α
SCAN␈α
function␈α
has␈α
been␈α
modified␈α
to␈α
return␈α
true␈α
substrings␈α
instead␈α
of␈α
copies␈α
in␈α∞those␈α
cases
␈↓ α∧␈↓that␈αthe␈αbreak␈αtable␈αin␈αquestion␈αwas␈αnot␈αomitting␈αany␈αcharacters.␈α This␈αshould␈αbe␈αan␈αimprovement
␈↓ α∧␈↓in the efficiency of those routines.



␈↓ α∧␈↓8.21 - ␈↓↓BREAK TABLES␈↓


␈↓ α∧␈↓There␈αare␈α
now␈α54␈αuser-setable␈α
break␈αtables␈αavailable␈α
to␈αthe␈αSCAN,␈α
INPUT,␈αTTYINL␈α
functions,␈αas
␈↓ α∧␈↓well as SETBREAK and BREAKSET.  These tables are allocated and deallocated dynamically.

␈↓ α∧␈↓In␈α∃addition,␈α∃GETBREAK␈α∃now␈α∃returns␈α∃the␈α∃value␈α∃of␈α∃the␈α∃smallest␈α∃unallocated␈α∃breaktable,␈α∀and
␈↓ α∧␈↓RELBREAK␈α
releases␈α
its␈α∞table␈α
argument.␈α
 The␈α
implicit␈α∞declarations␈α
of␈α
these␈α
new␈α∞runtime␈α
routines
␈↓ α∧␈↓are:

␈↓ α∧␈↓␈↓ ¬ INTEGER PROCEDURE GETBREAK
␈↓ α∧␈↓␈↓ ∧iPROCEDURE RELBREAK(INTEGER TABLE)


␈↓ α∧␈↓␈↓ ε}29␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓NOTE:␈α∞ a␈α∞breaktable␈α
is␈α∞allocated␈α∞by␈α
either␈α∞GETBREAK,␈α∞SETBREAK,␈α
BREAKSET␈α∞or␈α∞STDBRK.␈α
 A
␈↓ α∧␈↓breaktable␈α≤is␈α≤de-allocated␈α≤(and␈α≤thereby␈α≤made␈α≤available␈α≤to␈α≤GETBREAK)␈α≥by␈α≤RELBREAK.
␈↓ α∧␈↓Breaktables␈α∂are␈α∂stored␈α∂in␈α∂groups␈α∂of␈α∂18,␈α∂so␈α∂it␈α∂is␈α∂more␈α∂efficient␈α∂to␈α∂use␈α∂all␈α∂the␈α∂tables␈α∂in␈α∂a␈α∂given
␈↓ α∧␈↓group␈α∂before␈α⊂going␈α∂to␈α⊂another␈α∂group.␈α⊂ The␈α∂use␈α⊂of␈α∂GETBREAK␈α⊂is␈α∂particularly␈α⊂recommended␈α∂for
␈↓ α∧␈↓load-modules␈α∂and␈α∂the␈α∂like,␈α∂so␈α∂that␈α∂conflicts␈α∂will␈α∂be␈α∂minimzed.␈α∂ Breaktable␈α∂zero␈α∂is␈α∂special.␈α∂ It␈α∂is
␈↓ α∧␈↓predeclared␈α
to␈αproduce␈α
the␈α
same␈αresults␈α
as␈α
SETBREAK(0,NULL,NULL,"I").␈α This␈α
results␈α
in␈αbreak-
␈↓ α∧␈↓on-count␈α
for␈α
calls␈α
to␈α
INPUT,␈α
and␈α
always␈αreturns␈α
the␈α
whole␈α
string␈α
for␈α
SCAN.␈α
 Breaktable␈α
zero␈αis
␈↓ α∧␈↓stored along with breaktables 1 to 18, and thus takes up no additional space.

␈↓ α∧␈↓HACKERS:␈α∂ Actually␈α∂there␈α∂are␈α∂17␈α∂additional␈α∞system␈α∂breaktables␈α∂which␈α∂are␈α∂reserved␈α∂for␈α∂use␈α∞by
␈↓ α∧␈↓the␈α∩SAIL␈α∩runtime␈α∩system.␈α∩ These␈α∩tables␈α∪are␈α∩numbers␈α∩-17␈α∩through␈α∩-1,␈α∩and␈α∩are␈α∪ordinarily␈α∩not
␈↓ α∧␈↓available to the user.  They will be used by the debugger and by additional SAIL system software.

␈↓ α∧␈↓The␈α∞user␈α∂can␈α∞obtain␈α∂access␈α∞to␈α∂breaktables␈α∞-17␈α∂through␈α∞-1␈α∂by␈α∞setting␈α∂BRKPRV(USER)␈α∞to␈α∂-1,␈α∞for
␈↓ α∧␈↓example␈α∞by␈α∞the␈α∞USERCON␈α∞function␈α∞which␈α∞accesses␈α∞the␈α∞SAIL␈α∞user␈α∞table.␈α∞ WARNING:␈α∞ absolutely
␈↓ α∧␈↓no␈αguarantees␈αare␈αmade␈αto␈αthe␈αuser␈αwho␈αaccesses␈αthese␈αbreaktables.␈α This␈αinformation␈αis␈αintended
␈↓ α∧␈↓for completeness only; the use of these special breaktables by the user is not recommended.



␈↓ α∧␈↓8.22 - ␈↓↓CV6STR␈↓


␈↓ α∧␈↓CV6STR␈αdoes␈αwhat␈αyou␈αalways␈αwished␈αCVXSTR␈αdid.␈α I.e.,␈αit␈αstops␈αconverting␈αas␈αsoon␈αas␈αit␈α
sees␈αa
␈↓ α∧␈↓blank rather than always returning a six-character string.  Example:
␈↓ α∧␈↓        CV6STR(CVSIX("XYZ"))="XYZ", not "XYZ   ".

␈↓ α∧␈↓Beware, however, since

␈↓ α∧␈↓        CV6STR(CVSIX("X Y Z")) ="X", not "X Y Z" or "XYZ".



␈↓ α∧␈↓8.23 - ␈↓↓TENEX RUNTIMES␈↓


␈↓ α∧␈↓The␈α∀TENEX␈α∀version␈α∃of␈α∀SAIL␈α∀now␈α∀has␈α∃these␈α∀additional␈α∀teletype-oriented␈α∃routines:␈α∀ STTYP,
␈↓ α∧␈↓GTTYP, STPAR, STI, and DELNF, all named after jsyses.  See TENEX-specific documentation.







␈↓ α∧␈↓␈↓ ε}30␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓8.24 - ␈↓↓CVASTR␈↓


␈↓ α∧␈↓CVASTR␈α⊂is␈α⊂the␈α⊃"correct"␈α⊂inverse␈α⊂function␈α⊂to␈α⊃CVASC.␈α⊂ I.e.,␈α⊂it␈α⊂stops␈α⊃on␈α⊂a␈α⊂null␈α⊃character.␈α⊂ For
␈↓ α∧␈↓instance,
␈↓ α∧␈↓        CVASTR(CVASC("ABC")) is "ABC"

␈↓ α∧␈↓whereas

␈↓ α∧␈↓        CVSTR(CVASC("ABC")) is "ABC"&0&0



␈↓ α∧␈↓8.25 - ␈↓↓NEW SWITCHES␈↓


␈↓ α∧␈↓/V␈α∩ forces␈α∩loader␈α∩link␈α∪blocks␈α∩and␈α∩constant␈α∩string␈α∩texts␈α∪into␈α∩the␈α∩low␈α∩segment;␈α∪intended␈α∩for
␈↓ α∧␈↓overlay systems in which code is overlaid but data is not.

␈↓ α∧␈↓/X  controls compiler save/continue; see the section on save/continue.

␈↓ α∧␈↓/W␈α⊂ generates␈α⊂additional␈α⊂(suppressed)␈α⊂DDT␈α⊂symbols.␈α∂ These␈α⊂symbols␈α⊂are␈α⊂designed␈α⊂to␈α⊂serve␈α∂as
␈↓ α∧␈↓comments␈α↔to␈α⊗a␈α↔programmer␈α⊗or␈α↔processor␈α⊗rummaging␈α↔though␈α⊗the␈α↔generated␈α↔code.␈α⊗ Symbols
␈↓ α∧␈↓generated␈α
by␈α
this␈αswitch␈α
all␈α
begin␈αwith␈α
a␈α
percent␈αsign␈α
(%),␈α
and␈αmany␈α
come␈α
in␈αpairs.␈α
 A␈α
%$␈αsymbol
␈↓ α∧␈↓points␈α∂to␈α∂the␈α∂first␈α∞word␈α∂of␈α∂an␈α∂area␈α∂and␈α∞a␈α∂%.␈α∂symbol␈α∂points␈α∂to␈α∞the␈α∂first␈α∂word␈α∂beyond␈α∂the␈α∞area.
␈↓ α∧␈↓Thus the length of an area is the difference of its %. and %$ symbols.  The symbols are:
␈↓ α∧␈↓        %$ADCN  %.ADCN  address constant area
␈↓ α∧␈↓        %$LIT   %.LIT   literal area
␈↓ α∧␈↓        %$RLIT  %.RLIT  reference literal area
␈↓ α∧␈↓        %$SCOD  %.SCOD  START!CODE or QUICK!CODE area
␈↓ α∧␈↓        %$STRC  %$STRC  string variable area
␈↓ α∧␈↓        %$VARS  %.VARS  simple variable area
␈↓ α∧␈↓        %ALSTO          registers are about to be cleared
␈↓ α∧␈↓        %$ARRY          first data word of a fixed array
␈↓ α∧␈↓        %$FORE          FOREACH satisfier block
␈↓ α∧␈↓        %$SUCC          SUCCEED/FAIL return block

␈↓ α∧␈↓/W tends to increase the number of DDT symbols by a factor of 2 or 3.

␈↓ α∧␈↓The␈α∞statement␈α∞REQUIRE␈α∞"chars"␈α∞COMPILER_SWITCHES;␈α∂can␈α∞be␈α∞used␈α∞to␈α∞change␈α∞the␈α∂settings␈α∞of
␈↓ α∧␈↓the␈α⊂compiler␈α⊃switches.␈α⊂ "chars"␈α⊃must␈α⊂be␈α⊃a␈α⊂string␈α⊂constant␈α⊃which␈α⊂is␈α⊃a␈α⊂legitimate␈α⊃switch␈α⊂string,
␈↓ α∧␈↓containing none of the characters "(/)"; e.g.,
␈↓ α∧␈↓    REQUIRE "20F" COMPILER_SWITCHES;


␈↓ α∧␈↓␈↓ ε}31␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓The␈α⊂string␈α⊂of␈α⊂characters␈α⊂is␈α⊂merely␈α⊂passed␈α⊂to␈α⊂the␈α⊂switch␈α⊂processor,␈α⊂and␈α⊂it␈α⊂may␈α⊂be␈α⊂possible␈α∂to
␈↓ α∧␈↓cause␈α∂all␈α⊂sorts␈α∂of␈α⊂problems␈α∂depending␈α⊂on␈α∂the␈α⊂switches␈α∂you␈α⊂try␈α∂to␈α⊂modify.␈α∂ Currently␈α⊂the␈α∂only
␈↓ α∧␈↓switches␈αworth␈αmodifying␈αare␈α
the␈α/F␈α(listing␈αformat␈αcontrol)␈α
and␈α/B␈α(BAIL␈αcontrol)␈α
switches.␈α A
␈↓ α∧␈↓new␈α
value,␈α
/40F,␈α
has␈α
been␈α
added.␈α
 If␈α
this␈α
bit␈α
is␈α
turned␈α
on,␈α
characters␈α
will␈α
no␈α
longer␈α
be␈α
added␈α
to
␈↓ α∧␈↓the␈α
listing␈αfile;␈α
and␈α
if␈αthe␈α
bit␈αis␈α
off,␈α
the␈αlisting␈α
will␈α
resume.␈α Be␈α
sure␈αthat␈α
you␈α
have␈αa␈α
file␈α
open␈αif
␈↓ α∧␈↓you play with the /F or /B switches.



␈↓ α∧␈↓8.26 - ␈↓↓EDFILE␈↓

␈↓ α∧␈↓        EDFILE("filename",line,page,bits[0])

␈↓ α∧␈↓Exits␈αto␈αan␈αeditor.␈α Which␈αeditor␈αis␈αdetermined␈αby␈αthe␈αbits␈αwhich␈αare␈αon␈αin␈αthe␈αsecond␈αparameter,
␈↓ α∧␈↓line␈α.␈αIf␈αbit␈α0␈αor␈αbit␈α1␈α(600000,,0␈αbits)␈αis␈αon,␈αthen␈αline␈αis␈αassumed␈αto␈αbe␈αASCID␈αand␈αSOS␈αis␈αcalled.␈α If
␈↓ α∧␈↓neither␈αof␈α
these␈αbits␈αis␈α
on,␈αthen␈α line␈α
 is␈αassumed␈αto␈α
be␈αof␈αthe␈α
form␈α attach␈α
count,,sequential␈αline
␈↓ α∧␈↓number␈α
and␈α
E␈α
is␈α
called.␈α
 Page␈α
 is␈α
the␈α
binary␈α
page␈α
number.␈α
 Bits␈α
defaults␈α
to␈α
zero␈α
and␈α
controls␈α
the
␈↓ α∧␈↓editing mode:
␈↓ α∧␈↓            0  edit
␈↓ α∧␈↓            1  no directory (as in /N)
␈↓ α∧␈↓            2  readonly (as in /R)
␈↓ α∧␈↓            4  create

␈↓ α∧␈↓In␈αaddition,␈αthe␈αaccumulators␈αare␈αset␈αup␈αfrom␈αINIACS␈α(see␈αbelow)␈αso␈αthat␈αthe␈αE␈αcommand␈ααX␈αRUN
␈↓ α∧␈↓will␈αrun␈αthe␈αdump␈αfile␈αfrom␈αwhich␈αthe␈αcurrent␈αprogram␈αwas␈αgotten.␈α[Accumulators␈α0␈α(file␈α
name),␈α1
␈↓ α∧␈↓(extention), and 6 (device) are loaded from the corresponding values in INIACS.]



␈↓ α∧␈↓8.27 - ␈↓↓INIACS␈↓


␈↓ α∧␈↓The␈αcontents␈αof␈αlocations␈α0-'17␈αare␈αsaved␈αin␈αblock␈αINIACS␈αwhen␈αthe␈αcore␈αimage␈αis␈αstarted␈αfor␈αthe
␈↓ α∧␈↓first␈α%time.␈α% Declare␈α&INIACS␈α%as␈α%an␈α%external␈α&integer␈α%and␈α%use␈α&START_CODE␈α%or
␈↓ α∧␈↓MEMORY[LOCATION( INIACS)+n] to reference this block.










␈↓ α∧␈↓␈↓ ε}32␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ7MISCELLANEOUS NEW FEATURES


␈↓ α∧␈↓8.28 - ␈↓↓GOGTAB␈↓


␈↓ α∧␈↓Direct␈α∃access␈α∀to␈α∃the␈α∃user␈α∀table␈α∃can␈α∀be␈α∃gained␈α∃by␈α∀declaring␈α∃EXTERNAL␈α∃INTEGER␈α∀ARRAY
␈↓ α∧␈↓GOGTAB[0:n];  The clumsy USERCON linkage is obsolete.



␈↓ α∧␈↓8.29 - ␈↓↓ARERR␈↓


␈↓ α∧␈↓The␈α∂effective␈α∞address␈α∂of␈α∞an␈α∂ARERR␈α∞UUO␈α∂(op␈α∞code␈α∂007)␈α∞may␈α∂be␈α∞either␈α∂word␈α∞1␈α∂or␈α∞word␈α∂2␈α∂of␈α∞a
␈↓ α∧␈↓string descriptor.  This allows ARERR 1,["array name"] from START_CODE.
































␈↓ α∧␈↓␈↓ ε}33␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ)MINOR CORRECTIONS TO AIM-204


␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION  9␈↓

␈↓ α∧␈↓␈↓ ∧:␈↓↓MINOR CORRECTIONS TO AIM-204␈↓





␈↓ α∧␈↓␈↓βThis␈α∪is␈α∀a␈α∪file␈α∪of␈α∀known␈α∪SAIL␈α∀manual␈α∪defects␈α∪(mainly␈α∀typos)␈α∪that␈α∀are␈α∪not
␈↓ α∧␈↓βalready␈α∨noted␈α≡in␈α∨the␈α∨preface␈α≡or␈α∨covered␈α≡by␈α∨the␈α∨"incremental"␈α≡SAIL
␈↓ α∧␈↓βmanual.␈α∀ It␈α∪is␈α∀primarily␈α∀an␈α∪internal␈α∀document␈α∀for␈α∪the␈α∀SAIL␈α∀hackers,␈α∪put
␈↓ α∧␈↓βis␈α∃being␈α∃provided␈α∃here␈α∃as␈α∃a␈α∃stopgap␈α∃measure␈α∃pending␈α∃a␈α∃full␈α∃new␈α∃edition
␈↓ α∧␈↓βfor␈α∩the␈α∩manual.␈α∩ This␈α∩list␈α∩is,␈α∩however,␈α∩not␈α∩complete␈α∩in␈α∩that␈α∩it␈α∩does␈α∩not
␈↓ α∧␈↓βinclude␈α∀a␈α∪number␈α∀of␈α∪typos␈α∀that␈α∪do␈α∀not␈α∪change␈α∀the␈α∪meaning.␈α∀ If,␈α∪however,
␈↓ α∧␈↓βyou␈α∃discover␈α∃any␈α∃defects␈α∃in␈α∃the␈α∃manual␈α∃or␈α∃in␈α∃the␈α∃update,␈α∃please␈α∃notify
␈↓ α∧␈↓βyour friendly local SAIL representative.
␈↓ α∧␈↓β99R     KVL     The synonym for "SUCH THAT" is "|" and not "␈↓#v"␈↓#

␈↓ α∧␈↓β32R     KVL     APPENDIX 5 has nothing to do with the
␈↓ α∧␈↓β                bits for IO errors or mode enablings

␈↓ α∧␈↓β43L     RHT     FILEINFO documentation is a lie.  You usually get:

␈↓ α∧␈↓β                FILENAME
␈↓ α∧␈↓β                EXT,,DATE
␈↓ α∧␈↓β                prot(9)Mode(4)time(11)date(12)
␈↓ α∧␈↓β                negative swapped word count (if did a lookup).
␈↓ α∧␈↓β                0  (unless you opened device in magic mode)
␈↓ α∧␈↓β                0

␈↓ α∧␈↓β                The whole point is that what you get is the six words
␈↓ α∧␈↓β                from the last lookup or enter.  For details see the
␈↓ α∧␈↓β                monitor manual.

␈↓ α∧␈↓β58R     JRL     if a designated bracketed triple is not found
␈↓ α∧␈↓β                then bindit is returned and no error message is given

␈↓ α∧␈↓β33L     JRL     release now takes a second defaultable value integer
␈↓ α∧␈↓β                argument, the close inhibit bits (see RELEAS in UUO
␈↓ α∧␈↓β                manual).  These are defaulted to zero when
␈↓ α∧␈↓β                unspecified.

␈↓ α∧␈↓β72R     KVL     TELLALL does not do an implicit RESCHEDULE as the
␈↓ α∧␈↓β                description implies -- it just sets the status of
␈↓ α∧␈↓β                the concerned processes to "ready".

␈↓ α∧␈↓β102R    RFS     "33 through 36" S/B "33 through 35"

␈↓ α∧␈↓β105R    RFS     ". her are several"    s/b " . There are several"

␈↓ α∧␈↓␈↓ ε}34␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ)MINOR CORRECTIONS TO AIM-204


␈↓ α∧␈↓β79R,L   KVL     JOBTPC should be loaded with the location of a CALL
␈↓ α∧␈↓β                to a non-simple procedure.

␈↓ α∧␈↓β92R     JRL     20F will in future surround macro expansions with
␈↓ α∧␈↓β                "<>" not "⊂⊃".

␈↓ α∧␈↓β38R     RHT     The description of INCHWL is wrong.  Actually, the
␈↓ α∧␈↓β                activation character is never included in the string
␈↓ α∧␈↓β                and is always put into _SKIP_.  (<crlf> puts a <cr>
␈↓ α∧␈↓β                into _SKIP_ & throws away the <lf>).

␈↓ α∧␈↓β24L     RHT     The compiler will not in fact turn division by a
␈↓ α∧␈↓β                power of two into an ASH.

␈↓ α∧␈↓β90L     REG     "... See section 19 about these [compilation errors]"
␈↓ α∧␈↓β                should be section 20.

␈↓ α∧␈↓β90L     REG     19.1.3 "boundary" is misspelled.

␈↓ α∧␈↓β41R     RHT     CVSIX left-justifies the sixbit value it builds.

␈↓ α∧␈↓β43L     RHT     In POINT, it is "a PDP-10 byte pointer".

␈↓ α∧␈↓β45R     RHT     FORC syntax should be "FORC <identifier> ← ... "

␈↓ α∧␈↓β57R     RHT     " ... methods of searching the associative store ..."
␈↓ α∧␈↓β                had "store" missing before.

␈↓ α∧␈↓β105L    RHT     "omaname" should be "the symbolic name"

␈↓ α∧␈↓β110L    RHT     added reference:
␈↓ α∧␈↓β                Harvey, Brian  "Monitor Command Manual" SAILON 54.3
␈↓ α∧␈↓β                (Dec 1973)
␈↓ α∧␈↓β                Also, there is a more current SOS manual: SAILON 50.3

␈↓ α∧␈↓β76L     RHT     Should be "REF_ITEM(VALUE <expression>)"

␈↓ α∧␈↓β43L     RFS     For FILEINFO, also should have a note to export users
␈↓ α∧␈↓β                like "FILEINFO fills the array with the results of
␈↓ α∧␈↓β                the last LOOKUP or ENTER (DEC 10-50 systems).
␈↓ α∧␈↓β                Consult your local monitor manual for the format of
␈↓ α∧␈↓β                these entries."

␈↓ α∧␈↓β28L     JRL     CALLING PROCEDURES FROM INSIDE CODE BLOCKS
␈↓ α∧␈↓β                "... procedure is typed, it will return is value in
␈↓ α∧␈↓β                AC 1 (a pointer to the second word if the procedure
␈↓ α∧␈↓β                is a string procedure)." should be " procedure is
␈↓ α∧␈↓β                typed and not a string procedure it will return
␈↓ α∧␈↓β                its value in AC 1. String procedures push the two
␈↓ α∧␈↓β                word string descriptor corresponding to the result

␈↓ α∧␈↓␈↓ ε}35␈↓ ∀
␈↓ α∧␈↓SAIL Addendum  1␈↓ λ)MINOR CORRECTIONS TO AIM-204


␈↓ α∧␈↓β                on the SP stack."

␈↓ α∧␈↓β23L     RHT     The table of precedence for  ∧ & ∨ is misleading.
␈↓ α∧␈↓β                ∧ has higher precedence than ∨.


␈↓ α∧␈↓β26R     JRL     ARRYIN. No indication of how many words were actually
␈↓ α∧␈↓β                read is given if EOF is encountered while reading a
␈↓ α∧␈↓β                file in DUMP mode.

␈↓ α∧␈↓β25L     RHT     The description of the MEMORY[x,<type>] construct is
␈↓ α∧␈↓β                very misleading.  There is no restriction on the use
␈↓ α∧␈↓β                of this construct as the left hand side of an
␈↓ α∧␈↓β                assignment statement.  In fact, MEMORY[x,<type>] may
␈↓ α∧␈↓β                be used anywhere a simple variable of type <type> may
␈↓ α∧␈↓β                be used.































␈↓ α∧␈↓␈↓ ε}36␈↓ ∀