Log Message:
-----------
Fixed it so that direct calls to the add, sub, mult, etc functions
would work as expected (even though there is no need to call them directly).
Modified Files:
--------------
pg/lib/Value:
Formula.pm
Revision Data
-------------
Index: Formula.pm
===================================================================
RCS file: /webwork/cvs/system/pg/lib/Value/Formula.pm,v
retrieving revision 1.16
retrieving revision 1.17
diff -Llib/Value/Formula.pm -Llib/Value/Formula.pm -u -r1.16 -r1.17
--- lib/Value/Formula.pm
+++ lib/Value/Formula.pm
@@ -63,7 +63,7 @@
# Evaluate the formula if it is constant.
#
sub bop {
- my ($l,$r,$flag,$bop) = @_;
+ my ($bop,$l,$r,$flag) = @_;
if ($l->promotePrecedence($r)) {return $r->add($l,!$flag)}
if ($flag) {my $tmp = $l; $l = $r; $r = $tmp}
my $formula = $pkg->blank; my $parser = $formula->{context}{parser};
@@ -90,12 +90,12 @@
return $formula;
}
-sub add {bop(@_,'+')}
-sub sub {bop(@_,'-')}
-sub mult {bop(@_,'*')}
-sub div {bop(@_,'/')}
-sub power {bop(@_,'**')}
-sub cross {bop(@_,'><')}
+sub add {bop('+',@_)}
+sub sub {bop('-',@_)}
+sub mult {bop('*',@_)}
+sub div {bop('/',@_)}
+sub power {bop('**',@_)}
+sub cross {bop('><',@_)}
#
# Make dot work for vector operands
|