From: "David A. Black" Date: 2004-08-06T23:41:27+09:00 Subject: Re: %w for symbols Hi -- On Fri, 6 Aug 2004, Eric Hodel wrote: > Gavin Sinclair (gsinclair@soyabean.com.au) wrote: > > > On Friday, August 6, 2004, 9:18:12 PM, Austin wrote: > > > > > On Fri, 6 Aug 2004 16:00:32 +0900, Caio Chassot wrote: > > >> Is there any similar notation to %w[ word word2 word3 ] that returns an > > >> array of symbols instead of strings? > > >> > > >> If not, are there any plans for it in future ruby? Is it a good idea anyway? > > >> > > >> (Maybe that's a good example of where we could use macros?) > > > > > It seems common enough that it might be nice to have this. Perhaps > > > %W{} instead of %w{} ? > > > > I don't object to the feature either. I think %s{} makes more sense, > > though. > > %s is already used: > > $ ruby > p %s(foo bar baz) > ^D > :"foo bar baz" That actually points to another thing I was wondering about, namely, what would be the %?{ } equivalent of: ["abc".intern, "hi there".intern] You couldn't do (using %m as a placeholder here): %m{abc hi there} It would have to be %m{abc "hi there"} I'm just wondering whether that would lead down a path of escape syntax that would make it less streamlined. David -- David A. Black dblack@wobblini.net