Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 jruby 中将 bloc 转换为 lambda?基本上 jruby 对此的回答是什么:Ruby: convert proc to lambda? ?
只要您运行兼容 jruby 1.9(例如jruby --1.9 -S irb),它应该是相同的:
jruby --1.9 -S irb
my_proc = proc { |x| x } my_lambda = lambda &my_proc my_lambda.lambda? # => true