From: Mathieu Bouchard Date: 2005-01-04T18:18:59+09:00 Subject: Re: Allowing custom number literal suffixes? On Tue, 4 Jan 2005, Brent Roman wrote: > I'm not sure I would advocate making Ruby's grammar even more > byzantine (e.g. where, exactly, are parenthesis required vs. > optional?) but, "wenn schon, denn schon" Funny that you mention this, because this actually changed significantly between Ruby 1.6 and Ruby 1.8; the former conventions wrt nested methodcalls were more Perl-like and then, suddenly, only outermost methodcalls could skip parens (which broke a *lot* of my code back then). Well, the rule �wenn schon denn schon� apparently didn't apply at that particular moment in Ruby's history, I guess ! > Why not add something more similar to obj.method_missing for > unrecognized numeric literals? If a token begins with a digit and > cannot be parsed into a number, Ruby calls > Kernel.unrecognized_numeric_literal (tokenString) How is it found where the number ends? I assume that it would be whenever a not-letter-nor-digit is encountered, outside of the normal valid uses of period/minus/plus/underscore. > 4:30:19AM > 4.30.19A In Canada, it is most usual to write 4:30:19 (24-hour style), at least on official digital clocks. So IMHO it doesn't matter whether it's A or AM. For the dot versus the colon, i don't know, but note that it is also common practice, in the 23:45 or 11:45PM case, to write it as 23h45. That is, I still prefer single-letter globals (as long as they're uppercased), so it could be: T"4:30:19AM" with T for time. of course this only works as long as someone else doesn't insist on using T for something else (but there is nothing that can be done about this) _____________________________________________________________________ Mathieu Bouchard -=- Montr�al QC Canada -=- http://artengine.ca/matju