From: Hal Fulton Date: 2006-02-13T14:41:09+09:00 Subject: Re: Struct creates non-standard classes Mark Volkmann wrote: > On 2/12/06, David Vallner wrote:> D�a Nede�a 12 Febru�r 2006 20:45 Mark Volkmann nap�sal:> > If Struct is a shorthand way for creating Classes, why don't objects> > created from those Classes have instance_variables?> >>> My guess is because Struct directly accesses a C hashtable, instead of> registering instance variables in the interpreter. Not like it should matter> unless you for some reason with to access the variables with reflection> instead of the accessors, which I can't imagine why you'd want to do. > My issue is that I wanted to think of Struct as an alternate way ofdefining a class and that after doing so I could use it like any otherclass. However, classes created using Struct aren't the same asclasses created in the "normal" way and because of that I have toremember when I use them how they differ. I've found one way in whichthey differ and don't know if there are others. > --R. Mark VolkmannPartner, Object Computing, Inc. I don't know why some posts come out like the above. But anyway: This Struct issue was one reason I created SuperStruct (see http://sstruct.rubyforge.org). The usual disclaimer: I think it has bugs in spite of my testing. If you find any, let me know. Cheers, Hal