From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.bugs Subject: bug#37461: define-generic doesn't promote equal? to generic Date: Sat, 28 Sep 2019 12:31:24 -0500 Message-ID: <87sgognx8z.fsf@trouble.defaultvalue.org> References: <87lfukz48d.fsf@trouble.defaultvalue.org> <87blvfzx1f.fsf@trouble.defaultvalue.org> <87zhix1ss6.fsf@trouble.defaultvalue.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="100054"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37461@debbugs.gnu.org To: Mikael Djurfeldt Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Sep 28 19:32:13 2019 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iEGZn-000PuK-G1 for guile-bugs@m.gmane.org; Sat, 28 Sep 2019 19:32:11 +0200 Original-Received: from localhost ([::1]:34046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEGZl-0006wd-M0 for guile-bugs@m.gmane.org; Sat, 28 Sep 2019 13:32:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37950) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iEGZf-0006wK-Q5 for bug-guile@gnu.org; Sat, 28 Sep 2019 13:32:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iEGZe-0001W0-Mt for bug-guile@gnu.org; Sat, 28 Sep 2019 13:32:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42302) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iEGZe-0001VU-JG for bug-guile@gnu.org; Sat, 28 Sep 2019 13:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iEGZe-0004vQ-BW for bug-guile@gnu.org; Sat, 28 Sep 2019 13:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rob Browning Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sat, 28 Sep 2019 17:32:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37461 X-GNU-PR-Package: guile Original-Received: via spool by 37461-submit@debbugs.gnu.org id=B37461.156969188518885 (code B ref 37461); Sat, 28 Sep 2019 17:32:02 +0000 Original-Received: (at 37461) by debbugs.gnu.org; 28 Sep 2019 17:31:25 +0000 Original-Received: from localhost ([127.0.0.1]:51123 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEGZ3-0004uW-Gh for submit@debbugs.gnu.org; Sat, 28 Sep 2019 13:31:25 -0400 Original-Received: from defaultvalue.org ([45.33.119.55]:46712 ident=postfix) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iEGZ1-0004uN-8n for 37461@debbugs.gnu.org; Sat, 28 Sep 2019 13:31:23 -0400 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id 6FCE12038E; Sat, 28 Sep 2019 12:31:22 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 2684714E068; Sat, 28 Sep 2019 12:31:24 -0500 (CDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9436 Archived-At: Mikael Djurfeldt 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