> On Jan 11, 2017, at 8:53 PM, Robby Findler <ro...@eecs.northwestern.edu> > wrote: > > That might work. It might be easier to just stick in some `let`s, tho. > I'm not sure of the best way to do it (but you'll find it once you try > out a few), but the general approach of putting the macro system to > work seems like the right approach.
What do you mean by that? What do I stick `let`s around? I don't think I could do it by overriding current-eval, because I want definitions to work in the debug-repl. So what did you mean? Alex Knauth > Robby > > On Wed, Jan 11, 2017 at 6:15 PM, Alex Knauth <alexan...@knauth.org> wrote: >> >>> On Jan 11, 2017, at 6:50 PM, Robby Findler <ro...@eecs.northwestern.edu> >>> wrote: >>> >>> Change how local variables compile at the prompt that's inside the >>> debug repl? You should have the complete set of them, I think. Compile >>> them into looking into a table other than the namespace. >> >> Do you mean redefining #%top to look it up? >> >>> Robby >>> >>> >>> On Wed, Jan 11, 2017 at 5:41 PM, Alex Knauth <alexan...@knauth.org> wrote: >>>> Hello, >>>> >>>> I want to shadow instead of mutate. >>>> >>>> The ideal solution would be to create a new environment that extends the >>>> old >>>> one, so that new definitions in the new environment shadow the old >>>> definitions instead of mutating them. >>>> >>>> But if that isn't feasible with the way namespaces work right now, is there >>>> a way to copy a namespace so that mutating the copy doesn't mutate the >>>> original? If there isn't, is there a way to functionally update a namespace >>>> to add new definitions? >>>> >>>> I need this for my debug-repl package so I avoid mangling the namespace in >>>> examples like this: >>>> >>>>> (define x 1) >>>>> x >>>> 1 ; outside the debug-repl, x is 1 >>>>> (define (f x) (debug-repl)) >>>>> (f 2) >>>> -> x >>>> 2 ; inside the debug-repl, x is 2 >>>> -> ; exit the debug-repl >>>>> x >>>> 2 ; x should be 1, but it mangled the namespace >>>> >>>> Is there a way to do this without mangling the original namespace? >>>> >>>> Alex Knauth >>>> >>>> -- >>>> You received this message because you are subscribed to the Google Groups >>>> "Racket Users" group. >>>> To unsubscribe from this group and stop receiving emails from it, send an >>>> email to racket-users+unsubscr...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >> -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.