From: "Ara.T.Howard" Date: 2003-12-19T06:51:55+09:00 Subject: Re: Yukihiro - Please ensure backwards compatibility On Fri, 19 Dec 2003, Elias Athanasopoulos wrote: > Date: Fri, 19 Dec 2003 03:12:57 +0900 > From: Elias Athanasopoulos > Newsgroups: comp.lang.ruby > Subject: Re: Yukihiro - Please ensure backwards compatibility > > On Thu, Dec 18, 2003 at 12:39:53PM +0900, Austin Ziegler wrote: > > On Thu, 18 Dec 2003 11:01:56 +0900, Joseph Benik wrote: > > > i don't understand the need to nitpick the regexp in this case, if > > > someone passes a string it seems quite a simple task for you to _ENSURE > > > BACKWARDS COMPATIBILITY_ and convert it internally to a regexp > > > > This is a deprecation warning. It will no longer be backwards compatible in > > 1.9 and later, IIRC (maybe as early as 1.8.1). > > > > In 1.8.0, however, it's just a warning. > > I had this "problem", too. I can't see why Ruby is so verbose on that > and doesn't interpret foo.gsub[!]("bar", ...) as foo.gsub[!](/bar/, ...) > automagically... ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ this word is the reason for many, many, many hours spent debugging perl scripts. if you have done much perl programming you will know exactly what i mean. i'm all for backward compatibility - unless the 'old' way wasn't all that good. IMHO, it wasn't all that good to be able to do this (same situation as gsub) # why doesn't this work, after all my string does start with an 'a'? ~ > ruby16 -e 'puts( ("^a" =~ "ara") && "matched!" )' nil # oh right, wrong dang order - there went 10 minutes! ~ > ruby16 -e 'puts( ("ara" =~ "^a") && "matched!" )' matched! # now under ruby18 we are notified and have plenty of time to correct before # 1.9. backward compat is also preserved. ~ > ruby18 -e 'puts( ("ara" =~ "^a") && "matched!" )' -e:1: warning: string =~ string will be obsolete; use explicit regexp matched! ~ > ruby18 -e 'puts( ("^a" =~ "ara") && "matched!" )' -e:1: warning: string =~ string will be obsolete; use explicit regexp nil i'm all for this break of backward compat... my 2 cents. -a -- ATTN: please update your address books with address below! =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328 | STP :: http://www.ngdc.noaa.gov/stp/ | NGDC :: http://www.ngdc.noaa.gov/ | NESDIS :: http://www.nesdis.noaa.gov/ | NOAA :: http://www.noaa.gov/ | US DOC :: http://www.commerce.gov/ | | The difference between art and science is that science is what we | understand well enough to explain to a computer. | Art is everything else. | -- Donald Knuth, "Discover" | | /bin/sh -c 'for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done' ===============================================================================