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

From: Matthew Butterick (mb at mbtype.com)
Date: Wed Aug 6 20:39:40 EDT 2014

I've now concocted a simple but strange test case using three files:

;;; three.rkt
#lang racket

;;; two.rkt
#lang datalog

;;; one.rkt
#lang racket/base
(require racket/rerequire)
(dynamic-rerequire (string->path "two.rkt"))
(eval '(require "three.rkt") (make-base-namespace))

Then from the command line:

>racket one.rkt

And you should get:

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]
   standard-module-name-resolver
   standard-module-name-resolver




On Aug 6, 2014, at 4:02 PM, Spencer Florence <florence at northwestern.edu> wrote:

> "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/652425c2/attachment.html>

Posted on the users mailing list.