Apr
9th
Fri
9th
Class.allocateでBasicObjectのクローン
ふつうはできない。
irb(main):001:0> BasicObject.clone
TypeError: can't copy the root class
ところが…
c = Class.allocate
Module.instance_method(:initialize_copy).bind(c).call BasicObject
p c.ancestors # => [#<Class:0x00000001327098>]
新世界の神が誕生している様子が見て取れる。
まあ、なんというか、俺的には結構頑張ってるんだけどなかなかSEGVしないので困った。これ本当に平気なの?