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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tetsuya Kaneko
April 16, 2019
Programming
69
0
Share
Understanding Syntax Error on Ruby Blocks
Tetsuya Kaneko
April 16, 2019
More Decks by Tetsuya Kaneko
See All by Tetsuya Kaneko
Migrate from Unicorn to Puma
tetsuya
0
290
How to Brew Coffee at Home - A Guide For Beginners
tetsuya
0
650
Dive into ‘An error occurred while installing mysql2’
tetsuya
0
34
How Did Development Team Cope with Startup Chaos at U-NOTE
tetsuya
1
2k
Ansible - Where to start?
tetsuya
3
1.9k
How to Setup Your Mac
tetsuya
0
30
Other Decks in Programming
See All in Programming
【ディップ|26年新卒研修資料】TDD実装演習
dip_tech
PRO
0
190
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
460
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2.1k
書き換えて学ぶTemporal #fukts
pirosikick
2
380
20260514 - build with ai 2026 - build LINE Bot with Gemini CLI
line_developers_tw
PRO
0
450
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
210
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
3
400
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
120
cloudnative conference 2026 flyle
azihsoyn
1
190
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
390
AI Agent と正しく分析するための環境作り
yoshyum
2
540
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
1
200
Featured
See All Featured
Marketing to machines
jonoalderson
1
5.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
350
The Pragmatic Product Professional
lauravandoore
37
7.3k
Six Lessons from altMBA
skipperchong
29
4.2k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.5k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
800
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
Claude Code のすすめ
schroneko
67
220k
Prompt Engineering for Job Search
mfonobong
0
310
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
530
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 }