aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/algebra/matfuns.spad.pamphlet4
-rw-r--r--src/interp/g-opt.boot12
3 files changed, 14 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4eee6517..58a523d9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,12 @@
2011-12-27 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * interp/g-opt.boot (changeVariableDefinitionToStore): Tidy.
+ Remove handling of IF forms as no longer relevant.
+ * algebra/matfuns.spad.pamphlet
+ (MatrixLinearAlgebraFunctions) [rank]: Tidy.
+
+2011-12-27 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* algebra/matfuns.spad.pamphlet
(InnerMatrixLinearAlgebraFunctions) [rank]: Tidy.
diff --git a/src/algebra/matfuns.spad.pamphlet b/src/algebra/matfuns.spad.pamphlet
index 2f42249c..1fdf3cc9 100644
--- a/src/algebra/matfuns.spad.pamphlet
+++ b/src/algebra/matfuns.spad.pamphlet
@@ -676,8 +676,10 @@ MatrixLinearAlgebraFunctions(R,Row,Col,M):Exports == Implementation where
fm(maxRowIndex fm,maxColIndex fm)
rank x ==
+ rk := nrows x
y :=
- (rk := nrows x) > (rh := ncols x) =>
+ rh := ncols x
+ rk > rh =>
rk := rh
transpose x
copy x
diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot
index 2bdde63a..eb3c3e86 100644
--- a/src/interp/g-opt.boot
+++ b/src/interp/g-opt.boot
@@ -108,17 +108,13 @@ changeVariableDefinitionToStore(form,vars) ==
symbolMember?(v,vars) => form.op := '%store
vars := [v,:vars]
vars
- form is ['IF,p,s1,s2] =>
- -- variables defined in the predicate are visible in both branches, but
- -- no variable locally defined in one branch is visible in the other.
- vars' := changeVariableDefinitionToStore(p,vars)
- changeVariableDefinitionToStore(s1,vars')
- changeVariableDefinitionToStore(s2,vars')
+ form is ['%scope,.,expr] and expr is ['%seq,:.] =>
+ changeVariableDefinitionToStore(expr,vars)
vars
form is ['%when,:.] =>
for clause in form.args repeat
-- variable defined in clause predicates are visible
- -- in subsequent predicates. See the case for IF forms.
+ -- in subsequent predicates.
vars := changeVariableDefinitionToStore(first clause,vars)
-- but those defined in branches are local.
changeVariableDefinitionToStore(rest clause,vars)
@@ -139,7 +135,7 @@ changeVariableDefinitionToStore(form,vars) ==
vars' := [v,:vars']
changeVariableDefinitionToStore(third form,[:vars',:vars])
vars
- ident? form.op and abstractionOperator? form.op =>
+ abstraction? form =>
changeVariableDefinitionToStore(form.absBody,[:form.absParms,:vars])
vars
form is ['%repeat,:iters,body,val] =>