From unknown Sat Jun 21 03:06:18 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15691 <15691@debbugs.gnu.org> To: bug#15691 <15691@debbugs.gnu.org> Subject: Status: ,br doesn't work for generic functions Reply-To: bug#15691 <15691@debbugs.gnu.org> Date: Sat, 21 Jun 2025 10:06:18 +0000 retitle 15691 ,br doesn't work for generic functions reassign 15691 guile submitter 15691 Jordy Dickinson severity 15691 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 23 02:07:21 2013 Received: (at submit) by debbugs.gnu.org; 23 Oct 2013 06:07:21 +0000 Received: from localhost ([127.0.0.1]:36727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VYrbE-0001R2-6B for submit@debbugs.gnu.org; Wed, 23 Oct 2013 02:07:21 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58769) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VYrM0-0000xs-6i for submit@debbugs.gnu.org; Wed, 23 Oct 2013 01:51:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYrLt-0002mz-N8 for submit@debbugs.gnu.org; Wed, 23 Oct 2013 01:51:30 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:35257) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYrLt-0002mu-Jy for submit@debbugs.gnu.org; Wed, 23 Oct 2013 01:51:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYrLs-0006me-KF for bug-guile@gnu.org; Wed, 23 Oct 2013 01:51:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VYrLr-0002lf-6K for bug-guile@gnu.org; Wed, 23 Oct 2013 01:51:28 -0400 Received: from mail-ob0-x234.google.com ([2607:f8b0:4003:c01::234]:47520) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VYrLr-0002l4-1W for bug-guile@gnu.org; Wed, 23 Oct 2013 01:51:27 -0400 Received: by mail-ob0-f180.google.com with SMTP id wo20so333230obc.11 for ; Tue, 22 Oct 2013 22:51:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=3Tv8oxdoukaNQBz+5SB2+ecSwigtVgj97ONNLweBGkI=; b=StDBi+2vX+CWmdYprIsHY+E4efBMS4CtrocXeyhuc6RdXa5fW8mXfM9d2RO4Ym9IaY 8aKTgDllj5LKm2PS0DW+zbxGxMJwLra18FQQCOLHXH5Na1Z6yseiTzaZHv83teyABuTM thW7ANmog+Mv915h4dhgxGUZAaF3MGgPL3XIKSxGy7lNSXiEE3Tq1qTsYRKJlBEckoI8 PheLR5hTJcWX2XXHZ+gNpL3l7zh74ujxNRjgQp7AGRhbR0nLQfEw2sSXvrOgB0r7Hia4 wLmpWHw4C3fu5fmLdwEMqOB9kZcMkxGVcXES2LcSWmFg+qXh1/8xbLdmb6SfpxB0hx5P YOQQ== MIME-Version: 1.0 X-Received: by 10.182.125.65 with SMTP id mo1mr10867969obb.40.1382507485764; Tue, 22 Oct 2013 22:51:25 -0700 (PDT) Received: by 10.76.141.169 with HTTP; Tue, 22 Oct 2013 22:51:25 -0700 (PDT) Date: Wed, 23 Oct 2013 01:51:25 -0400 Message-ID: Subject: ,br doesn't work for generic functions From: Jordy Dickinson To: bug-guile@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Wed, 23 Oct 2013 02:07:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -4.0 (----) # What I did: I used ,br with a generic function, specifically I entered ",br initialize". # What I expected: I wasn't sure what to expect, given that generic functions can have many implementations, but since there was no error and a "generic" object appeared in the output of ",traps", I expected at least that when _some_ initialize method was called I would be put into a debugging prompt. # What actually happened: When I called a function that called the initialize method ("make" in this particular case), it completed successfully, without any debug prompt. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 24 00:53:26 2013 Received: (at 15691) by debbugs.gnu.org; 24 Oct 2013 04:53:26 +0000 Received: from localhost ([127.0.0.1]:39842 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZCvF-0006d5-3C for submit@debbugs.gnu.org; Thu, 24 Oct 2013 00:53:25 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:58150) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZCvB-0006co-FD for 15691@debbugs.gnu.org; Thu, 24 Oct 2013 00:53:22 -0400 Received: by mail-wi0-f179.google.com with SMTP id hm4so1929123wib.0 for <15691@debbugs.gnu.org>; Wed, 23 Oct 2013 21:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=Fgiyz2O43myY5bN5+inhlz9ETr9dZSbI6bM1RQ8oRiQ=; b=LH5ZlQsO+HLkG/1DLouLkwcBfmZNhONu0rQyEcdAZJ81aFXXGZHQxW00XCePb0jP6H 1Fte9CSMzBBAQODGiowCdwvwfQb8BCMfraXBybPx9TUPFzU0L0DaFXYlhkkz75OCqmAT KqS6f1AaBcMR0yNmfy5F0ntOcG+w8v6f+0oNxfyF0LeaasV/wOjsMkknHAUR1jA8dVu+ /4exp3PVqpjAc3fidY3/Zt2mhTH3Jwf3Po3CNKhK37WgCbRxCMB1ztJzyQSYa7n7sHva c/lbRrQV+lM6rNbG15UtHvcfueviXk3mY2KuisPZ72+8OZgWWZS+mHKqicqOlWM4vM7B vmow== X-Received: by 10.180.210.231 with SMTP id mx7mr375494wic.5.1382590395609; Wed, 23 Oct 2013 21:53:15 -0700 (PDT) Received: from Kagami.home (host86-132-92-201.range86-132.btcentralplus.com. [86.132.92.201]) by mx.google.com with ESMTPSA id ey4sm23404183wic.11.2013.10.23.21.53.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 23 Oct 2013 21:53:14 -0700 (PDT) From: Ian Price To: Jordy Dickinson Subject: Re: bug#15691: ,br doesn't work for generic functions References: Date: Thu, 24 Oct 2013 05:53:12 +0100 In-Reply-To: (Jordy Dickinson's message of "Wed, 23 Oct 2013 01:51:25 -0400") Message-ID: <877gd3xoav.fsf@Kagami.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 15691 Cc: 15691@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.4 (/) --=-=-= Content-Type: text/plain Jordy Dickinson writes: > # What I expected: > > I wasn't sure what to expect, given that generic functions can have > many implementations, but since there was no error and a "generic" > object appeared in the output of ",traps", I expected at least that > when _some_ initialize method was called I would be put into a > debugging prompt. Indeed, there are two reasonable behaviours here. 1. We stop before method specialisation in the "top level" of the function returned by (procedure ). This is the behaviour I would expect for an arbitrary applicable struct. 2. We stop after method specialisation. This requires goops specific hackery, but is probably more helpful if we could pull it off. > > # What actually happened: > > When I called a function that called the initialize method ("make" in > this particular case), it completed successfully, without any debug > prompt. The reason this happens is that in the procedure `frame-matcher' in (system vm traps), it tests for the equivalence of the procedure passed in, with the procedure in the frame with eq?. In the first instance, the procedure is an applicable struct, the latter however is the function returned by (procedure that-applicable-struct). We could either fix this a bit further up the stack, by making sure that we extract the procedure from applicable structs, we could extract it in `frame-matcher'. I think `frame-matcher' is the right place to fix this, rather than further up the stack. Various procedures in (system vm traps) are documented as taking a procedure, which IMO should include applicable structs. I've attached a patch which handles this, implementing behaviour (1) above. -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" --=-=-= Content-Type: #("text/x-patch" 2 3 (face ido-hacks-flex-match) 7 8 (face ido-hacks-flex-match) 8 9 (face ido-hacks-flex-match) 9 10 (face ido-hacks-flex-match) 10 11 (face ido-hacks-flex-match)) Content-Disposition: inline; filename=0001-Fix-trap-handlers-to-handle-applicable-structs.patch Content-Transfer-Encoding: 8bit Content-Description: ,br fix >From 3a117b22b10c9577868fd22f88d1cad2e2ec32a0 Mon Sep 17 00:00:00 2001 From: Ian Price Date: Thu, 24 Oct 2013 05:51:47 +0100 Subject: [PATCH] Fix trap handlers to handle applicable structs. Reported by Jordy Dickinson . Fixes . * module/system/vm/traps.scm (frame-matcher): Extract procedure when proc is an applicable struct. --- module/system/vm/traps.scm | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/module/system/vm/traps.scm b/module/system/vm/traps.scm index cccd6ea..b65e034 100644 --- a/module/system/vm/traps.scm +++ b/module/system/vm/traps.scm @@ -109,15 +109,18 @@ ((new-disabled-trap vm enable disable) frame)) (define (frame-matcher proc match-objcode?) - (if match-objcode? - (lambda (frame) - (let ((frame-proc (frame-procedure frame))) - (or (eq? frame-proc proc) - (and (program? frame-proc) - (eq? (program-objcode frame-proc) - (program-objcode proc)))))) - (lambda (frame) - (eq? (frame-procedure frame) proc)))) + (let ((proc (if (struct? proc) + (procedure proc) + proc))) + (if match-objcode? + (lambda (frame) + (let ((frame-proc (frame-procedure frame))) + (or (eq? frame-proc proc) + (and (program? frame-proc) + (eq? (program-objcode frame-proc) + (program-objcode proc)))))) + (lambda (frame) + (eq? (frame-procedure frame) proc))))) ;; A basic trap, fires when a procedure is called. ;; -- 1.7.11.7 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 24 01:00:06 2013 Received: (at 15691) by debbugs.gnu.org; 24 Oct 2013 05:00:06 +0000 Received: from localhost ([127.0.0.1]:39854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZD1g-0006ne-Hy for submit@debbugs.gnu.org; Thu, 24 Oct 2013 01:00:05 -0400 Received: from mail-wg0-f48.google.com ([74.125.82.48]:56538) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VZD1c-0006mT-Pq for 15691@debbugs.gnu.org; Thu, 24 Oct 2013 01:00:01 -0400 Received: by mail-wg0-f48.google.com with SMTP id b13so1775210wgh.27 for <15691@debbugs.gnu.org>; Wed, 23 Oct 2013 21:59:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=RK/miPq4AxweB5RQNn3W85UYCg9nIJGAqJZhu+J/6aA=; b=Q4XlQhFL2gMRPZ+r6YqZMolPbT4lPPvUP9aO8OX2VLKrRDsXfNorDmRWRVqMydFzOZ KDUKSy15njFzC98WI1Cl0dEe1czaGLIsMZ5XJq7b13Ke9P/p0CofQEzOfq5YhkqZ1pgg D7yYW3wrgPAMqD6Or836zdzMn+BibinvZu31DW9I5wfNs7FxkfY9oQ27PdSE6zeFndJH IAJFNo/IB8lKf1o5uFLZ4ynTjq/9Ee4D2BBE5n0GrcGvzB5LQ4wK1ocvEeQ7Ww5CF16A kY9yHOXHpl4rkp4utpMqf1LChIe6bLnYlpXgId2lG6Zh1AORmp1+qrazok0DeC02H1jF opxg== X-Received: by 10.194.119.132 with SMTP id ku4mr295866wjb.51.1382590794809; Wed, 23 Oct 2013 21:59:54 -0700 (PDT) Received: from Kagami.home (host86-132-92-201.range86-132.btcentralplus.com. [86.132.92.201]) by mx.google.com with ESMTPSA id q3sm23155860wib.5.2013.10.23.21.59.53 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 23 Oct 2013 21:59:53 -0700 (PDT) From: Ian Price To: Jordy Dickinson Subject: Re: bug#15691: ,br doesn't work for generic functions References: <877gd3xoav.fsf@Kagami.home> Date: Thu, 24 Oct 2013 05:59:51 +0100 In-Reply-To: <877gd3xoav.fsf@Kagami.home> (Ian Price's message of "Thu, 24 Oct 2013 05:53:12 +0100") Message-ID: <87zjpzw9fc.fsf@Kagami.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 15691 Cc: 15691@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.4 (/) Ian Price writes: > We could either fix this a bit further up the stack, by making sure that > we extract the procedure from applicable structs, we could extract it > in `frame-matcher'. It did not occur to me before I sent it, but there is one other reasonable behaviour, which would be to store the applicable struct as the frame procedure. This might actually be preferable to the fix I posted, but it will hacking in C. -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 08 23:07:49 2014 Received: (at 15691-done) by debbugs.gnu.org; 9 Jan 2014 04:07:49 +0000 Received: from localhost ([127.0.0.1]:43386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W16uK-0003PV-Tt for submit@debbugs.gnu.org; Wed, 08 Jan 2014 23:07:49 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:43638) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W16uI-0003PL-Vi for 15691-done@debbugs.gnu.org; Wed, 08 Jan 2014 23:07:47 -0500 Received: by mail-wi0-f177.google.com with SMTP id cc10so2956703wib.16 for <15691-done@debbugs.gnu.org>; Wed, 08 Jan 2014 20:07:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=QNgdyzd2hvC+0hIV3BDTz/+jzGdhRqKrAs4E32m4Gr4=; b=hZfqfqpijCOoZl1emomQ/ogoTMUrr1x2+tGac0bNn/87dUH0eHjsFwbalLczTt4coZ i31mmEpJkZFvuzjF+BOqDoSTQ7uMB+RaDV+grHN8FtWqq+rOfRtlDdhuVSqh/X3AFCyW AmJIdDMXzJ0efvQGVFokdThxo8pQFo3NGRJ5GI9Bz9XhEzhIMYy8EA9+AXa0Ctl6d+03 IGEVYcnxYHOG7l5Cglzzim8Ept2tlBhyuiZVRN7VIl52jl/DSktP0A1BovsZi37W8HuL 9AWYwXj5VPJihNhy1swtSpeACmaK7C6CKnH6P7ansDd5PebYMKTUtsy0Q2f86XP6F3oe WwSA== X-Received: by 10.194.161.136 with SMTP id xs8mr683229wjb.56.1389240465882; Wed, 08 Jan 2014 20:07:45 -0800 (PST) Received: from Kagami.home (host86-184-83-158.range86-184.btcentralplus.com. [86.184.83.158]) by mx.google.com with ESMTPSA id j9sm489682wjx.18.2014.01.08.20.07.43 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 08 Jan 2014 20:07:44 -0800 (PST) From: Ian Price To: Jordy Dickinson Subject: Re: bug#15691: ,br doesn't work for generic functions References: <877gd3xoav.fsf@Kagami.home> <87zjpzw9fc.fsf@Kagami.home> Date: Thu, 09 Jan 2014 04:07:39 +0000 In-Reply-To: <87zjpzw9fc.fsf@Kagami.home> (Ian Price's message of "Thu, 24 Oct 2013 05:59:51 +0100") Message-ID: <878uupbxx0.fsf@Kagami.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.4 (/) X-Debbugs-Envelope-To: 15691-done Cc: 15691-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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: -0.4 (/) I pushed the patch from the 24 of October (commit 3981feaa11aa0d866ff1d99128f0ace3). It's not perfect, but I'm marking this one done. Sorry it took a while. -- Ian Price -- shift-reset.com "Programming is like pinball. The reward for doing it well is the opportunity to do it again" - from "The Wizardy Compiled" From unknown Sat Jun 21 03:06:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 06 Feb 2014 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator