Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Parallelism in Crystal. Parent comment
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.
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...)