Re: sb-thread:make-thread sets thread's package to CL-USER
Stas Boukarev <[email protected]>
| Newsgroups | gmane.lisp.steel-bank.general |
|---|---|
| Message-ID | <CAF63=12XNjQs3ZB+KjGBTD0MhZ_axbuYB=h_xrCB5XOLSZGd1A@mail.gmail.com> |
It doesn't set anything, it just doesn't retain your binding of *pacakge* at the time of calling make-thread. On Wed, Jun 12, 2024 at 11:37 PM Raimondas K. <[email protected]> wrote: > I don't see this explicitly documented either way, > but it looks that, empirically, the *package* inside the > newly created thread is set to COMMON-LISP-USER. > > To demonstrate > (defpackage :my (:use :cl)) > (in-package :my) > > (defun test () > (format *standard-output* "in TEST thread: package ~a~%" *package*)) > > (format *standard-output* "in MAIN thread: package ~a~%" *package*) > > (sb-thread:make-thread #'test > :arguments '() > :name "test") > > SBCL 2.3.2 prints out > in MAIN thread: package #<PACKAGE "MY"> > in TEST thread: package #<PACKAGE "COMMON-LISP-USER"> > > Not sure if this is how it is supposed to work; I find this > behaviour counterintuitive, c/w for instance, with (load "file"). > > =R. > > > _______________________________________________ > Sbcl-help mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/sbcl-help > _______________________________________________ Sbcl-help mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sbcl-help