[system] / trunk / pg / lib / Parser / Function.pm Repository:
ViewVC logotype

Log of /trunk/pg/lib/Parser/Function.pm

Parent Directory Parent Directory


Links to HEAD: (view) (download) (as text) (annotate)
Sticky Revision:

Revision 5509 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Sep 15 00:56:51 2007 UTC (12 years, 2 months ago) by dpvc
File length: 9387 byte(s)
Diff to previous 5367
Formula objects and Context objects contain reference loops, which
prevent them from being freed properly by perl when they are no longer
needed.  This is a source of an important memory leak in WeBWorK.  The
problem has been fixed by using Scalar::Util::weaken for these
recursive references, so these objects can be freed properly when they
go out of scope.  This should cause an improvement in the memory usage
of the httpd child processes.

Revision 5367 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 18 23:46:02 2007 UTC (12 years, 3 months ago) by dpvc
File length: 9372 byte(s)
Diff to previous 5130
Include extra parens when they have been requested.

Revision 5130 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Jul 9 12:45:06 2007 UTC (12 years, 5 months ago) by dpvc
File length: 9342 byte(s)
Diff to previous 5012
Added new flags to error checking of operands and function arguments.
This is so that a context can be developed that is more forgiving
about what can be put next to what.  Such a context can NOT be used
for evaluation or answer checking, but can be used to generate TeX
output in more sophisticated situations.

Revision 5012 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Jun 21 23:10:13 2007 UTC (12 years, 5 months ago) by dpvc
File length: 9024 byte(s)
Diff to previous 5001
Added Package method to the Context object to replace the
Value->Package() calls and simplify the $self->Package calls (don't
have to look up the context again).

Revision 5001 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jun 12 04:05:56 2007 UTC (12 years, 6 months ago) by dpvc
File length: 9026 byte(s)
Diff to previous 4994
More fixes for creating items in the corret context.  Also added a
method for looking up the package associated with a particular Parser
class (for consistency with the Value->Package call).

Revision 4994 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Jun 10 01:17:29 2007 UTC (12 years, 6 months ago) by dpvc
File length: 9099 byte(s)
Diff to previous 4975
Update to handle the fact that the Value package now includes the
context with all MathObjects.  (This may still need some work.)

Revision 4975 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Jun 6 21:44:05 2007 UTC (12 years, 6 months ago) by dpvc
File length: 9042 byte(s)
Diff to previous 3702
This begins some major updates to the Parser and Value libraries.
This may make the MathObjects unstable as things shake down, but I'll
try to keep that to a minimum.

This update reorganizes how the overloading of operations are
implemented.  The base Value class is now overloaded rather than the
individual Value classes.  This makes it easier to make subclasses
that take advantage of the overloading.

The code that handles promoting one MathObject to another has been
updated as a part of this.  This should also make subclassing the
existing MathObjects more flexible.

In the past, Formula objects included a pointer to the Context in
which the object was created, but other MathObject did not.  This
update is the first round of updates to include the context in the
other MathObjects, but more work needs to be done.

The changes here should not affect existing problems; it is possible
that some macro files will need to be updated, but none of the
standard ones in pg/macros seem to need it at the moment.

Revision 3702 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Oct 10 23:41:05 2005 UTC (14 years, 2 months ago) by dpvc
File length: 9130 byte(s)
Diff to previous 3591
If constant functions are not being reduced, don't mark the function
call as constant (since otherwise it might be evaluated later accidentally).

Revision 3591 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 30 12:21:36 2005 UTC (14 years, 3 months ago) by dpvc
File length: 9077 byte(s)
Diff to previous 3578
The perl method for UOP and BOP now put spaces around the operator, to
prevent Perl from thinking that things like -e is a file test and
*Parser::Function->call is a name reference.  (Some of these had been
done by hand earlier, but now the base BOP and UOP classes handle it,
so we should not have problems in the future).  I removed the ad hoc
fixes from several other locations (Parser/Function.pm,
Parser/Context/Default.pm).

Also extended the operator definitions to allow operators to create
function-call syntax in perl mode (for when the operator doesn't
correspond to a perl operator).

Revision 3578 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 26 14:06:39 2005 UTC (14 years, 3 months ago) by jj
File length: 9079 byte(s)
Diff to previous 3568
Fix bug where perl functions which may need parentheses by forcing them
when the function starts Parser::Function->.  This seems to work, but
there might be a better way to do it, or need other cleaning up.

Revision 3568 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Aug 25 03:32:16 2005 UTC (14 years, 3 months ago) by dpvc
File length: 9077 byte(s)
Diff to previous 3491
Fixed log and log10 perl methods so that log obeys the useBaseTenLog
flag, and log10 doesn't try to call main::log10, which is not
available from within this preloaded package.  The in- and outside
the safe compartment stuff is very confusing, and functions that are
not overloaded native perl functions seem to be not callable from the
Value::Formula package, so the perl method now calls
Parser::Function->call() directly (doesn't look pretty, but I've given
up on that).

