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 [EMAIL PROTECTED] http://per.bothner.com/ _______________________________________________ Guile-user mailing list [email protected] http://lists.gnu.org/mailman/listinfo/guile-user
