[plt-scheme] source location info for procedures

From: Doug Orleans (dougo at ccs.neu.edu)
Date: Mon Nov 4 04:26:04 EST 2002

The "object-name" primitive in MzScheme accesses the inferred name of a
procedure; according to the manual,

  When an inferred name is not available, but a source location is
  available, a name is constructed using the source location

For example:

  > (object-name (lambda () 0))

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?  I know it's available in the syntax object, but
is it still accessible after the syntax object has been evaluated into
a procedure?  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?

--dougo at ccs.neu.edu

Posted on the users mailing list.