Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ethan (3163)

ethan
  reversethis-{ed. ... rap.nov.olissat}

Being a 25-year old chap living in the western-most town of Germany. Stuying communication and information science and being a huge fan of XS-related things.

Journal of ethan (3163)

Friday August 15, 2003
01:53 AM

'Least surprise', Mats, eh?

[ #14133 ]

While drilling my String::Ruby methods to behave as their Ruby counterparts, I noticed this little oddity in Ruby which seems to violate the least-surprise-rule:

       
                print "- 377".oct ==> -255
                print "- 377".oct ==> 0
       

So how many whitespaces may I add before ruby starts vomitting? Seven actually. Now I wonder whether hex() allows up to 15.....*tests*...no, just four! Funny.

The downside of that: I can't blindly use ruby's output as test-cases. I planned on writing a couple of ruby scripts that I have automatically converted into test scripts. Or at least I have to hand-edit them afterwards and take out those test-failures that are caused by Ruby bugs (I guess the above is one).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.