1 May 2005 02:34
Re: instantiating metaclasses, sorta [Was: determining when inside 'class << self']
Christoph <chr_mail <at> gmx.net>
2005-05-01 00:34:08 GMT
2005-05-01 00:34:08 GMT
Jim Freeze schrieb:
>* Mark Hubbart <discordantus <at> gmail.com> [2005-04-30 16:35:16 +0900]:
>
>
>
>>While experimenting with this, I discovered something interesting: it
>>is possible to instantiate a metaclass. By duping a metaclass, you
>>regain the ability to instantiate it, apparently without losing any
>>functionality.
>>
>>
>
>As is said later, duping the object 'erases' the singleton methods
>while 'cloning' carries them over.
>
>I've always considered duping as a nice way of erasing the 'specialness'
>of an object while returning it to its natural state.
>
>
It's true that duping erases class method for general
objects - it's FALSE for Module objects!
---
module A
def self.bla
puts "bla"
end
end
(Continue reading)
RSS Feed