From: Michal Rokos Date: 2001-10-24T20:11:11+09:00 Subject: [ruby-talk:23176] Re: Instance VARS and C objects Yukihiro Matsumoto wrote: > So why not attributes("virtual_parameters")? > You have perfect control if you use attributes. > But you may have unspoken problems. Just one reason to allow InstanceVariables is nicer code. Example: (the real class has Cstruct inside) class X def initialize(ary) #C processing to pack array inside end def ary #C processing to export ARY from Cstruct end def ary=(ary) #C processing to pack array in end #so attribute ary is virtual, bue behaves like array #NOW I'd like to have def arr<<(member) #add member to ary that is packed to Cstruct end #BUT I CAN'T DEFINE THIS METHOD (because of grammar) end Got it? Michal -- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Michal Rokos Czech Technical University, Prague E-mail: m.rokos@sh.cvut.cz ICQ: 36118339 -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-