Parent Directory
|
Revision Log
Make sure loadMacros() doesn't try to load these files more than once.
1 ########################################################################### 2 # 3 # Declares functions needed for Value.pm 4 # 5 6 # 7 # Constructors for the various types 8 # 9 sub String {Value::String->new(@_)} 10 sub Real {Value::Real->new(@_)} 11 sub Complex {Value::Complex->new(@_)} 12 sub Point {Value::Point->new(@_)} 13 sub Vector {Value::Vector->new(@_)} 14 sub Matrix {Value::Matrix->new(@_)} 15 sub List {Value::List->new(@_)} 16 sub Interval {Value::Interval->new(@_)} 17 sub Union {Value::Union->new(@_)} 18 19 # sub Formula {Value::Formula->new(@_)} 20 # 21 # # 22 # # Parse a formula and evaluate it 23 # # 24 # sub Compute { 25 # my $formula = Formula(shift); 26 # return $formula->eval(@_); 27 # } 28 29 # 30 # Make a point or list a closed interval 31 # 32 sub Closed { 33 my $x = shift; 34 if (Value::isValue($x)) {$x->{open} = '['; $x->{close} = ']'} 35 return $x; 36 } 37 38 ########################################################################### 39 # 40 # Make it possible to use 1+3*i in perl rather than 1+3*$i or 1+3*i() 41 # 42 #sub i () {Value::Complex->i}; # defined in Parser.pl 43 #sub pi () {Value::Complex->pi}; # defined in dangerousMacros.pl 44 45 ########################################################################### 46 47 sub _Value_init {}; # don't let loadMacros load it again 48 49 ########################################################################### 50 51 1;
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |