How does one convert a bloc to a lambda in jruby? Basically what is the jruby answer for this: Ruby: convert proc to lambda??
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
As long as you're running jruby 1.9-compatibly (e.g. jruby --1.9 -S irb
), it should be the same:
my_proc = proc { |x| x }
my_lambda = lambda &my_proc
my_lambda.lambda?
# => true