~/talk

Pattern Matching - New feature in Ruby 2.7

Talkat RubyConf 2019 · 2019-11-18..11-20· [ruby]
slides:none on file

Ruby 2.7 ships an experimental pattern matching feature that extends case with case/in and raises NoMatchingPatternError when none match; it implements value, variable, alternative, AS, array and hash patterns, supports guards and a pin operator (caret), and relies on new hooks like deconstruct and deconstruct_keys. The design trades compatibility and duck‑typing for ergonomics, and the deconstruct_keys optimization avoids returning ~40 Time fields at once at the cost of more complex implementation.

AI-written summary · about

  1. 0:00Intro
  2. 0:21SELF INTRODUCTION
  3. 1:32AGENDA
  4. 1:57WHAT IS PATTERN MATCHING?
  5. 4:41EXAMPLE
  6. 7:46VALUE PATTERN
  7. 8:14VARIABLE PATTERN
  8. 10:53ALTERNATIVE PATTERN
  9. 11:08AS PATTERN
  10. 12:28ARRAY PATTERN
  11. 18:28HASH PATTERN
  12. 26:06KEEP COMPATIBILITY: SYNTAX
  13. 28:15KEEP COMPATIBILITY: NAMESPACE
  14. 32:56FUTURE WORKS
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.