Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JunichiIto/54f1d0dbb928566f5083b6caf9d8a2b2 to your computer and use it in GitHub Desktop.
Save JunichiIto/54f1d0dbb928566f5083b6caf9d8a2b2 to your computer and use it in GitHub Desktop.
Syntax error is gone in Ruby 2.4?
➜ ~ ruby -v
ruby 2.3.4p301 (2017-03-30 revision 58214) [x86_64-darwin16]
➜ ~ irb
irb(main):001:0> [].delete 1 { 'NG' }
SyntaxError: (irb):1: syntax error, unexpected '{', expecting end-of-input
[].delete 1 { 'NG' }
^
from /Users/jit/.rbenv/versions/2.3.4/bin/irb:11:in `<main>'
irb(main):002:0> exit
➜ ~ rbenv shell 2.4.1
➜ ~ irb
irb(main):001:0> [].delete 1 { 'NG' }
=> "NG"
irb(main):002:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment