Actions
Feature #9853
openPlease consider quoted generation of hash like in %h( foo bar bee blaa )
Status:
Open
Assignee:
-
Target version:
-
Description
Hi.
In Ruby we can do this:
%w( foo bar bee blaa ) # => ["foo", "bar", "bee", "blaa"]
Ok makes an array of strings.
We can do this:
%i( foo bar bee blaa ) # => [:foo, :bar, :bee, :blaa]
Ok, makes an array of symbols.
We can also use [] on class Hash to generate a hash:
Hash[*%w( foo bar bee blaa )] # => {"foo"=>"bar", "bee"=>"blaa"}
My question:
Would it be possible to add %h() ? It would create a hash:
%h( foo bar bee blaa ) # => {"foo"=>"bar", "bee"=>"blaa"}
And would raise if odd number of arguments would be supplied.
No data to display
Actions
Like0