[racket] confusing error message: what is "lang:read.1"?

From: Spencer Florence (florence at northwestern.edu)
Date: Wed Aug 6 19:02:03 EDT 2014

"lang:read.1" looks a some name generated by "syntax-local-lift-expression"
or "generate-temporaries". IIRC the ".1" is how the printer handles showing
identifiers that may have the same symbol, but different scope.

so:

#lang racket
(define-syntax (example stx)
  (syntax-case stx ()
    [(_)
     (with-syntax ([id (syntax-local-lift-expression #''anything)])
       #'(displayln 'id))]))
(example)
(example)


would display something like

lifted.0
lifted.2

But I'm not sure what makes the name "lang:read".


On Wed, Aug 6, 2014 at 5:50 PM, Matthew Butterick <mb at mbtype.com> wrote:

> Under certain circumstances, because of what I assume is a bug in my code,
> I get an error like this:
>
> > define-values: assignment disallowed;
> >  cannot re-define a constant
> >   constant: lang:read.1
> >   in module: "/Users/mb/git/racket/racket/collects/racket/main.rkt"
> >   context...:
> >    (submod /Users/mb/git/racket/racket/collects/racket/main.rkt reader):
> [running body]
>
> I understand how the "assignment disallowed" error arises. What I don't
> understand is the meaning of "lang:read.1" in this context. I'm guessing it
> has something to do with the #lang line (?) but ... the rest is hazy.
>
> Clarification welcome.
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140806/d8e01592/attachment-0001.html>

Posted on the users mailing list.