From aa7e3e2f0d8bbcafe488f536faa86ff9581efef0 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Wed, 9 Jul 2008 13:19:32 +0000 Subject: * 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. --- src/interp/fnewmeta.lisp | 2 +- src/interp/i-spec2.boot | 24 ++++++++++++++++-------- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'src/interp') 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 -- cgit v1.2.3