[Openmcl-devel] Equivalent of process-initial-bindings in ACL?
gb at clozure.com
Sat Apr 12 22:22:09 EDT 2003
On Sat, 12 Apr 2003, Ram Krishnan wrote:
> Is there something equivalent to Allegro CL's process-initial-bindings
> in OpenMCL?
There actually is in 0.14 (for which documentation is being written,
even as we speak. Honest.)
> I'm trying to figure out a way to have a thread inherit some dynamic
> bindings (mostly the standard i/o streams) from its parent thread (i.e.
> the thread from which the new thread is forked). Unfortunately, this
> seems to be something that isn't covered by the somewhat standard MP
> package interface.
There are a handful of cases in which the CL special operator PROGV
is useful, and this is one of them. One way to do this is:
(let* ((bindings-alist '((*a* . 1) (*b* . 2))))
(progv (mapcar #'car bindings-alist)
(mapcar #'cdr bindings-alist)
(format t "~&in new thread, *a* = ~s, *b* = ~s"
That's not a very compelling example, because the values (and the set of
symbols to bind) are constants. If we replaced the constant alist with
(let* ((bindings-alist (compute-bindings-alist)))
(let* ((bindings-alist (compute-bindings-for '(*a* *b))))
it might start to look like a useful mechanism.
> Any pointers would be greatly appreciated.
Hope this makes sense.
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
Openmcl-devel mailing list
Openmcl-devel at clozure.com
More information about the Openmcl-devel