[racket] How to read procedure documentation?

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Fri Apr 19 14:57:51 EDT 2013

On 2013-04-19 20:18:53 +0200, Manfred Lotz wrote:
>   path : path-string?
>
> [...]
>
> I would expect that the first parameter path is a string and that the
> second parameter is an optional parameter denoting a file mode. Further
> I would assume that file->string returns a string containing the whole
> file.
>
> From this I'm wondering why there are predicates when for example I
> would expect strings?

Is the question about the `path` argument in particular? The
documentation here is just saying `path` should be any value that can
pass the `path-string?` predicate, which is a subset of the values that
pass `string?`.

So for example "\0" is an invalid argument because
  -> (path-string? "\0")
  #f

but "/tmp" is fine because
  -> (path-string? "/tmp")
  #t

The documentation of `path-string?` has more details.

Cheers,
Asumu

Posted on the users mailing list.