aboutsummaryrefslogtreecommitdiff
path: root/src/interp/functor.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-11-28 03:49:34 +0000
committerdos-reis <gdr@axiomatics.org>2011-11-28 03:49:34 +0000
commitedde1ab05981cf948483ba0407e3d8aa466f56c2 (patch)
treecd1f136dc9d95a72acede7cf242a84a3b3d0d3eb /src/interp/functor.boot
parentcc6921eeffcee91d76d322303884e808e4851345 (diff)
downloadopen-axiom-edde1ab05981cf948483ba0407e3d8aa466f56c2.tar.gz
* interp/database.boot (dbDefaultPackage?): New.
* interp/define.boot (compDefine1): Avoid encodeItem when symbolName is meant. (mkRepititionAssoc): Move from functor.boot (encodeItem): Likewise. (getCaps): Likewise. Tidy. (encodeFunctionName): Likewise.
Diffstat (limited to 'src/interp/functor.boot')
-rw-r--r--src/interp/functor.boot34
1 files changed, 1 insertions, 33 deletions
diff --git a/src/interp/functor.boot b/src/interp/functor.boot
index 5a71aaf7..26ffe49b 100644
--- a/src/interp/functor.boot
+++ b/src/interp/functor.boot
@@ -757,27 +757,13 @@ mkOperatorEntry(opSig is [op,sig,:flag],pred,count) ==
--% Code for encoding function names inside package or domain
-encodeFunctionName(db,fun,signature,sep,count) ==
- signature':= MSUBST("$",dbConstructorForm db,signature)
- reducedSig:= mkRepititionAssoc [:rest signature',first signature']
- encodedSig:=
- (strconc/[encodedPair for [n,:x] in reducedSig]) where
- encodedPair() ==
- n=1 => encodeItem x
- strconc(toString n,encodeItem x)
- encodedName:= makeSymbol strconc(symbolName dbAbbreviation db,'";",
- encodeItem fun,'";",encodedSig,sep,toString count)
- dbCapsuleDefinitions(db) :=
- [[encodedName,signature'],:dbCapsuleDefinitions db]
- encodedName
-
++ Return the linkage name of the local operation named `op'.
encodeLocalFunctionName op ==
prefix :=
$prefix => $prefix
$functorForm => symbolName dbAbbreviation constructorDB $functorForm.op
stackAndThrow('"There is no context for local function %1b",[op])
- makeSymbol strconc(prefix,'";",encodeItem op)
+ makeSymbol strconc(prefix,'";",symbolName op)
splitEncodedFunctionName(encodedName, sep) ==
-- [encodedPackage, encodedItem, encodedSig, sequenceNo] or nil
@@ -795,21 +781,3 @@ splitEncodedFunctionName(encodedName, sep) ==
s4 := subString(encodedName, p3+1)
[s1, s2, s3, s4]
-mkRepititionAssoc l ==
- mkRepfun(l,1) where
- mkRepfun(l,n) ==
- null l => nil
- l is [x] => [[n,:x]]
- l is [x, =x,:l'] => mkRepfun(rest l,n+1)
- [[n,:first l],:mkRepfun(rest l,1)]
-
-encodeItem x ==
- x is [op,:argl] => getCaps op
- ident? x => symbolName x
- STRINGIMAGE x
-
-getCaps x ==
- s:= STRINGIMAGE x
- clist:= [c for i in 0..maxIndex s | upperCase? (c:= s.i)]
- null clist => '"__"
- strconc/[first clist,:[L_-CASE u for u in rest clist]]