X-Loop: help-debbugs@HIDDEN Subject: bug#37461: define-generic doesn't promote equal? to generic Resent-From: Rob Browning <rlb@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Thu, 19 Sep 2019 15:38:02 +0000 Resent-Message-ID: <handler.37461.B.15689074794241 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: report 37461 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 37461 <at> debbugs.gnu.org X-Debbugs-Original-To: bug-guile@HIDDEN Received: via spool by submit <at> debbugs.gnu.org id=B.15689074794241 (code B ref -1); Thu, 19 Sep 2019 15:38:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Sep 2019 15:37:59 +0000 Received: from localhost ([127.0.0.1]:56289 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iAyVL-00016L-Fg for submit <at> debbugs.gnu.org; Thu, 19 Sep 2019 11:37:59 -0400 Received: from lists.gnu.org ([209.51.188.17]:42815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rlb@HIDDEN>) id 1iAyVJ-00016D-LR for submit <at> debbugs.gnu.org; Thu, 19 Sep 2019 11:37:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36913) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <rlb@HIDDEN>) id 1iAyVI-0002Xi-B9 for bug-guile@HIDDEN; Thu, 19 Sep 2019 11:37:57 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <rlb@HIDDEN>) id 1iAyVH-0000Cn-75 for bug-guile@HIDDEN; Thu, 19 Sep 2019 11:37:56 -0400 Received: from defaultvalue.org ([45.33.119.55]:39460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <rlb@HIDDEN>) id 1iAyVH-0000CN-1t for bug-guile@HIDDEN; Thu, 19 Sep 2019 11:37:55 -0400 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@HIDDEN) by defaultvalue.org (Postfix) with ESMTPSA id 368262015C for <bug-guile@HIDDEN>; Thu, 19 Sep 2019 10:37:54 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 763EC14E068; Thu, 19 Sep 2019 10:37:54 -0500 (CDT) From: Rob Browning <rlb@HIDDEN> Date: Thu, 19 Sep 2019 10:37:54 -0500 Message-ID: <87lfukz48d.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 45.33.119.55 X-Spam-Score: -1.4 (-) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -2.4 (--) Version: 2.2.6 scheme@(guile-user)> (use-modules (oop goops)) scheme@(guile-user)> equal? $1 = #<procedure equal? (#:optional _ _ . _)> scheme@(guile-user)> (define-generic equal?) scheme@(guile-user)> equal? $2 = #<procedure equal? (#:optional _ _ . _)> The same appears to be true for other primitives like + too, but if I'm reading it right, this makes it sound like it was intended to work: https://www.gnu.org/software/guile/docs/master/guile.html/Extending-Primitives.html You can work around the problem by stashing equal? somewhere else, and then define-generic will work after a (define equal? #f). Presumably you'd then need to define a base specialization using the original equal? or do something equivalent. I also noticed goops itself does this: https://git.savannah.gnu.org/gitweb/?p=guile.git;a=blob;f=module/oop/goops.scm;h=837a667e602\ 5b6f8ed7818e5a8efe064cca7843d;hb=791cae940afcb2b2eb2c167fe438be1dc1008a73#l2335 Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) Content-Type: text/plain; charset=utf-8 X-Loop: help-debbugs@HIDDEN From: help-debbugs@HIDDEN (GNU bug Tracking System) To: Rob Browning <rlb@HIDDEN> Subject: bug#37461: Acknowledgement (define-generic doesn't promote equal? to generic) Message-ID: <handler.37461.B.15689074794241.ack <at> debbugs.gnu.org> References: <87lfukz48d.fsf@HIDDEN> X-Gnu-PR-Message: ack 37461 X-Gnu-PR-Package: guile Reply-To: 37461 <at> debbugs.gnu.org Date: Thu, 19 Sep 2019 15:38:02 +0000 Thank you for filing a new bug report with debbugs.gnu.org. This is an automatically generated reply to let you know your message has been received. Your message is being forwarded to the package maintainers and other interested parties for their attention; they will reply in due course. Your message has been sent to the package maintainer(s): bug-guile@HIDDEN If you wish to submit further information on this problem, please send it to 37461 <at> debbugs.gnu.org. Please do not send mail to help-debbugs@HIDDEN unless you wish to report a problem with the Bug-tracking system. --=20 37461: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D37461 GNU Bug Tracking System Contact help-debbugs@HIDDEN with problems
X-Loop: help-debbugs@HIDDEN Subject: bug#37461: define-generic doesn't promote equal? to generic Resent-From: Rob Browning <rlb@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Thu, 19 Sep 2019 23:28:02 +0000 Resent-Message-ID: <handler.37461.B37461.156893567917374 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 37461 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 37461 <at> debbugs.gnu.org Received: via spool by 37461-submit <at> debbugs.gnu.org id=B37461.156893567917374 (code B ref 37461); Thu, 19 Sep 2019 23:28:02 +0000 Received: (at 37461) by debbugs.gnu.org; 19 Sep 2019 23:27:59 +0000 Received: from localhost ([127.0.0.1]:56571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iB5qB-0004W9-E1 for submit <at> debbugs.gnu.org; Thu, 19 Sep 2019 19:27:59 -0400 Received: from defaultvalue.org ([45.33.119.55]:47122 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rlb@HIDDEN>) id 1iB5q9-0004W0-G9 for 37461 <at> debbugs.gnu.org; Thu, 19 Sep 2019 19:27:58 -0400 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@HIDDEN) by defaultvalue.org (Postfix) with ESMTPSA id 6C1732008A for <37461 <at> debbugs.gnu.org>; Thu, 19 Sep 2019 18:27:56 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 95D6D14E068; Thu, 19 Sep 2019 18:27:56 -0500 (CDT) From: Rob Browning <rlb@HIDDEN> In-Reply-To: <87lfukz48d.fsf@HIDDEN> References: <87lfukz48d.fsf@HIDDEN> Date: Thu, 19 Sep 2019 18:27:56 -0500 Message-ID: <87blvfzx1f.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Rob Browning <rlb@HIDDEN> writes: > You can work around the problem by stashing equal? somewhere else, and > then define-generic will work after a (define equal? #f). Presumably > you'd then need to define a base specialization using the original > equal? or do something equivalent. It looks like while this works within a module, I haven't figured out any workaround that allows the module to present the resulting generic equal? to code that uses the module. A re-export doesn't affect the module using the re-exporter, and export and replace both fail with "Unbound variable: equal?", even though there's a (define equal? ...) in the module. -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
X-Loop: help-debbugs@HIDDEN Subject: bug#37461: define-generic doesn't promote equal? to generic Resent-From: Rob Browning <rlb@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Sat, 21 Sep 2019 15:16:01 +0000 Resent-Message-ID: <handler.37461.B37461.156907894320117 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 37461 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 37461 <at> debbugs.gnu.org Cc: control <at> debbugs.gnu.org Received: via spool by 37461-submit <at> debbugs.gnu.org id=B37461.156907894320117 (code B ref 37461); Sat, 21 Sep 2019 15:16:01 +0000 Received: (at 37461) by debbugs.gnu.org; 21 Sep 2019 15:15:43 +0000 Received: from localhost ([127.0.0.1]:33113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iBh6s-0005EN-I1 for submit <at> debbugs.gnu.org; Sat, 21 Sep 2019 11:15:42 -0400 Received: from defaultvalue.org ([45.33.119.55]:47196 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rlb@HIDDEN>) id 1iBh6r-0005ED-7W; Sat, 21 Sep 2019 11:15:41 -0400 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@HIDDEN) by defaultvalue.org (Postfix) with ESMTPSA id 5EDA320317; Sat, 21 Sep 2019 10:15:40 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id D20C414E068; Sat, 21 Sep 2019 10:15:41 -0500 (CDT) From: Rob Browning <rlb@HIDDEN> In-Reply-To: <87blvfzx1f.fsf@HIDDEN> References: <87lfukz48d.fsf@HIDDEN> <87blvfzx1f.fsf@HIDDEN> Date: Sat, 21 Sep 2019 10:15:41 -0500 Message-ID: <87lfuh3cki.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) retitle 37461 Methods added to primitive generics don't always work thanks Rob Browning <rlb@HIDDEN> writes: > A re-export doesn't affect the module using the re-exporter, and export > and replace both fail with "Unbound variable: equal?", even though > there's a (define equal? ...) in the module. It looks like equal? isn't changed by define-generic, etc. because it already has "generic-capability?". And in fact, I can see that defining a method on it does alter its primitive-generic-generic, but then dispatch to the new method doesn't always seem to work (or perhaps I just misunderstand the dispatch rules). Here a one argument specialization doesn't work, but a two argument specialization does -- for new classes, but not for a "standard" class like <string>: scheme@(guile-user)> (use-modules (oop goops)) scheme@(guile-user)> (primitive-generic-generic equal?) $1 = #<<generic> equal? (1)> scheme@(guile-user)> (define-class <foo> () (data)) scheme@(guile-user)> (define-method (equal? (x <foo>)) 'x) scheme@(guile-user)> (primitive-generic-generic equal?) $2 = #<<generic> equal? (2)> scheme@(guile-user)> (equal? (make <foo>)) $3 = #t scheme@(guile-user)> (define-method (equal? (x <foo>) (y <foo>)) 'x) $4 = #<<generic> equal? (3)> scheme@(guile-user)> (equal? (make <foo>) (make <foo>)) $5 = x scheme@(guile-user)> (define-method (equal? (x <string>) (y <string>)) 'x) $6 = #<<generic> equal? (4)> scheme@(guile-user)> (equal? "x" "y") $7 = #f Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
Received: (at control) by debbugs.gnu.org; 21 Sep 2019 15:15:43 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 21 11:15:43 2019 Received: from localhost ([127.0.0.1]:33115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iBh6s-0005ER-UY for submit <at> debbugs.gnu.org; Sat, 21 Sep 2019 11:15:43 -0400 Received: from defaultvalue.org ([45.33.119.55]:47196 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rlb@HIDDEN>) id 1iBh6r-0005ED-7W; Sat, 21 Sep 2019 11:15:41 -0400 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@HIDDEN) by defaultvalue.org (Postfix) with ESMTPSA id 5EDA320317; Sat, 21 Sep 2019 10:15:40 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id D20C414E068; Sat, 21 Sep 2019 10:15:41 -0500 (CDT) From: Rob Browning <rlb@HIDDEN> To: 37461 <at> debbugs.gnu.org Subject: Re: bug#37461: define-generic doesn't promote equal? to generic In-Reply-To: <87blvfzx1f.fsf@HIDDEN> References: <87lfukz48d.fsf@HIDDEN> <87blvfzx1f.fsf@HIDDEN> Date: Sat, 21 Sep 2019 10:15:41 -0500 Message-ID: <87lfuh3cki.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: control Cc: control <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) retitle 37461 Methods added to primitive generics don't always work thanks Rob Browning <rlb@HIDDEN> writes: > A re-export doesn't affect the module using the re-exporter, and export > and replace both fail with "Unbound variable: equal?", even though > there's a (define equal? ...) in the module. It looks like equal? isn't changed by define-generic, etc. because it already has "generic-capability?". And in fact, I can see that defining a method on it does alter its primitive-generic-generic, but then dispatch to the new method doesn't always seem to work (or perhaps I just misunderstand the dispatch rules). Here a one argument specialization doesn't work, but a two argument specialization does -- for new classes, but not for a "standard" class like <string>: scheme@(guile-user)> (use-modules (oop goops)) scheme@(guile-user)> (primitive-generic-generic equal?) $1 = #<<generic> equal? (1)> scheme@(guile-user)> (define-class <foo> () (data)) scheme@(guile-user)> (define-method (equal? (x <foo>)) 'x) scheme@(guile-user)> (primitive-generic-generic equal?) $2 = #<<generic> equal? (2)> scheme@(guile-user)> (equal? (make <foo>)) $3 = #t scheme@(guile-user)> (define-method (equal? (x <foo>) (y <foo>)) 'x) $4 = #<<generic> equal? (3)> scheme@(guile-user)> (equal? (make <foo>) (make <foo>)) $5 = x scheme@(guile-user)> (define-method (equal? (x <string>) (y <string>)) 'x) $6 = #<<generic> equal? (4)> scheme@(guile-user)> (equal? "x" "y") $7 = #f Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
X-Loop: help-debbugs@HIDDEN Subject: bug#37461: define-generic doesn't promote equal? to generic Resent-From: Rob Browning <rlb@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Sat, 21 Sep 2019 17:09:01 +0000 Resent-Message-ID: <handler.37461.B37461.15690857077322 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 37461 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: 37461 <at> debbugs.gnu.org Received: via spool by 37461-submit <at> debbugs.gnu.org id=B37461.15690857077322 (code B ref 37461); Sat, 21 Sep 2019 17:09:01 +0000 Received: (at 37461) by debbugs.gnu.org; 21 Sep 2019 17:08:27 +0000 Received: from localhost ([127.0.0.1]:33167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iBiry-0001u2-Jv for submit <at> debbugs.gnu.org; Sat, 21 Sep 2019 13:08:26 -0400 Received: from defaultvalue.org ([45.33.119.55]:47208 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rlb@HIDDEN>) id 1iBirw-0001tr-Eh for 37461 <at> debbugs.gnu.org; Sat, 21 Sep 2019 13:08:25 -0400 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@HIDDEN) by defaultvalue.org (Postfix) with ESMTPSA id AD37220324 for <37461 <at> debbugs.gnu.org>; Sat, 21 Sep 2019 12:08:23 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 2C21D14E068; Sat, 21 Sep 2019 12:08:25 -0500 (CDT) From: Rob Browning <rlb@HIDDEN> In-Reply-To: <87blvfzx1f.fsf@HIDDEN> References: <87lfukz48d.fsf@HIDDEN> <87blvfzx1f.fsf@HIDDEN> Date: Sat, 21 Sep 2019 12:08:25 -0500 Message-ID: <87zhix1ss6.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Rob Browning <rlb@HIDDEN> writes: > A re-export doesn't affect the module using the re-exporter, and export > and replace both fail with "Unbound variable: equal?", even though > there's a (define equal? ...) in the module. Perhaps there was something else going on, but now :replace does appear to work, e.g. if I define a completely new generic and then (define equal? new-equal) a "replace: (equal?)" in the define-module does appear to work when you use the module. Though define-method still ignores attempts to specialize (or change the specialization) for existing types like <string>, etc. (as mentioned in my other message). Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
X-Loop: help-debbugs@HIDDEN Subject: bug#37461: define-generic doesn't promote equal? to generic Resent-From: Mikael Djurfeldt <mikael@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Mon, 23 Sep 2019 15:56:01 +0000 Resent-Message-ID: <handler.37461.B37461.156925410232156 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 37461 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Rob Browning <rlb@HIDDEN> Cc: 37461 <at> debbugs.gnu.org Reply-To: mikael@HIDDEN Received: via spool by 37461-submit <at> debbugs.gnu.org id=B37461.156925410232156 (code B ref 37461); Mon, 23 Sep 2019 15:56:01 +0000 Received: (at 37461) by debbugs.gnu.org; 23 Sep 2019 15:55:02 +0000 Received: from localhost ([127.0.0.1]:36843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iCQfw-0008M8-GU for submit <at> debbugs.gnu.org; Mon, 23 Sep 2019 11:55:02 -0400 Received: from mail-vs1-f42.google.com ([209.85.217.42]:44760) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mdjurfeldt@HIDDEN>) id 1iCPqf-0000qb-JE for 37461 <at> debbugs.gnu.org; Mon, 23 Sep 2019 11:01:58 -0400 Received: by mail-vs1-f42.google.com with SMTP id w195so9603202vsw.11 for <37461 <at> debbugs.gnu.org>; Mon, 23 Sep 2019 08:01:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=4SRQCWs/ptJyjLAxhYcamTLvmv/QxDXeSzIBKL1SmLU=; b=Na274vUP5oLXeL+uwkGituRRyUoDQNC72V9mOGvNpaiVEaF4HQrD3dBFt+qLVACWnt AnoZn6TcwYBCs+zpsc6HN9k2GC1aDPuGsh4x1p6XUsbYJKSMbeiPMUDD2zzqno4vgvI8 Px97APtbUUQkKTQMnjD0BNCd1y+eAnETj0qCIYCmZRV0lo1b0GRQLozhzXdAMWxP7xLi uHTB0VZMBYfegDh0F3+r7GoDW9ifSjdMZQAhK+O5w+oA4138arrVlocdIRsQYdEQnNFv dW7w2XMyXBZxujWEyugUuqIPUjp5RLpslc8KF3vElKTEidefLRCDkEgF2AdtmiGrSiwr KL6g== X-Gm-Message-State: APjAAAV5VwK7OUQc936fIkwGP5KFuJDir/Xz7Hhrk1YBriQmnMSd9MTO LczzbpF+h+uMHs0/0/E/NFrBBzGG/YmQCdnVFtkQtwVq X-Google-Smtp-Source: APXvYqxT0G7RKyEOxQxK3zVXv7KBstEnEOclhlLSpcygJn/Y77XumbrjsVQjG9Xbjmxpim0BJ/YEyGpoCduV2pO+BCs= X-Received: by 2002:a67:6a85:: with SMTP id f127mr10300274vsc.140.1569250911748; Mon, 23 Sep 2019 08:01:51 -0700 (PDT) MIME-Version: 1.0 References: <87lfukz48d.fsf@HIDDEN> <87blvfzx1f.fsf@HIDDEN> <87zhix1ss6.fsf@HIDDEN> In-Reply-To: <87zhix1ss6.fsf@HIDDEN> From: Mikael Djurfeldt <mikael@HIDDEN> Date: Mon, 23 Sep 2019 17:01:40 +0200 Message-ID: <CAA2XvwK_C8UULe4h=DBOHPvHibad=iNCjjOJfeoT_mnO-VSVxA@HIDDEN> Content-Type: multipart/alternative; boundary="0000000000002887ae059339b386" X-Spam-Score: 0.3 (/) X-Mailman-Approved-At: Mon, 23 Sep 2019 11:54:54 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.7 (/) --0000000000002887ae059339b386 Content-Type: text/plain; charset="UTF-8" Hi Rob, I left GOOPS development at Guile version 1.8. The way this was then intended to work was that (define-generic equal?) means that you want to create a new generic equal?. This discards the old binding for equal?. (define-method (equal? (a <string>) (b <string>)) ...) on the other hand, means that you want to *extend* the current behavior of equal? with a specialization to two strings. The method is then added to equal?, which in guile-1.8 was from scratch a "primitive-generic". Here's the actual output of guile-1.8: guile> equal? #<primitive-generic equal?> guile> (use-modules (oop goops)) guile> (define-method (equal? (a <string>) (b <string>)) (string=? a b)) guile> equal? #<primitive-generic equal?> guile> (primitive-generic-generic equal?) #<<generic> equal? (2)> guile> (define-generic equal?) guile> equal? #<<generic> equal? (0)> I don't know if the changes between 1.8 and 2.2.6 is intentional or a bug. Does someone here know? Best regards, Mikael On Sat, Sep 21, 2019 at 7:09 PM Rob Browning <rlb@HIDDEN> wrote: > Rob Browning <rlb@HIDDEN> writes: > > > A re-export doesn't affect the module using the re-exporter, and export > > and replace both fail with "Unbound variable: equal?", even though > > there's a (define equal? ...) in the module. > > Perhaps there was something else going on, but now :replace does appear > to work, e.g. if I define a completely new generic and then > > (define equal? new-equal) > > a "replace: (equal?)" in the define-module does appear to work when you > use the module. > > Though define-method still ignores attempts to specialize (or change the > specialization) for existing types like <string>, etc. (as mentioned in > my other message). > > Thanks > -- > Rob Browning > rlb @defaultvalue.org and @debian.org > GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A > GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4 > > > > --0000000000002887ae059339b386 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hi Rob,</div><div><br></div><div>I left GOOPS develop= ment at Guile version 1.8. The way this was then intended to work was that<= /div><div><br></div><div>=C2=A0 (define-generic equal?)</div><div><br></div= ><div>means that you want to create a new generic equal?. This discards the= old binding for equal?.</div><div><br></div><div>=C2=A0 (define-method (eq= ual? (a <string>) (b <string>)) ...)</div><div><br></div><div>o= n the other hand, means that you want to *extend* the current behavior of e= qual? with a specialization to two strings. The method is then added to equ= al?, which in guile-1.8 was from scratch a "primitive-generic".</= div><div><br></div><div>Here's the actual output of guile-1.8:</div><di= v><br></div><div>guile> equal?<br>#<primitive-generic equal?><br>g= uile> (use-modules (oop goops))<br>guile> (define-method (equal? (a &= lt;string>) (b <string>)) (string=3D? a b))<br>guile> equal?<br= >#<primitive-generic equal?><br>guile> (primitive-generic-generic = equal?)<br>#<<generic> equal? (2)><br>guile> (define-generic= equal?)<br>guile> equal?<br>#<<generic> equal? (0)><br></di= v><div><br></div><div>I don't know if the changes between 1.8 and 2.2.6= is intentional or a bug. Does someone here know?</div><div><br></div><div>= Best regards,</div><div>Mikael<br></div></div><br><div class=3D"gmail_quote= "><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Sep 21, 2019 at 7:09 PM Rob= Browning <<a href=3D"mailto:rlb@HIDDEN">rlb@HIDDEN<= /a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0= px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">R= ob Browning <<a href=3D"mailto:rlb@HIDDEN" target=3D"_blank">r= lb@HIDDEN</a>> writes:<br> <br> > A re-export doesn't affect the module using the re-exporter, and e= xport<br> > and replace both fail with "Unbound variable: equal?", even = though<br> > there's a (define equal?=C2=A0 ...)=C2=A0 in the module.<br> <br> Perhaps there was something else going on, but now :replace does appear<br> to work, e.g. if I define a completely new generic and then<br> <br> =C2=A0 (define equal? new-equal)<br> <br> a "replace: (equal?)" in the define-module does appear to work wh= en you<br> use the module.<br> <br> Though define-method still ignores attempts to specialize (or change the<br= > specialization) for existing types like <string>, etc. (as mentioned = in<br> my other message).<br> <br> Thanks<br> -- <br> Rob Browning<br> rlb @<a href=3D"http://defaultvalue.org" rel=3D"noreferrer" target=3D"_blan= k">defaultvalue.org</a> and @<a href=3D"http://debian.org" rel=3D"noreferre= r" target=3D"_blank">debian.org</a><br> GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A<br> GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4<br> <br> <br> <br> </blockquote></div> --0000000000002887ae059339b386--
X-Loop: help-debbugs@HIDDEN Subject: bug#37461: define-generic doesn't promote equal? to generic Resent-From: Mikael Djurfeldt <mikael@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Sat, 28 Sep 2019 17:19:01 +0000 Resent-Message-ID: <handler.37461.B37461.156969109017530 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 37461 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Rob Browning <rlb@HIDDEN> Cc: Mikael Djurfeldt <mikael@HIDDEN>, 37461 <at> debbugs.gnu.org Reply-To: mikael@HIDDEN Received: via spool by 37461-submit <at> debbugs.gnu.org id=B37461.156969109017530 (code B ref 37461); Sat, 28 Sep 2019 17:19:01 +0000 Received: (at 37461) by debbugs.gnu.org; 28 Sep 2019 17:18:10 +0000 Received: from localhost ([127.0.0.1]:51112 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iEGMD-0004Yg-NL for submit <at> debbugs.gnu.org; Sat, 28 Sep 2019 13:18:10 -0400 Received: from mail-vk1-f182.google.com ([209.85.221.182]:33679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mdjurfeldt@HIDDEN>) id 1iEFww-0003t7-B9 for 37461 <at> debbugs.gnu.org; Sat, 28 Sep 2019 12:52:03 -0400 Received: by mail-vk1-f182.google.com with SMTP id q186so1866976vkb.0 for <37461 <at> debbugs.gnu.org>; Sat, 28 Sep 2019 09:52:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=oNNo48JbeUuT9KaKMZuNusj8fioXQRUOtgGE68k3Qaw=; b=D8B5ZTI/3Il8FLy7vgyoPwLBejrRlzbk1lOdfSDYadTiUDFMHduJ7uTHVvwV/QQNby lc4bh3t9XvHyPHb16cG6MYwv6r/kQ9a1Zfg3EEYqDK7TyVkiXZB3mB0PgA4q1jetxwWr d2z45GHVSI+RdVZD8YHPLuMznJb9E37GAUB03NEcsdZ3BwP0DOo8/Csa9ixDEuPLAtfv AEQXcMyv6BIu1Yzp84w40G+5FEW0LcRRLjUdbdFf3asofvUnlLzgH4Exf86Vad2udVDh nzWNnR0vKTCWIGxrSW7La2OsxyV6Eyl4UkZgD9jVS8zKIeP/v6qAKSCo3KjksOW1z4la 2jkw== X-Gm-Message-State: APjAAAX/2fcrlnBMUaDO7KMHkz6sVj3IuoEM16IbuN8SZ/dtOr28Rm42 UJl1G9fvRi4GrcNJD83+EIsqRW208xfcbySFlxgxzA== X-Google-Smtp-Source: APXvYqzxyJtccjCe4+Lz4Qx0mB/EbnLy2SdQoniuLDwLsUG2NED2uZ/71/JF++66ZhBEOQqVr7GkFImTVzTTxIWF3Xk= X-Received: by 2002:a1f:6244:: with SMTP id w65mr1616712vkb.50.1569689515266; Sat, 28 Sep 2019 09:51:55 -0700 (PDT) MIME-Version: 1.0 References: <87lfukz48d.fsf@HIDDEN> <87blvfzx1f.fsf@HIDDEN> <87zhix1ss6.fsf@HIDDEN> <CAA2XvwK_C8UULe4h=DBOHPvHibad=iNCjjOJfeoT_mnO-VSVxA@HIDDEN> In-Reply-To: <CAA2XvwK_C8UULe4h=DBOHPvHibad=iNCjjOJfeoT_mnO-VSVxA@HIDDEN> From: Mikael Djurfeldt <mikael@HIDDEN> Date: Sat, 28 Sep 2019 18:51:43 +0200 Message-ID: <CAA2XvwJmS5B700nGiSgRN-D1_kk1PwAi_M5HqBmZJ+qvs7Z3OA@HIDDEN> Content-Type: multipart/alternative; boundary="000000000000f7179905939fd1ae" X-Spam-Score: 0.4 (/) X-Mailman-Approved-At: Sat, 28 Sep 2019 13:18:09 -0400 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -0.6 (/) --000000000000f7179905939fd1ae Content-Type: text/plain; charset="UTF-8" On Mon, Sep 23, 2019 at 5:01 PM Mikael Djurfeldt <mikael@HIDDEN> wrote: > > (define-method (equal? (a <string>) (b <string>)) ...) > > on the other hand, means that you want to *extend* the current behavior of > equal? with a specialization to two strings. The method is then added to > equal?, which in guile-1.8 was from scratch a "primitive-generic". > > Actually, this is misguided. I should have examined this problem more carefully, and also read your later emails more carefully. You see, I was under the impression that primitive-generic capability had been removed for equal?. It has not. It's only the printed representation which has changed. Your bug report contains two problems. One concerns why define-generic doesn't create a new generic. I believe this is an intentional or unintentional change at some version. The other problem concerns the dispatch rules for primitive generics. You are right that the dispatch rules are special for primitive generics. The purpose of primitive generics is to get around any performance penalty for standard behavior, so primitive generics first try standard dispatch. Then, if that fails, GOOPS method dispatch is used. The standard behavior of equal? is to simply return #t when applied to a single argument regardless of type. This is the explanation why you get #t for (equal? <foo>). One way to view this is that the dispatch of primitive-generics is partially constrained. --000000000000f7179905939fd1ae Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">On Mon, Sep 23, 2019 at 5:01 PM Mikael Dj= urfeldt <<a href=3D"mailto:mikael@HIDDEN">mikael@HIDDEN</a= >> wrote:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail= _quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204= ,204);padding-left:1ex"><div dir=3D"ltr"><br><div>=C2=A0 (define-method (eq= ual? (a <string>) (b <string>)) ...)</div><div><br></div><div>o= n the other hand, means that you want to *extend* the current behavior of e= qual? with a specialization to two strings. The method is then added to equ= al?, which in guile-1.8 was from scratch a "primitive-generic".</= div><div><br></div></div></blockquote><div>Actually, this is misguided. I s= hould have examined this problem more carefully, and also read your later e= mails more carefully.</div><div><br></div><div>You see, I was under the imp= ression that primitive-generic capability had been removed for equal?. It h= as not. It's only the printed representation which has changed.<br></di= v><div><br></div><div>Your bug report contains two problems. One concerns w= hy define-generic doesn't create a new generic. I believe this is an in= tentional or unintentional change at some version. The other problem concer= ns the dispatch rules for primitive generics.<br></div><div><br></div><div>= You are right that the dispatch rules are special for primitive generics. T= he purpose of primitive generics is to get around any performance penalty f= or standard behavior, so primitive generics first try standard dispatch. Th= en, if that fails, GOOPS method dispatch is used. The standard behavior of = equal? is to simply return #t when applied to a single argument regardless = of type. This is the explanation why you get #t for (equal? <foo>).</= div><div><br></div><div>One way to view this is that the dispatch of primit= ive-generics is partially constrained.<br></div></div></div> --000000000000f7179905939fd1ae--
X-Loop: help-debbugs@HIDDEN Subject: bug#37461: define-generic doesn't promote equal? to generic Resent-From: Rob Browning <rlb@HIDDEN> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> Resent-CC: bug-guile@HIDDEN Resent-Date: Sat, 28 Sep 2019 17:32:02 +0000 Resent-Message-ID: <handler.37461.B37461.156969188518885 <at> debbugs.gnu.org> Resent-Sender: help-debbugs@HIDDEN X-GNU-PR-Message: followup 37461 X-GNU-PR-Package: guile X-GNU-PR-Keywords: To: Mikael Djurfeldt <mikael@HIDDEN> Cc: Mikael Djurfeldt <mikael@HIDDEN>, 37461 <at> debbugs.gnu.org Received: via spool by 37461-submit <at> debbugs.gnu.org id=B37461.156969188518885 (code B ref 37461); Sat, 28 Sep 2019 17:32:02 +0000 Received: (at 37461) by debbugs.gnu.org; 28 Sep 2019 17:31:25 +0000 Received: from localhost ([127.0.0.1]:51123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1iEGZ3-0004uW-Gh for submit <at> debbugs.gnu.org; Sat, 28 Sep 2019 13:31:25 -0400 Received: from defaultvalue.org ([45.33.119.55]:46712 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <rlb@HIDDEN>) id 1iEGZ1-0004uN-8n for 37461 <at> debbugs.gnu.org; Sat, 28 Sep 2019 13:31:23 -0400 Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@HIDDEN) by defaultvalue.org (Postfix) with ESMTPSA id 6FCE12038E; Sat, 28 Sep 2019 12:31:22 -0500 (CDT) Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 2684714E068; Sat, 28 Sep 2019 12:31:24 -0500 (CDT) From: Rob Browning <rlb@HIDDEN> In-Reply-To: <CAA2XvwJmS5B700nGiSgRN-D1_kk1PwAi_M5HqBmZJ+qvs7Z3OA@HIDDEN> References: <87lfukz48d.fsf@HIDDEN> <87blvfzx1f.fsf@HIDDEN> <87zhix1ss6.fsf@HIDDEN> <CAA2XvwK_C8UULe4h=DBOHPvHibad=iNCjjOJfeoT_mnO-VSVxA@HIDDEN> <CAA2XvwJmS5B700nGiSgRN-D1_kk1PwAi_M5HqBmZJ+qvs7Z3OA@HIDDEN> Date: Sat, 28 Sep 2019 12:31:24 -0500 Message-ID: <87sgognx8z.fsf@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org> X-Spam-Score: -1.0 (-) Mikael Djurfeldt <mikael@HIDDEN> writes: > You see, I was under the impression that primitive-generic capability had > been removed for equal?. It has not. It's only the printed representation > which has changed. Ahh, right -- that confused me at first too. > One way to view this is that the dispatch of primitive-generics is > partially constrained. Understood -- It'd be nice if the expectations were documented a bit more clearly. I'd be happy to propose something, assuming we can determine what's appropriate, i.e. what Guile really intends to promise. It sounds like: - This might need adjustment: 8.6.2 Extending Primitives -------------------------- Many of Guile's primitive procedures can be extended by giving them a generic function definition that operates in conjunction with their normal C-coded implementation. When a primitive is extended in this way, it behaves like a generic function with the C-coded implementation as its default method. In particular, it sounds like the C-coded implementation actually takes precedence; it doesn't act like a normal default method. I suppose in practice, unless the behavior of the primitive-generic is very well specified, it might be best to avoid specializations for anything other than new types (that you're responsible for). Otherwise future changes might fairly mysteriously break things. - We're unsure whether define-generic is intended to do anything to a primitive generic, but if we can figure that out, I can adjust the define-generic documentation: -- syntax: define-generic symbol Create a generic function with name SYMBOL and bind it to the variable SYMBOL. If SYMBOL was previously bound to a Scheme procedure (or procedure-with-setter), the old procedure (and setter) is incorporated into the new generic function as its default procedure (and setter). Any other previous value, including an existing generic function, is discarded and replaced by a new, empty generic function. and might also mention the issue in the define-method docs. Thanks -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.