David A. Black wrote:

>>In message "Re: OK... :) question about hash and array literals"
>>    on Sat, 4 Sep 2004 12:54:52 +0900, Hal Fulton <hal9000 / hypermetrics.com> writes:
>>
>>|Is there a method that does get called (I think not), or could
>>|in theory such a thing be implemented?
>>
>>Not planned, just because changing semantics of literals are too
>>dangerous, as dangerous as macros for my eyes.
> 
> This is just a thought (not even an "idea" :-) but what about a
> %-style constructor:
> 
>   %H{ k1 => v1, k2 => v2, ... }
> 
> or something.

Good idea, though I shy away from changing syntax more than I
shy away from changing and adding classes.

I was thinking something similar, now that you mention it: An array-like
notation with hash-like arrows inside:

    x = {1=>2, 3=>4}    # hash
    y = [3,4]           # array
    z = [1=>2, 3=>4]    # ordered association

Is this reasonable at all? Matz??


Hal