From: "David A. Black" Date: 2004-09-04T22:03:38+09:00 Subject: Re: OK... :) question about hash and array literals Hi -- On Sat, 4 Sep 2004, gabriele renzi wrote: > David A. Black ha scritto: > > > Hi -- > > > > On Sat, 4 Sep 2004, Yukihiro Matsumoto wrote: > > > > > >>Hi, > >> > >>In message "Re: OK... :) question about hash and array literals" > >> on Sat, 4 Sep 2004 12:54:52 +0900, Hal Fulton 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, ... } > > > > please no. > This is just my very little unvaluable opinion, but %-stuff literals are > one of the few things I don't like about ruby. > Nothing is telling me what they mean, It's something a user can't have > control over and there are subtle differencies beetween one and another > that are just... well.. _too_ subtle. > But as I write I'm getting the idea you're suggesting overridable % > constructors? If that is the suggestion.. well, interesting :) I wasn't really suggesting anything concretely -- just looking for a direction to go in to solve Hal's problem about no available literal syntax. I think user-defined %-notation is probably impossible, since any given notation could be defined by multiple libraries and conflict. David -- David A. Black dblack@wobblini.net