diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 10 | ||||
-rw-r--r-- | src/algebra/aggcat.spad.pamphlet | 2 | ||||
-rw-r--r-- | src/algebra/strap/BOOLEAN.lsp | 10 | ||||
-rw-r--r-- | src/algebra/strap/LIST.lsp | 10 | ||||
-rw-r--r-- | src/algebra/strap/VECTOR.lsp | 11 | ||||
-rw-r--r-- | src/interp/compiler.boot | 13 |
6 files changed, 36 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 6f839da9..30faef3d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,13 @@ +2009-04-23 Gabriel Dos Reis <gdr@cs.tamu.edu> + + * 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. + 2009-04-22 Gabriel Dos Reis <gdr@cs.tamu.edu> * interp/sys-constants.boot ($SystemInlinableConstructorNames): diff --git a/src/algebra/aggcat.spad.pamphlet b/src/algebra/aggcat.spad.pamphlet index 86d91cba..8e941ff8 100644 --- a/src/algebra/aggcat.spad.pamphlet +++ b/src/algebra/aggcat.spad.pamphlet @@ -1326,7 +1326,7 @@ BinaryRecursiveAggregate(S:Type):Category == RecursiveAggregate S with if S has CoercibleTo(OutputForm) then coerce(t:%): OutputForm == - empty? t => "[]"::OutputForm + empty? t => bracket(empty()$OutputForm) v := value(t):: OutputForm empty? left t => empty? right t => v diff --git a/src/algebra/strap/BOOLEAN.lsp b/src/algebra/strap/BOOLEAN.lsp index 9241d5a1..2ca05a21 100644 --- a/src/algebra/strap/BOOLEAN.lsp +++ b/src/algebra/strap/BOOLEAN.lsp @@ -201,8 +201,8 @@ |BOOLEAN;size;Nni;18| (|Integer|) (8 . |even?|) (|PositiveInteger|) |BOOLEAN;index;Pi$;19| (13 . |One|) |BOOLEAN;lookup;$Pi;20| (17 . |random|) - |BOOLEAN;random;$;21| (|Symbol|) (|InputForm|) - (21 . |convert|) |BOOLEAN;convert;$If;22| (|OutputForm|) + |BOOLEAN;random;$;21| (|OutputForm|) (|InputForm|) + (21 . |convert|) |BOOLEAN;convert;$If;22| (|Symbol|) (26 . |outputForm|) |BOOLEAN;coerce;$Of;23| (|String|) (|SingleInteger|)) '#(~= 31 ~ 37 |xor| 42 |true| 48 |test| 52 |size| 57 |random| @@ -219,10 +219,10 @@ (|PropositionalLogic|) (|Finite|) (|Logic|) (|SetCategory|) (|ConvertibleTo| 36) (|BasicType|) - (|CoercibleTo| 39)) + (|CoercibleTo| 35)) (|makeByteWordVec2| 43 '(0 10 0 11 0 10 0 12 1 27 10 0 28 0 29 - 0 31 0 27 0 33 1 36 0 35 37 1 39 0 35 + 0 31 0 27 0 33 1 36 0 35 37 1 35 0 39 40 2 0 10 0 0 1 1 0 0 0 13 2 0 0 0 0 18 0 0 0 7 1 0 0 0 6 0 0 25 26 0 0 0 34 2 0 0 0 0 16 1 0 0 0 9 2 0 0 0 0 @@ -230,7 +230,7 @@ 0 0 1 2 0 0 0 0 1 1 0 29 0 32 1 0 42 0 1 1 0 0 29 30 2 0 0 0 0 22 1 0 43 0 1 0 0 0 8 2 0 0 0 0 23 1 0 36 0 38 1 - 0 39 0 41 2 0 0 0 0 14 2 0 0 0 0 17 2 + 0 35 0 41 2 0 0 0 0 14 2 0 0 0 0 17 2 0 10 0 0 1 2 0 10 0 0 1 2 0 10 0 0 21 2 0 10 0 0 1 2 0 10 0 0 24 2 0 0 0 0 15))))) diff --git a/src/algebra/strap/LIST.lsp b/src/algebra/strap/LIST.lsp index d446ced6..6eda32ee 100644 --- a/src/algebra/strap/LIST.lsp +++ b/src/algebra/strap/LIST.lsp @@ -203,7 +203,7 @@ (PROGN (LETT |dv$1| (|devaluate| |#1|) . #0=(|List|)) (LETT |dv$| (LIST '|List| |dv$1|) . #0#) - (LETT $ (|newShell| 70) . #0#) + (LETT $ (|newShell| 69) . #0#) (|setShellEntry| $ 0 |dv$|) (|setShellEntry| $ 3 (LETT |pv$| @@ -287,14 +287,14 @@ (97 . |removeDuplicates|) (102 . |setUnion|) (108 . |empty|) (112 . |empty?|) (117 . |member?|) (123 . |setIntersection|) (129 . |elt|) (135 . |concat|) - (141 . |setDifference|) (|Symbol|) (|InputForm|) + (141 . |setDifference|) (|OutputForm|) (|InputForm|) (147 . |convert|) (152 . |convert|) (|List| 45) (157 . |concat|) (|List| $) (163 . |convert|) (168 . |convert|) (|Mapping| 6 6 6) (|NonNegativeInteger|) (|List| 6) (|Equation| 6) (|List| 56) (|Mapping| 10 6) (|Mapping| 10 6 6) (|UniversalSegment| 7) '"last" '"rest" - '"first" '"value" (|Mapping| 6 6) (|OutputForm|) - (|SingleInteger|) (|List| 7) (|Union| 6 '"failed")) + '"first" '"value" (|Mapping| 6 6) (|SingleInteger|) + (|List| 7) (|Union| 6 '"failed")) '#(|setUnion| 173 |setIntersection| 179 |setDifference| 185 |rest| 191 |removeDuplicates| 196 |null| 201 |nil| 206 |member?| 210 |first| 216 |empty?| 221 |empty| 226 |elt| @@ -325,7 +325,7 @@ (|OrderedSet|) (|Aggregate|) (|EltableAggregate| 7 6) (|Evalable| 6) (|SetCategory|) (|Type|) (|Eltable| 7 6) - (|InnerEvalable| 6 6) (|CoercibleTo| 66) + (|InnerEvalable| 6 6) (|CoercibleTo| 44) (|ConvertibleTo| 45) (|BasicType|) (|OpenMath|)) (|makeByteWordVec2| 52 diff --git a/src/algebra/strap/VECTOR.lsp b/src/algebra/strap/VECTOR.lsp index 50609410..c9db05ae 100644 --- a/src/algebra/strap/VECTOR.lsp +++ b/src/algebra/strap/VECTOR.lsp @@ -40,7 +40,7 @@ (PROGN (LETT |dv$1| (|devaluate| |#1|) . #0=(|Vector|)) (LETT |dv$| (LIST '|Vector| |dv$1|) . #0#) - (LETT $ (|newShell| 36) . #0#) + (LETT $ (|newShell| 35) . #0#) (|setShellEntry| $ 0 |dv$|) (|setShellEntry| $ 3 (LETT |pv$| @@ -96,15 +96,14 @@ (MAKEPROP '|Vector| '|infovec| (LIST '#(NIL NIL NIL NIL NIL (|IndexedVector| 6 (NRTEVAL 1)) (|local| |#1|) (|Integer|) (0 . |One|) (|List| 6) - (4 . |construct|) |VECTOR;vector;L$;1| (|Symbol|) + (4 . |construct|) |VECTOR;vector;L$;1| (|OutputForm|) (|InputForm|) (9 . |convert|) (14 . |parts|) (19 . |convert|) (|List| $) (24 . |convert|) (29 . |convert|) (|Mapping| 6 6 6) (|Boolean|) (|NonNegativeInteger|) (|Equation| 6) (|List| 23) (|Mapping| 21 6) (|Mapping| 21 6 6) (|UniversalSegment| 7) - (|Void|) (|Mapping| 6 6) (|OutputForm|) (|Matrix| 6) - (|SingleInteger|) (|String|) (|Union| 6 '"failed") - (|List| 7)) + (|Void|) (|Mapping| 6 6) (|Matrix| 6) (|SingleInteger|) + (|String|) (|Union| 6 '"failed") (|List| 7)) '#(|vector| 34 |parts| 39 |convert| 44 |construct| 49) '((|shallowlyMutable| . 0) (|finiteAggregate| . 0)) (CONS (|makeByteWordVec2| 5 @@ -127,7 +126,7 @@ (|OrderedSet|) (|Aggregate|) (|EltableAggregate| 7 6) (|Evalable| 6) (|SetCategory|) (|Type|) (|Eltable| 7 6) - (|InnerEvalable| 6 6) (|CoercibleTo| 30) + (|InnerEvalable| 6 6) (|CoercibleTo| 12) (|ConvertibleTo| 13) (|BasicType|)) (|makeByteWordVec2| 19 '(0 7 0 8 1 0 0 9 10 1 13 0 12 14 1 0 9 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]) |