Re: Emacs Lisp and Guile

>>>>> "RMS" == Richard Stallman <address@hidden> writes:
RMS> How and why? Things like buffer-local variables are concepts broken
RMS> in principle in Emacs Lisp. Moving to Scheme is a chance to correct
RMS> these historic mistakes.
RMS> We seem to have very basic disagreements. It is not likely I would
RMS> agree with recommendations that you make on this issue.
Is it possible to have a discussion on this?
RMS> Check out R5RS. For example, at:
RMS>
http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_idx_576
RMS> I will try to send email to fetch this.
I've included the text verbatim.

procedure: (dynamic-wind before thunk after)
Calls thunk without arguments, returning the result(s) of this
call. Before and after are called, also without arguments, as required
by the following rules (note that in the absence of calls to
continuations captured using call-with-current-continuation the three
arguments are called once each, in order). Before is called whenever
execution enters the dynamic extent of the call to thunk and after is
called whenever it exits that dynamic extent. The dynamic extent of a
procedure call is the period between when the call is initiated and
when it returns. In Scheme, because of call-with-current-continuation,
the dynamic extent of a call may not be a single, connected time
period. It is defined as follows:
* The dynamic extent is entered when execution of the body of the
called procedure begins.
* The dynamic extent is also entered when execution is not within
the dynamic extent and a continuation is invoked that was
captured (using call-with-current-continuation) during the
dynamic extent.
* It is exited when the called procedure returns.
* It is also exited when execution is within the dynamic extent and a
continuation is invoked that was captured while not within the
dynamic extent.
If a second call to dynamic-wind occurs within the dynamic extent of
the call to thunk and then a continuation is invoked in such a way
that the afters from these two invocations of dynamic-wind are both to
be called, then the after associated with the second (inner) call to
dynamic-wind is called first.
If a second call to dynamic-wind occurs within the dynamic extent of
the call to thunk and then a continuation is invoked in such a way
that the befores from these two invocations of dynamic-wind are both
to be called, then the before associated with the first (outer) call
to dynamic-wind is called first.
If invoking a continuation requires calling the before from one call
to dynamic-wind and the after from another, then the after is called
first.
The effect of using a captured continuation to enter or exit the
dynamic extent of a call to before or after is undefined.
(let ((path '())
(c #f))
(let ((add (lambda (s)
(set! path (cons s path)))))
(dynamic-wind
(lambda () (add 'connect))
(lambda ()
(add (call-with-current-continuation
(lambda (c0)
(set! c c0)
'talk1))))
(lambda () (add 'disconnect)))
(if (< (length path) 4)
(c 'talk2)
(reverse path))))
===> (connect talk1 disconnect
connect talk2 disconnect)