From: ts Date: 2000-12-19T19:54:38+09:00 Subject: [ruby-talk:7675] Re: Ruby as 1st lang.; Newbie mail-list, rubywin question; %w question >>>>> "C" == Conrad Schneiker writes: C> On page 10 of PR [Programming Ruby] the %w shortcut is shown creating an C> array with curly braces (a=%w{a d c f}) which works. The same construction C> also works with square brackets [which] seems more consistant with arrays. C> This is a bit confusing since it isn't mentioned in the text. %w (and other %[Qqwxr]) work with {}, [], <>, () and any characters for example pigeon% ruby -e 'p %wza b cz' ["a", "b", "c"] pigeon% With {}, [], <>, () you can nest the separators for example pigeon% ruby -e 'p %w{a {} c }' ["a", "{}", "c"] pigeon% Guy Decoux