From: Mark Hubbart Date: 2004-08-07T00:32:32+09:00 Subject: Re: %w for symbols On Aug 6, 2004, at 7:01 AM, 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" symbol words? how about: %sw( these are symbols ) => [:these, :are, :symbols] As far as I can tell, the %?{} literal format allows for strings of indeterminate length. So it's really the %.*{} literal format. cheers Mark