From: dpvc v. a. <we...@ma...> - 2008-08-15 12:56:32
|
Log Message: ----------- Fixed some typos and updated a couple of examples. Tags: ---- rel-2-4-patches Modified Files: -------------- webwork2/doc/parser/docs: UsingParser.pod Revision Data ------------- Index: UsingParser.pod =================================================================== RCS file: /webwork/cvs/system/webwork2/doc/parser/docs/UsingParser.pod,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -Ldoc/parser/docs/UsingParser.pod -Ldoc/parser/docs/UsingParser.pod -u -r1.1.2.1 -r1.1.2.2 --- doc/parser/docs/UsingParser.pod +++ doc/parser/docs/UsingParser.pod @@ -49,7 +49,9 @@ variable by another formula, if you wish. To make this easier, substitute will apply Formula() to any string values automatically. E.g., + Formula("x-1")->substitute(x=>"y") + returns "y-1" as a formula. =item $f->string @@ -353,7 +355,7 @@ and can change, remove or list the constants via methods like those used for variables above. The command - $M = $constant->constants->get('M'); + $M = $context->constants->get('M'); will return the value of the consant M. (See the pg/lib/Value/Context/Data.pm file for more information on the methods @@ -362,16 +364,23 @@ To add new predefined words (like 'NONE' and 'DNE'), use something like - $constant->strings->add(TRUE=>{},FALSE=>{}); + $context->strings->add(TRUE=>{},FALSE=>{}); + +Strings are case-insensitive, unless you say otherwise. To mark a +string as being case-senstive, use + + $context->strings->add(TRUE => {caseSensitive=>1}); -Note that strings are case-sensitive, so you might want to add +You may want to privide several forms for the same word; to do so, +make the additional words into aliases: - $constant->strings->add( - true => {alias=>'TRUE'}, - false => {alias=>'FALSE'}, + $context->strings->add( + T => {alias=>'TRUE'}, + F => {alias=>'FALSE'}, ); -so that either "TRUE" or "true" will be interpreted as TRUE. +so that either "TRUE" or "T" will be interpreted as TRUE, and +similarly for "FALSE" and "F"; There are a number of values stored in the context that control things like the tolerance used when comparing numbers, and so on. You |