aboutsummaryrefslogtreecommitdiff
path: root/src/interp/compiler.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-04-23 06:24:08 +0000
committerdos-reis <gdr@axiomatics.org>2009-04-23 06:24:08 +0000
commit461221b5ee886e30778b65765aaaedf4e0b76c36 (patch)
tree3612fad67322edc40521e6e25fd8874c989fe3ba /src/interp/compiler.boot
parent1db4bd76938d5901b39cb516327a054c1aa0fdec (diff)
downloadopen-axiom-461221b5ee886e30778b65765aaaedf4e0b76c36.tar.gz
* interp/compiler.boot ($IOFormDomains): New.
(compAtom): Allow implicit coercion to IO forms for values of fundamental types. (compSymbol): Likewise. (compQuote): Likewise. * algebra/aggcat.spad.pamphlet (coerce$BinaryRecursiveAggregate): Don't hard code empty bracket.
Diffstat (limited to 'src/interp/compiler.boot')
-rw-r--r--src/interp/compiler.boot13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index 1217d63c..82b8567d 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -88,9 +88,15 @@ applyMapping: (%Form,%Mode,%Env,%List) -> %Maybe %Triple
$coreDiagnosticFunctions ==
'(error userError systemError)
+$IOFormDomains ==
+ [$InputForm,$OutputForm,$Syntax]
+
++ list of functions to compile
$compileOnlyCertainItems := []
+
+--%
+
compTopLevel: (%Form,%Mode,%Env) -> %Maybe %Triple
compTopLevel(x,m,e) ==
-- signals that target is derived from lhs-- see NRTmakeSlot1Info
@@ -399,7 +405,7 @@ compAtom(x,m,e) ==
convert(T,m)
t:=
isSymbol x => compSymbol(x,m,e) or return nil
- m = $OutputForm and primitiveType x => [x,m,e]
+ member(m,$IOFormDomains) and primitiveType x => [x,m,e]
STRINGP x => [x,x,e]
[x,primitiveType x or return nil,e]
convert(t,m)
@@ -430,7 +436,8 @@ compSymbol(s,m,e) ==
[s,m',e] --s is a declared argument
MEMQ(s,$FormalMapVariableList) =>
stackMessage('"no mode found for %1b",[s])
- m = $OutputForm or m = $Symbol => [['QUOTE,s],m,e]
+ member(m,$IOFormDomains) or member(m,[$Identifier,$Symbol]) =>
+ [['QUOTE,s],m,e]
not isFunction(s,e) => errorRef s
++ Return true if `m' is the most recent unique type case assumption
@@ -957,7 +964,7 @@ compQuote(expr,m,e) ==
expr is ["QUOTE",x] and IDENTP x =>
-- Ideally, Identifier should be the default type. However, for
-- historical reasons we cannot afford that luxury yet.
- m = $Identifier => [expr,$Identifier,e]
+ m = $Identifier or member(m,$IOFormDomains) => [expr,m,e]
convert([expr,$Symbol,e],m)
stackAndThrow('"%1b is not a literal symbol.",[x])