From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Thien-Thi Nguyen Newsgroups: gmane.lisp.guile.devel Subject: Re: Inheriting from foreign objects Date: Tue, 23 Apr 2002 13:43:56 -0700 Sender: guile-devel-admin@gnu.org Message-ID: References: <873cy47mxs.fsf@alice.rhinosaur.lan> Reply-To: ttn@glug.org NNTP-Posting-Host: localhost.gmane.org X-Trace: main.gmane.org 1019595094 26643 127.0.0.1 (23 Apr 2002 20:51:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 23 Apr 2002 20:51:34 +0000 (UTC) Cc: guile-devel@gnu.org, guile-user@gnu.org Return-path: Original-Received: from fencepost.gnu.org ([199.232.76.164]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 1707G9-0006vc-00 for ; Tue, 23 Apr 2002 22:51:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1707Fp-0004vy-00; Tue, 23 Apr 2002 16:51:13 -0400 Original-Received: from ca-crlsbd-u5-c4a-a-172.crlsca.adelphia.net ([24.48.214.172] helo=giblet) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 1707Ct-0004l8-00; Tue, 23 Apr 2002 16:48:11 -0400 Original-Received: from ttn by giblet with local (Exim 3.33 #1 (Debian)) id 17078m-000118-00; Tue, 23 Apr 2002 13:43:56 -0700 Original-To: a.rottmann@gmx.at In-Reply-To: (message from Neil Jerram on 10 Apr 2002 20:47:13 +0100) Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.9 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:476 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:476 From: Neil Jerram 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 )' for `supers' for normal operation. btw, it doesn't look like user-supplied ctor/dtor are suppressed based on foreign bit in any case. [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!] thi _______________________________ SCM scm_make_class (SCM meta, char *s_name, SCM supers, size_t size, void * (*constructor) (SCM initargs), size_t (*destructor) (void *)) { SCM name, class; name = scm_str2symbol (s_name); if (SCM_NULLP (supers)) supers = scm_list_1 (scm_class_foreign_object); class = scm_basic_basic_make_class (meta, name, supers, SCM_EOL); scm_sys_inherit_magic_x (class, supers); if (destructor != 0) { SCM_SET_SLOT (class, scm_si_destructor, (SCM) destructor); SCM_SET_CLASS_DESTRUCTOR (class, scm_free_foreign_object); } else if (size > 0) { SCM_SET_CLASS_DESTRUCTOR (class, scm_struct_free_light); SCM_SET_CLASS_INSTANCE_SIZE (class, size); } SCM_SET_SLOT (class, scm_si_layout, scm_str2symbol ("")); SCM_SET_SLOT (class, scm_si_constructor, (SCM) constructor); return class; } _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel