[system] / trunk / pg / macros / Value.pl Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# Annotation of /trunk/pg/macros/Value.pl

Revision 3267 - (view) (download) (as text)

 1 : dpvc 2576 ########################################################################### 2 : # 3 : # Declares functions needed for Value.pm 4 : # 5 : 6 : # 7 : # Constructors for the various types 8 : # 9 : dpvc 2609 sub String {Value::String->new(@_)} 10 : dpvc 2590 sub Real {Value::Real->new(@_)} 11 : dpvc 2576 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 : dpvc 3267 sub ColumnVector {Value::Vector->new(@_)->with(ColumnVector=>1,open=>undef,close=>undef)} 20 : 21 : dpvc 2576 # sub Formula {Value::Formula->new(@_)} 22 : # 23 : # # 24 : # # Parse a formula and evaluate it 25 : # # 26 : # sub Compute { 27 : # my \$formula = Formula(shift); 28 : # return \$formula->eval(@_); 29 : # } 30 : 31 : dpvc 2626 # 32 : # Make a point or list a closed interval 33 : # 34 : sub Closed { 35 : my \$x = shift; 36 : if (Value::isValue(\$x)) {\$x->{open} = '['; \$x->{close} = ']'} 37 : return \$x; 38 : } 39 : 40 : dpvc 2576 ########################################################################### 41 : # 42 : # Make it possible to use 1+3*i in perl rather than 1+3*\$i or 1+3*i() 43 : # 44 : #sub i () {Value::Complex->i}; # defined in Parser.pl 45 : #sub pi () {Value::Complex->pi}; # defined in dangerousMacros.pl 46 : 47 : ########################################################################### 48 : 49 : dpvc 2644 sub _Value_init {}; # don't let loadMacros load it again 50 : 51 : ########################################################################### 52 : 53 : dpvc 2576 1;

 aubreyja at gmail dot com ViewVC Help Powered by ViewVC 1.0.9