Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I still refer to the * operator as “splat” after a presentation I saw him give in London in 2007.

_why is most definitely gone but not forgotten.



I thought splat was actually the "official" usage these days, tho I think some people call it spread


It is yes [0].

> You can turn an Array into an argument list with * (or splat) operator

> You can turn a Hash into keyword arguments with the * (keyword splat) operator:

It's also named spat across the MRI codebase, e.g. `VM_CALL_ARGS_SPLAT` etc.

[0] https://docs.ruby-lang.org/en/master/syntax/calling_methods_...


It's called spread in Javascript [0], where the keyword is `...`.

[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


splat is the official name in Ruby, spread comes from the similar JS construct (obviously, lots of people using Ruby also use JS, so its natural for terminology from one context to sometimes get applied to similar concepts in the other even where it isn’t official.)




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: