I find this very confusing, and am not sure at all what you're asking.
But here's my attempt at an answer.

How is .map {|v| v} not the same as just .map() ? Array#map with no
block will return an enumerator which should work fine. I've seen
Array#cycle used often in this manner to get the enumerator. Why do
you even need .map in there => a.split(";")[1..-1].join(",")?


> But say I want to cut off the first value of a comma-separated line:
> a = "a,b,c"
> a.split(";")[1..-1].map {|v| v}.join(";") #=> "b;c"

I can think of 10 ways of doing that that don't look half as
complicated. Seems like 1-line solution obsession to me.
Regex? a.gsub!(/^\w+\,/ , '' )
Array#shift() ? Would be longer, but the intent is much clearer than
a.split(",")[1..-1]

Also BTW a.split(",")[1..-1] will return nil if 'a' is an empty
string. So any method calls after that will crash.

Just my 2 cents. But again, maybe I'm totally missing the issue.

On Sat, Nov 22, 2014 at 4:14 AM, Augusts Bautra <augusts / creo.mobi> wrote:
> So these are equivalent:
>
> something {|i| i.foo }
> something(&:foo)
>
> But say I want to cut off the first value of a comma-separated line:
>
> a = "a,b,c"
> a.split(";")[1..-1].map {|v| v}.join(";") #=> "b;c"
>
> Can I somehow use ampersand (or to_proc) to have a shorthand of {|v| v}
> Any way to use something like this?
>
> a.split(";")[1..-1].map&join(";")
>
> Thanks,
> --
> Augusts Bautra
> Creative Mobile
>