Here is an example of how to do it:

loadMacros("contextString.pl"); Context("Numeric"); $critpts = Compute("-2.7, 1.5, 3.53"); Context("String")->strings->add("+"=>{}, "-"=>{}, "0"=>{}); # define the allowed strings Context()->operators->redefine(",", from=>"Numeric"); # allow lists $signs = Compute("+,-,+,-"); BEGIN_TEXT The critical points are: \{ans_rule(20)\}$BR The signs of the intervals between them are \{ans_rule(20)\} END_TEXT ANS($critpts->cmp(showHints=>1, showLengthHints=>1)); ANS($signs->cmp(ordered=>1, entry_type=>"a sign"));

Hope that does it.

Davide