[system] / trunk / pg / lib / Value.pm Repository:
ViewVC logotype

Diff of /trunk/pg/lib/Value.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 6202 Revision 6203
370 # 370 #
371 371
372=cut 372=cut
373 373
374sub makeValue { 374sub makeValue {
375 my $x = shift; return $x if Value::isValue($x); 375 my $x = shift;
376 my %params = (showError => 0, makeFormula => 1, context => Value->context, @_); 376 my %params = (showError => 0, makeFormula => 1, context => Value->context, @_);
377 my $context = $params{context}; 377 my $context = $params{context};
378 if (Value::isValue($x)) {
379 return $x unless {@_}->{context};
380 return $x->copy->inContext($context);
381 }
378 return $context->Package("Real")->make($context,$x) if matchNumber($x); 382 return $context->Package("Real")->make($context,$x) if matchNumber($x);
379 if (matchInfinite($x)) { 383 if (matchInfinite($x)) {
380 my $I = $context->Package("Infinity")->new($context); 384 my $I = $context->Package("Infinity")->new($context);
381 $I = $I->neg if $x =~ m/^$context->{pattern}{-infinity}$/; 385 $I = $I->neg if $x =~ m/^$context->{pattern}{-infinity}$/;
382 return $I; 386 return $I;

Legend:
Removed from v.6202  
changed lines
  Added in v.6203

aubreyja at gmail dot com
ViewVC Help
Powered by ViewVC 1.0.9