From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Matthias Koeppe Newsgroups: gmane.lisp.guile.devel Subject: Emacs variables (was: Bug in eval-string?) Date: Tue, 27 Aug 2002 16:18:12 +0200 Sender: guile-devel-admin@gnu.org Message-ID: References: <20020808125641.GA23831@www> <878z3hukoz.fsf@zagadka.ping.de> <87adnwpey3.fsf@zagadka.ping.de> <873ctm7q6r.fsf@zagadka.ping.de> <87n0rrmw1j.fsf@zagadka.ping.de> <878z30t3mz.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: main.gmane.org 1030457892 2974 127.0.0.1 (27 Aug 2002 14:18:12 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 27 Aug 2002 14:18:12 +0000 (UTC) Cc: guile-devel@gnu.org Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17jhAY-0000lW-00 for ; Tue, 27 Aug 2002 16:18:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jhBn-0001SV-00; Tue, 27 Aug 2002 10:19:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17jhAl-0001Ef-00 for guile-devel@gnu.org; Tue, 27 Aug 2002 10:18:23 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17jhAd-0001Cq-00 for guile-devel@gnu.org; Tue, 27 Aug 2002 10:18:22 -0400 Original-Received: from saturn.math.uni-magdeburg.de ([141.44.75.38]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17jhAc-0001CU-00 for guile-devel@gnu.org; Tue, 27 Aug 2002 10:18:14 -0400 Original-Received: from beta.math.uni-magdeburg.de (beta [141.44.75.78]) by saturn.math.uni-magdeburg.de (8.11.6/8.11.6) with ESMTP id g7REICX27988; Tue, 27 Aug 2002 16:18:12 +0200 (MET DST) Original-Received: (from mkoeppe@localhost) by beta.math.uni-magdeburg.de (8.10.2+Sun/8.10.2) id g7REIC207811; Tue, 27 Aug 2002 16:18:12 +0200 (MEST) X-Authentication-Warning: beta.math.uni-magdeburg.de: mkoeppe set sender to mkoeppe@mail.math.uni-magdeburg.de using -f Original-To: Marius Vollmer In-Reply-To: <878z30t3mz.fsf@zagadka.ping.de> (Marius Vollmer's message of "21 Aug 2002 21:26:12 +0200") Original-Lines: 60 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1.80 (sparc-sun-solaris2.7) Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1167 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1167 Marius Vollmer writes: >[abstract part of the discussion snipped] > > Matthias Koeppe 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.=20=20 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))=20 ...CODE...) to a FLUID-LET that temporarily sets the buffer-local value of the variable CASE-FOLD-SEARCH to false.=20=20 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 =3D 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, --=20 Matthias K=F6ppe -- http://www.math.uni-magdeburg.de/~mkoeppe _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel