From: Andrew Hunt Date: 2000-03-28T21:35:43-05:00 Subject: [ruby-talk:02231] Re: A few questions >> 1. ... Does an extension module have to be in this file to be built >> (it would appear not)? > >No it has not to be in this file. Simple add an directory to 'ext' and >create a MANIFEST file for that extension within its directory. Then >it will be build automagically during the next make run. Then why does this file exist? Solely for static linking? >I would propose, that you also describe how to build and install >extensions if they would *not* be in Ruby's ext dir. Sorry if you have >already thought of this... Already in the book, but thanks for suggesting it! >> 3. Is Struct still used, or is it deprecated? If it's still used, how is >> it different from Data (Data_Wrap_Struct, etc.) > >AFAIK, Struct is a normal class in Ruby that allows you to simulate C >struct like datatypes. That means a Struct instance do not represent a >C struct, but allow to encapsulate some member to group them together. >You could also use a class here, but using Struct is more comfortable, >as you have not to deal with the class creation overhead (syntactically). Okay, I was momentarily confused but I think I have a handle on it now. >Here an instance of class Data will be created. This instance is >wrapping a pointer to an allocated dbmdata struct. Furthermore this >Data instance will fake itself to be a DBM instance! So ruby thinks it >is dealing with a DBM instance instead of a Data instance. So the extra C stuff you have allocated adds itself to the other stuff (instance vars, etc.) in the DBM instance? >All understandings removed? ... ;-)))) That's about right :-) /\ndy