aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-01-28 21:13:46 +0000
committerdos-reis <gdr@axiomatics.org>2008-01-28 21:13:46 +0000
commit1eac6c122d6a62d8ce3eeced8c3b1b6b97108498 (patch)
tree82aa9a05557e7fc955c32c164eee167045de9917 /src
parenta27cc2ac7bf6a0ad60cc6c9f949a988d0444bb4e (diff)
downloadopen-axiom-1eac6c122d6a62d8ce3eeced8c3b1b6b97108498.tar.gz
Support signature declaration in Boot.
* boot/ast.boot (bfUntuple): New. (bfTagged): Toplevel tags are signatures. * boot/parser.boot (bpTyping): New. (bpTagged): Use it. * boot/translator.boot (genDeclaration): New. (bpOutItem): Use it. * interp/compiler.boot: Add type annotations for compiler routines. * lisp/Makefile.in ($(OUT)/lisp$(EXEEXT)): Don't turn on emit-fn.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog12
-rw-r--r--src/boot/ast.boot20
-rw-r--r--src/boot/parser.boot12
-rw-r--r--src/boot/translator.boot13
-rw-r--r--src/interp/compiler.boot81
-rw-r--r--src/interp/g-util.boot28
-rw-r--r--src/lisp/Makefile.in3
7 files changed, 158 insertions, 11 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5bdbf5f8..d60325bf 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,15 @@
+2008-01-28 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ Support signature declaration in Boot.
+ * boot/ast.boot (bfUntuple): New.
+ (bfTagged): Toplevel tags are signatures.
+ * boot/parser.boot (bpTyping): New.
+ (bpTagged): Use it.
+ * boot/translator.boot (genDeclaration): New.
+ (bpOutItem): Use it.
+ * interp/compiler.boot: Add type annotations for compiler routines.
+ * lisp/Makefile.in ($(OUT)/lisp$(EXEEXT)): Don't turn on emit-fn.
+
2008-01-27 Gabriel Dos Reis <gdr@cs.tamu.edu>
* boot/Makefile.pamphlet: Remove.
diff --git a/src/boot/ast.boot b/src/boot/ast.boot
index 4c0c02d4..958ad11c 100644
--- a/src/boot/ast.boot
+++ b/src/boot/ast.boot
@@ -175,6 +175,11 @@ compFluidize x==
bfTuple x== ["TUPLE",:x]
bfTupleP x==EQCAR(x,"TUPLE")
+
+++ If `bf' is a tuple return its elements; otherwise `bf'.
+bfUntuple bf ==
+ bfTupleP bf => cdr bf
+ bf
bfTupleIf x==
if bfTupleP x
@@ -914,13 +919,14 @@ shoeCompTran1 x==
shoeCompTran1 cdr x
bfTagged(a,b)==
- IDENTP a =>
- EQ(b,"FLUID") => bfLET(compFluid a,NIL)
- EQ(b,"fluid") => bfLET(compFluid a,NIL)
- EQ(b,"local") => bfLET(compFluid a,NIL)
- $typings:=cons(["TYPE",b,a],$typings)
- a
- ["THE",b,a]
+ null $op => Signature(a,b) -- surely a toplevel decl
+ IDENTP a =>
+ EQ(b,"FLUID") => bfLET(compFluid a,NIL)
+ EQ(b,"fluid") => bfLET(compFluid a,NIL)
+ EQ(b,"local") => bfLET(compFluid a,NIL)
+ $typings:=cons(["TYPE",b,a],$typings)
+ a
+ ["THE",b,a]
bfAssign(l,r)==
if bfTupleP l then bfSetelt(CADR l,CDDR l ,r) else bfLET(l,r)
diff --git a/src/boot/parser.boot b/src/boot/parser.boot
index 9908a68a..9c41a07b 100644
--- a/src/boot/parser.boot
+++ b/src/boot/parser.boot
@@ -553,9 +553,19 @@ bpApplication()==
(bpApplication() and
bpPush(bfApplication(bpPop2(),bpPop1())) or true)
+++ Typing:
+++ SimpleType
+++ Mapping
+bpTyping() ==
+ bpApplication() and
+ (bpEqKey "ARROW" and (bpApplication() or bpTrap()) and
+ bpPush Mapping(bpPop1(), bfUntuple bpPop1()) or true) or bpMapping()
+
+++ Tagged:
+++ Name : Typing
bpTagged()==
bpApplication() and
- (bpEqKey "COLON" and (bpApplication() or bpTrap()) and
+ (bpEqKey "COLON" and (bpTyping() or bpTrap()) and
bpPush bfTagged(bpPop2(),bpPop1()) or true)
bpExpt()== bpRightAssoc('(POWER),function bpTagged)
diff --git a/src/boot/translator.boot b/src/boot/translator.boot
index 0fc79fa0..8d866052 100644
--- a/src/boot/translator.boot
+++ b/src/boot/translator.boot
@@ -351,7 +351,17 @@ shoeOutParse stream ==
nil
else CAR $stack
+++ Generate a global signature declaration for symbol `n'.
+genDeclaration(n,t) ==
+ t is ["Mapping",valType,argTypes] =>
+ if bfTupleP argTypes then argTypes := cdr argTypes
+ if not null argTypes and SYMBOLP argTypes
+ then argTypes := [argTypes]
+ ["DECLAIM",["FTYPE",["FUNCTION",argTypes,valType],n]]
+ ["DECLAIM",["TYPE",t,n]]
+
bpOutItem()==
+ $op := nil
bpComma() or bpTrap()
b:=bpPop1()
EQCAR(b,"TUPLE")=> bpPush cdr b
@@ -359,6 +369,9 @@ bpOutItem()==
b is ["L%T",l,r] and IDENTP l =>
bpPush [["DEFPARAMETER",l,r]]
case b of
+ Signature(op,t) =>
+ bpPush [genDeclaration(op,t)]
+
Module(m) =>
bpPush [shoeCompileTimeEvaluation ["PROVIDE", m]]
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index ed7554cb..0a59bdcf 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -48,7 +48,7 @@ $coreDiagnosticFunctions ==
++ list of functions to compile
$compileOnlyCertainItems := []
-
+compTopLevel: (%Thing,%Thing,%List) -> %List
compTopLevel(x,m,e) ==
--+ signals that target is derived from lhs-- see NRTmakeSlot1Info
$NRTderivedTargetIfTrue: local := false
@@ -62,12 +62,15 @@ compTopLevel(x,m,e) ==
--keep old environment after top level function defs
compOrCroak(x,m,e)
+compUniquely: (%Thing,%Thing,%List) -> %List
compUniquely(x,m,e) ==
$compUniquelyIfTrue: local:= true
CATCH("compUniquely",comp(x,m,e))
+compOrCroak: (%Thing,%Thing,%List) -> %List
compOrCroak(x,m,e) == compOrCroak1(x,m,e,'comp)
+compOrCroak1: (%Thing,%Thing,%List,%Thing) -> %List
compOrCroak1(x,m,e,compFn) ==
fn(x,m,e,nil,nil,compFn) where
fn(x,m,e,$compStack,$compErrorMessageStack,compFn) ==
@@ -97,11 +100,13 @@ tc() ==
comp($x,$m,$f)
+comp: (%Thing,%Thing,%List) -> %List
comp(x,m,e) ==
T:= compNoStacking(x,m,e) => ($compStack:= nil; T)
$compStack:= [[x,m,e,$exitModeStack],:$compStack]
nil
+compNoStacking: (%Thing,%Thing,%List) -> %List
compNoStacking(x,m,e) ==
T:= comp2(x,m,e) =>
$useRepresentationHack and m=$EmptyMode and T.mode=$Representation =>
@@ -114,11 +119,13 @@ compNoStacking(x,m,e) ==
--hack only when `Rep' is defined the old way. -- gdr 2008/01/26
compNoStacking1(x,m,e,$compStack)
+compNoStacking1: (%Thing,%Thing,%List,%List) -> %List
compNoStacking1(x,m,e,$compStack) ==
u:= get(RepIfRepHack m,"value",e) =>
(T:= comp2(x,u.expr,e) => [T.expr,m,T.env]; nil)
nil
+comp2: (%Thing,%Thing,%List) -> %List
comp2(x,m,e) ==
[y,m',e]:= comp3(x,m,e) or return nil
if $LISPLIB and isDomainForm(x,e) then
@@ -131,6 +138,7 @@ comp2(x,m,e) ==
--$bootStrapMode-test necessary for compiling Ring in $bootStrapMode
[y,m',e]
+comp3: (%Thing,%Thing,%List) -> %List
comp3(x,m,$e) ==
--returns a Triple or %else nil to signalcan't do'
$e:= addDomain(m,$e)
@@ -155,6 +163,7 @@ comp3(x,m,$e) ==
[x',m',addDomain(m',e')]
t
+compTypeOf: (%List,%Thing,%List) -> %List
compTypeOf(x:=[op,:argl],m,e) ==
$insideCompTypeOf: local := true
newModemap:= EQSUBSTLIST(argl,$FormalMapVariableList,get(op,'modemap,e))
@@ -167,6 +176,7 @@ hasFormalMapVariable(x, vl) ==
ScanOrPairVec(function hasone?,x) where
hasone? x == MEMQ(x,$formalMapVariables)
+compWithMappingMode: (%Thing,%List,%List) -> %List
compWithMappingMode(x,m is ["Mapping",m',:sl],oldE) ==
$killOptimizeIfTrue: local:= true
e:= oldE
@@ -270,12 +280,14 @@ extractCodeAndConstructTriple(u, m, oldE) ==
[op,:.,env] := u
[["CONS",["function",op],env],m,oldE]
+compExpression: (%Thing,%Thing,%List) -> %List
compExpression(x,m,e) ==
$insideExpressionIfTrue: local:= true
atom first x and (fn:= GETL(first x,"SPECIAL")) =>
FUNCALL(fn,x,m,e)
compForm(x,m,e)
+compAtom: (%Thing,%Thing,%List) -> %List
compAtom(x,m,e) ==
T:= compAtomWithModemap(x,m,e,get(x,"modemap",e)) => T
x="nil" =>
@@ -291,6 +303,7 @@ compAtom(x,m,e) ==
[x,primitiveType x or return nil,e]
convert(t,m)
+primitiveType: %Thing -> %List
primitiveType x ==
x is nil => $EmptyMode
STRINGP x => $String
@@ -301,6 +314,7 @@ primitiveType x ==
FLOATP x => $DoubleFloat
nil
+compSymbol: (%Thing,%Thing,%List) -> %List
compSymbol(s,m,e) ==
s="$NoValue" => ["$NoValue",$NoValueMode,e]
isFluid s => [s,getmode(s,e) or return nil,e]
@@ -324,6 +338,7 @@ compSymbol(s,m,e) ==
++ Return true if `m' is the most recent unique type case assumption
++ on `x' that predates its declaration in environment `e'.
+hasUniqueCaseView: (%Thing,%Thing,%List) -> %Boolean
hasUniqueCaseView(x,m,e) ==
props := getProplist(x,e)
for [p,:v] in props repeat
@@ -331,11 +346,13 @@ hasUniqueCaseView(x,m,e) ==
p = "value" => return false
+convertOrCroak: (%List,%Thing) -> %List
convertOrCroak(T,m) ==
u:= convert(T,m) => u
userError ["CANNOT CONVERT: ",T.expr,"%l"," OF MODE: ",T.mode,"%l",
" TO MODE: ",m,"%l"]
+convert: (%List,%Thing) -> %List
convert(T,m) ==
coerce(T,resolve(T.mode,m) or return nil)
@@ -358,6 +375,15 @@ hasType(x,e) ==
x is [["case",.,y],:.] => y
fn rest x
+--% General Forms
+
+compForm: (%List,%Thing,%List) -> %List
+compForm1: (%List,%Thing,%List) -> %List
+compForm2: (%List,%Thing,%List,%List) -> %List
+compForm3: (%Thing,%Thing,%List,%List) -> %List
+compArgumentsAndTryAgain: (%List,%Thing,%List) -> %List
+compExpressionList: (%List,%Thing,%List) -> %List
+
compForm(form,m,e) ==
T:=
compForm1(form,m,e) or compArgumentsAndTryAgain(form,m,e) or return
@@ -473,6 +499,7 @@ compForm3(form is [op,:argl],m,e,modemapList) ==
T
T
+getFormModemaps: (%List,%List) -> %List
getFormModemaps(form is [op,:argl],e) ==
op is ["elt",domain,op1] =>
[x for x in getFormModemaps([op1,:argl],e) | x is [[ =domain,:.],:.]]
@@ -500,6 +527,7 @@ getFormModemaps(form is [op,:argl],e) ==
++ the same arity and must take flag argument in the same position.
++ Returns a vector of length `nargs' with positive entries indicating
++ flag arguments, and negative entries for normal argument passing.
+checkCallingConvention: (%List,%Short) -> %Vector
checkCallingConvention(sigs,nargs) ==
v := GETZEROVEC nargs
for sig in sigs repeat
@@ -563,10 +591,12 @@ substituteIntoFunctorModemap(argl,modemap is [[dc,:sig],:.],e) ==
compConstructorCategory(x,m,e) == [x,resolve($Category,m),e]
+compString: (%String,%Thing,%List) -> %List
compString(x,m,e) == [x,resolve($StringCategory,m),e]
--% SUBSET CATEGORY
+compSubsetCategory: (%List,%Thing,%List) -> %List
compSubsetCategory(["SubsetCategory",cat,R],m,e) ==
--1. put "Subsets" property on R to allow directly coercion to subset;
-- allow automatic coercion from subset to R but not vice versa
@@ -581,6 +611,9 @@ compSubsetCategory(["SubsetCategory",cat,R],m,e) ==
--% CONS
+compCons: (%List,%Thing,%List) -> %List
+compCons1: (%List,%Thing,%List) -> %List
+
compCons(form,m,e) == compCons1(form,m,e) or compForm(form,m,e)
compCons1(["CONS",x,y],m,e) ==
@@ -599,6 +632,9 @@ compCons1(["CONS",x,y],m,e) ==
--% SETQ
+compSetq: (%List,%Thing,%List) -> %List
+compSetq1: (%List,%Thing,%List) -> %List
+
compSetq(["LET",form,val],m,E) == compSetq1(form,val,m,E)
compSetq1(form,val,m,E) ==
@@ -611,6 +647,7 @@ compSetq1(form,val,m,E) ==
op="Tuple" => setqMultiple(l,val,m,E)
setqSetelt(form,val,m,E)
+compMakeDeclaration: (%Thing,%Thing,%List) -> %List
compMakeDeclaration(x,m,e) ==
$insideExpressionIfTrue: local
compColon(x,m,e)
@@ -727,12 +764,14 @@ setqMultipleExplicit(nameList,valList,m,e) ==
++ ??? based on the meta operator, e.g. (DEF ...) would be a
++ DefinitionAst, etc. That however requires that we have a full
++ fledged AST algebra -- which we don't have yet in mainstream.
+compileQuasiquote: (%List,%Thing,%List) -> %List
compileQuasiquote(["[||]",:form],m,e) ==
null form => nil
coerce([["QUOTE", :form],$Syntax,e], m)
--% WHERE
+compWhere: (%List,%Thing,%List) -> %List
compWhere([.,form,:exprList],m,eInit) ==
$insideExpressionIfTrue: local:= false
$insideWhereIfTrue: local:= true
@@ -748,6 +787,7 @@ compWhere([.,form,:exprList],m,eInit) ==
eInit
[x,m,eFinal]
+compConstruct: (%List,%Thing,%List) -> %List
compConstruct(form is ["construct",:l],m,e) ==
y:= modeIsAggregateOf("List",m,e) =>
T:= compList(l,["List",CADR y],e) => convert(T,m)
@@ -766,12 +806,14 @@ compConstruct(form is ["construct",:l],m,e) ==
compQuote(expr,m,e) == [expr,m,e]
+compList: (%Thing,%List,%List) -> %List
compList(l,m is ["List",mUnder],e) ==
null l => [NIL,m,e]
Tl:= [[.,mUnder,e]:= comp(x,mUnder,e) or return "failed" for x in l]
Tl="failed" => nil
T:= [["LIST",:[T.expr for T in Tl]],["List",mUnder],e]
+compVector: (%Thing,%List,%List) -> %List
compVector(l,m is ["Vector",mUnder],e) ==
null l => [$EmptyVector,m,e]
Tl:= [[.,mUnder,e]:= comp(x,mUnder,e) or return "failed" for x in l]
@@ -795,6 +837,10 @@ compMacro(form,m,e) ==
--% SEQ
+compSeq: (%List,%Thing,%List) -> %List
+compSeq1: (%List,%List,%List) -> %List
+compSeqItem: (%Thing,%Thing,%List) -> %List
+
compSeq(["SEQ",:l],m,e) == compSeq1(l,[m,:$exitModeStack],e)
compSeq1(l,$exitModeStack,e) ==
@@ -838,6 +884,7 @@ replaceExitEtc(x,tag,opFlag,opMode) ==
replaceExitEtc(rest x,tag,opFlag,opMode)
--% SUCHTHAT
+compSuchthat: (%List,%Thing,%List) -> %List
compSuchthat([.,x,p],m,e) ==
[x',m',e]:= comp(x,m,e) or return nil
[p',.,e]:= comp(p,$Boolean,e) or return nil
@@ -846,6 +893,7 @@ compSuchthat([.,x,p],m,e) ==
--% exit
+compExit: (%List,%Thing,%List) -> %List
compExit(["exit",level,x],m,e) ==
index:= level-1
$exitModeStack = [] => comp(x,m,e)
@@ -863,6 +911,7 @@ modifyModeStack(m,index) ==
($exitModeStack.index:= resolve(m,$exitModeStack.index); $exitModeStack))
$exitModeStack.index:= resolve(m,$exitModeStack.index)
+compLeave: (%List,%Thing,%List) -> %List
compLeave(["leave",level,x],m,e) ==
index:= #$exitModeStack-1-$leaveLevelStack.(level-1)
[x',m',e']:= u:= comp(x,$exitModeStack.index,e) or return nil
@@ -871,6 +920,7 @@ compLeave(["leave",level,x],m,e) ==
--% return
+compReturn: (%List,%Thing,%List) -> %List
compReturn(["return",level,x],m,e) ==
null $exitModeStack =>
stackSemanticError(["the return before","%b",x,"%d","is unneccessary"],nil)
@@ -886,6 +936,7 @@ compReturn(["return",level,x],m,e) ==
--% ELT
+compElt: (%List,%Thing,%List) -> %List
compElt(form,m,E) ==
form isnt ["elt",aDomain,anOp] => compForm(form,m,E)
aDomain="Lisp" =>
@@ -913,6 +964,7 @@ compElt(form,m,E) ==
--% HAS
+compHas: (%List,%Thing,%List) -> %List
compHas(pred is ["has",a,b],m,$e) ==
--b is (":",:.) => (.,.,E):= comp(b,$EmptyMode,E)
$e:= chaseInferences(pred,$e)
@@ -937,6 +989,10 @@ compHasFormat (pred is ["has",olda,b]) ==
--% IF
+compIf: (%List,%Thing,%List) -> %List
+compBoolean: (%List,%Thing,%List) -> %List
+compFromIf: (%List,%Thing,%List) -> %List
+
compIf(["IF",a,b,c],m,E) ==
[xa,ma,Ea,Einv]:= compBoolean(a,$Boolean,E) or return nil
[xb,mb,Eb]:= Tb:= compFromIf(b,m,Ea) or return nil
@@ -1052,6 +1108,7 @@ compFromIf(a,m,E) ==
quotify x == x
+compImport: (%List,%Thing,%List) -> %List
compImport(["import",:doms],m,e) ==
for dom in doms repeat e:=addDomain(dom,e)
["/throwAway",$NoValueMode,e]
@@ -1061,6 +1118,7 @@ compImport(["import",:doms],m,e) ==
--% etc.
++ compile a logical negation form `(not ...)'.
+compileNot: (%List,%Thing,%List) -> %List
compileNot(x,m,e) ==
x isnt ["not", y] => nil
-- If there is a modemap available that can make this work, just use it.
@@ -1074,6 +1132,9 @@ compileNot(x,m,e) ==
convert([["NOT", xcode], $Boolean, xfalseEnv], m)
+--% Case
+compCase: (%List,%Thing,%List) -> %List
+compCase1: (%List,%Thing,%List) -> %List
--Will the jerk who commented out these two functions please NOT do so
--again. These functions ARE needed, and case can NOT be done by
@@ -1108,10 +1169,12 @@ compCase1(x,m,e) ==
++ (target type) is taken unevaluated. The corresponding parameter
++ type in the modemap was specified as quasiquotation. We
++ want to look at the actual type when comparing with modeEqual.
+maybeSpliceMode: %Thing -> %Thing
maybeSpliceMode m ==
(m' := isQuasiquote m) => m'
m
+compColon: (%List,%Thing,%List) -> %List
compColon([":",f,t],m,e) ==
$insideExpressionIfTrue=true => compColonInside(f,m,e,t)
--if inside an expression, ":" means to convert to m "on faith"
@@ -1148,6 +1211,7 @@ unknownTypeError name ==
name
stackSemanticError(["%b",name,"%d","is not a known type"],nil)
+compPretend: (%List,%Thing,%List) -> %List
compPretend(["pretend",x,t],m,e) ==
e:= addDomain(t,e)
T:= comp(x,t,e) or comp(x,$EmptyMode,e) or return nil
@@ -1167,6 +1231,7 @@ compColonInside(x,m,e,m') ==
stackWarning [":",m'," -- should replace by pretend"]
T'
+compIs: (%List,%Thing,%List) -> %List
compIs(["is",a,b],m,e) ==
[aval,am,e] := comp(a,$EmptyMode,e) or return nil
[bval,bm,e] := comp(b,$EmptyMode,e) or return nil
@@ -1180,6 +1245,7 @@ compIs(["is",a,b],m,e) ==
-- One should always call the correct function, since the represent-
-- ation of basic objects may not be the same.
+coerce: (%List,%Thing) -> %List
coerce(T,m) ==
$InteractiveMode =>
keyedSystemError("S2GE0016",['"coerce",
@@ -1197,6 +1263,8 @@ coerce(T,m) ==
["Cannot coerce","%b",x,"%d","%l"," of mode","%b",m1,"%d","%l",
" to mode","%b",m2,"%d"]
+
+coerceEasy: (%List,%Thing) -> %List
coerceEasy(T,m) ==
m=$EmptyMode => T
m=$NoValueMode or m=$Void => [T.expr,m,T.env]
@@ -1208,6 +1276,8 @@ coerceEasy(T,m) ==
T.mode=$EmptyMode or modeEqualSubst(T.mode,m,T.env) =>
[T.expr,m,T.env]
+
+coerceSubset: (%List,%Thing) -> %List
coerceSubset([x,m,e],m') ==
isSubset(m,m',e) => [x,m',e]
m is ['SubDomain,=m',:.] => [x,m',e]
@@ -1219,6 +1289,7 @@ coerceSubset([x,m,e],m') ==
[x,m',e]
nil
+coerceHard: (%List,%Thing) -> %List
coerceHard(T,m) ==
$e: local:= T.env
m':= T.mode
@@ -1235,6 +1306,7 @@ coerceHard(T,m) ==
coerceExtraHard(T,m)
coerceExtraHard(T,m)
+coerceExtraHard: (%List,%Thing) -> %List
coerceExtraHard(T is [x,m',e],m) ==
T':= autoCoerceByModemap(T,m) => T'
isUnionMode(m',e) is ["Union",:l] and (t:= hasType(x,e)) and
@@ -1262,16 +1334,23 @@ coerceable(m,m',e) ==
coerce(["$fromCoerceable$",m,e],m') => m'
nil
+coerceExit: (%List,%Thing) -> %List
coerceExit([x,m,e],m') ==
m':= resolve(m,m')
x':= replaceExitEtc(x,catchTag:= MKQ GENSYM(),"TAGGEDexit",$exitMode)
coerce([["CATCH",catchTag,x'],m,e],m')
+compAtSign: (%List,%Thing,%List) -> %List
compAtSign(["@",x,m'],m,e) ==
e:= addDomain(m',e)
T:= comp(x,m',e) or return nil
coerce(T,m)
+compCoerce: (%List,%Thing,%List) -> %List
+compCoerce1: (%List,%Thing,%List) -> %List
+coerceByModemap: (%List,%Thing) -> %List
+autoCoerceByModemap: (%List,%Thing) -> %List
+
compCoerce(["::",x,m'],m,e) ==
e:= addDomain(m',e)
T:= compCoerce1(x,m',e) => coerce(T,m)
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 2f900f6a..5d62e098 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -38,6 +38,15 @@ import '"macros"
++
$interpOnly := false
+++ Basic types used throughout Boot codes.
+%Boolean <=> BOOLEAN
+%Short <=> FIXNUM
+%Integer <=> BIGNUM
+%Symbol <=> SYMBOL
+%String <=> STRING
+%List <=> LIST
+%Vector <=> VECTOR
+%Thing <=> true
--% Utility Functions of General Use
@@ -53,6 +62,12 @@ PPtoFile(x, fname) ==
x
+++ Query properties for an entity in a given environment.
+get: (%Thing,%Symbol,%List) -> %List
+get0: (%Thing,%Symbol,%List) -> %List
+get1: (%Thing,%Symbol,%List) -> %List
+get2: (%Thing,%Symbol,%List) -> %List
+
get(x,prop,e) ==
$InteractiveMode => get0(x,prop,e)
get1(x,prop,e)
@@ -78,6 +93,12 @@ get2(x,prop,e) ==
nil
nil
+++ Update properties of an entity in an environment.
+put: (%Thing,%Symbol,%Thing,%List) -> %List
+addBinding: (%Thing,%List,%List) -> %List
+augProplistOf: (%Thing,%List,%Thing,%List) -> %List
+augProplist: (%List,%Thing,%Thing) -> %List
+
put(x,prop,val,e) ==
$InteractiveMode and not EQ(e,$CategoryFrame) =>
putIntSymTab(x,prop,val,e)
@@ -103,6 +124,7 @@ isQuasiquote m ==
-- Convert an arbitrary lisp object to canonical boolean.
+bool: %Thing -> %Boolean
bool x ==
NULL NULL x
@@ -495,6 +517,12 @@ opOf x ==
atom x => x
first x
+
+getProplist: (%Thing,%List) -> %List
+search: (%Thing,%List) -> %List
+searchCurrentEnv: (%Thing,%List) -> %List
+searchTailEnv: (%Thing,%List) -> %List
+
getProplist(x,E) ==
not atom x => getProplist(first x,E)
u:= search(x,E) => u
diff --git a/src/lisp/Makefile.in b/src/lisp/Makefile.in
index 4a466082..8537f1fb 100644
--- a/src/lisp/Makefile.in
+++ b/src/lisp/Makefile.in
@@ -93,8 +93,7 @@ ifeq (@axiom_lisp_flavor@,gcl)
' sys-ld))) ' \
'(compiler::link (quote ($(FASLS))) "lisp$(EXEEXT)" ' \
' (format nil "(progn (let ((*load-path* (cons ~S *load-path*))'\
- ' (si::*load-types* ~S))' \
- ' (compiler::emit-fn t))' \
+ ' (si::*load-types* ~S)))' \
' (when (fboundp (quote si::sgc-on))' \
' (si::sgc-on nil))' \
' (setq si::*top-level-hook* (read-from-string \"|AxiomCore|::|topLevel|\")))"' \