From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Maxime Devos Newsgroups: gmane.lisp.guile.bugs Subject: bug#48712: (is-a? #nil ) --> #f (oop goops) Date: Fri, 28 May 2021 10:59:05 +0200 Message-ID: <624661bacce9263eac189a51b7d2774864f9c6b8.camel@telenet.be> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-lgQRidxL2unqYWWMMlAp" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27742"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.34.2 To: 48712@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Fri May 28 11:00:20 2021 Return-path: Envelope-to: guile-bugs@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 1lmYLs-0006y3-N7 for guile-bugs@m.gmane-mx.org; Fri, 28 May 2021 11:00:20 +0200 Original-Received: from localhost ([::1]:55512 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmYLq-0000xp-QM for guile-bugs@m.gmane-mx.org; Fri, 28 May 2021 05:00:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmYLa-0000xc-BF for bug-guile@gnu.org; Fri, 28 May 2021 05:00:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42057) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmYLa-0008Oi-2r for bug-guile@gnu.org; Fri, 28 May 2021 05:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lmYLa-0007U4-0a for bug-guile@gnu.org; Fri, 28 May 2021 05:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 28 May 2021 09:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48712 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162219236328691 (code B ref -1); Fri, 28 May 2021 09:00:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 May 2021 08:59:23 +0000 Original-Received: from localhost ([127.0.0.1]:53603 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmYKw-0007Sh-UW for submit@debbugs.gnu.org; Fri, 28 May 2021 04:59:23 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:43010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lmYKv-0007Sa-OD for submit@debbugs.gnu.org; Fri, 28 May 2021 04:59:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52138) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmYKt-0000wO-SP for bug-guile@gnu.org; Fri, 28 May 2021 04:59:21 -0400 Original-Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]:57516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmYKq-0007nz-4i for bug-guile@gnu.org; Fri, 28 May 2021 04:59:19 -0400 Original-Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by xavier.telenet-ops.be with bizsmtp id A8zC250010mfAB4018zCqN; Fri, 28 May 2021 10:59:12 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1622192352; bh=VMKhgZ4gA7QPog+PdtnV2Mfp97d+tjYMRnpJjj1/AFs=; h=Subject:From:To:Date; b=h9nUFrW7VLpStRwSZUBHCZBOv6tKjyD/U2rWEp4ufbVf72GoRBrMJ3GlJ2Yo+cjQE qRevbUJkRumir+xc8pT0dzQNjDHFsWv8EbJvJFd6xr7Yf3aR9cFR4vULm/bBmtX+xv cdEB2fBsXS2ixnvzvxm9opchpY41R+inv/mqJeJSqczp52JsEY7GZVzUT7+GSfYOA7 DWI82K4VEIQcXNeTq+2yYH7iEBZUNhSzi5iB9i1+0RDo3MA8+oqciAV/Z6IgbmDv2f bM8UYd0s3bYZUf0+8R/z8LiTa6tBWOahjtg+mYYGRc9S8NKeqkp1sxXG6WkIRjwTiO 3VRefwFNuTL9A== Received-SPF: pass client-ip=2a02:1800:120:4::f00:14; envelope-from=maximedevos@telenet.be; helo=xavier.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.io gmane.lisp.guile.bugs:10112 Archived-At: --=-lgQRidxL2unqYWWMMlAp Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I want to make sure some Scheme code using (oop goops) can be used from elisp. The method I'm defining is something like this (overly simplified): ;; TODO: Define a instead of working with raw integers? (define-method (send-message! (msg ) (data ) (remote )) [ write data to msg ] [ call mach_msg appropriately ]) I tested whether elisp's #nil is considered a , apparently not: (use-modules (oop goops)) (is-a? '() ) ;; #t (is-a? '(a . ()) ) ;; #t (is-a? #nil ) ;; #f, expected #t (is-a? '(a . #nil) ) ;; #t (class-of '()) ;; (class-of '(a . ())) ;; (class-of #nil) ;; , expected (a subclass of) (class-of '(a . #nil)) ;; #nil is both a boolean, and an end-of-list object. As such, it should be both and (and ). But currently it is only . My untested suggestion: Define a class , inheriting from and . Define class_elisp_nil appropriately in libguile/goops.c and (oop goops). In scm_class_of, adjust case scm_tc3_imm24: if (SCM_CHARP (x)) return class_char; else if (scm_is_bool (x)) return class_boolean; else if (scm_is_null (x)) return class_null; else return class_unknown; appropriately. Greetings, Maxime --=-lgQRidxL2unqYWWMMlAp Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYLCw2RccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7n3YAP4w3L7pOZGS3146cm0YC011l7Vp P3mhAVThpReOhoVtxwEA9fMoo41+2UOJmI/IYTPXD9zrrhFNHrOBOn5D+RT3jA0= =eoU1 -----END PGP SIGNATURE----- --=-lgQRidxL2unqYWWMMlAp--