GNU bug report logs - #24887
procedure-sources not working

Previous Next

Package: guile;

Reported by: Jean Louis <bugs <at> gnu.support>

Date: Sat, 5 Nov 2016 22:03:01 UTC

Severity: normal

Full log


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

From: Jean Louis <bugs <at> gnu.support>
To: Andy Wingo <wingo <at> pobox.com>
Cc: guile-devel <at> gnu.org, 24887 <at> debbugs.gnu.org, Jean Louis <bugs <at> gnu.support>
Subject: Re: bug#24887: procedure-sources not working
Date: Wed, 1 Mar 2017 17:43:36 +0300
On Wed, Mar 01, 2017 at 03:09:06PM +0100, Andy Wingo wrote:
> On Sat 05 Nov 2016 23:01, Jean Louis <bugs <at> gnu.support> writes:
> 
> > Sadly, the procedure-source is not working. This would be very useful
> > for programming.
> >
> > Jean
> >
> > scheme@(guile-user) [50]> (define (dosomething text) (write text))
> > scheme@(guile-user) [50]> (dosomething "Hello")
> > "Hello"scheme@(guile-user) [50]> (procedure-source dosomething )
> > $93 = #f
> > scheme@(guile-user) [50]> 
> 
> Sadly I think I am going to WONTFIX this one :/
> 
> The reason is complicated.  First of all, a procedure's source only
> makes sense within an environment: in a module and in a lexical
> context, and you're not guaranteed to be able to reconstruct either of
> those.  Also a procedure's source is expressed in some dialect via
> macros; what should the source be for even this simple example?  Should
> it be:

Thank you. I am not an advanced user of Guile. And that
procedure-source, I can compare to (SYMBOL-PLIST 'FUNCTION) in Lisp,
as I am also using CLISP.

If I have a function defined, such as RED, then I can see the source
of the function in CLISP:

(symbol-plist 'red)
(SYSTEM::DEFINITION ((DEFUN RED (FILE) (ED FILE) (LOAD FILE)) . #(NIL NIL NIL NIL ((DECLARATION OPTIMIZE DECLARATION)))) SYSTEM::DOC
 (SYSTEM::FILE ((SYSTEM::DEFUN/DEFMACRO
 #P"/home/data1/protected/.clisprc.lisp" 53 53))))

And I was simply expecting the PROCEDURE-SOURCE in Guile to behave in
similar fashion.

From documentation:

-- Scheme Procedure: procedure-source proc
 -- C Function: scm_procedure_source (proc)
     Return the source of the procedure PROC.  Returns ‘#f’ if the
     source code is not available.

So that is what I am expecting according to documentation. As I am not
developer of Guile, rather user and student, I cannot go into details,
if it should be there or not.

It is simply there and is not functioning, so it is expected to
function. Or you propose the removal, I don't mind.

Jean Louis




This bug report was last modified 8 years and 107 days ago.

Previous Next


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