[Larceny-users] procedure introspection

William D Clinger will at ccs.neu.edu
Fri Mar 13 10:33:39 EDT 2009


jao wrote:
> in particular, if the interface for
> 'operations on procedures' described in
> 
> <http://larceny.ccs.neu.edu/doc/user-manual.html#id2542921>
> 
> were functional, i'd have much of what i need. alas, those procedures
> seem to be not (yet?) implemented.

Those operations are implemented, but the first five
(make-procedure, procedure-length, procedure-ref,
procedure-set!, and procedure-copy) are deprecated
because they are useful only to compiler writers and
system implementors.

The operations beginning with procedure-arity are
implemented minimally; the only ones that are likely
to return useful information (as opposed to #f) are
procedure-arity and procedure-name, and even the
procedure-name procedure returns #f more often than
you'd like.

The procedure-expression procedure will work if you
incant (include-source-code #t) to change that
compiler switch, but it exposes some confusing
renaming of keywords, and that compiler switch is
automatically turned off when compiling files (to
keep the compiled files from becoming much larger).

> so my question: are there plans to
> provide them in a future version of larceny? is it just a 'simple matter
> of programming' what's needed or, on the contrary, major changes in
> larceny's inner workings are needed to make them real?

It is indeed a simple matter of programming.  The
current development system is already capable of
recording source code positions, and the compiled
code and the compiler's intermediate representations
already contain documentation slots where that info
should go.

I'll try to get this into the next release (v0.97),
but if not it should certainly be improved in v0.98.

Will



More information about the Larceny-users mailing list