aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-12-05 22:46:02 +0000
committerdos-reis <gdr@axiomatics.org>2011-12-05 22:46:02 +0000
commit5a91fcad2db8abc1e9825873034959b3ffe07b18 (patch)
treec322441ceeb5b5ea97aa2b173e36a5b0cbc4357a /src/interp
parent8463a17556bf5cbc2911f4c880a6322d718c2f52 (diff)
downloadopen-axiom-5a91fcad2db8abc1e9825873034959b3ffe07b18.tar.gz
* interp/g-util.boot (splitAssignments): Rework.
(spliceSeqArgs): Tidy. * algebra/gdpoly.spad.pamphlet (GeneralDistributedMultivariatePolynomial): Fix thinko.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/g-util.boot14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot
index 437c0427..7e15d637 100644
--- a/src/interp/g-util.boot
+++ b/src/interp/g-util.boot
@@ -68,12 +68,18 @@ mkBind(inits,expr) ==
mkBind([:inits,:inits'],expr')
['%bind,inits,expr]
-splitAssignments u == main(u,nil) where
+++ Given a (possibly multiple) assignment expression `u', return
+++ the list of all assignment sub-expressions that must be evaluated before
+++ effecting the toplevel assignment indicated by `u'. In that case,
+++ modify `u' in place to reflect the new right-hand-side.
+splitAssignments! u == main(u,nil) where
main(u,l) ==
u is ['%LET,x,v] =>
- v is ['%LET,y,.] => main(v,[['%LET,x,y],:l])
- [u,:l]
- nil
+ v is ['%LET,y,.] =>
+ second(u.args) := y
+ [:main(v,l),v]
+ l
+ l
++ We have a list `l' of expressions to be executed sequentially.
++ Splice in any directly-embedded sequence of expressions.