guile-user
[Top][All Lists]
Advanced

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

Re: Guile top-level functions


From: Neil Jerram
Subject: Re: Guile top-level functions
Date: Wed, 19 Jan 2005 21:39:40 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5

Kevin Ryde wrote:

Actually I was thinking of something like

        (define callback noop)
        ...
        (set! callback (lambda () (display 'hello)))
        ...
        (callback)

when the callback is made you'd like to know where that anonymous
procedure came from.

Well:

guile> (source-properties (caddr (procedure-source callback)))
((breakpoint . #f) (line . 1) (column . 26) (filename . "standard input"))

But this assumes that the first form in the body is a pair (or more generally, if tweaked, that the body contains _some_ pair), and I agree that if would be nicer for the result of (procedure-source ...) to have the source properties directly.

        Neil




reply via email to

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