[Top][All Lists]

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

Re: setting a buffer's namespace

From: Jose A. Ortega Ruiz
Subject: Re: setting a buffer's namespace
Date: Mon, 18 Nov 2019 19:46:19 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Hi James,

On Sun, Nov 17 2019, James Mckernon wrote:

> I'm writing a racket module in a certain file. I would like to be able
> to test and eval the definitions in this module with some
> interactively-evaluated code, a bit like one would in the repl, but
> with code saved in another file, so I don't have to type it out each
> time.
> In the repl this works because one can set the repl's namespace. Is it
> possible to set a file buffer to eval its statements in another
> module's namespace, or for two file buffers to share a namespace? (And
> if it isn't possible, how hard would it be to hack into geiser?)

Hmm, no, there's no way of doing that currently.

> Of course, using 'require' to load the definitions from the module
> file makes them available in my testing file, but this only loads them
> the first time. I would like to be able to load the module, test the
> files, tinker with the definitions, re-test, re-tinker, etc. This
> workflow doesn't work that well if I have to restart the racket
> process every time I want to redefine something.

The "normal" workflow to do that is to just have two files/buffers, one
with the module, the other, as you say, requiring it.  And then you
re-evaluate things in the module's buffer first (with C-c C-k, C-c C-e,
etc.), and those redefinitions should be visible in the other buffer
without restarting racket.

There is a budding morrow in midnight. -John Keats, poet (1795-1821)

reply via email to

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