This is the mail archive of the kawa@sources.redhat.com 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]

implemented srfi-39: parameter objects


I checked into CVS an implementation of SRFI-39 "parameter
objects".  In Kawa threads inherit bindings (as in Gambit-C),
the way fluid variables have also worked.

Basically a parameter object is an "anonymous fluid variable".
In fact you can do:

(define param (make-parameter))
(define-alias var (param))

Then:
  (fluid-let ((var val)) body)
and
  (parameterize ((param val)) body)
are equivalent.   (At least that's how it's supposed to be!)

This was done as part of a re-vamping of fluid variables to
work more robustly (if a bit less efficiently) in the
presense of multiple threads/futures.

Another reason for parameter objects is to control various
options such as for printing.  Common Lisp has dynamic variables
like *print-pretty* but hard-wiring in Common Lisp variable
names into language-independent libraries would be wrong.  Instead,
we create a parameter object (speaking loosely), and define a
language-specific variable such as *print-pretty* to be an
alias for the parameter object.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


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