pdl / Test-Proto

OO test script golf sugar
1 stars 1 forks source link

Create a Number class & Scalar class #33

Open schwern opened 11 years ago

schwern commented 11 years ago

There is a String class but no Number class. Given that Perl operators act differently on numbers vs strings, and that you want to do different things on numbers and strings, this seems like an opportunity to differentiate functionality.

There's also no Scalar class. This would represent the sort of ambiguous thing that might be used as a number OR a string and it would have the methods of both.

Or maybe there just needs to be a Scalar class, because there's nothing that says you can't do string checks on a number...

pdl commented 11 years ago

Yeah, at the moment effectively the Scalar class is Test::Proto::Base, and the String class is Test::Proto::String. But I'm not happy about the division of labour.