[system] / trunk / pg / macros / Value.pl Repository:
ViewVC logotype

View of /trunk/pg/macros/Value.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2626 - (download) (as text) (annotate)
Mon Aug 16 19:44:26 2004 UTC (15 years, 3 months ago) by dpvc
File size: 1197 byte(s)
One more fix for handling intervals properly (I think it's really
right this time).  Also, named constants that end in numbers will
produce TeX output with the number as a subscript (this was already
true for variable names).

    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 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9