On 5/26/07, Robert Klemme <shortcutter / googlemail.com> wrote:

>
> irb(main):001:0> def it_test(v)
> irb(main):002:1>   (v+1).instance_eval do
> irb(main):003:2*     return self if self < 10
> irb(main):004:2>   end
> irb(main):005:1>   "nothing"
> irb(main):006:1> end
> => nil
> irb(main):007:0> it_test 0
> => 1
> irb(main):008:0> (0..10).map {|i| it_test i}
> => [1, 2, 3, 4, 5, 6, 7, 8, 9, "nothing", "nothing"]
>
That is something I am surprised about, b/c the intention was to have
an idiom for
 return it if h(x) < 10
and
return it_test(h(x))
really is not the same, right?

Cheers
Robert
> Kind regards
>
>         robert
>
>


-- 
You see things; and you say Why?
But I dream things that never were; and I say Why not?
-- George Bernard Shaw