aboutsummaryrefslogtreecommitdiff
path: root/src/interp/modemap.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2008-01-27 17:52:17 +0000
committerdos-reis <gdr@axiomatics.org>2008-01-27 17:52:17 +0000
commit58cae19381750526539e986ca1de122803ac2293 (patch)
tree24c77cb7e745a5072eac5dde2503820de3c376f9 /src/interp/modemap.boot
parenta388d36abab4b55733a8e2c19b1a8ec882274fa8 (diff)
downloadopen-axiom-58cae19381750526539e986ca1de122803ac2293.tar.gz
Fix SF/1872551
* interp/c-util.boot (dollarIfRepHack): New. (RepIfRepHack): Likewise. (substituteDollarIfRepHack): Likewise. (isSubset): Dollar is subset of Rep only in old semantics. * interp/buildom.boot (mkMappingFunList): Substitute dollar for Rep only when appropriate. (mkRecordFunList): Likewise. (mkNewUnionFunList): Likewise. (mkUnionFunList): Likewise. * interp/compiler.boot (compNoStacking): Likewise. (compNoStacking1): Likewise. (getConstructorFormOfMode): Likewise. (isUnionMode): Likewise. (coerce): Likewise. (coerceSubset): Likewise. * interp/modemap.boot (addModemap1): Likewise. (isSuperDomain): Likewise. * interp/define.boot (maybeInsertViewMorphisms): New. (compCapsule): Use it. (compCategoryItem): Don't allow exports of rep and per. * interp/sys-globals.boot ($useRepresentationHack): New.
Diffstat (limited to 'src/interp/modemap.boot')
-rw-r--r--src/interp/modemap.boot15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/interp/modemap.boot b/src/interp/modemap.boot
index 1cdfdd2c..f2ae0fc5 100644
--- a/src/interp/modemap.boot
+++ b/src/interp/modemap.boot
@@ -1,6 +1,6 @@
-- Copyright (c) 1991-2002, The Numerical ALgorithms Group Ltd.
-- All rights reserved.
--- Copyright (C) 2007, Gabriel Dos Reis.
+-- Copyright (C) 2007-2008, Gabriel Dos Reis.
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without
@@ -160,11 +160,7 @@ addEltModemap(op,mc,sig,pred,fn,e) ==
addModemap1(op,mc,sig,pred,fn,e) ==
--mc is the "mode of computation"; fn the "implementation"
- if mc='Rep then
--- if fn is [kind,'Rep,.] and
- -- save old sig for NRUNTIME
--- (kind = 'ELT or kind = 'CONST) then fn:=[kind,'Rep,sig]
- sig:= substitute("$",'Rep,sig)
+ if mc="Rep" then sig := substituteDollarIfRepHack sig
currentProplist:= getProplist(op,e) or nil
newModemapList:=
mkNewModemapList(mc,sig,pred,fn,LASSOC('modemap,currentProplist),e,nil)
@@ -220,7 +216,8 @@ mergeModemap(entry is [[mc,:sig],[pred,:.],:.],modemapList,e) ==
isSuperDomain(domainForm,domainForm',e) ==
isSubset(domainForm',domainForm,e) => true
- domainForm='Rep and domainForm'="$" => true --regard $ as a subdomain of Rep
+ --regard $ as a subdomain of Rep, only if using old style Rep
+ domainForm='Rep and domainForm'="$" => $useRepresentationHack
LASSOC(opOf domainForm',get(domainForm,"SubDomain",e))
--substituteForRep(entry is [[mc,:sig],:.],curModemapList) ==
@@ -255,13 +252,13 @@ substituteCategoryArguments(argl,catform) ==
--operations are not being redefined.
augModemapsFromCategoryRep(domainName,repDefn,functorBody,categoryForm,e) ==
[fnAlist,e]:= evalAndSub(domainName,domainName,domainName,categoryForm,e)
- [repFnAlist,e]:= evalAndSub('Rep,'Rep,repDefn,getmode(repDefn,e),e)
+ [repFnAlist,e]:= evalAndSub("Rep","Rep",repDefn,getmode(repDefn,e),e)
catform:= (isCategory categoryForm => categoryForm.(0); categoryForm)
compilerMessage ["Adding ",domainName," modemaps"]
e:= putDomainsInScope(domainName,e)
$base:= 4
for [lhs:=[op,sig,:.],cond,fnsel] in fnAlist repeat
- u:=assoc(SUBST('Rep,domainName,lhs),repFnAlist)
+ u:=assoc(SUBST("Rep",domainName,lhs),repFnAlist)
u and not AMFCR_,redefinedList(op,functorBody) =>
fnsel':=CADDR u
e:= addModemap(op,domainName,sig,cond,fnsel',e)