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 <laurent.ors...@gmail.com> 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.

Reply via email to