Revision 3491 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Aug 12 22:54:38 2005 UTC (14 years, 4 months ago) by dpvc
File length: 9003 byte(s)
Diff to previous 3370
Mark function as constant if it is.

Revision 3370 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Jul 12 22:29:53 2005 UTC (14 years, 5 months ago) by dpvc
File length: 8970 byte(s)
Diff to previous 3221
A first pass at making parser error messages localizable.  The
Context()->{error}{msg} hash can be used to specify translations of
the standard messages.  For example,

    Context()->{error}{msg}{'Division by zero'} = "Don't divide by zero, dude!";
    Context()->{error}{msg}{'Function '%s' has too many inputs'} =
        "You passed too many arguments to '%s'";

(I didn't translate into another language, here, but you could do
that, too.)

The msg hash could also be used within answer checkers to make certain
answer messages more appropriate for the given type of expected answer.

Revision 3221 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon May 2 00:58:00 2005 UTC (14 years, 7 months ago) by dpvc
File length: 8933 byte(s)
Diff to previous 3194
During a call(), if the evaluation produced an error message generated
by Value::Error, report it, otherwise report a generic message.

Revision 3194 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Mar 16 13:35:01 2005 UTC (14 years, 8 months ago) by dpvc
File length: 8859 byte(s)
Diff to previous 2915
removed a commented-out line that was no longer needed.

Revision 2915 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Wed Oct 13 03:31:17 2004 UTC (15 years, 1 month ago) by dpvc
File length: 8926 byte(s)
Diff to previous 2796
Trap errors in functions that are not native perl functions (like
acos() and csc(), etc.).  In the past, if an error occurred within the
definition of a function, the error message that was reported was the
internal error within the definition of the function.  For example
csc(0) would report "illegal division by zero", while acos(-2) would
report "can't take sqrt of -3".  Now the errors will be "can't take
csc of 0" and "can't take acos of -2".

Revision 2796 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sun Sep 19 01:15:03 2004 UTC (15 years, 2 months ago) by dpvc
File length: 8711 byte(s)
Diff to previous 2789
Added flags that control the reductions performed by
Formula()->reduce.  Each reduction operation can be individually
enabled or disabled in the context, and in the reduce() call itself.

More complex reductions need to be developed.

Revision 2789 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Thu Sep 16 22:24:32 2004 UTC (15 years, 2 months ago) by dpvc
File length: 8728 byte(s)
Diff to previous 2768
Added context flags to control automatic reduction of operations that
involve only constant values.  The default is to combine constants,
but this can now be disabled.

Also added a new flag to control the addition of extra parentheses
that make string values painfully unambiguous (these are for
situations that students tend to get wrong).  By default this is
turned off (so that professor answers won't contain excessive
parentheses), but the answer checker will be made to turn this on for
student answers.

Finally, when extra parens are added to formulas, they alternate
between ( ) and [ ] to make it easier to read.

Revision 2768 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Fri Sep 10 23:55:31 2004 UTC (15 years, 3 months ago) by dpvc
File length: 8577 byte(s)
Diff to previous 2697
When creating formulas from functions, don't evaluate even if the
formula is constant.  (This makes it possible to create automatically
create formulas even if they only contain constants.)

Revision 2697 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 28 12:43:57 2004 UTC (15 years, 3 months ago) by dpvc
File length: 8576 byte(s)
Diff to previous 2696
Two more minor TeX improvements.

Revision 2696 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Sat Aug 28 12:34:56 2004 UTC (15 years, 3 months ago) by dpvc
File length: 8574 byte(s)
Diff to previous 2680
Improved TeX and string output in a number of situations.  Improved
use of parentheses to avoid things like x+-3.  Fixed wrong parentheses
in powers.  Display (sin(x))^2 as sin^2(x) in TeX output.

Revision 2680 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Tue Aug 24 03:33:30 2004 UTC (15 years, 3 months ago) by dpvc
File length: 8518 byte(s)
Diff to previous 2678
Made string function look for a string field in teh definition of the
function as an override for its name. (This way, you can make asin
appear as arcsin or even sin^(-1) if you want).

Revision 2678 - (view) (download) (as text) (annotate) - [select for diffs]
Modified Mon Aug 23 23:55:37 2004 UTC (15 years, 3 months ago) by dpvc
File length: 8492 byte(s)
Diff to previous 2558
Modified the parser so that the classes for the various object
constructors are stored in the context table rather than hard-coded
into the parser.  That way, you can override the default classes with
your own.  This gives you even more complete control to modify the
parser.  (You had been able to replace the definitions of operators,
functions and list-like objects, but could not override the behaviour
of numbers, strings, variables, and so on.  Now you can.)

This effects most of the files, but only by changing the name of the
calls that create the various objects.

There are also a couple of other minor fixes.

Revision 2558 - (view) (download) (as text) (annotate) - [select for diffs]
Added Wed Jul 28 20:32:33 2004 UTC (15 years, 4 months ago) by sh002i
File length: 8345 byte(s)
merged changes from rel-2-1-a1 -- stop using that branch.

This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

Sort log by:

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9