1 Oct 2009 01:42
Re: [groovy-dev] string to int/long/etc... conversion
Why does that method have to be in Groovy core? Your arbitrary rules aren't likely to line up with other people's arbitrary rules, so I'd stick to keeping that in a library. ~~ Robert Fischer, Smokejumper IT Consulting. Enfranchised Mind Blog http://EnfranchisedMind.com/blog Check out my book, "Grails Persistence with GORM and GSQL"! http://www.smokejumperit.com/gormbook Jim Jagielski wrote: > > On Sep 30, 2009, at 5:32 PM, Jason Smith wrote: > >> -1 >> >> "1024k" == "1024M" ??? >> > > No, but (int)"1024k" == (int)"1024M" > > When you move from strings to their numeric values, you have to > think numerically. ;) > >> What about "1024abcd" (which is a perfectly valid hexadecimal number)? >> >> I learned back in the days of Visual Basic that magical type >> conversions are the cause all sorts of subtle yet devastating bugs. >> I'd hate to see this made a part of Groovy proper. >> >(Continue reading)
Indeed. I think the single most important thing about an error message
is giving the right information about where. Almost everything else can
usually be deduced by observation!
> Besides that.... remember always the convention of putting the operator
> on the same line as the first operand ;)
It all stems from Bob Swift's GANT-84, so I can pass the buck
RSS Feed