From: "David A. Black" Date: 2008-04-24T10:49:39+09:00 Subject: Re: [RCR] Drop :: as a . synonym Hi -- On Thu, 24 Apr 2008, Thomas Enebo wrote: > David A. Black wrote: >> Hi -- >> >> On Thu, 24 Apr 2008, Charles Oliver Nutter wrote: >> >>> David A. Black wrote: >>>> OK... but could you do something else? :-) I don't mean that >>>> facetiously; I'm just not sure that having two ways to get at the Java >>>> class is worth having all the extra ::'s throughout so much Ruby code. >>>> But I don't know enough about the problem to know how it might have >>>> played out if . and :: had been fully differentiated in Ruby. >>> >>> You can't do this with dots: >>> >>> class java::lang::System >>> end >> >> But that's an effect, rather than the cause, of the decisions taken >> about :: and .. (Hard to end a sentence with .! :-) Maybe we're in too >> deep for it to change, though. It might make more sense if I knew what >> Matz had in mind with it originally (i.e., why have two >> message-sending operators?). > Does that really matter in lieu of the fact that multiple people are using > this 'feature'? I think most software designers are surprised how people end > up using their software. It certainly could be done differently, but > class/modules only take colon2/3 which means we would need to do this over > multiple lines or need to expand definition of what can go after > class/module. I know what you're saying, but I am actually curious about the origins. I don't know whether it really matters, in practical terms. I guess it's always a judgment call how much the amount people use something weighs against whether it's fundamentally something that makes sense for the language. I can't help thinking that if :: had been, all along, just for constant resolution, and . were the universal way to send messages to objects, no one would be submitting RCRs suggesting that they be semi-merged :-) Of course one can't turn back the clock, though I don't think this change would be any more radical than something like adding block-local variables and the syntax changes that come with that. David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates!