[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 2912 - (download) (as text) (annotate)
Wed Oct 13 01:35:51 2004 UTC (15 years, 3 months ago) by dpvc
File size: 900 byte(s)
Fixed typo in the comments.

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

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9