Skip to content

Instantly share code, notes, and snippets.

@Munksgaard
Created April 27, 2011 16:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Munksgaard/944546 to your computer and use it in GitHub Desktop.
Save Munksgaard/944546 to your computer and use it in GitHub Desktop.
(require :bordeaux-threads)
(defparameter *tmp* 40)
(defun threadfun ()
(format t "*tmp*: ~A~%" *tmp*))
(defun bob ()
(let* ((bordeaux-threads:*default-special-bindings*
(acons '*tmp* 42
bordeaux-threads:*default-special-bindings*)))
(bordeaux-threads:make-thread #'threadfun)))
@Munksgaard
Copy link
Author

This is my output:

$ sbcl --load "test.lisp"
This is SBCL 1.0.45.0.debian, an implementation of ANSI Common Lisp.
More information about SBCL is available at http://www.sbcl.org/.

SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.

  • (bob)
    tmp:
    tmp:
    40
    #<SB-THREAD:THREAD FINISHED values: NIL {B1E09E9}>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment