bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#15691: ,br doesn't work for generic functions


From: Ian Price
Subject: bug#15691: ,br doesn't work for generic functions
Date: Thu, 24 Oct 2013 05:53:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Jordy Dickinson <address@hidden> 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"

Attachment: 0001-Fix-trap-handlers-to-handle-applicable-structs.patch
Description: ,br fix


reply via email to

[Prev in Thread] Current Thread [Next in Thread]