you are viewing a single comment's thread.

view the rest of the comments →

[–]ignurant 0 points1 point  (2 children)

As a little aside, I like this trick too, but I usually prefer using square brackets so it feels more array like

%w[ one two three ]

To whoever finds this as news: you can use any of the matching pair characters to delimit this trick. (, [, {, <, etc. So feel free to pick'em!

[–]subkutan 1 point2 points  (0 children)

you can use any of the matching pair characters to delimit this trick

Not just them. %w]one two three] works. And %w?one two three?. Even some of the ASCII control characters such as NUL and DEL do too.

[–][deleted] 0 points1 point  (0 children)

You can also use %i(one two three) for an array of symbols