help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Thread and closure


From: Manuel Giraud
Subject: Thread and closure
Date: Thu, 04 May 2023 14:02:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi,

Is it possible in Emacs to have lisp threads to works with closures?
With the following example, 'M-x closure' displays a message but 'M-x
threaded-closure' does not:

--8<---------------cut here---------------start------------->8---
(defun closure ()
  (interactive)
  (let ((my-message "Hello world"))
    (funcall #'(lambda ()
                 (message "%s" my-message)))))

(defun threaded-closure ()
  (interactive)
  (let ((my-message "Hello world"))
    (make-thread #'(lambda ()
                     (message "%s" my-message)))))
--8<---------------cut here---------------end--------------->8---

Best regards,
-- 
Manuel Giraud



reply via email to

[Prev in Thread] Current Thread [Next in Thread]