aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGabriel Dos Reis <gdr@axiomatics.org>2015-12-27 02:57:00 -0800
committerGabriel Dos Reis <gdr@axiomatics.org>2015-12-27 02:57:00 -0800
commitba8d29ccd1dd272f5883fe3d042b1bc38f1ce688 (patch)
tree489b3e47f048e704d9a5bd7996f20dd10fb68fe0 /src
parent12c45e096d0e55f6df58366fb670eed0a50cb453 (diff)
downloadopen-axiom-ba8d29ccd1dd272f5883fe3d042b1bc38f1ce688.tar.gz
Simplify representation of constants in functors.
Diffstat (limited to 'src')
-rw-r--r--src/interp/br-data.boot4
-rw-r--r--src/interp/br-op1.boot1
-rw-r--r--src/interp/c-util.boot4
-rw-r--r--src/interp/functor.boot2
-rw-r--r--src/interp/nruncomp.boot6
-rw-r--r--src/interp/showimp.boot5
6 files changed, 10 insertions, 12 deletions
diff --git a/src/interp/br-data.boot b/src/interp/br-data.boot
index 45d947b1..1951754f 100644
--- a/src/interp/br-data.boot
+++ b/src/interp/br-data.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical Algorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007-2014, Gabriel Dos Reis.
+-- Copyright (C) 2007-2015, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -463,7 +463,7 @@ getImports conname == --called by mkUsersHashTable
u := [doImport(i,template)
for i in 5..(maxIndex template) | test] where
test() == template.i is [op,:.] and ident? op
- and not (op in '(Mapping Union Record Enumeration CONS QUOTE local %closure))
+ and not (op in '(Mapping Union Record Enumeration CONS QUOTE local %constant))
doImport(x,template) ==
x is [op,:args] =>
op = 'QUOTE or op = '%eval => first args
diff --git a/src/interp/br-op1.boot b/src/interp/br-op1.boot
index a383f0e3..dcbf5fdb 100644
--- a/src/interp/br-op1.boot
+++ b/src/interp/br-op1.boot
@@ -954,7 +954,6 @@ getDomainOpTable(dom,fromIfTrue,:options) ==
[f,:r] := cell
f is 'nowhere => 'nowhere --see replaceGoGetSlot
f is 'makeSpadConstant => 'constant
- f is '%constant => 'constant
f is 'newGoGet => substitute('_$,domname,devaluate first r)
not vector? r => systemError devaluateList r
substitute('_$,domname,devaluate r)
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 6256c305..7ecab9d4 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1766,8 +1766,8 @@ lookupDefiningFunction(op,sig,dc) ==
-- 6. We have a location to a function descriptor.
fun := domainRef(shell,loc)
- -- 6.1. A constant producing functions?
- fun is [.,'%constant,[.,['%function,fun'],.]] => fun'
+ -- 6.1. A constant producing function?
+ fun is ['%constant,[fun',.]] => fun'
-- 6.2. An inherited function?
fun is [idx,:.] =>
not integer? idx => nil -- a UFO?
diff --git a/src/interp/functor.boot b/src/interp/functor.boot
index 30c5a5df..4a294084 100644
--- a/src/interp/functor.boot
+++ b/src/interp/functor.boot
@@ -521,7 +521,7 @@ SetFunctionSlots(sig,body,flag,mode) == --mode is either "original" or "adding"
for catImplem in findOperatorImplementations sig repeat
catImplem is [q,.,index] and q in '(ELT CONST) =>
if q = 'CONST and body is ['%closure,a,b] then
- body := ['%closure,'%constant,['FUNCALL,a,b]]
+ body := ['%closure,'%constant,[second a,b]]
body:= ['%store,['%tref,'$,index],body]
not vector? $SetFunctions => nil --packages don't set it
TruthP vectorRef($SetFunctions,index) => -- the function was already assigned
diff --git a/src/interp/nruncomp.boot b/src/interp/nruncomp.boot
index 260d4fd1..ab55362d 100644
--- a/src/interp/nruncomp.boot
+++ b/src/interp/nruncomp.boot
@@ -338,7 +338,7 @@ descendCodeTran(db,u,condList) ==
u.first := '%list
u.rest := nil
domainRef(dbTemplate db,i) :=
- fn is '%constant => a
+ fn is '%constant => a.args
fn is ['%function,fn'] => fn'
fn
nil --code for this will be generated by the instantiator
@@ -379,8 +379,8 @@ stuffSlot(dollar,i,item) ==
vectorRef(dollar,i) :=
item isnt [.,:.] => [symbolFunction item,:dollar]
item is [n,:op] and integer? n => ['newGoGet,dollar,:item]
- item is ['%closure,.,['FUNCALL,a,b]] =>
- b is '$ => ['makeSpadConstant,eval a,dollar,i]
+ item is ['%constant,[a,b]] =>
+ b is '$ => ['makeSpadConstant,symbolFunction a,dollar,i]
sayBrightlyNT '"Unexpected constant environment!!"
pp devaluate b
nil
diff --git a/src/interp/showimp.boot b/src/interp/showimp.boot
index 633b7d22..78977b06 100644
--- a/src/interp/showimp.boot
+++ b/src/interp/showimp.boot
@@ -283,7 +283,7 @@ dcSlots con ==
item is [n,:op] and integer? n => dcOpLatchPrint(op,n)
null item and i > 5 => sayBrightly ['"arg ",strconc('"#",toString(i - 5))]
item isnt [.,:.] => sayBrightly ['"fun ",item]
- item is ['%closure,.,['FUNCALL,[.,a],b]] => sayBrightly ['"constant ",a]
+ item is ['%constant,[a,.]] => sayBrightly ['"constant ",a]
sayBrightly concat('"lazy ",form2String formatSlotDomain i)
dcOpLatchPrint(op,index) ==
@@ -364,8 +364,7 @@ dcOpPrint(op,index) ==
slotNumber = 1 => '"missing"
name := $infovec.0.slotNumber
name isnt [.,:.] => name
- name is ['%closure,'%constant,
- ["FUNCALL", ['%function, impl],"$"]] =>
+ name is ['%constant,[impl,"$"]] =>
kind := 'CONST
impl
'"looked up"