Back

在proc中调用proc ( call proc in another proc ... )

发布时间: 2015-06-28 01:48:00

这是个问题...

hi_proc = proc { |another_proc|
  puts 'hihihi'
  another_proc.call
}
name_proc = proc { puts 'jim' }
puts hi_proc.call(name_proc)
# hihihi
# jim

Back