Pattern Matching in Ruby
summary
Proposes a concrete pattern‑matching spec for Ruby and shows a working implementation by modifying parse.y to parse a new %p pattern literal and inject matching code into the AST, compiled to bytecode. Demonstrates array, hash, nested and regex guard patterns, class checks and variable binding; examples successfully bind matched values. Implementation is released as a Ruby library, is functional though still limited and buggy, and supports pattern matching without external gems.
AI-written summary · about
chapters (7)
- 0:00Introduction and goals
- 2:23Demonstrating pattern matching
- 5:31Concepts and inspiration
- 10:44Proposal and examples
- 19:41Internal implementation
- 24:18Closing and acknowledgments
- 26:14Q&A session
related talks
37mThis or that? Similar methods & classes in Ruby && Rails
37mThis or that? Similar methods & classes in Ruby && Rails
36mA custom design pattern for building dynamic ActiveRecord queries
42mExtending Gems - Patterns and Anti-Patterns of Pluggable Gems
44mRuby Libraries Important for Rails
53mRuby 2 in Ruby on Rails
33mRails is Just Ruby
37mPatters to deal with big ActiveRecord models
