[plt-dev] language dialog, some minor changes & bugfixes

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Jan 29 16:58:47 EST 2010

On Jan 29, Robby Findler wrote:
> On Fri, Jan 29, 2010 at 3:48 PM, Eli Barzilay <eli at barzilay.org> wrote:
> > On Jan 29, Robby Findler wrote:
> >> On Fri, Jan 29, 2010 at 3:45 PM, Eli Barzilay <eli at barzilay.org> wrote:
> >> > On Jan 29, Robby Findler wrote:
> >> >> PS: I changed the ^ in the regexp to .* so it works for things like
> >> >>
> >> >>   ;;;; fdask
> >> >>   #lang scheme
> >> >>
> >> >> I assume that's what you'd meant?
> >> >
> >> > Oh right.  But it's probably better to allow only whitespace, and
> >> > throw an error (ie, return "???") if there's some unexpected text
> >> > (like some language that would have a `#!' in the name).
> >>
> >> That would make the above example break, no?
> >
> > I'm thinking of something like
> >
> >
> >  #lang some-language #!bleh
> >
> > where the `#!bleh' is part of the `some-language' specification.
> 
> But the string is limited to what was consumed, so the regexp won't be
> applied to that part of the string or so I thought.

The thing that gets consumed is *anything* that the language reader
decides to read to make a decision about all of its settings.  In the
above case, the code dispatches to the reader in
`some-language/lang/reader' after reading `some-lang', then that code
can read *anything* it wants and return the info function.  So the
point where reading reached is the point that marks all the necessary
text to determine the language and its settings.

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


Posted on the dev mailing list.