This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: SCM_SMOB_TAG smob abstraction


On 9 Sep 1999, Mikael Djurfeldt wrote:

> I think that maybe what Dirk and you are after is that you want smob
> to be a sub-type and you want a macro to distinguish a smob from other
> smobs.  But then you'd need to make two tests:
> 
> #define SCM_FOOP(x) (SCM_SMOBP (x) && SCM_SMOBNUM (x) == smobnum_foo)

You are right:  This is what I was thinking of and I even forgot about
the existence of SCM_SMOBNUM.  Sorry for that.

However, IIRC some time ago I had suggested to introduce a macro which
performs the above test in one go.

> I don't see a strong enough reason to change this in the scm
> interface.  I *do* think that we should implement a really easy way to
> handle user defined types in the gh interface.

Sure, this would definitely be a better way, although I can not imagine
yet what this interface would look like.  Still, even for implementors
of guile internals it would IMHO make sense to provide macros for
frequently used patterns like the test for a specific type of smob.

Best regards,
Dirk Herrmann


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]