From: Ben Tilly Date: 2000-12-15T21:04:49+09:00 Subject: [ruby-talk:7304] Re: Whre is #prec "Christoph Rippel" > >Hi, > >maybe this a silly question. Both Fixnum and String provide a >hard coded #succ implementation - an override is quietly ignored >and #succ does not show up in Fixnum.methods either. (Ruby has a >pretty interesting idea of 'A'..'k' versus 'A'..'kk' by the way). >I am curious on why the analog #prec methods is missing? There has been enough discussion about Fixnum. I think I can answer why strings don't have #prec. There is no behaviour that won't surprise a lot of people. Seriously the Perl people argued long and hard over what semantics would be possible, and despite many thinking that there should be a good solution, couldn't find one. One of the threads on this is "One of these things is not like the other" and people who want to read it can go to: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2000-06/thrd2.html#00100 The basic problem is that the behaviour of ++ is not easily reversable. Different people think the (plenty and messy) boundary conditions should be handled different ways. But what you will inevitably get are a lot of situations where ++ and -- don't undo each other. Ruby shouldn't IMO be going there. But if you disagree, try adding your own method and figuring out the semantics. Cheers, Ben _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com