[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 4997 - (download) (as text) (annotate)
Mon Jun 11 18:16:40 2007 UTC (12 years, 8 months ago) by gage
File size: 1544 byte(s)
Fixing docementation so that it can be read from the web.

    1 
    2 
    3 =head1 Value.pl DESCRIPTION
    4 
    5 #
    6 #  Declares functions needed for Value.pm
    7 #
    8 
    9 =cut
   10 
   11 =head3 Constructors for the various types
   12 
   13 #
   14 # String, Real, Complex, Point, Vector, Matrix, List, Interval, Set, Union, ColumnVector
   15 #
   16 
   17 =cut
   18 
   19 
   20 sub String   {Value->Package("String")->new(@_)}
   21 sub Real     {Value->Package("Real")->new(@_)}
   22 sub Complex  {Value->Package("Complex")->new(@_)}
   23 sub Point    {Value->Package("Point")->new(@_)}
   24 sub Vector   {Value->Package("Vector")->new(@_)}
   25 sub Matrix   {Value->Package("Matrix")->new(@_)}
   26 sub List     {Value->Package("List")->new(@_)}
   27 sub Interval {Value->Package("Interval")->new(@_)}
   28 sub Set      {Value->Package("Set")->new(@_)}
   29 sub Union    {Value->Package("Union")->new(@_)}
   30 
   31 sub ColumnVector {Value->Package("Vector")->new(@_)->with(ColumnVector=>1,open=>undef,close=>undef)}
   32 
   33 # sub Formula  {Value->Package("Formula")->new(@_)}  # in Parser.pl
   34 
   35 =head3 Closed($L_bound,$U_bound)
   36 
   37 #
   38 #  Make a point or list a closed interval
   39 #
   40 
   41 =cut
   42 
   43 sub Closed {
   44   my $x = shift;
   45   if (Value::isValue($x)) {$x->{open} = '['; $x->{close} = ']'}
   46   return $x;
   47 }
   48 
   49 =head3 NOTE:
   50 
   51 ###########################################################################
   52 #
   53 #  Make it possible to use  1+3*i  in perl rather than  1+3*$i or 1+3*i()
   54 #
   55 
   56 #sub i ()  {Value->Package("Complex")->i};   #  defined in Parser.pl
   57 #sub pi () {Value->Package("Complex")->pi};  #  defined in dangerousMacros.pl
   58 
   59 
   60 =cut
   61 
   62 sub _Value_init {};  # don't let loadMacros load it again
   63 
   64 ###########################################################################
   65 
   66 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9