From: m4dc4p Date: 2005-11-11T04:22:13+09:00 Subject: Re: Golf, anyone? Trans wrote: > But your exmaple has it that a subclass will share the same @prop (Ie. > Baz -> Bar). Which appreantly is why you added the superclass call. > (Notice also that Robert's example doesn't handle this). So I'm > wondering which you really want. Basically you asking two different > things: Standard module method inheritance (which has independent class > instance vars) or Or module method inheritance with addtioanl class > variable inheritance. > Thanks for your reply - definitely the second case - "variable inheritance." > include 'facet/inheritor' > > module Foo > inheritor :prop, [], :+ > end > I looked at the implementation of inheritor and I wonder if you could explain the reason for passing the ":+" symbol to the method. From the implementation, you have this line: deflambda = lambda do define_method( key ) do defined?(super) ? super.__send__(op,obj) : obj.dup end ... Why does the "+" method need to be called on the parent? I am hoping to be able to understand what you are doing here so I can be a better Rubyist! Ara and Robert - sorry for replying directly to you. I meant to post to the group but accidently clicked "reply to author". Thanks for your responses also.