[plt-scheme] source location info for procedures

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Nov 11 11:54:23 EST 2002

At Mon, 4 Nov 2002 04:26:04 -0500 (EST), Doug Orleans wrote:
> For example:
> 
>   > (object-name (lambda () 0))
>   |STDIN::305|
> 
> Is there a way to get the source location (file name, line number,
> etc) directly from the procedure object, regardless of whether there
> is an inferred name?  

No. It's not in the procedure at all right now.

> If not, is there an easier way to make this info
> available than wrapping lambda with a macro that stores the info in a
> hash table somewhere?

You can do slightly better than using a hash table by using structs
that act like procedures.

Here's an example where the motivation was to get procedure bodies
(instead of srcloc info), but it's the same idea:

 http://list.cs.brown.edu/pipermail/plt-scheme/2002-September/000683.html

Matthew



Posted on the users mailing list.