From: Dave Thomas Date: 2000-11-03T01:32:44+09:00 Subject: [ruby-talk:6000] Re: Mem overhead of singleton (ProgRuby chapt 19 q) Robert Feldt writes: > I've been working with class decoration a bit and find your piece on > "Class and Module Definitions" interesting. However, my q to you and > (possibly other Ruby gurus?) are what effect the "performance enhancement > based on Tadayoshi Funaba's data module" has on the mem usage? Yes, there is an overhead, although I'd have to do some digging to find out exactly how great. You could eliminate the singleton at the expense of an extra instance variable by rewriting the methods as def if !@ @name_defined = true @name_value = end @name_value end but Funaba-san's technique is a lot more fun! Regards Dave