在proc中调用proc ( call proc in another proc ... )
访问量: 3026
这是个问题...
hi_proc = proc { |another_proc|
puts 'hihihi'
another_proc.call
}
name_proc = proc { puts 'jim' }
puts hi_proc.call(name_proc)
# hihihi
# jim
访问量: 3026
这是个问题...
hi_proc = proc { |another_proc|
puts 'hihihi'
another_proc.call
}
name_proc = proc { puts 'jim' }
puts hi_proc.call(name_proc)
# hihihi
# jim