GNU bug report logs - #15691
,br doesn't work for generic functions

Previous Next

Package: guile;

Reported by: Jordy Dickinson <jordy.dickinson <at> gmail.com>

Date: Wed, 23 Oct 2013 06:08:01 UTC

Severity: normal

Done: Ian Price <ianprice90 <at> googlemail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 15691 in the body.
You can then email your comments to 15691 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#15691; Package guile. (Wed, 23 Oct 2013 06:08:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jordy Dickinson <jordy.dickinson <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Wed, 23 Oct 2013 06:08:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jordy Dickinson <jordy.dickinson <at> gmail.com>
To: bug-guile <at> gnu.org
Subject: ,br doesn't work for generic functions
Date: Wed, 23 Oct 2013 01:51:25 -0400
# 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.




Information forwarded to bug-guile <at> gnu.org:
bug#15691; Package guile. (Thu, 24 Oct 2013 04:54:02 GMT) Full text and rfc822 format available.

Message #8 received at 15691 <at> debbugs.gnu.org (full text, mbox):

From: Ian Price <ianprice90 <at> googlemail.com>
To: Jordy Dickinson <jordy.dickinson <at> gmail.com>
Cc: 15691 <at> debbugs.gnu.org
Subject: Re: bug#15691: ,br doesn't work for generic functions
Date: Thu, 24 Oct 2013 05:53:12 +0100
[Message part 1 (text/plain, inline)]
Jordy Dickinson <jordy.dickinson <at> gmail.com> 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 <some-generic>). 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"

[0001-Fix-trap-handlers-to-handle-applicable-structs.patch (#("text/x-patch", inline)]

Information forwarded to bug-guile <at> gnu.org:
bug#15691; Package guile. (Thu, 24 Oct 2013 05:01:02 GMT) Full text and rfc822 format available.

Message #11 received at 15691 <at> debbugs.gnu.org (full text, mbox):

From: Ian Price <ianprice90 <at> googlemail.com>
To: Jordy Dickinson <jordy.dickinson <at> gmail.com>
Cc: 15691 <at> debbugs.gnu.org
Subject: Re: bug#15691: ,br doesn't work for generic functions
Date: Thu, 24 Oct 2013 05:59:51 +0100
Ian Price <ianprice90 <at> googlemail.com> 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"




Reply sent to Ian Price <ianprice90 <at> googlemail.com>:
You have taken responsibility. (Thu, 09 Jan 2014 04:08:01 GMT) Full text and rfc822 format available.

Notification sent to Jordy Dickinson <jordy.dickinson <at> gmail.com>:
bug acknowledged by developer. (Thu, 09 Jan 2014 04:08:02 GMT) Full text and rfc822 format available.

Message #16 received at 15691-done <at> debbugs.gnu.org (full text, mbox):

From: Ian Price <ianprice90 <at> googlemail.com>
To: Jordy Dickinson <jordy.dickinson <at> gmail.com>
Cc: 15691-done <at> debbugs.gnu.org
Subject: Re: bug#15691: ,br doesn't work for generic functions
Date: Thu, 09 Jan 2014 04:07:39 +0000
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"




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 06 Feb 2014 12:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.