T
Tammo Freese
Hi all,
I stumbled over the following difference between method calls and
Proc calls:
require 'pp';
def a_method(arg, *args)
arg
end
a_proc = Proc.new do | arg, *args |
arg
end
pp a_method(1) # => expected 1, got 1
pp a_proc.call(1) # => expected 1, got 1
pp a_method([1]) # => expected [1], got [1]
pp a_proc.call([1]) # => expected [1], got 1 <== ?!
I would expect that method calls and proc calls do not differ in such
a way.
Is this a bug or a feature?
Thanks for your help,
Tammo
I stumbled over the following difference between method calls and
Proc calls:
require 'pp';
def a_method(arg, *args)
arg
end
a_proc = Proc.new do | arg, *args |
arg
end
pp a_method(1) # => expected 1, got 1
pp a_proc.call(1) # => expected 1, got 1
pp a_method([1]) # => expected [1], got [1]
pp a_proc.call([1]) # => expected [1], got 1 <== ?!
I would expect that method calls and proc calls do not differ in such
a way.
Is this a bug or a feature?
Thanks for your help,
Tammo