From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: divoplade Newsgroups: gmane.lisp.guile.user Subject: Re: no scm_foreign_object_p ? Date: Sat, 23 Jan 2021 21:04:37 +0100 Message-ID: <4cb1b5067cb30fbadd34dac26c246bcf47876ade.camel@divoplade.fr> References: <87f7e2c4-3a42-acdf-35cf-6920b6240444@gmail.com> <87zh0zfo52.fsf@clara> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13842"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 To: Olivier Dion , Matt Wette , Guile User Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Jan 23 21:05:40 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l3PAC-0003Ti-NO for guile-user@m.gmane-mx.org; Sat, 23 Jan 2021 21:05:40 +0100 Original-Received: from localhost ([::1]:37632 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3PAB-0005Ur-Ob for guile-user@m.gmane-mx.org; Sat, 23 Jan 2021 15:05:39 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3P9N-0005F0-39 for guile-user@gnu.org; Sat, 23 Jan 2021 15:04:49 -0500 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:36429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3P9J-00084C-VG for guile-user@gnu.org; Sat, 23 Jan 2021 15:04:48 -0500 X-Originating-IP: 86.239.3.142 Original-Received: from pruneau-1.home (lfbn-poi-1-564-142.w86-239.abo.wanadoo.fr [86.239.3.142]) (Authenticated sender: d@divoplade.fr) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id AB63E20009; Sat, 23 Jan 2021 20:04:38 +0000 (UTC) In-Reply-To: <87zh0zfo52.fsf@clara> Received-SPF: pass client-ip=217.70.183.200; envelope-from=d@divoplade.fr; helo=relay7-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17189 Archived-At: Hello, Le samedi 23 janvier 2021 à 14:29 -0500, olivier.dion--- via General Guile related discussions a écrit : > On Sat, 23 Jan 2021, Matt Wette wrote: > > I started using foreign objects but want something akin to > > number?, > > string? etc. > > Is there something that works here? > > I was hoping to see scm_foreign_object_p(type, object). > > The only thing I see in the manual is > `scm_assert_foreign_object_type`. That's what I noticed too; if you want something finer you need to write scheme code. Since foreign pointers are GOOPS objects and foreign pointer types are classes, maybe the is-a? predicate could work, with the foreign pointer type as the class? divoplade