[racket] curious behavior of path-replace-suffix for files beginning with dot?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Sun Nov 3 12:10:54 EST 2013

At Mon, 21 Oct 2013 15:38:01 -0700, Matthew Butterick wrote:
> Looking over the
> documentation<http://docs.racket-lang.org/reference/Manipulating_Paths.html#(de
> f._((lib._racket/private/misc..rkt)._path-replace-suffix))>
> I'm
> not clear why this would be so:
> 
> > (path-replace-suffix (string->path ".foobar") "")
> 
> #<path:?>
> 
> 
> If the behavior is undefined, seems like path-replace-suffix ought to raise
> an error rather than return a path that is a single question mark.

Yes, I've pushed a repair. The problem actually starts with
`{string,bytes}->path-element`, so I've fixed those functions to raise
exceptions, too.

Thanks for the report!


Posted on the users mailing list.