News for hackers. Stuff that matters.
Re:Parallelism in Crystal by e12e on Saturday September 07, 2019 @02:28PM (#20905604)
I suppose in ruby you'd re-open Object and add new_method there... (in part by overriding method_missing, maybe).

I wouldn't recommend actually doing that, however.

If actually doing this (adding new method to a class) I think it's quite easy to re-open a class in ruby (see sibling comment(s)).

I can see adding methods actual instances (only) might be more work in ruby though.

What would be the typical use case for a special instance in a given scope, as opposed to a special class in a given scope?

Ed: i see qquark's so link address the technical part: define_singleton_method (so no need to open Object to add that...)

There are no comments on this comment yet.