guile-user
[Top][All Lists]
Advanced

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

Re: emacs+guile


From: Per Bothner
Subject: Re: emacs+guile
Date: Tue, 03 Jan 2006 10:01:43 -0800
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)

Mikael Djurfeldt wrote:
However, concerning moving from Elisp to Scheme, there is one usage
pattern in Elisp code which I think does not yet have any good
counterpart on the Scheme side:

Emacs behavior is to a large extent controlled by the state of a set
of global and buffer-local variables. Elisp code often uses dynamic
binding to temporarily change some state, such as:

 (let ((case-fold-search nil)))
    (string-match ...))

Possibly one could indeed use fluids if enough convenient helper
syntax, such as some variant of fluid-let, is provided. Personally,
I've been playing with the thought of storing state, such as
case-fold-search, in some kind of objects representing context in
similarity to how GWM (The Generic Window Manager) handles properties
of X windows. Also in this case, there is a need of helper syntax. The
advantage would be that one could avoid dynamic binding and have a
somewhat better modularization and abstraction of states.

Fluid-let or SRFI-39 "parameter objects" seems to work pretty well.
Kawa provides both: a "fluid variable" is loosely a named alias
for a parameter object.  However, there are some complications if
you want to support multiple threads (or futures) and have bindings
be inherited from a parent thread to a child thread.
See http://www.gnu.org/software/kawa/Parameter-objects.html
--
        --Per Bothner
address@hidden   http://per.bothner.com/




reply via email to

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