From 461221b5ee886e30778b65765aaaedf4e0b76c36 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 23 Apr 2009 06:24:08 +0000 Subject: * 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. --- src/interp/compiler.boot | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/interp/compiler.boot') 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]) -- cgit v1.2.3