all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Thread return value
@ 2023-11-05  8:57 Manuel Giraud via Emacs development discussions.
  2023-11-05  9:07 ` Helmut Eller
  2023-11-05  9:48 ` Eli Zaretskii
  0 siblings, 2 replies; 5+ messages in thread
From: Manuel Giraud via Emacs development discussions. @ 2023-11-05  8:57 UTC (permalink / raw)
  To: emacs-devel

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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-11-05 10:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-05  8:57 Thread return value Manuel Giraud via Emacs development discussions.
2023-11-05  9:07 ` Helmut Eller
2023-11-05 10:07   ` Manuel Giraud via Emacs development discussions.
2023-11-05 10:13     ` Manuel Giraud via Emacs development discussions.
2023-11-05  9:48 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.