perm filename SAIL.XGP[DOC,AIL] blob
sn#536103 filedate 1980-09-22 generic text, type T, neo UTF8
/LMAR=0/XLINE=3/FONT#0=BDR30/FONT#1=BDR40/FONT#2=BDR30/FONT#3=LPT/BMAR=100
␈↓ α∧␈↓Sail Addendum␈↓
↑New Features
␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION 1␈↓
␈↓ α∧␈↓␈↓ ε∩␈↓↓New Features␈↓
␈↓ α∧␈↓This section describes changes and additions to Sail since the August 1976 manual, AIM-289.
␈↓ α∧␈↓1.1 - ␈↓↓Double Precision␈↓
␈↓ α∧␈↓Double␈α↔precision␈α⊗floating-point␈α↔arithmetic␈α⊗is␈α↔available.␈α⊗ Use␈α↔the␈α⊗<type_qualifier>␈α↔LONG␈α⊗in
␈↓ α∧␈↓declarations. For example,
␈↓ α∧␈↓α LONG REAL X, Y, Z;
␈↓ α∧␈↓α LONG REAL ARRAY XA[0:N];
␈↓ α∧␈↓Currently␈αLONG␈αhas␈αmeaning␈αonly␈αwhen␈αit␈αappears␈αas␈αpart␈αof␈αLONG␈αREAL.␈α (At␈αsome␈αfuture␈αtime
␈↓ α∧␈↓LONG INTEGERs may also exist.)
␈↓ α∧␈↓The␈α∞runtime␈α∂routines␈α∞LREALIN␈α∂and␈α∞LREALSCAN␈α∞operate␈α∂the␈α∞same␈α∂as␈α∞REALIN␈α∂and␈α∞REALSCAN,
␈↓ α∧␈↓except␈α⊂for␈α⊃returning␈α⊂LONG␈α⊃REAL␈α⊂values.␈α⊃ The␈α⊂routine␈α⊂CVEL␈α⊃takes␈α⊂a␈α⊃LONG␈α⊂REAL␈α⊃value␈α⊂and
␈↓ α∧␈↓returns␈αa␈αstring␈αrepresentation␈αlike␈αthat␈αof␈αCVE,␈αexcept␈αthat␈α"@@"␈αis␈αused␈αto␈αsignify␈αLONG␈αwhen
␈↓ α∧␈↓delimiting␈α∂the␈α∂exponent.␈α∂ Any␈α∂of␈α∂"@",␈α∂"@@",␈α∂"E",␈α∂or␈α∂"D"␈α∂are␈α∂acceptable␈α∂exponent␈α∂delimiters␈α∞to
␈↓ α∧␈↓LREALIN and LREALSCAN.
␈↓ α∧␈↓Variables␈α∪which␈α∀are␈α∪declared␈α∪LONG␈α∀REAL␈α∪are␈α∪represented␈α∀in␈α∪KI10␈α∪hardware␈α∀format␈α∪double
␈↓ α∧␈↓precision,␈αtake␈αtwo␈αconsecutive␈αwords␈αof␈αstorage,␈αand␈αprovide␈α62␈αbits␈αof␈αprecision␈α(approximately
␈↓ α∧␈↓18␈α∪decimal␈α∪digits)␈α∪to␈α∪represent␈α∪the␈α∪fraction␈α∪part␈α∪of␈α∪a␈α∪floating-point␈α∪number.␈α∪ Regular␈α∪REAL
␈↓ α∧␈↓variables␈α⊂occupy␈α⊂a␈α⊂single␈α⊂word␈α∂and␈α⊂have␈α⊂27␈α⊂bits␈α⊂(8␈α∂decimal␈α⊂digits)␈α⊂of␈α⊂precision.␈α⊂ The␈α∂exponent
␈↓ α∧␈↓range␈αof␈αboth␈αREAL␈αand␈αLONG␈αREAL␈αvariables␈αis␈αfrom␈α-128␈αto␈α127,␈αwhere␈α2↑127␈αis␈αapproximately
␈↓ α∧␈↓10↑38.
␈↓ α∧␈↓LONG␈α∪REAL␈α∪is␈α∀a␈α∪dominant␈α∪type␈α∀in␈α∪arithmetic␈α∪operations␈α∀+-*/%↑␈α∪MAX␈α∪MIN␈α∀and␈α∪arithmetic
␈↓ α∧␈↓relationals␈α⊃<>=≠≤≥.␈α⊂ If␈α⊃one␈α⊂operand␈α⊃is␈α⊃LONG␈α⊂REAL␈α⊃then␈α⊂both␈α⊃operands␈α⊂will␈α⊃be␈α⊃converted␈α⊂to
␈↓ α∧␈↓LONG␈αREAL␈α(if␈αnecessary)␈αbefore␈αperforming␈αthe␈αoperation.␈α An␈αexponentiation␈αinvolving␈αa␈αLONG
␈↓ α∧␈↓REAL␈αraised␈αto␈αa␈αpositive␈αinteger␈αconstant␈αis␈αan␈αexception␈αto␈αthis␈αrule.␈α The␈αtype␈αcoercion␈αpath␈αis
␈↓ α∧␈↓linear:␈α STRING␈α↔␈αINTEGER␈α↔␈αREAL␈α↔␈αLONG␈αREAL.␈α Conversion␈αfrom␈αREAL␈αto␈αLONG␈α
REAL␈αis
␈↓ α∧␈↓performed␈α
by␈α
assigning␈α
the␈α
(only)␈α∞word␈α
of␈α
the␈α
REAL␈α
to␈α∞the␈α
most␈α
significant␈α
word␈α
of␈α∞the␈α
LONG
␈↓ α∧␈↓REAL␈α∂and␈α∞setting␈α∂the␈α∂second␈α∞(least␈α∂significant)␈α∂word␈α∞of␈α∂the␈α∂LONG␈α∞REAL␈α∂to␈α∂zero.␈α∞ Conversion
␈↓ α∧␈↓from LONG REAL to REAL is by UUO which rounds.
␈↓ α∧␈↓Arithmetic␈α⊂and␈α⊂assignment␈α⊂operations␈α⊂are␈α⊂compiled␈α⊂into␈α⊂DFAD,␈α⊂DFSB,␈α⊂DFMP,␈α⊂DFDV,␈α∂DMOVE,
␈↓ α∧␈↓DMOVEM␈α∀instructions.␈α∃ The␈α∀Sail␈α∀operations␈α∃ASH,␈α∀LSH,␈α∀ROT,␈α∃LAND,␈α∀LOR,␈α∀EQV,␈α∃XOR␈α∀are
␈↓ α∧␈↓␈↓ π¬1␈↓ ∀
␈↓ α∧␈↓Sail Addendum␈↓
↑New Features
␈↓ α∧␈↓performed␈α
on␈α∞both␈α
words␈α
(ASHC,␈α∞LSHC,␈α
ROTC,␈α
2␈α∞ANDs,␈α
2␈α
IORs,␈α∞etc.).␈α
LOCATION␈α
of␈α∞a␈α
LONG
␈↓ α∧␈↓REAL␈α⊃variable␈α⊃gives␈α⊃an␈α⊃address␈α⊃E␈α⊃such␈α⊂that␈α⊃DMOVE␈α⊃AC,E␈α⊃fetches␈α⊃the␈α⊃appropriate␈α⊃words␈α⊂of
␈↓ α∧␈↓memory.␈α When␈α
passed␈αby␈α
value␈αas␈α
an␈αactual␈αparameter␈α
to␈αa␈α
procedure,␈αboth␈α
words␈αare␈α
placed␈αon
␈↓ α∧␈↓the␈α∞P␈α∂stack:␈α∞ PUSH␈α∂P,X␈α∞↔␈α∂PUSH␈α∞P,X+1.␈α∞ LONG␈α∂REAL␈α∞fields␈α∂in␈α∞record␈α∂classes␈α∞are␈α∂handled␈α∞much
␈↓ α∧␈↓like␈α∞STRING␈α∞fields,␈α
except␈α∞that␈α∞the␈α
address␈α∞in␈α∞the␈α
record␈α∞field␈α∞points␈α
to␈α∞the␈α∞first␈α
word␈α∞of␈α∞a␈α
2-
␈↓ α∧␈↓word block (rather than to the second word as in the case with STRINGs).
␈↓ α∧␈↓LONG␈αREAL␈αARRAYs␈αare␈αstored␈αas␈αcontiguous␈αblocks␈αof␈α2-word␈αvalues.␈α ARRTRAN␈αdone␈αon␈αtwo
␈↓ α∧␈↓LONG␈α⊃REAL␈α⊃arrays␈α⊃is␈α⊃a␈α⊃transparent␈α⊃operation,␈α⊃but␈α⊃for␈α⊃ARRYIN,␈α⊃ARRYOUT,␈α⊃or␈α⊃ARRBLT␈α⊃the
␈↓ α∧␈↓actual␈α∂word␈α∂count␈α∂is␈α∂specified;␈α∂think␈α∂about␈α∂whether␈α∂you␈α∂should␈α∂multiply␈α∂by␈α∂2!␈α∂ At␈α∂runtime␈α∂the
␈↓ α∧␈↓array␈α
descriptor␈αfor␈α
a␈αLONG␈α
ARRAY␈αhas␈α
bit␈α12␈α
(40,,0␈αbit)␈α
set␈αin␈α
MULT(n),␈αthe␈α
multiplier␈α
for␈αthe
␈↓ α∧␈↓last␈α
dimension␈α
(which␈α
would␈α
otherwise␈α
be␈α
=1).␈α
Similarly,␈α
a␈α
LONG␈α
ARRAY␈α
is␈α
allocated␈α
by␈α
setting
␈↓ α∧␈↓bit 12 (40,,0) bit in the parameter which specifies the number of dimensions to ARMAK.
␈↓ α∧␈↓Runtime␈α∩support␈α⊃for␈α∩LEAP␈α⊃items␈α∩with␈α⊃LONG␈α∩REAL␈α⊃datums␈α∩does␈α⊃not␈α∩yet␈α⊃exist,␈α∩although␈α⊃the
␈↓ α∧␈↓compiler␈αdoes␈αgenerate␈αsuitable␈αcode.␈α Runtime␈αsupport␈αfor␈αdouble␈αprecision␈αexponentiation␈αis␈αalso
␈↓ α∧␈↓limited␈α∩for␈α∩the␈α∪moment.␈α∩ Any␈α∩exponentiation␈α∪X↑K␈α∩where␈α∩K␈α∩is␈α∪a␈α∩positive␈α∩integer␈α∪constant␈α∩is
␈↓ α∧␈↓compiled␈α∞inline␈α
using␈α∞the␈α∞binary␈α
("Russian␈α∞peasant")␈α∞method,␈α
regardless␈α∞of␈α∞the␈α
type␈α∞of␈α∞X.␈α
Other
␈↓ α∧␈↓exponentiations involving LONG REALs are merely translated into procedure calls on
␈↓ α∧␈↓α LONG REAL PROCEDURE DPOW (INTEGER EXPONENT; LONG REAL BASE);
␈↓ α∧␈↓α LONG REAL PROCEDURE DLOGS (LONG REAL EXPONENT, BASE);
␈↓ α∧␈↓depending␈α⊃on␈α⊃the␈α∩type␈α⊃of␈α⊃the␈α⊃exponent.␈α∩ The␈α⊃Sail␈α⊃runtime␈α⊃system␈α∩does␈α⊃not␈α⊃yet␈α∩contain␈α⊃such
␈↓ α∧␈↓procedures, so you will have to roll your own.
␈↓ α∧␈↓1.2 - ␈↓↓Declarations and Scope␈↓
␈↓ α∧␈↓Sail␈α∞declarations␈α
must␈α∞occur␈α
before␈α∞use.␈α
For␈α∞example,␈α
in␈α∞the␈α
following␈α∞program␈α
the␈α∞argument␈α
to
␈↓ α∧␈↓PRINT␈α
is␈α
interpreted␈αas␈α
the␈α
K␈αon␈α
line␈α
2,␈αeven␈α
though␈α
by␈αthe␈α
ALGOL60␈α
notion␈αof␈α
scope␈α
it␈αshould
␈↓ α∧␈↓be interpreted as the K on line 5.
␈↓ α∧␈↓α BEGIN "FOO"
␈↓ α∧␈↓α INTEGER K; COMMENT this is line 2;
␈↓ α∧␈↓α BEGIN "RUB"
␈↓ α∧␈↓α PROCEDURE BAR; BEGIN PRINT(K) END;
␈↓ α∧␈↓α INTEGER K; COMMENT this is line 5;
␈↓ α∧␈↓α <statements>
␈↓ α∧␈↓α END "RUB"
␈↓ α∧␈↓α END "FOO"
␈↓ α∧␈↓␈↓ π¬2␈↓ ∀
␈↓ α∧␈↓Sail Addendum␈↓
↑New Features
␈↓ α∧␈↓1.3 - ␈↓↓Two-character Operators␈↓
␈↓ α∧␈↓The compiler now recognizes "**" for "↑", ":=" for "←", "<=" for "≤", and ">=" for "≥".
␈↓ α∧␈↓1.4 - ␈↓↓Requires␈↓
␈↓ α∧␈↓REQUIRE␈α∩OVERLAP_OK;␈α∪will␈α∩suppress␈α∪the␈α∩message␈α∪which␈α∩occurs␈α∪at␈α∩initialization␈α∪when␈α∩two
␈↓ α∧␈↓programs have declared items.
␈↓ α∧␈↓REQUIRE␈α⊂VERIFY_DATUMS;␈α⊂causes␈α⊂the␈α⊂compiler␈α⊂to␈α⊂generate␈α⊂three␈α⊂additional␈α⊂instructions␈α∂for
␈↓ α∧␈↓each␈αDATUM␈αreference,␈αto␈α
make␈αsure␈α(dynamically,␈αat␈α
run␈αtime)␈αthat␈αthe␈α
type␈αof␈αthe␈αitem␈α
in␈αthe
␈↓ α∧␈↓DATUM␈α∂construct␈α∞is␈α∂the␈α∂same␈α∞as␈α∂the␈α∂compiler␈α∞expected.␈α∂ This␈α∂is␈α∞similar␈α∂to␈α∂(the␈α∞unimplimented
␈↓ α∧␈↓effect␈α∞of)␈α∞declaring␈α
all␈α∞itemvars␈α∞CHECKED.␈α∞ It␈α
is␈α∞planned␈α∞that␈α
VERIFY_DATUMS␈α∞will␈α∞soon␈α∞be␈α
a
␈↓ α∧␈↓bit in the /A switch and that the corresponding REQUIRE will disappear.
␈↓ α∧␈↓REQUIRE␈α∪PROCESSES;␈α∩insures␈α∪that␈α∩MAINPR,␈α∪the␈α∪main␈α∩process,␈α∪is␈α∩initialized.␈α∪ You␈α∪need␈α∩not
␈↓ α∧␈↓specify␈α⊂this␈α⊂REQUIRE␈α⊂if␈α⊂you␈α⊂use␈α⊂APPLY␈α⊂or␈α∂SPROUT,␈α⊂but␈α⊂if␈α⊂the␈α⊂only␈α⊂use␈α⊂of␈α⊂processes␈α⊂is␈α∂via
␈↓ α∧␈↓INTSET then you must REQUIRE PROCESSES;.
␈↓ α∧␈↓1.5 - ␈↓↓CASE statement␈↓
␈↓ α∧␈↓In␈α⊂an␈α⊂explicitly␈α⊂numbered␈α∂CASE␈α⊂statement␈α⊂the␈α⊂word␈α⊂ELSE␈α∂can␈α⊂appear␈α⊂where␈α⊂a␈α⊂bracketed␈α∂case
␈↓ α∧␈↓number␈α∞is␈α∞normally␈α∞used.␈α∞ The␈α∞statement␈α∞following␈α∞the␈α∞ELSE␈α∞is␈α∞a␈α∞catch-all␈α∞for␈α∞any␈α∂case␈α∞number
␈↓ α∧␈↓not␈α∩mentioned,␈α⊃including␈α∩anything␈α⊃which␈α∩would␈α∩otherwise␈α⊃generate␈α∩a␈α⊃CASE␈α∩index␈α∩error.␈α⊃ For
␈↓ α∧␈↓example,
␈↓ α∧␈↓α CASE K OF BEGIN [3] J←3; ELSE J←4; [5] J←5 END
␈↓ α∧␈↓is another way of accomplishing
␈↓ α∧␈↓α IF K=3 THEN J←3
␈↓ α∧␈↓α ELSE IF K=5 THEN J←5
␈↓ α∧␈↓α ELSE J←4
␈↓ α∧␈↓A␈α⊃CASE␈α∩statement␈α⊃containing␈α∩an␈α⊃ELSE␈α∩case␈α⊃does␈α∩not␈α⊃generate␈α∩a␈α⊃call␈α∩to␈α⊃the␈α∩CSERR␈α⊃runtime
␈↓ α∧␈↓routine,␈αand␈αin␈αaddition␈αthe␈αjump␈αtable␈αusually␈αcontains␈αonly␈αmax_case␈α-␈αmin_case␈α+1␈αwords␈α(rather
␈↓ α∧␈↓than max_case +1).
␈↓ α∧␈↓␈↓ π¬3␈↓ ∀
␈↓ α∧␈↓Sail Addendum␈↓
↑New Features
␈↓ α∧␈↓1.6 - ␈↓↓Circular RECORD_CLASSes␈↓
␈↓ α∧␈↓To␈α∂define␈α∂two␈α∞record␈α∂classes,␈α∂both␈α∞of␈α∂which␈α∂contain␈α∞RECORD_POINTER␈α∂fields␈α∂refering␈α∂to␈α∞the
␈↓ α∧␈↓other class, say
␈↓ α∧␈↓α FORWARD RECORD_CLASS BAR (RECORD_POINTER (ANY_CLASS) Q2);
␈↓ α∧␈↓α RECORD_CLASS FOO (RECORD_POINTER (BAR) Q1);
␈↓ α∧␈↓α RECORD_CLASS BAR (RECORD_POINTER (FOO) Q2);
␈↓ α∧␈↓In␈α
general,␈α∞declare␈α
one␈α
class␈α∞to␈α
be␈α
FORWARD␈α∞and␈α
list␈α
its␈α∞RECORD_POINTER␈α
fields␈α∞as␈α
pointers
␈↓ α∧␈↓to ANY_CLASS. This breaks the circularity and allows maximum compile-time type checking.
␈↓ α∧␈↓␈↓ π¬4␈↓ ∀
␈↓ α∧␈↓Sail Addendum␈↓ qDocumentation Errors
␈↓ α∧␈↓␈↓ ε~␈↓↓SECTION 2␈↓
␈↓ α∧␈↓␈↓ ¬G␈↓↓Documentation Errors␈↓
␈↓ α∧␈↓This is a list of known bugs in the August 1976 Sail manual, AIM-289.
␈↓ α∧␈↓PAGE DESCRIPTION
␈↓ α∧␈↓abstr. "varaiables" is a misspelling [JFR 10-22-76]
␈↓ α∧␈↓iiiL no period after LEAP (line 6 of paragraph) [LES 10-22-76]
␈↓ α∧␈↓162L "i.e" in the line "2. Recursive entry" [JFR 10-23-76]
␈↓ α∧␈↓1R "Nauer" for "Naur" (also References) [JFR 11-2-76]
␈↓ α∧␈↓22L,26L "disjunct" → "conjunct" [JMC 11-12-76]
␈↓ α∧␈↓31L line -9 "its" → "it's" [JMC 11-12-76]
␈↓ α∧␈↓162R The word PDA+'13 contains something other than indicated.
␈↓ α∧␈↓ The parameter descriptor words actually start at PDA+'14,
␈↓ α∧␈↓ but the way to find them is to follow the pointer in
␈↓ α∧␈↓ the right half of PDA+7. [JFR 12-9-76]
␈↓ α∧␈↓9L Another restriction on SIMPLE procedures: They should not do
␈↓ α∧␈↓ up-level addressing themselves (in addition to point 4.) unless
␈↓ α∧␈↓ the user really understands what is going on with the stack.
␈↓ α∧␈↓ It is possible to "screw up" without complaints from the compiler.
␈↓ α∧␈↓ SIMPLE ought to mean "I know what I am doing, so let me do it.".
␈↓ α∧␈↓ [JFR/DON 12-xx-76]
␈↓ α∧␈↓56L CRLF="('15 & '12)", not '12 & '15 [JFR 1-15-77]
␈↓ α∧␈↓10R It should be made clear that LET A=B; works even if
␈↓ α∧␈↓ A is a reserved word. In particular, LET DEFINE=REDEFINE;
␈↓ α∧␈↓ Also note that B can be any reserved
␈↓ α∧␈↓ word except COMMENT. [COMMENT ALWAYS means "ignore through
␈↓ α∧␈↓ the next semicolon".]
␈↓ α∧␈↓4R POLLING_POINTS is not a valid <require_spec> [WFW 1-21-77]
␈↓ α∧␈↓50R In FILEINFO, hidate2 occupies 3 bits [JFR 2-3-77]
␈↓ α∧␈↓152L CHNCDB and FILEINFO are defined everywhere except TENEX. [JFR 2-3-77]
␈↓ α∧␈↓␈↓ π¬5␈↓ ∀
␈↓ α∧␈↓Sail Addendum␈↓ qDocumentation Errors
␈↓ α∧␈↓65R A better way of getting around the array problem is as follows:
␈↓ α∧␈↓ REQUIRE "⊂⊃<>" DELIMITERS;
␈↓ α∧␈↓ DEFINE NewArray(type,name,bounds)=⊂
␈↓ α∧␈↓ BEGIN
␈↓ α∧␈↓ type ARRAY proxy bounds;
␈↓ α∧␈↓ MEMORY[LOCATION(name)] ← MEMORY[LOCATION(proxy)];
␈↓ α∧␈↓ MEMORY[LOCATION(proxy)] ← 0;
␈↓ α∧␈↓ END⊃;
␈↓ α∧␈↓ which hides all the hair of a poor facility and is perfectly general.
␈↓ α∧␈↓ unlike the present scheme in the manual. A typical call would be:
␈↓ α∧␈↓ RECORD_CLASS RC(STRING ARRAY SA);
␈↓ α∧␈↓ RECORD_POINTER (RC) rp;
␈↓ α∧␈↓ rp ← NEW_RECORD(RC);
␈↓ α∧␈↓ NewArray(STRING,RC:SA[rp],[0:1,-2:3]); [MWK for KS 01-13-77]
␈↓ α∧␈↓27L DIV and MOD use integer divide and are meant as a "integer divide"
␈↓ α∧␈↓ and "integer divide and remainder". This is NOT the real mod as
␈↓ α∧␈↓ written in Knuth volume 1. In fact, MOD would better have been
␈↓ α∧␈↓ names REM. [MWK 01-13-77]
␈↓ α∧␈↓117R DTI takes only one arg, the terminal code. [BVM 9-22-80]
␈↓ α∧␈↓␈↓ π¬6␈↓ ∀