From debbugs-submit-bounces@debbugs.gnu.org Fri May 28 04:59:23 2021 Received: (at submit) by debbugs.gnu.org; 28 May 2021 08:59:23 +0000 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 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 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 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 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 Message-ID: <624661bacce9263eac189a51b7d2774864f9c6b8.camel@telenet.be> Subject: (is-a? #nil ) --> #f (oop goops) From: Maxime Devos To: bug-guile@gnu.org Date: Fri, 28 May 2021 10:59:05 +0200 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-lgQRidxL2unqYWWMMlAp" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 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-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-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--