On Mon, 20 Jan 2003, Jim Freeze wrote:

> Hi:
>
Hi,

> I was wondering, to create an array I usually do
>
> %w{a b c}  #=> ["a", "b", "c"]
>
> Is there a built-in way to do this and get symbols?
> For example:
>
> %w{:a :b :c} #=> [:a, :b, :c]
>
> or given a mixed list
>
> %w{:a b :c} #=> [:a, "b", :c]
>
Not that I know of, but of course there is

$ ruby -e 'p %w{a b c}.map {|s| s.intern}'
[:a, :b, :c]

which is not much longer...

Regards,

Robert