From: Austin Ziegler Date: 2004-06-08T06:54:06+09:00 Subject: Re: How to ducktype a Hash? > dblack@wobblini.evault.com > On Tue, 8 Jun 2004, Austin Ziegler wrote: > > Richard Kilmer [mailto:rich@infoether.com] : > > > Oops...sorry...you are right...it would have to be: > > > > > > f.{Array}['rich'] > > > > > > to make it explicit that you are grouping the {} with the > > > method name. This is only an issue for the operator'ish methods > > > because methods require the dot in them already. > > > > Maybe: > > > > f['rich'] > > f.[firstname] > > > > It's ugly enough to discourage its use, but it also calls > to mind the > > syntax for C++ templates (for good or ill) while not being > > currently-legal Ruby. > > I think it has to be assumed that if Matz adds any type-related stuff, > it will get very heavy use, ugly or not. Luckily there's little or no > precedent for Matz adding ugly stuff :-) but I think this is a case > where people who want to use it are not going to be deterred by how it > looks, so I wouldn't want to rely on that effect. Well, I still think that this is probably a good compromise, as (1) it isn't legal Ruby in 1.8, and (2) it will definitely raise warning hackles to the people who *don't* use it. I seem to recall reading something in the last year or so that suggests that Matz did add something to the language that was either *hard* or *ugly* because he wanted it to be used rarely, but available. I don't remember what it was. -austin -- austin ziegler * austin.ziegler@evault.com