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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5373 - (download) (as text) (annotate)
Sun Aug 19 02:01:57 2007 UTC (12 years, 3 months ago) by dpvc
File size: 821 byte(s)
Normalized comments and headers to that they will format their POD
documentation properly.  (I know that the POD processing was supposed
to strip off the initial #, but that doesn't seem to happen, so I've
added a space throughout.)

    1 loadMacros("MathObjects.pl","contextString.pl");
    2 
    3 sub _contextTF_init {}; # don't load it again
    4 
    5 =head3 Context("TF")
    6 
    7  ##########################################################
    8  #
    9  #  Implements contexts for string-valued answers especially
   10  #  for matching problems (where you match against T and F).
   11  #
   12  #  Context("TF");
   13  #
   14  #  You can add new strings to the context as needed (or remove old ones)
   15  #  via the Context()->strings->add() and Context()-strings->remove()
   16  #  methods.
   17  #
   18  #  Use:
   19  #
   20  #  ANS(string_cmp("T","F"));
   21  #
   22  #  when there are two answers, the first being "T" and the second being "F".
   23  #
   24 
   25 =cut
   26 
   27 $context{TF} = Parser::Context->getCopy("String");
   28 $context{TF}->strings->are(
   29  "T" => {value => 1},
   30  "F" => {value => 0},
   31  "True" => {alias => "T"},
   32  "False" => {alias => "F"},
   33 );
   34 
   35 Context("TF");
   36 
   37 1;

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9