This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Kawa-1.9.90 available
On 08/10/2009 11:54 AM, Dan Stanger wrote:
That is usable, as long as a set-procedure-property! call is used to set
the function name.
Using the name: property also works, as in the example below.
I fixed the define implementation so it obeys --no-inline better,
and updated the documentation:
-- Syntax: trace procedure
Cause PROCEDURE to be "traced", that is debugging output will be
written to the standard error port every time PROCEDURE is called,
with the parameters and return value.
Note that Kawa will normally assume that a procedure defined with
the procedure-defining variant of `define' is constant, and so it
might be inlined:
(define (ff x) (list x x))
(trace ff) ;; probably won't work
(ff 3) ;; not traced
It works if you specify the `--no-inline' flag to Kawa.
Alternatively, you can use the variable-defining variant of
`define':
#|kawa:1|# (define ff (lambda (x) name: 'ff (list x x)))
#|kawa:2|# (trace ff) ;; works
#|kawa:3|# (ff 3)
call to ff (3)
return from ff => (3 3)
(3 3)
Note the use of the `name:' procedure property to give the
anonymous `lambda' a name.
--
--Per Bothner
per@bothner.com http://per.bothner.com/