emacs-devel
[Top][All Lists]
Advanced

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

Re: continuation passing in Emacs vs. JUST-THIS-ONE


From: miha
Subject: Re: continuation passing in Emacs vs. JUST-THIS-ONE
Date: Thu, 16 Mar 2023 22:35:57 +0100

There's also the issue that using continuation passing (async-io)
doesn't auto-magically solve the re-entrancy issues.

Consider the following hypothetical command, written using JS-style
async/await operators:

(async-defun insert-some-parent-dirs ()
  (interactive)
  (insert (await (locate-dominating-file default-directory "go.mod")))
  (insert "\n")
  (insert (await (locate-dominating-file default-directory "go.work"))))

If the user executed such a command multiple times in quick succession,
the executions could happen in parallel and would trample over each
other.

For each use of "await", the programmer has to think about the
possibility of other code running "in-between". This style of
programming may be harder in Elisp which has a lot of global state in
form of buffer contents, markers and overlays.

Attachment: signature.asc
Description: PGP signature


reply via email to

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