[racket-dev] literal strings and numbers are now interned

From: Eli Barzilay (eli at barzilay.org)
Date: Wed May 2 19:39:24 EDT 2012

It was the first -- for quick hacks where you want to "parse" through
some text and find where the text had newlines.  It's true that it
wasn't working across modules, but that's also tricky to do with
syntax properties, so it was intended to be used with a locally
defined newline.  It's also true that you can do the same with syntax
properties (ones that already exist), but then you're dealing with
macros so it's no longer "quick".

In any case, the whole thing is much less important after the
"discovery" that it's fine to use @foo[...] for things like `itemize',
and avoid the newline parsing.


On November 24th 2011, Matthew Flatt wrote:
> Based on the docs, I think the idea was to support functions and
> syntax forms that treat reader-introduced newline strings
> differently from other strings. I can't come up with a good example
> myself.
> 
> It may also have been that the reader needed the distinction
> internally, and so it made sense to expose it. (The internal
> distinction can be implemented with a syntax property, though.)
> 
> I've removed the test and documentation for this feature.
> 
> At Tue, 22 Nov 2011 14:09:10 -0600, Robby Findler wrote:
> > Why did the reader make this promise?
> > 
> > Robby
> > 
> > On Tue, Nov 22, 2011 at 1:50 PM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> > > At Tue, 22 Nov 2011 09:18:30 -0700, Matthew Flatt wrote:
> > >> Along the same lines, I think it's unlikely that good programs are
> > >> affected by the `read' interning change
> > >
> > > Some Scribble tests failed in DrDr, because the Scribble reader
> > > actually promises a distinct "\n" for literal newlines. There's no way
> > > to make that work with syntax objects, since `datum->syntax' now always
> > > interns strings.
> > >
> > > Any objection to removing that feature of the Scribble reader?
> > >
> > > The idea of a specific "\n" isn't compatible with separate compilation,
> > > even prior to v5.2.0.4, in the sense that
> > >
> > >                      a.rkt
> > >                      -----
> > >  #lang at-exp racket
> > >  (provide is-source-newline?)
> > >  (define nl '@{
> > >              })
> > >  (define (is-source-newline? v) (eq? (first nl) v))
> > >
> > >                      b.rkt
> > >                      -----
> > >  #lang at-exp racket
> > >  (require "a.rkt")
> > >  (define nl '@{
> > >              })
> > >  (is-source-newline? (first nl))
> > >
> > > produces different results depending on whether "b.rkt" is run from
> > > bytecode or from source.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.