[plt-scheme] basic syntax problem

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Tue May 6 08:59:19 EDT 2008

At Tue, 6 May 2008 07:36:05 -0500, "Robby Findler" wrote:
> On Tue, May 6, 2008 at 7:23 AM, Tim Hanson <tbhanson at gmx.de> wrote:
> > > There were a few bugs that manifested like that in the last year or
> >  > two (in the contract library and in the libraries used by the contract
> >  > library). I believe that they are all fixed now in the latest version.
> >  >
> >  > Robby
> >
> >  thanks. i wasn't sure if 372 = 372, so i re-installed just now and the 
> problem persists. based on Noel's hint i tried the code in MZScheme and I 
> think it worked there. i don't suppose the fact that i'm running on a W2k3 
> server machine under VmWare is relevant?
> 
> No, that's not relevant. There is only one 372. :)
> 
> One thing that worked around one of the bugs (I've lost track which
> one was which) is to do something like this:
> 
>   (define s->u string->url)
> 
> at the top of your file and then use s->u instead of string->url everywhere.

I don't think that works. The bug is related to the top-level
environment; any reference to `string->url' in the top-level
environment, including on the right-hand side of a definition, will
fail the second time around.

The only workaround I know is to put the reference to `string->url' in
a module. That is, you can put your whole program in a module --- which
is recommended, for lots of reasons --- or use

  (module workaround mzscheme
    (require (lib "url.ss" "net"))
    (define s->u string->url)
    (provide (rename s->u string->url)))
  (require workaround)


Matthew



Posted on the users mailing list.