This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How do thread locations get updated?


Try using set! instead of define. define is probably creating a new
binding that shadows gnu.text.PrettyWriter:lineLengthLoc.
fluid-let will work, too, if you don't want the change to be
permanent:

#|kawa:1|# (gnu.text.PrettyWriter:lineLengthLoc:get #!null)
#!null
#|kawa:2|# *print-right-margin*
#!null
#|kawa:3|# (set! *print-right-margin* 20)
#|kawa:4|# *print-right-margin*
20
#|kawa:5|# (gnu.text.PrettyWriter:lineLengthLoc:get #!null)
20
#|kawa:6|# (fluid-let ((*print-right-margin* 10)) (gnu.text.PrettyWriter:lineLengthLoc:get #!null))
10
#|kawa:7|# (gnu.text.PrettyWriter:lineLengthLoc:get #!null)
20



-Jamie


On Sep 29, 2011, at 7:04 PM, Charles Turner wrote:

Hi,
I'm trying to see a dynamic change in some of the ThreadLocation's
defined in PrettyWriter.
As an example, lineLengthLoc seems to always be null. It's "Scheme
name", if it's sensible to call it that, is *print-right-margin*.
Which is setup in Scheme using,

defAliasStFld("*print-right-margin*", "gnu.text.PrettyWriter", "lineLengthLoc");

I expect that having evaluated (define *print-right-margin* 20) in the
REPL, lineLengthLoc.get(null) would return 20, and not null again.

What am I missing?

Thanks,
Charles.

-- Jamison Hope The PTR Group www.theptrgroup.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]