aboutsummaryrefslogtreecommitdiff
path: root/src/interp/as.boot
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp/as.boot')
-rw-r--r--src/interp/as.boot108
1 files changed, 54 insertions, 54 deletions
diff --git a/src/interp/as.boot b/src/interp/as.boot
index 6652448e..7108d5a4 100644
--- a/src/interp/as.boot
+++ b/src/interp/as.boot
@@ -140,7 +140,7 @@ asMakeAlist con ==
--TTT in case we put the wrong thing in for niladic catgrs
--if atom(form) and kind='category then form:=[form]
if atom(form) then form:=[form]
- kind = 'function => asMakeAlistForFunction con
+ kind is 'function => asMakeAlistForFunction con
abb := asyAbbreviation(con,#(KDR sig))
if null KDR form then PUT(opOf form,'NILADIC,'T)
modemap := asySubstMapping LASSOC(con,$mmAlist)
@@ -159,7 +159,7 @@ asMakeAlist con ==
niladicPart := symbolMember?(con,$niladics) and [['NILADIC,:true]]
falist := TAKE(#KDR form,$FormalMapVariableList)
constructorCategory :=
- kind = 'category =>
+ kind is 'category =>
talist := TAKE(#KDR form, $TriangleVariableList)
SUBLISLIS(talist, falist, $constructorCategory)
SUBLISLIS(falist,KDR form,$constructorCategory)
@@ -167,7 +167,7 @@ asMakeAlist con ==
exportAlist := asGetExports(kind, form, constructorCategory)
constructorModemap := SUBLISLIS(falist,KDR form,modemap)
--TTT fix a niladic category constructormodemap (remove the joins)
- if kind = 'category then
+ if kind is 'category then
constructorModemap.mmTarget := $Category
res := [['constructorForm,:form],:constantPart,:niladicPart,
['constructorKind,:kind],
@@ -268,14 +268,14 @@ asGetModemaps(opAlist,oform,kind,modemap) ==
kind in '(category function) => "*1"
form
pred1 :=
- kind = 'category => [["*1",form]]
+ kind is 'category => [["*1",form]]
nil
signature := CDAR modemap
domainList :=
[[a,m] for a in rest form for m in rest signature |
asIsCategoryForm m]
catPredList:=
- kind = 'function => [["isFreeFunction","*1",opOf form]]
+ kind is 'function => [["isFreeFunction","*1",opOf form]]
[['ofCategory,:u] for u in [:pred1,:domainList]]
-- for [op,:itemlist] in SUBLISLIS(rpvl, $FormalMapVariableList,opAlist) repeat
-- the code seems to oscillate between generating $FormalMapVariableList
@@ -318,7 +318,7 @@ asyExtractDescription str ==
str
trimComments str ==
- str = nil or str = '"" => '""
+ str = nil or str is '"" => '""
m := maxIndex str
str := subString(str,0,m)
trimString str
@@ -340,13 +340,13 @@ asyExportAlist con ==
asyMakeOperationAlist(con,proplist, key) ==
oplist :=
- u := LASSOC('domExports,proplist) =>
+ u := symbolLassoc('domExports,proplist) =>
kind := 'domain
u
- u := LASSOC('catExports,proplist) =>
+ u := symbolLassoc('catExports,proplist) =>
kind := 'category
u
- key = 'domain =>
+ key is 'domain =>
kind := 'domain
u := NIL
return nil
@@ -364,7 +364,7 @@ asyMakeOperationAlist(con,proplist, key) ==
----------> Constants change <--------------
id
pred :=
- LASSOC('condition,r) is p => hackToRemoveAnd p
+ symbolLassoc('condition,r) is p => hackToRemoveAnd p
nil
sig := asySignature(asytranForm(form,[idForm],nil),nil)
entry :=
@@ -390,7 +390,7 @@ asyAncestors x ==
x is ['Apply,:r] => asyAncestorList r
x is [op,y,:.] and op in '(PretendTo RestrictTo) => asyAncestors y
atom x =>
- x = '_% => '_$
+ x is '_% => '_$
symbolMember?(x, $niladics) => [x]
niladicConstructorFromDB x => [x]
x
@@ -436,11 +436,11 @@ mkNiladics u ==
--OLD DEFINITION FOLLOWS
asytranDeclaration(dform,levels,predlist,local?) ==
['Declare,id,form,r] := dform
- id = 'failed => id
- KAR dform ~= 'Declare => systemError '"asytranDeclaration"
- if levels = '(top) then
+ id is 'failed => id
+ KAR dform isnt 'Declare => systemError '"asytranDeclaration"
+ if levels is '(top) then
if form isnt ['Apply,"->",:.] then HPUT($constantHash,id,true)
- comments := LASSOC('documentation,r) or '""
+ comments := symbolLassoc('documentation,r) or '""
idForm :=
levels is ['top,:.] =>
form is ['Apply,'_-_>,source,target] => [id,:asyArgs source]
@@ -459,14 +459,14 @@ asytranDeclaration(dform,levels,predlist,local?) ==
'domain
'domain
first levels
- typeCode := LASSOC('symeTypeCode,r)
+ typeCode := symbolLassoc('symeTypeCode,r)
record := [idForm,newsig,asyMkpred predlist,key,true,comments,typeCode,:$asyFile]
if not local? then
ht :=
- levels = '(top) => $conHash
+ levels is '(top) => $conHash
$docHashLocal
HPUT(ht,id,[record,:HGET(ht,id)])
- if levels = '(top) then asyMakeOperationAlist(id,r, key)
+ if levels is '(top) then asyMakeOperationAlist(id,r, key)
['Declare,id,newsig,r]
asyLooksLikeCatForm? x ==
@@ -476,13 +476,13 @@ asyLooksLikeCatForm? x ==
--asytranDeclaration(dform,levels,predlist,local?) ==
-- ['Declare,id,form,r] := dform
--- id = 'failed => id
+-- id is 'failed => id
-- levels isnt ['top,:.] => asytranForm(form,[id,:levels],local?)
-- idForm :=
-- form is ['Apply,'_-_>,source,target] => [id,:asyArgs source]
-- id
-- if form isnt ['Apply,"->",:.] then HPUT($constantHash,id,true)
--- comments := LASSOC('documentation,r) or '""
+-- comments := symbolLassoc('documentation,r) or '""
-- newsig := asytranForm(form,[idForm,:levels],local?)
-- key :=
-- id in '(%% Category Type) => 'constant
@@ -493,10 +493,10 @@ asyLooksLikeCatForm? x ==
-- record := [newsig,asyMkpred predlist,key,true,comments,:$asyFile]
-- if not local? then
-- ht :=
--- levels = '(top) => $conHash
+-- levels is '(top) => $conHash
-- $docHashLocal
-- HPUT(ht,id,[record,:HGET(ht,id)])
--- if levels = '(top) then asyMakeOperationAlist(id,r)
+-- if levels is '(top) then asyMakeOperationAlist(id,r)
-- ['Declare,id,newsig,r]
asyIsCatForm form ==
@@ -541,13 +541,13 @@ asytranForm1(form,levels,local?) ==
form is ['Define,:.] =>
form is ['Define,['Declare,.,x,:.],rest] =>
--TTT i don't know about this one but looks ok
- x = 'Category => asytranForm1(rest,levels, local?)
+ x is 'Category => asytranForm1(rest,levels, local?)
asytranForm1(x,levels,local?)
error '"DEFINE forms are not handled yet"
- if form = '_% then $hasPerCent := true
+ if form is '_% then $hasPerCent := true
IDENTP form =>
- form = "%" => "$"
- GETL(form,"NILADIC") => [form]
+ form is "%" => "$"
+ form has NILADIC => [form]
form
[asytranForm(x,levels,local?) for x in form]
@@ -562,7 +562,7 @@ asytranApply(['Apply,name,:arglist],levels,local?) ==
name is 'string => asytranLiteral first arglist
name is 'integer => asytranLiteral first arglist
name is 'float => asytranLiteral first arglist
- name = 'Enumeration =>
+ name is 'Enumeration =>
["Enumeration",:[asytranEnumItem arg for arg in arglist]]
[:argl,lastArg] := arglist
[name,:[asytranFormSpecial(arg,levels,true) for arg in argl],
@@ -691,9 +691,9 @@ asyCosigType u ==
u is [name,t] =>
t is [fn,:.] =>
asyComma? fn => fn
- fn = 'With => 'T
+ fn is 'With => 'T
nil
- t = 'Type => 'T
+ t is 'Type => 'T
error '"Unknown atomic type"
error false
@@ -798,7 +798,7 @@ asySig1(u,name?,target?) ==
name? and u is [name,t] => t
u
x is [fn,:r] =>
- fn = 'Join => asyTypeJoin r ---------> jump out to newer code 4/94
+ fn is 'Join => asyTypeJoin r ---------> jump out to newer code 4/94
fn in '(RestrictTo PretendTo) => asySig(first r,name?)
asyComma? fn =>
u := [asySig(x,name?) for x in r]
@@ -808,20 +808,20 @@ asySig1(u,name?,target?) ==
-- in the interpreter
['Multi,:u]
u
- fn = 'With => asyCATEGORY r
- fn = 'Third =>
+ fn is 'With => asyCATEGORY r
+ fn is 'Third =>
r is [b] =>
b is ['With,:s] => asyCATEGORY s
b is ['Blank,:.] => asyCATEGORY nil
error x
- fn = 'Apply and r is ['_-_>,:s] => asyMapping(s,name?)
- fn = '_-_> => asyMapping(r,name?)
- fn = 'Declare and r is [name,typ,:.] =>
+ fn is 'Apply and r is ['_-_>,:s] => asyMapping(s,name?)
+ fn is '_-_> => asyMapping(r,name?)
+ fn is 'Declare and r is [name,typ,:.] =>
asySig1(typ, name?, target?)
x is '(_%) => '(_$)
[fn,:[asySig(x,name?) for x in r]]
---x = 'Type => $Type
- x = '_% => '_$
+--x is 'Type => $Type
+ x is '_% => '_$
x
-- old version was :
@@ -846,19 +846,19 @@ asyMapping([a,b],name?) ==
--============================================================================
asyType x ==
x is [fn,:r] =>
- fn = 'Join => asyTypeJoin r
+ fn is 'Join => asyTypeJoin r
fn in '(RestrictTo PretendTo) => asyType first r
asyComma? fn =>
u := [asyType x for x in r]
u
- fn = 'With => asyCATEGORY r
- fn = '_-_> => asyTypeMapping r
- fn = 'Apply => r
--- fn = 'Declare and r is [name,typ,:.] => typ
+ fn is 'With => asyCATEGORY r
+ fn is '_-_> => asyTypeMapping r
+ fn is 'Apply => r
+-- fn is 'Declare and r is [name,typ,:.] => typ
x is '(_%) => '(_$)
x
---x = 'Type => $Type
- x = '_% => '_$
+--x is 'Type => $Type
+ x is '_% => '_$
x
asyTypeJoin r ==
@@ -914,20 +914,20 @@ asyTypeMapping([a,b]) ==
asyTypeUnit x ==
x is [fn,:r] =>
- fn = 'Join => systemError 'Join ----->asyTypeJoin r
+ fn is 'Join => systemError 'Join ----->asyTypeJoin r
fn in '(RestrictTo PretendTo) => asyTypeUnit first r
asyComma? fn =>
u := [asyTypeUnit x for x in r]
u
- fn = 'With => asyCATEGORY r
- fn = '_-_> => asyTypeMapping r
- fn = 'Apply => asyTypeUnitList r
- fn = 'Declare and r is [name,typ,:.] => asyTypeUnitDeclare(name,typ)
+ fn is 'With => asyCATEGORY r
+ fn is '_-_> => asyTypeMapping r
+ fn is 'Apply => asyTypeUnitList r
+ fn is 'Declare and r is [name,typ,:.] => asyTypeUnitDeclare(name,typ)
x is '(_%) => '(_$)
[fn,:asyTypeUnitList r]
GETL(x,"NILADIC") => [x]
---x = 'Type => $Type
- x = '_% => '_$
+--x is 'Type => $Type
+ x is '_% => '_$
x
asyTypeUnitList x == [asyTypeUnit y for y in x]
@@ -1068,7 +1068,7 @@ asyUnTuple x ==
asyTypeItem x ==
atom x =>
- x = '_% => '_$
+ x is '_% => '_$
x
x is ['_-_>,a,b] =>
['Mapping,b,:asyUnTuple a]
@@ -1117,7 +1117,7 @@ asCategoryParts(kind,conform,category,:options) == main where
$oplist := listSort(function GLESSEQP,$oplist)
res := [$attrlist,:$oplist]
if cons? then res := [listSort(function GLESSEQP,$conslist),:res]
- if kind = 'category then
+ if kind is 'category then
tvl := TAKE(#rest conform,$TriangleVariableList)
res := SUBLISLIS($FormalMapVariableList,tvl,res)
res
@@ -1129,7 +1129,7 @@ asCategoryParts(kind,conform,category,:options) == main where
constructor? opOf attr =>
$conslist := [[attr,:pred],:$conslist]
nil
- opOf attr = 'nothing => 'skip
+ opOf attr is 'nothing => 'skip
$attrlist := [[opOf attr,IFCDR attr,:pred],:$attrlist]
item is ['TYPE,op,type] =>
$oplist := [[op,[type],:pred],:$oplist]