[Openmcl-devel] Equivalent of process-initial-bindings in ACL?

Gary Byers gb at clozure.com
Sat Apr 12 19:22:09 PDT 2003



On Sat, 12 Apr 2003, Ram Krishnan wrote:

> Hello,
>
> 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))))
   (process-run-function "example"
                         #'(lambda ()
                             (progv (mapcar #'car bindings-alist)
                                    (mapcar #'cdr bindings-alist)
                               (format t "~&in new thread, *a* = ~s, *b* = ~s"
                                     *a* *b*)))))

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
something like:

(let* ((bindings-alist (compute-bindings-alist)))
 ...)

or

(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.

>
> Thanks.
>
> -ram
>
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel
>
>


_______________________________________________
Openmcl-devel mailing list
Openmcl-devel at clozure.com
http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list