[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object Data and pointer assignments

"J.D. Smith" wrote:

> The only reason I quibble is to dispel the notion that the __define in class
> definitions merely suggests or defines the class data members, as it does for
> fields of structures, and that you must "fill out" the skeleton of class data in
> the Init method.  In the context of object creation, obj_new *does* in fact
> implicitly assign values to them all: namely null (0,'',null pointer, etc.).
> You can think of the first step of obj_new being something like
> self={MY_CLASS}.  So by the time you get to the Init Method, you do have a
> *real* pointer, namely a null pointer.


This doesn't sound like a quibble to a newbie.   So, the filling out of the
skeleton may or may not occur in the INIT function, but not in the __DEFINE

You have brought up the the issue of SELF ... which is another source of
confusion.  I have just written the SetProperty and GetProperty  methods.  They
work just fine (so far I can get and set what I need).   However, it feels a little
bit like living in Flatland where things pop in and out of my two dimensions from
some unkown third dimension.   Magically, SELF appears as if out of thin air; how
does it get there if there is no SELF argument in the procedure... and how come I
don't have to call the structure BLAH (rather than self) if it is a named

Thanks again,


Ben Tupper

Bigelow Laboratory for Ocean Science