>>>>> "P" == Pit Capitain <pit / capitain.de> writes:

P>   puts yield_with_args( &m )   => []   # expected: no arg
P>   puts yield_without_args( &m )   => [nil]   # strange

pigeon% cat b.rb
#!./ruby -v
class C
   def m( *args ); args.inspect; end
end
m = C.new.method( :m )   # method "m" of new instance

def yield_with_args( *args ); yield( *args ); end
def yield_without_args; yield; end

puts yield_with_args( &m )   => []   # expected: no arg
puts yield_without_args( &m )   => [nil]   # strange
pigeon% 

pigeon% b.rb
ruby 1.7.1 (2001-07-03) [i686-linux]
[]
[]
pigeon% 


Guy Decoux