This is the mail archive of the
mailing list for the Kawa project.
Re: trying to migrate to 1.6.60
- To: Per Bothner <per at bothner dot com>
- Subject: Re: trying to migrate to 1.6.60
- From: "Walter C. Pelissero" <wcp at demon dot db dot de>
- Date: Tue, 5 Oct 1999 10:31:17 +0200 (W. Europe Daylight Time)
- Cc: kawa at sourceware dot cygnus dot com
- References: <firstname.lastname@example.org><email@example.com><firstname.lastname@example.org><email@example.com>
- Reply-To: wcp at pop dot systemy dot it
[ I CC-ed to the mailing list because I belive it might be of public
I tried to extend a little bit your sample code but for instance this
(%trace-variable (location var)))))
(define (%trace-variable loc)
((primitive-virtual-method <gnu.mapping.Binding> "setConstraint"
loc (object (<gnu.mapping.Constraint>)
((get (binding <gnu.mapping.Binding>))
(display "get method")
((primitive-get-field <gnu.mapping.Binding> "value" <object>)
((set (binding <gnu.mapping.Binding>)
(display "set method")
((primitive-set-field <gnu.mapping.Binding> "value"
((isBound (binding <gnu.mapping.Binding>))
(display "isBound method")
unless you declare value public (inside Binding class).
I guess I'm missing something.
Per Bothner writes:
> "Walter C. Pelissero" <firstname.lastname@example.org> writes:
> > Unfortunately I based a poor-men tracing package on this. The new
> > Kawa, as far as I know, doesn't offer anything even close to it.
> let-syntax may be useful, as it allows you to define a macro (perhaps
> named set!) while still having access to the old definition. However,
> it only does this syntactically in a local scope.
> If you want to trace a / some variables, then I think a better
> approach is to use the Binding / Constraint framework in gnu.mapping.
> It should be possible to define a Syntax
> (trace-variable var)
> which replaces the `constraint' field of the variable `var' with a
> Constraint that has the side-effect of printing out trace information.
> I would try:
> (define-syntax trace-variable (syntax-rules ()
> ((trace-variable var)
> (%trace-variable (location var)))))
> (define (%trace-variable loc)
> ((primitive-virtual-method <gnu.mapping.Binding> "setConstraint"
> <void> (<gnu.mapping.Constraint>))
> loc (object (<gnu.mapping.Constraint>) ....)))
> The .... is up to you.
> Let me know if you get this working and useful. May be I'll add
> something like this to standard Kawa.
> --Per Bothner
> email@example.com firstname.lastname@example.org http://www.bothner.com/~per/