L
Lennon Day-Reynolds
My point was that DL was already a part of the Ruby standard library,
and as such, had opened the door to implement exactly what you're
asking for without changes to the core Ruby interpreter. The cost of
that flexibility, however, is that you must trust the programmer not
to go and cause a segfault.
I think that it's fine to have that access available for clever hacks,
but only if you trust the author of that hack to really, really know
what they're doing. It also could tie your code to a certain version
of Ruby, as the internal data structures the interpreter uses could
easily change in representation between versions.
Making #class= or #become a part of the core library seems unecessary,
exactly because it is potentially so dangerous. For those rare cases
where people need that functionality, DL and evil.rb are available;
for us mere mortals, the current (already wide-open) object semantics
seem appropriate.
and as such, had opened the door to implement exactly what you're
asking for without changes to the core Ruby interpreter. The cost of
that flexibility, however, is that you must trust the programmer not
to go and cause a segfault.
I think that it's fine to have that access available for clever hacks,
but only if you trust the author of that hack to really, really know
what they're doing. It also could tie your code to a certain version
of Ruby, as the internal data structures the interpreter uses could
easily change in representation between versions.
Making #class= or #become a part of the core library seems unecessary,
exactly because it is potentially so dangerous. For those rare cases
where people need that functionality, DL and evil.rb are available;
for us mere mortals, the current (already wide-open) object semantics
seem appropriate.