News for hackers. Stuff that matters.
Re:Better Know a Ruby Thing: Singleton Classes by empw on Friday January 31, 2025 @03:08PM (#42891335)
I haven't written any ruby for over a decade and a half, when ruby 2.x was still on the horizon. But I do know the source of "eigenclass". It was first jokingly used in an odd instructional programming book / web comic / experimental art piece by "why the lucky stiff" who was briefly prominent in ruby-land then erased himself from the internet. It's funny that it has now become an established term of art for Ruby people.
Re:Better Know a Ruby Thing: Singleton Classes by nixpulvis on Friday January 31, 2025 @05:54PM (#42893337)
I remember reading WPGTR in college. Really inspired me to play around and learn the language. I've always kept my printed copy in a safe place.
Re:Better Know a Ruby Thing: Singleton Classes by adriand on Friday January 31, 2025 @11:45PM (#42895725)
I read it after college when I first started working with Rails 1 after I joined a friend’s company. Funny to think that was almost two decades ago. I still remember the quirky art style, although I will admit to preferring a more prosaic book when I learned the language. But it was a fun community and the sense of creativity was really apparent.
Re:Better Know a Ruby Thing: Singleton Classes by KerrAvon on Friday January 31, 2025 @06:56PM (#42893952)
_why's influence is indelible.
Re:Better Know a Ruby Thing: Singleton Classes by insane_dreamer on Friday January 31, 2025 @10:50PM (#42895482)
loved _why’s stuff back when he was still around.
Re:Better Know a Ruby Thing: Singleton Classes by Lio on Saturday February 01, 2025 @02:45AM (#42896646)
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.

Re:Better Know a Ruby Thing: Singleton Classes by riffraff on Saturday February 01, 2025 @03:27AM (#42896813)
I thought splat was actually the "official" usage these days, tho I think some people call it spread
Re:Better Know a Ruby Thing: Singleton Classes by byroot on Saturday February 01, 2025 @05:10AM (#42897319)
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_...

Re:Better Know a Ruby Thing: Singleton Classes by dragonwriter on Saturday February 01, 2025 @05:12AM (#42897326)
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.)
Re:Better Know a Ruby Thing: Singleton Classes by Etheryte on Saturday February 01, 2025 @08:35AM (#42898178)
It's called spread in Javascript [0], where the keyword is `...`.

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

Re:Better Know a Ruby Thing: Singleton Classes by lloeki on Saturday February 01, 2025 @02:54AM (#42896684)
Sunny Ripert paid a wonderful tribute to _why as a talk at ParisRB 2020.

https://m.youtube.com/watch?v=njr39cVU7d0

It was not so much aimed at the "old guard" (those that knew about _why) as the "next generation" (those that never heard of him).

At some point Sunny asked to raise hands if one knew about _why, maybe half did, tops.

By the end of the talk the emotion in the room was palpable.