~/talk

Ruby keyword args and the options hash, from the parser to the virtual machine

Talkat ArrrrCamp 2015 · 2015-10-01..10-02· [ruby]
slides:none on file

Argument handling turns out to be about implementation not syntax: Ruby treats keywords as an options hash under the hood, historical parser quirks cause empty-literal behavior, and early Ruby 2.1 keyword calls are much slower until VM work in 2.2 adds a KWARGS instruction that pushes keywords as regular parameters. The double splat semantics change from odd precedence to left-to-right merges, required keywords and performance fixes land but edge cases remain (implicit to_hash conversion, empty-hash dispatch).

AI-written summary · about

  1. 0:00Intro
  2. 1:06Keyword vs positional args
  3. 3:10Connascence
  4. 8:48options hash as keyword args
  5. 10:33Splat & options hash
  6. 11:54Ruby 1.9 hash syntax
  7. 12:23Ruby 2.0 optional keyword arguments
  8. 13:12Ruby 2.1 required kwarg
  9. 13:26Original Gotcha
  10. 16:20Method call
  11. 16:59Array literal syntax
  12. 17:38Splat & double-splat
  13. 17:48Ruby 2.1 double-splat
  14. 20:42Double-splat **-implicit conversion
  15. 21:30Hash implicit conversion
  16. 22:27Performance
  17. 23:17Ruby VM
  18. 25:29Ruby 2.2 VM
  19. 26:30Ruby 2.2 hash syntax
  20. 27:12Repetition
~/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.