emacs-devel
[Top][All Lists]
Advanced

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

Thread return value


From: Manuel Giraud
Subject: Thread return value
Date: Sun, 05 Nov 2023 09:57:40 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

Hi,

Is there a way to retrieve an Emacs thread's implicit return value?  In
the simple example below, it would be to get the boolean value computed
by the thread 'my-flip' after its death:

--8<---------------cut here---------------start------------->8---
(defun coin ()
  (evenp (random 100)))

(setq my-flip (make-thread #'coin))
--8<---------------cut here---------------end--------------->8---

I don't need a solution where I can 'setq' a global variable into
'coin'.  Consider that 'coin' is immutable (or written by someone else
for other purpose).

If this is not currently possible, do you think it would be a hard thing
to do in "thread.el" or "thread.c"?

Best regards,
-- 
Manuel Giraud



reply via email to

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