bugGuile - Bugs: bug #30469, `procedure-source' is broken in...

 
 

bug #30469: `procedure-source' is broken in Guile 1.9.11

Submitter:  Patrick McCarty <pnorcks>
Submitted:  Sun 18 Jul 2010 12:02:52 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 13 Feb 2011 07:05:02 PM UTC, comment #3: 

Sorry it took so long to get back to you.  Use `procedure-arguments' from (ice-9 session).  See its docstring for more details.

I'll leave this bug open until we decide to do something else with procedure-source...

Andy Wingo <wingo>
Group administrator
Fri 23 Jul 2010 04:46:20 PM UTC, comment #2: 

I discovered this while debugging a compile failure with LilyPond...

LilyPond's autogenerated documentation of its internal procedures uses `procedure-source' to access the signature of a given procedure.

Would you recommend a different solution for this?

Patrick McCarty <pnorcks>
Mon 19 Jul 2010 07:22:29 PM UTC, comment #1: 

It's not possible in general to get the source of a procedure, as variables introduced by macros may have the same name but not be the same variables (they have different identities/marks/gensyms, depending on how you look at it). In addition the output of macro expansion may have free variables referenced with regard to different modules.

That said, it is a bug that when debugging you can't get to the expressions, and I do plan to fix that soonish. What do you use procedure-source for?

Andy

Andy Wingo <wingo>
Group administrator
Sun 18 Jul 2010 12:02:52 AM UTC, original submission:  

Hello,

I am testing the latest git, and I think I've found a regression (compared to 1.8.7).  For a valid procedure definition, Guile returns `#f' for `procedure-source':

  scheme@(guile-user)> (define (test a) (+ a 1))
  scheme@(guile-user)> (procedure-source test)
  $1 = #f
  scheme@(guile-user)>

The same procedure in Guile 1.8.7 returns valid info:

  guile> (define (test a) (+ a 1))
  guile> (procedure-source test)
  (lambda (a) (+ a 1))
  guile>

Patrick McCarty <pnorcks>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wingo (Posted a comment)
  • -email is unavailable- added by pnorcks (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-54b4.
    Corresponding source code