[#1816] Ruby 1.5.3 under Tru64 (Alpha)? — Clemens Hintze <clemens.hintze@...>

Hi all,

17 messages 2000/03/14

[#1989] English Ruby/Gtk Tutorial? — schneik@...

18 messages 2000/03/17

[#2241] setter() for local variables — ts <decoux@...>

18 messages 2000/03/29

[ruby-talk:02231] Re: A few questions

From: Andrew Hunt <andy@...>
Date: 2000-03-29 02:35:43 UTC
List: ruby-talk #2231
    >> 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

In This Thread

Prev Next