Math::Symbolic::Custom::DefaultDumpers3pm
Default math::symbolic output routines
Usage
use Math::Symbolic qw/parse_from_string/;$term = parse_from_string(...);my ($sub, $leftover_trees) = $term->to_sub();
Overview
This is a class of default output routines for Math::Symbolic trees. Likewise, Math::Symbolic::Custom::DefaultTests defines default tree testing routines and Math::Symbolic::Custom::DefaultMods has default tree modification methods. For details on how the custom method delegation model works, please have a look at the Math::Symbolic::Custom and Math::Symbolic::Custom::Base classes.
Export
Please see the docs for Math::Symbolic::Custom::Base for details, but you should not try to use the standard Exporter semantics with this class.
Subroutines
to_string
The to_string method is currently implemented in the module core namespaces and will be moved to Math::Symbolic::DefaultDumpers in a future release.
Takes one optional argument indicating whether the Math::Symbolic tree should be transformed to a string using 'postfix' notation or using 'infix' notation. Default is infix which is also more likely to be reparseable by the Math::Symbolic parser.
to_code
This method is a wrapper around the compile_to_code class method in the Math::Symbolic::Compiler module. Takes key/value pairs of variables and integers as argument. The integers should starting at 0 and they determine the order of the variables/parameters to the compiled code.
Returns the compiled code and a reference to an array of possible leftover tree elements that could not be compiled.
Please refer to the Math::Symbolic::Compiler man page for details.
to_sub
This method is a wrapper around the compile_to_sub class method in the Math::Symbolic::Compiler module. Takes key/value pairs of variables and integers as argument. The integers should starting at 0 and they determine the order of the variables/parameters to the compiled code.
Returns the compiled sub and a reference to an array of possible leftover tree elements that could not be compiled.
Please refer to the Math::Symbolic::Compiler man page for details.
Releases
7 releases since Debian 7 (Wheezy); the text changed 5 times.