On Jun 7, 2004, at 2:54 PM, Austin Ziegler wrote:

>> 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<Array>['rich']
>>>   f.<Person>[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

what? it is legal, as far as I can tell:

hash<Hash>[:key]
NoMethodError: undefined method `<' for {:key=>:value}:Hash
         from (irb):26
hash.<Hash>[:key]
TypeError: compared with non class/module
         from (irb):27:in `>'
         from (irb):27

[:key] is interpreted as an array, and the <>s are interpreted as 
comparison operators.


> 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
>
>
>
>