Skip to content

Commit

Permalink
ComplexStr needs to exist too
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Jan 17, 2012
1 parent 32cb82d commit ca7eb73
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/CORE.setting
Expand Up @@ -2794,12 +2794,14 @@ role Niecza::Dualvar is Niecza::PseudoStr {
class IntStr is Int does Niecza::Dualvar { }
class RatStr is Rat does Niecza::Dualvar { }
class NumStr is Num does Niecza::Dualvar { }
class ComplexStr is Complex does Niecza::Dualvar { }
sub val($str) is pure {
$_ = Niecza::NumSyntax.str2num($str);
when Num { return NumStr.new($_, $str) }
when Rat { return RatStr.new($_, $str) }
when Int { return IntStr.new($_, $str) }
when Complex { return ComplexStr.new($_, $str) }
fail:
return $str;
CATCH { goto fail; }
Expand Down

0 comments on commit ca7eb73

Please sign in to comment.