[Top][All Lists]

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

Re: [RFC] Adding threads to Eshell

From: Jim Porter
Subject: Re: [RFC] Adding threads to Eshell
Date: Fri, 16 Dec 2022 21:19:18 -0800

On 12/16/2022 7:40 PM, Stefan Monnier wrote:
I suppose I mean *local* bindings, really.

I must admit that I don't know what is "a local binding".

I guess just let-bindings (and anything else that works like 'let'). Maybe the manual section on threads should be updated, since "local variable bindings" *could* mean buffer-local variables, but I think it's *supposed* to mean let-bindings. (Threads have their own current buffer, so I'd expect that buffer-local bindings take effect for the thread's current buffer as usual. I haven't actually tried it out though.)

For dynamically scoped vars, then you'll need to do something like what
the `lml-closure` does, but that shouldn't be hard.

To preserve the existing behavior, I think all we'd need is to copy any let-bindings for dynamically-scoped vars. Eshell already ignores statically-scoped bindings (though changing that would present some interesting possibilities...)

The only bit I'm still unsure about is if there's a good (and performant)
way to ask, "What are all the local bindings of dynamic variables?" Then,

We could potentially add such a thing (except for the "performant" part,
but I think it would be fast enough anyway), but there isn't one, no,
and it's not very easy to add one (e.g. because some of the currently
active dynamic bindings can be local to specific buffers).

Well, hopefully it wouldn't cost too much performance, or else we'd probably want to have users opt into it. But we can cross that bridge later. The lml-closure example you posted gave me enough to get a somewhat-clumsy solution working for the regression tests at least, so I can keep hacking away.

reply via email to

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