Log of /trunk/pg/lib/Value/Context/Data.pm
Parent Directory
Revision
3483 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 12 01:21:48 2005 UTC (14 years, 4 months ago) by
dpvc
File length: 5028 byte(s)
Diff to
previous 3370
Added redefine() function to complement undefine() for various
Context() values. For example
Context()->operators->undefine('+');
makes '+' undefined, but
Context()->operators->redefine('+');
will put it back. You can specify a context from which to take the
redefinition, and a name in that context, as in
Context()->operators->redefine('U',from=>"Interval");
Context()->operators->redefine('u',from=>"Interval",using=>"U");
Context()->operators->redefine('U',from=>$content);
where $content is a reference to a Context object.
The undefine() function lets you undefine several items at once, as in
Context()->operators->undefine('+','-');
For redefine, you must put multiple names in square brackets because
of the optional parmeters:
Context()->operators->redefine(['+','-']);
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: 4288 byte(s)
Diff to
previous 3333
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
2771 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sat Sep 11 17:11:29 2004 UTC (15 years, 3 months ago) by
dpvc
File length: 4281 byte(s)
Diff to
previous 2658
Fixed a bug with constants where the values were being cached so that
changes in the context were not being reflected in the formulas that
use them.
Revision
2658 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 20 11:17:06 2004 UTC (15 years, 3 months ago) by
dpvc
File length: 4239 byte(s)
Diff to
previous 2649
Make blank patterns be ^$ (which should never match) rather than empty
(which always matches). this fixes a problem where if a context has
no functions, for example, the parser would attempt to create function
calls to a function named ''.
Revision
2579 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Added
Mon Aug 9 21:38:01 2004 UTC (15 years, 4 months ago) by
dpvc
File length: 4142 byte(s)
Significant update to new parser.
New features include:
Better control over format of vector output (you can now
specify ijk-format rather than <...> format)
"Fuzzy" reals, where the relations like == return true when the
two values are "close enough". (This is controlable using
parameters similar to those used in NUM_CMP).
The fuzzy reals are now used in vectors/points/matrices/complexes/intervals
and so on so that their relations will also be fuzzy. E.g.,
(1E-13,2) == (0,3) will be true, and norm(Vector(0,1E-13)) will
equal 0.
The two main portions of the parser (the Parser and Value packages)
now share a common context object for configuration purposes.
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.