Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-18 Thread Matthew Flatt
At Thu, 14 Jul 2016 19:07:50 -0400, Alex Knauth wrote: > > > On Jul 14, 2016, at 5:11 PM, Matthew Flatt wrote: > > > > At Thu, 14 Jul 2016 16:01:52 -0400, Alex Knauth wrote: > >> Ok, by using `syntax-debug-info` I was able to get somewhere. However, I > want > >> to make the variables I'm putt

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-14 Thread mattapiroglu
> I've noticed that if it can refer to a module-level immutable variable, > `eval` seems to know that it's immutable. So is there any way to define a new > variable as immutable in a namespace? > I believe box-immutable isn't what you're looking for, or would be too obvious an answer? (eval

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-14 Thread Alex Knauth
> On Jul 14, 2016, at 5:11 PM, Matthew Flatt wrote: > > At Thu, 14 Jul 2016 16:01:52 -0400, Alex Knauth wrote: >> Ok, by using `syntax-debug-info` I was able to get somewhere. However, I >> want >> to make the variables I'm putting into the namespace all immutable. For that >> I >> thought I

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-14 Thread Matthew Flatt
At Thu, 14 Jul 2016 16:01:52 -0400, Alex Knauth wrote: > Ok, by using `syntax-debug-info` I was able to get somewhere. However, I want > to make the variables I'm putting into the namespace all immutable. For that > I > thought I could use `define-syntax` within `eval`, but `define-syntax` > ap

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-14 Thread Alex Knauth
Ok, by using `syntax-debug-info` I was able to get somewhere. However, I want to make the variables I'm putting into the namespace all immutable. For that I thought I could use `define-syntax` within `eval`, but `define-syntax` appears to not have any effect: #lang racket/base (require (for-syn

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
> On Jul 13, 2016, at 7:46 PM, Robby Findler > wrote: > > I don't think that either of the options I suggested require you to do that. > > The debugger works as a post-expansion process that rewrites the > program. A language could use a similar approach, but work only for > the files in that

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Robby Findler
I don't think that either of the options I suggested require you to do that. The debugger works as a post-expansion process that rewrites the program. A language could use a similar approach, but work only for the files in that language. Robby On Wed, Jul 13, 2016 at 6:32 PM, Alex Knauth wrote:

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
> On Jul 13, 2016, at 7:25 PM, Robby Findler > wrote: > > You could define a language. Or you could do what DrRacket's debugger is > doing? > > Robby That would would if I was willing to re-define every possible binding form that could ever be used. But then if I import something like `matc

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Robby Findler
You could define a language. Or you could do what DrRacket's debugger is doing? Robby On Wed, Jul 13, 2016 at 2:33 PM, Alex Knauth wrote: > >> On Jul 13, 2016, at 3:28 PM, Matthew Flatt wrote: >> >> At Wed, 13 Jul 2016 14:16:11 -0400, Alex Knauth wrote: >>> >>> Thanks. So defining it as a funct

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
> On Jul 13, 2016, at 3:28 PM, Matthew Flatt wrote: > > At Wed, 13 Jul 2016 14:16:11 -0400, Alex Knauth wrote: >> >> Thanks. So defining it as a function won't work. But if I define it as a >> macro, can I get more information out of it? > > Instead of > > (define (f x y) > ;; x and y are

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Matthew Flatt
At Wed, 13 Jul 2016 14:16:11 -0400, Alex Knauth wrote: > > > On Jul 13, 2016, at 11:22 AM, Matthew Flatt wrote: > > > > At Wed, 13 Jul 2016 11:10:30 -0400, Alex Knauth wrote: > >> Ok. Is there a way to set up a namespace that would have those local > >> variables? Would a `(#%variable-reference

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
> On Jul 13, 2016, at 11:22 AM, Matthew Flatt wrote: > > At Wed, 13 Jul 2016 11:10:30 -0400, Alex Knauth wrote: >> Ok. Is there a way to set up a namespace that would have those local >> variables? Would a `(#%variable-reference)` help here? Or is there a way to >> get all of the identifiers f

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Matthew Flatt
At Wed, 13 Jul 2016 11:10:30 -0400, Alex Knauth wrote: > Ok. Is there a way to set up a namespace that would have those local > variables? Would a `(#%variable-reference)` help here? Or is there a way to > get all of the identifiers from the lexical context of a syntax object? No, there's no wa

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-13 Thread Alex Knauth
> On Sun, Jul 10, 2016 at 8:29 PM, Alex Knauth wrote: >> I'm doing a weird thing. I'm trying to use the lexical information from a >> `(quote-syntax here #:local)` syntax object to access local variables. It >> can distinguish between bound and unbound identifiers, because it raises >> normal

Re: [racket-users] identifier-out-of-context when trying to make a debug-repl

2016-07-10 Thread Robby Findler
I don't think those variables are in the namespace that eval is using. Robby On Sun, Jul 10, 2016 at 8:29 PM, Alex Knauth wrote: > I'm doing a weird thing. I'm trying to use the lexical information from a > `(quote-syntax here #:local)` syntax object to access local variables. It can > distin