From 694fe2e55c7b14c6c8fdeb9b38a4966e62391783 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 10 Oct 2018 17:45:04 -0600 Subject: [PATCH] docs: correct description of custom-port special results There no longer seems to be any path that uses the 0-arity option for a read result from a custom input-port that is a function for a "special" result. Probably, that path got lost when I added a `source` optional argument to `read-char-or-special`. If so, that effect of the change wasn't intentional, but let's just be happy that a simplification is in place. --- .../scribblings/reference/custom-ports.scrbl | 27 ++++--------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/pkgs/racket-doc/scribblings/reference/custom-ports.scrbl b/pkgs/racket-doc/scribblings/reference/custom-ports.scrbl index d6e71006ef..fa6cbc35cd 100644 --- a/pkgs/racket-doc/scribblings/reference/custom-ports.scrbl +++ b/pkgs/racket-doc/scribblings/reference/custom-ports.scrbl @@ -71,8 +71,8 @@ The arguments implement the port as follows: @item{@racket[eof];} @item{a procedure of arity four (representing a ``special'' - result, as discussed @elemref["special"]{further below}) and - optionally of arity zero, but a procedure result is allowed only + result, as discussed @elemref["special"]{further below}), + but a procedure result is allowed only when @racket[peek] is not @racket[#f];} @item{a @techlink{pipe} input port that supplies bytes to be @@ -377,26 +377,9 @@ The arguments implement the port as follows: return a character or @racket[eof]; in particular, @racket[read-char] raises an exception if it encounters a special-result procedure, even if the procedure produces a byte.) A special-result procedure must - accept four arguments, and it can optionally accept zero arguments: - - @itemize[ - - @item{When the special read is triggered by @racket[read-syntax], - @racket[read-syntax/recursive] the - procedure is passed four arguments that represent a source - location. Four arguments for a source location are also provided when - the read is triggered by @racket[read-byte-or-special], - @racket[read-char-or-special], @racket[peek-byte-or-special], or - @racket[peek-char-or-special] with a non-@racket[#f] source name.} - - @item{When the special read is triggered by @racket[read], - @racket[read/recursive], or other calls to - @racket[read-byte-or-special], @racket[read-char-or-special], - @racket[peek-byte-or-special], or @racket[peek-char-or-special], the - procedure is passed no arguments if it accepts zero arguments, - otherwise it is passed four arguments that are all @racket[#f].} - - ] + accept four arguments that represent a source location. The first + argument is @racket[#f] when the special read is triggered by @racket[read] + or @racket[read/recursive]. The special-value procedure can return an arbitrary value, and it will be called zero or one times (not necessarily before further