aboutsummaryrefslogtreecommitdiff
path: root/src/interp/g-util.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-12-03 04:24:04 +0000
committerdos-reis <gdr@axiomatics.org>2011-12-03 04:24:04 +0000
commite9584df65c00f385474f9e4dd56b95b51e1efb65 (patch)
treeaa06687a6b7022920ab9668c3f3285728cbed388 /src/interp/g-util.boot
parent543e6d9ca95c41ae2f9bf7c45c98121cc94602ed (diff)
downloadopen-axiom-e9584df65c00f385474f9e4dd56b95b51e1efb65.tar.gz
* interp/g-util.boot (hasNoLeave?): Move from g-opt.boot.
(mkLabelled): New. (mkBind): Likewise. * interp/g-opt.boot (groupVariableDefinitions): Use them. * algebra/aggcat.spad.pamphlet (ListAggregate) [merge!]: Declare local variables `r' and `s' before assigning to them.
Diffstat (limited to 'src/interp/g-util.boot')
-rw-r--r--src/interp/g-util.boot23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 18ada7f8..b9a6e99c 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -48,6 +48,29 @@ module g_-util where
--%
+hasNoLeave?(expr,g) ==
+ expr is ['%leave, =g,:.] => false
+ expr isnt [.,:.] => true
+ hasNoLeave?(first expr,g) and hasNoLeave?(rest expr,g)
+
+mkLabelled(tag,expr) ==
+ expr is ['%leave,=tag,expr'] and hasNoLeave?(expr',tag) => expr'
+ expr is ['%bind,inits,expr'] and hasNoLeave?(inits,tag) =>
+ mkBind(inits,mkLabelled(tag,expr'))
+ hasNoLeave?(expr,tag) => expr
+ ['%labelled,tag,expr]
+
+mkBind(inits,expr) ==
+ expr is ['%leave,tag,expr'] =>
+ ['%leave,tag,mkBind(inits,expr')]
+ expr is ['%bind,inits',expr'] =>
+ mkBind([:inits,:inits'],expr')
+ ['%bind,inits,expr]
+
+
+
+--%
+
++ List of category constructors that do not have entries in the
++ constructor database. So, they are mostly recognized by their names.
$CategoryNames ==