Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Understanding Syntax Error on Ruby Blocks
Search
Tetsuya Kaneko
April 16, 2019
Programming
0
47
Understanding Syntax Error on Ruby Blocks
Tetsuya Kaneko
April 16, 2019
Tweet
Share
More Decks by Tetsuya Kaneko
See All by Tetsuya Kaneko
Migrate from Unicorn to Puma
tetsuya
0
150
How to Brew Coffee at Home - A Guide For Beginners
tetsuya
0
560
Dive into ‘An error occurred while installing mysql2’
tetsuya
0
11
How Did Development Team Cope with Startup Chaos at U-NOTE
tetsuya
1
2k
Ansible - Where to start?
tetsuya
3
1.8k
How to Setup Your Mac
tetsuya
0
16
Other Decks in Programming
See All in Programming
Contemporary Test Cases
maaretp
0
140
3rd party scriptでもReactを使いたい! Preact + Reactのハイブリッド開発
righttouch
PRO
1
600
イベント駆動で成長して委員会
happymana
1
320
Better Code Design in PHP
afilina
PRO
0
130
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
1.1k
聞き手から登壇者へ: RubyKaigi2024 LTでの初挑戦が 教えてくれた、可能性の星
mikik0
1
130
flutterkaigi_2024.pdf
kyoheig3
0
140
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
2
1.1k
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Duckdb-Wasmでローカルダッシュボードを作ってみた
nkforwork
0
130
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
620
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
Rails Girls Zürich Keynote
gr2m
94
13k
Making the Leap to Tech Lead
cromwellryan
133
8.9k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Faster Mobile Websites
deanohume
305
30k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
RailsConf 2023
tenderlove
29
900
How GitHub (no longer) Works
holman
310
140k
Typedesign – Prime Four
hannesfritz
40
2.4k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Transcript
Ruby Blocks ʹ͓͚Δ Syntax Error ͷṖΛ͏ 2019.4.16 ࣾLTେձ #1
@tetsuya
͜ͷίʔυಈ͘Ͱ͠ΐ͏͔ʁ 1.upto(2) {|i| p i }
ಈ͘ $ ruby -e '1.upto(2) {|i| p i } '
1 2
͡Ό͋ͬͪ͜ʁ 1.upto 2 {|i| p i }
͑
όʔδϣϯʹΑΔ
ྫ
Ruby 1.9.0-4 (ಈ͘) $ ruby -ve '1.upto 2 {|i| p
i} ' ruby 1.9.0 (2008-08-26 revision 18849) [i386-darwin18.2.0 ] 1 2
Ruby 2.3.3 (ಈ͔ͳ͍) $ ruby -ve '1.upto 2 {|i| p
i} ' ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin18 ] -e:1: syntax error, unexpected '{', expecting end-of-inpu t 1.upto 2 {|i| p i}
Ruby 2.4.0 (ಈ͘) $ ruby -ve '1.upto 2 {|i| p
i} ' ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin18 ] 1 2
Ruby 2.4.1 (ಈ͘) $ ruby -ve '1.upto 2 {|i| p
i} ' ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin18 ] 1 2
Ruby 2.4.2 (ಈ͔ͳ͍) $ ruby -ve '1.upto 2 {|i| p
i} ' ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin18 ] -e:1: syntax error, unexpected '{', expecting end-of-inpu t 1.upto 2 {|i| p i}
ͳ͔ͥ
ྺ࢙ΛḪΔ͜ͱ10 • ͱ1.9Ͱ༷มߋͱͯ͠Ճ͞ΕɺΑΓʹϒϩοΫΛղ ऍ͢ΔΑ͏ͳͷͩͬͨ • ʮϓϩάϥϚ a {|i| ...} ϝιουݺͼग़͠ͱͯ͠ղऍ͢Δ͕ɺ
2 {|i| …} ϝιουݺͼग़͠ͱղऍ͠ͳ͍ͣͩʯ • ʮϦςϥϧͰ͋Δ͔มͰ͋Δ͔ͰৼΔ͍͕ҟͳΔ͜ͱɺࠞ ཚΛট͘Մೳੑ͕͋Δʯ Bug #505: 1.upto 2 {|i| p i } - Ruby trunk - Ruby Issue Tracking System
ٞͷ * parse.y (yylex): "1.upto 2 {|i| p i }"
should be syntax error. · ruby/ruby@05edaf5
ͦͷޙಈ͍ͨΓಈ͔ͳ͔ͬͨΓ • Bug #13547: [].delete 1 { 'NG' } -
Ruby trunk - Ruby Issue Tracking System • Bug #14023: SyntaxError on array argument and block - Ruby trunk - Ruby Issue Tracking System
݁ • ɹɹɹɹɹɹɹɹɹ Syntax error ͕ͩɺRuby ͷόʔδϣϯ ʹΑͬͯಈ͍ͯ͠·͏ 1.upto 2
{|i| p i }