From: Hugh Sasse Date: 2006-11-21T00:16:06+09:00 Subject: Re: Ruby 1.[89].\d+ and beyond. On Mon, 20 Nov 2006, URABE Shyouhei wrote: > Hugh Sasse wrote: > > #define RUBY_VERSION_MAJOR 1 > > #define RUBY_VERSION_MINOR 6 > > #define RUBY_VERSION_TEENY 8 [...] > Please. Don't forget RUBY_VERSION_CODE. Browse the Google Code Search > (or whatever you please) to remember how it's impossible to extend > _MINOR and _TEENY beyond 9. > > http://www.google.com/codesearch?q=%22%23if+RUBY_VERSION_CODE%22 > > I think RUBY_VERSION_CODE is one of the biggest mistake we made. But > whether that was a mistake or not it's so widely used. Breaking > compatibility to this C-level API come to no good. Ouch. The only solution to that that I can think of would be to make the constant float, and add decimal places. I've forgotten what happens about coercion in C ... After poking around the net a bit I think that would work, but it would still be horrid. It would mean adding TEENY_TEENY or some such balderdash to the names. brains hgs 16 %> ./silly_version comparison workedbrains hgs 17 %> brains hgs 17 %> cat silly_version.c #include int main(int argc, char *argv[]) { if (180 < 180.5) { printf("comparison worked"); }else{ printf("comparison FAILED"); }; return(0); } brains hgs 18 %> Such version numbers should still do the right thing in the string case. Hugh > >