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:16 AM, Dan Stanger wrote:
On 5/27 I sent out:
Hello All,
The following expressions produce a trace in 1.9.1:
#|kawa:1|# (define (x a) (display a))
#|kawa:2|# (trace x)
#|kawa:3|# (x 1)
call to x (1)
return from x =>
1
#|kawa:4|#
However the same expressions using the current svn do not:
#|kawa:1|# (define (x a) (display a))
#|kawa:2|# (trace x)
#|kawa:3|# (x 1)
1
#|kawa:4|#
Is there a configure switch to enable tracing?
This is compiled with JDK 1.6.0.
Trace is awkward - it is a run-time function, so it can't
modify static/lexical bindings - and Kawa is all about
doing as much at compile-time as we can.
There is a --no-inline flag which probably should do what
you want - but doesn't. That would perhaps be looked into.
However, there is one relatively simple work-around
that works - use the variable-definition syntax for
of define, rather than the function-definition form:
(define x (lambda (a) (display a)))
Kawa treats these forms differently - the syntax
(define (x a) (display a)) has the extra effect of
declaring x to be constant, which means calls to x
may be bound/optimized so the trace doesn't work.
--
--Per Bothner
per@bothner.com http://per.bothner.com/