From: Matthias Koeppe <mkoeppe@mail.Math.Uni-Magdeburg.De>
Cc: guile-devel@gnu.org
Subject: Emacs variables (was: Bug in eval-string?)
Date: Tue, 27 Aug 2002 16:18:12 +0200 [thread overview]
Message-ID: <uw51y8kjsgr.fsf_-_@saturn.math.uni-magdeburg.de> (raw)
In-Reply-To: <878z30t3mz.fsf@zagadka.ping.de> (Marius Vollmer's message of "21 Aug 2002 21:26:12 +0200")
Marius Vollmer <mvo@zagadka.ping.de> writes:
>[abstract part of the discussion snipped]
>
> Matthias Koeppe <mkoeppe@mail.Math.Uni-Magdeburg.De> writes:
>> The only reason why I would be interested in a Guile-based
>> implementation of Emacs is the hope for a clean, thread-safe Lisp
>> engine, which would allow for a multi-threaded Emacs. We can't reach
>> this goal if we copy all the inherently single-threaded stuff
>> (swapping in and out values, as with FLUID-LET) from the Emacs Lisp
>> engine into Guile.
>
> I still don't see how fluid-let ruins multi-threaded applications.
> The current buffer needs to be thread-local, but code like
>
> (fluid-let ((case-fold-search #f))
> ...)
>
> would still need to be used.
This example illustrates the problem with FLUID-LET, in fact. From
the syntactic variations you gave below I deduce that you want to
translate the common Emacs Lisp construction
(let ((case-fold-search nil))
...CODE...)
to a FLUID-LET that temporarily sets the buffer-local value of the
variable CASE-FOLD-SEARCH to false.
But in a multi-threaded Emacs I want to have the possibility of having
a user-interaction thread, where I (the user) can set CASE-FOLD-SEARCH
in a buffer to some value I like, and some other thread that scans the
same buffer (for instance, for creating an index) using
CASE-FOLD-SEARCH = nil. Of course the other thread cannot temporarily
set the buffer-local value of CASE-FOLD-SEARCH to its liking, because
this would disturb the user interaction. This means that FLUID-LET
cannot be used here, unless you stored the buffer-local value of a
variable in fluids.
However, in other cases a thread _wants_ to make a mutation of a
buffer-local variable. Therefore, we cannot simply store all
buffer-local values in fluids.
The point is that Emacs Lisp's dynamically-binding LET binds a
_symbol_ to a fresh _location_ in its dynamic environment. This is
semantically very different from a value-swapping FLUID-LET (in a
multithreaded environment), no matter to which generalized location
FLUID-LET is applied. This is not simply about the "exposition of
Emacs variables to Scheme". It's about the implementation of dynamic
scoping in a multithreaded environment.
The dynamic environment, of course, is thread-local, so it can be
implemented in Guile with a fluid. See my pseudocode in my previous
message.
Regards,
--
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-08-27 14:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-08 12:56 Bug in eval-string? rm
2002-08-08 21:03 ` Marius Vollmer
2002-08-09 9:06 ` Matthias Koeppe
2002-08-09 9:19 ` Marius Vollmer
2002-08-09 10:24 ` Matthias Koeppe
2002-08-10 14:18 ` Marius Vollmer
2002-08-12 18:20 ` Matthias Koeppe
2002-08-13 0:39 ` Marius Vollmer
2002-08-14 19:07 ` Marius Vollmer
2002-08-17 11:09 ` Neil Jerram
2002-08-20 11:39 ` Matthias Koeppe
2002-08-21 19:26 ` Marius Vollmer
2002-08-27 14:18 ` Matthias Koeppe [this message]
2002-08-31 13:51 ` Emacs variables (was: Bug in eval-string?) Marius Vollmer
2002-08-08 21:27 ` Bug in eval-string? Neil Jerram
2002-08-09 9:35 ` rm
2002-08-10 14:43 ` Marius Vollmer
2002-08-12 10:49 ` rm
2002-08-13 20:55 ` Marius Vollmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=uw51y8kjsgr.fsf_-_@saturn.math.uni-magdeburg.de \
--to=mkoeppe@mail.math.uni-magdeburg.de \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).