[racket-dev] url->string: what do we do?

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Mar 30 11:34:41 EDT 2012

Just now, Robby Findler wrote:
> On Fri, Mar 30, 2012 at 10:30 AM, Eli Barzilay <eli at barzilay.org> wrote:
> > I'm fine with that (and with the push that does it), as long as
> > it's clear that this would change if it grows to be more than just
> > a regexp match.  (Hence my question whether the second regexp is
> > needed -- if it's just the first one, then it looks like it
> > already allows other schemas, to be parsed further in the code.)
> I'm not quite following this paragraph, but I think we're in
> agreement. I've already pushed the change and my inference is that
> you'd be happy with it (I put some timing numbers in the commit.).

The question is whether there is any damage to what it can do now if
you change the contract to a more restrictive but simpler one:

   (string->url (-> #rx"^[a-zA-Z][a-zA-Z0-9+.-]*:" url?))


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

Posted on the dev mailing list.