diff options
author | dos-reis <gdr@axiomatics.org> | 2008-07-09 13:19:32 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-07-09 13:19:32 +0000 |
commit | aa7e3e2f0d8bbcafe488f536faa86ff9581efef0 (patch) | |
tree | 848dde1b6e7d8107e342dba32bf1710110921c15 /src/interp | |
parent | 55515251e3643565e3a6683a5d775a1f262939cd (diff) | |
download | open-axiom-aa7e3e2f0d8bbcafe488f536faa86ff9581efef0.tar.gz |
* interp/i-spec2.boot (findConstantInDomain): Abstract from
upDollar.
(upDollar): Use it. Don't return general constants as mappings.
* interp/fnewmeta.lisp (|PARSE-FloatTok|): Fix typo.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/fnewmeta.lisp | 2 | ||||
-rw-r--r-- | src/interp/i-spec2.boot | 24 |
2 files changed, 17 insertions, 9 deletions
diff --git a/src/interp/fnewmeta.lisp b/src/interp/fnewmeta.lisp index 49fe82c8..70fd040c 100644 --- a/src/interp/fnewmeta.lisp +++ b/src/interp/fnewmeta.lisp @@ -818,7 +818,7 @@ (DEFUN |PARSE-FloatTok| () (AND (PARSE-NUMBER) - (PUSH-REDUCTION '|PARSE-FloatTok| (POP-STACK-1))))) + (PUSH-REDUCTION '|PARSE-FloatTok| (POP-STACK-1)))) (DEFUN |PARSE-FormalParameter| () (|PARSE-FormalParameterTok|)) diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot index f3362bff..58c737af 100644 --- a/src/interp/i-spec2.boot +++ b/src/interp/i-spec2.boot @@ -67,6 +67,16 @@ upDEF t == --% Handler for package calling and $ constants +++ Constant `c' is referenced from domain `d'; return its value +++ in the VAT `op'. +findConstantInDomain(op,c,d) == + isPartialMode d => throwKeyedMsg("S2IS0020",NIL) + if $genValue then + val := wrap getConstantFromDomain([c],d) + else val := ["getConstantFromDomain",["LIST",MKQ c],MKQ d] + putValue(op,objNew(val,d)) + putModeSet(op,[d]) + upDollar t == -- Puts "dollar" property in atree node, and calls bottom up t isnt [op,D,form] => nil @@ -82,15 +92,13 @@ upDollar t == if f = $immediateDataSymbol then f := objValUnwrap coerceInteractive(getValue form,$OutputForm) if f = '(construct) then f := "nil" - ATOM(form) and (f ^= $immediateDataSymbol) and - (u := findUniqueOpInDomain(op,f,t)) => u + -- FIXME: The next two cases should be simplified and merged as + -- we move to general constant definitions. + atom form and (f ^= $immediateDataSymbol) => + constantInDomain?([f],t) => findConstantInDomain(op,f,t) + findUniqueOpInDomain(op,f,t) f in '(One Zero true false nil) and constantInDomain?([f],t) => - isPartialMode t => throwKeyedMsg("S2IS0020",NIL) - if $genValue then - val := wrap getConstantFromDomain([f],t) - else val := ["getConstantFromDomain",["LIST",MKQ f],MKQ t] - putValue(op,objNew(val,t)) - putModeSet(op,[t]) + findConstantInDomain(op,f,t) nargs := #rest form |