From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Wette Newsgroups: gmane.lisp.guile.user Subject: Re: no scm_foreign_object_p ? Date: Sat, 23 Jan 2021 12:52:45 -0800 Message-ID: <79ff69c1-d1f2-393f-d66e-30d850e02553@gmail.com> References: <87f7e2c4-3a42-acdf-35cf-6920b6240444@gmail.com> <87zh0zfo52.fsf@clara> <4cb1b5067cb30fbadd34dac26c246bcf47876ade.camel@divoplade.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13948"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat Jan 23 21:53:02 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 1l3Pu2-0003Y7-CQ for guile-user@m.gmane-mx.org; Sat, 23 Jan 2021 21:53:02 +0100 Original-Received: from localhost ([::1]:43092 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l3Pu1-0005HH-Dw for guile-user@m.gmane-mx.org; Sat, 23 Jan 2021 15:53:01 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l3Ptr-0005H9-PD for guile-user@gnu.org; Sat, 23 Jan 2021 15:52:51 -0500 Original-Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]:43232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l3Ptp-0004qQ-CV for guile-user@gnu.org; Sat, 23 Jan 2021 15:52:51 -0500 Original-Received: by mail-pf1-x429.google.com with SMTP id q131so6051934pfq.10 for ; Sat, 23 Jan 2021 12:52:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=vR8loTqAXlRU2z643LvPVObOWFfRInivMJSYAzqzH18=; b=UL1+eeJ8M0ajDBBK6+KVo49EYkpv78lXeBf1xwdcxh8DAVyAEneovCj2cRP8DrnxCH J13SKqeaES9vTH0/cggnpVlTCYz6YQjodRsKJzEDywAPNuHCEiSZbLx3zFXKps5nvm1A TcUVcKRfTEDtu72cv1odd5nts1kUflTxFsMol1lL63TCMn4dKPabmZpTe7OXSqsFp4Ik b1oMM+jUdFds64d4U6HYNjcTfe/QKYYEonWPjdxONQRkAxD1Ct/nrAZ84CorO0gcelZ1 RT7vZdd5fKvZUOc1OVCaBPC2kwMjJ73Av5CwnJ9h2k53ddUtaSg6KMCsLBgsd+KPcwCN 7itg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=vR8loTqAXlRU2z643LvPVObOWFfRInivMJSYAzqzH18=; b=JldjLBwtC0kAWvdH4ztvO6/uzQpOFvQjUrJBnDCNBmadtN4ja1QrGJ71qu4d/nIuAj 1KZjl4k9s3phWS332tGDq/95uDWm2EcGwlgFcaaVE4kXb7si94PRS0Bm7w6HeX/gmxQu e225BH2SmkpSv9GHu0SDULYVgKDrORwDM5PdnjKRAAJuuS3wVUNVMf/onz0YLPUvTDgD dDwsFkmH2DX+GTFe8daDxWaZcehkJupyvFDkcVXohU0jy4ZIY9h7BN5nKjhibImcW7Ck iZgNRlpMWPq/vpfeyhjyT/NeSgICnBuROqqU+qZuTpaNf7j3FYdIU/Z1ZSLIiUxOQERU 0bEQ== X-Gm-Message-State: AOAM531GlOM37fTkY9kV9lkV/3FwenGnkB1jf8GdMMGEocn9t/ZuPEsn 4y8ddSoHiMjUxlC1zfgauLnoLfOLAmQ= X-Google-Smtp-Source: ABdhPJzpPWCcSyh0kQweaXe5eHe3Sl3qLx9i3ydM7sR89FvR4fkgz2Mn4S/EQTHMBVx/Hp7liXcTag== X-Received: by 2002:a63:1f1d:: with SMTP id f29mr11077305pgf.47.1611435167610; Sat, 23 Jan 2021 12:52:47 -0800 (PST) Original-Received: from [192.168.2.183] (64-52-176-132.championbroadband.com. [64.52.176.132]) by smtp.gmail.com with ESMTPSA id j9sm12585854pgb.47.2021.01.23.12.52.46 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 23 Jan 2021 12:52:47 -0800 (PST) In-Reply-To: <4cb1b5067cb30fbadd34dac26c246bcf47876ade.camel@divoplade.fr> Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=matt.wette@gmail.com; helo=mail-pf1-x429.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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:17190 Archived-At: On 1/23/21 12:04 PM, divoplade wrote: > 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 > > GOOPS should not be part of the solution.  I'm thinking of punting foreign-object and see if using some combination of structs and bytevectors will work out better.