in reply to Re: Array-ize a function
in thread Array-ize a function

Well... no. Actually, I had multiple goals when I wrote the snippet.

When I was on my scooter going back home, I simply thought about simply using map to do the job. Clean and straightforward, as in your first suggestion.

Then, I was wondering about a scenario in which I would re-use already written functions without touching them. This obviously kicks the last proposal out, which modifies do_something, even if I've to admit that it's quite an elegant approach.

By the time I came home, I was obsessed by minimising typing (I like these variations on the theme...), so I ended up with that solution. Moreover, I get a pretty obfuscated code with my solution - don't you agree? :) The better I was able to do is to lower typing overhead down to 8 chars.

-- Don't fool yourself.