From: Andreas Rottmann <a.rottmann@gmx.at>
Subject: Re: Inheriting from foreign objects
Date: 30 Apr 2002 12:23:06 +0200 [thread overview]
Message-ID: <874rht7aet.fsf@alice.rhinosaur.lan> (raw)
In-Reply-To: <E17078m-000118-00@giblet>
Thien-Thi Nguyen <ttn@giblet.glug.org> writes:
> From: Neil Jerram <neil@ossau.uklinux.net>
> Date: 10 Apr 2002 20:47:13 +0100
>
> Andreas> Is there a way I can cleanly derive from C-created classes?
>
> I'd say you're in virgin territory here, and that any advice you can
> give on such problems, and on defining a C API for GOOPS, would be
> very useful.
>
> it looks like foreign bit is set when superclass list is empty. perhaps
> a good guideline would be to use at least `(list <object>)' for `supers'
> for normal operation.
I can't test your statement, since I have switched to create a
'normal' class and have a special slot being a smob containing the
pointer to the C++ object.
> btw, it doesn't look like user-supplied ctor/dtor
> are suppressed based on foreign bit in any case.
>
When you inherit from a 'foreign' class, the constructor/destructor
fields of the new class are set NULL.
I suggest you write some 'test' code that uses the various
goops-related C functions, as that would both make them easier to
understand and they can be validated this way.
> [cc guile-user in order to ask survey question: which goops-related C
> functions do people use now? the answer to this helps shape definition
> of the C interface to goops -- thanks!]
>
I use, in my C++ <-> GOOPS bindings:
scm_load_goops()
scm_make()
scm_basic_make_class()
scm_sys_allocate_instance()
scm_sys_initialize_object()
scm_slot_set_x()
SCM_IS_A_P()
scm_add_method()
scm_generic_function_methods()
scm_method_procedure()
scm_method_specializers()
scm_slot_exists_p()
scm_slot_ref()
I may have overlooked some.
BTW: Has anybody of the developers looked at my GOOPS-related
bugreport yet? Since I have included a program documenting the bug it
shouldn't be too hard to investigate...
Regards, Andy
--
Andreas Rottmann | Dru@ICQ | 118634484@ICQ | a.rottmann@gmx.at
http://www.8ung.at/rotty | GnuPG Key: http://www.8ung.at/rotty/gpg.asc
Fingerprint | DFB4 4EB4 78A4 5EEE 6219 F228 F92F CFC5 01FD 5B62
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-04-30 10:23 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-09 18:21 Inheriting from foreign objects Andreas Rottmann
2002-04-10 19:47 ` Neil Jerram
2002-04-23 20:43 ` Thien-Thi Nguyen
2002-04-30 10:23 ` Andreas Rottmann [this message]
2002-05-15 12:30 ` Thien-Thi Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874rht7aet.fsf@alice.rhinosaur.lan \
--to=a.rottmann@gmx.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).