Re: [racket-users] namespace-anchor->namespace and eval

2017-10-05 Thread Laurent
Ah so that was actually a bug then :) Thanks for fix!

On Thu, Oct 5, 2017 at 5:47 PM, Matthew Flatt  wrote:

> I've pushed a repair for this problem. It's a bug in the current
> expander that could be triggered by a just-right combination of
> `syntax-local-lift-expression` (as used by `new`) and `expand` (as used
> by errortrace, which is used by DrRacket).
>
> At Sun, 1 Oct 2017 16:05:16 +0100, Laurent wrote:
> > Hi,
> >
> > Does anyone know a good explanation as to why the following code works
> > depending on whether the apparently-useless line is commented out?
> >
> > #lang racket
> >
> > #;(new object%) ; uncommenting this raises an error
> >
> > (define-namespace-anchor nsa)
> > (define ns (namespace-anchor->namespace nsa))
> > (eval '(new object%) ns)
> >
> > The error is:
> > lifted.0.0: undefined;
> >  cannot reference an identifier before its definition
> > with syntax location on the eval line
> >
> > Thanks!
> >
> > --
> > 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.
>

-- 
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.


Re: [racket-users] namespace-anchor->namespace and eval

2017-10-05 Thread Matthew Flatt
I've pushed a repair for this problem. It's a bug in the current
expander that could be triggered by a just-right combination of
`syntax-local-lift-expression` (as used by `new`) and `expand` (as used
by errortrace, which is used by DrRacket).

At Sun, 1 Oct 2017 16:05:16 +0100, Laurent wrote:
> Hi,
> 
> Does anyone know a good explanation as to why the following code works
> depending on whether the apparently-useless line is commented out?
> 
> #lang racket
> 
> #;(new object%) ; uncommenting this raises an error
> 
> (define-namespace-anchor nsa)
> (define ns (namespace-anchor->namespace nsa))
> (eval '(new object%) ns)
> 
> The error is:
> lifted.0.0: undefined;
>  cannot reference an identifier before its definition
> with syntax location on the eval line
> 
> Thanks!
> 
> -- 
> 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.


Re: [racket-users] namespace-anchor->namespace and eval

2017-10-01 Thread Philip McGrath
I have no explanation, but I can get a longer version of the error message.
If you change the definitions to:

#lang racket

(new object%)

(define-namespace-anchor nsa)
(define ns (namespace-anchor->namespace nsa))

And then evaluate at the REPL:

> (eval '(new object%) ns)

You get this error message:

../../Applications/Racket
v6.10/collects/racket/private/class-internal.rkt:3313:7: lifted.0.0:
undefined;
 cannot reference an identifier before its definition

-Philip

On Sun, Oct 1, 2017 at 10:05 AM, Laurent  wrote:

> Hi,
>
> Does anyone know a good explanation as to why the following code works
> depending on whether the apparently-useless line is commented out?
>
> #lang racket
>
> #;(new object%) ; uncommenting this raises an error
>
> (define-namespace-anchor nsa)
> (define ns (namespace-anchor->namespace nsa))
> (eval '(new object%) ns)
>
> The error is:
> lifted.0.0: undefined;
>  cannot reference an identifier before its definition
> with syntax location on the eval line
>
> Thanks!
>
>
>
> --
> 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.