We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If the argument list for a lambda expression using Ruby 1.9's arrow syntax is a set of empty parentheses, JRuby throws a syntax error:
irb(main):001:0> RUBY_ENGINE => "jruby" irb(main):002:0> JRUBY_VERSION => "1.7.19" irb(main):003:0> -> () {} SyntaxError: (irb):3: syntax error, unexpected tLPAREN_ARG -> () {} ^ from org/jruby/RubyKernel.java:1107:in `eval' from org/jruby/RubyKernel.java:1507:in `loop' from org/jruby/RubyKernel.java:1270:in `catch' from org/jruby/RubyKernel.java:1270:in `catch' from /home/greg/.rbenv/versions/jruby-1.7.19/bin/irb:13:in `(root)'
Contrast this with MRI, which accepts this syntax:
irb(main):001:0> RUBY_ENGINE => "ruby" irb(main):002:0> RUBY_VERSION => "2.2.1" irb(main):003:0> -> () {} => #<Proc:0x007f03f6ab8988@(irb):3 (lambda)>
The text was updated successfully, but these errors were encountered:
This was apparently a change in grammar introduced in Ruby 2.0 and Ruby 1.9.3 seems to behave the same way for me:
mri19 -ve '-> () {}' ruby 1.9.3p551 (2014-11-13 revision 48407) [x86_64-darwin13.4.0] -e:1: syntax error, unexpected tLPAREN_ARG, expecting keyword_do_LAMBDA or tLAMBEG -> () {} ^
This is working ok in JRuby 9k (which is 2.2.1) so I am resolving this.
Sorry, something went wrong.
No branches or pull requests
If the argument list for a lambda expression using Ruby 1.9's arrow syntax is a set of empty parentheses, JRuby throws a syntax error:
Contrast this with MRI, which accepts this syntax:
The text was updated successfully, but these errors were encountered: