Log of /trunk/pg/lib/Parser/Context/Functions.pm
Parent Directory
Revision
3483 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Fri Aug 12 01:21:48 2005 UTC (14 years, 3 months ago) by
dpvc
File length: 3387 byte(s)
Diff to
previous 3332
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
3332 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Jul 3 20:05:28 2005 UTC (14 years, 5 months ago) by
dpvc
File length: 2894 byte(s)
Diff to
previous 3274
Fixed a bug in the enable/disable routines that would cause them to
always work on the current context rather than the one whose
enable/disable method was being called.
Revision
3274 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Thu Jun 9 11:16:01 2005 UTC (14 years, 6 months ago) by
dpvc
File length: 2900 byte(s)
Diff to
previous 2672
Fixed Disable() and Enable() so that they can be called as
Context()->functions->disable()
and
Context()->functions->enable()
as well as
Parser::Context::Functions::Disable()
and
Parser::Context::Functions::Enable()
The former is the preferred syntax.
Revision
2672 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Sun Aug 22 22:46:14 2004 UTC (15 years, 3 months ago) by
dpvc
File length: 2732 byte(s)
Diff to
previous 2579
Added easy calls to disable/enable collections of functions or
individual functions in the current context. So you can say
Parser::Context::Functions::Disable('Trig');
to disallow the use of trig functions, or
Parser::Context::Functions::Disable('Trig','Numeric');
Parser::Context::Functions::Enable('sqrt');
to disable trig and numeric functions (like log, exp, abs, etc) but
allow sqrt.
Note that disabling sqrt() does not disable x^(1/2) (this must be done
through disabling the ^ and ** operators), and disabling abs() does
not disable |x| (which must be done by removing the '|' definition
from the Context's parens list).
Revision
2579 -
(
view)
(
download)
(
as text)
(
annotate)
-
[select for diffs]
Modified
Mon Aug 9 21:38:01 2004 UTC (15 years, 4 months ago) by
dpvc
File length: 841 byte(s)
Diff to
previous 2558
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.