improve readable-snip<%> and related docs

svn: r15784

original commit: 8da19de7b275655228fdeb042d99ce1f46443472
This commit is contained in:
Matthew Flatt 2009-08-19 20:51:23 +00:00
parent c4a70aaa36
commit f821b9221a

View File

@ -4,10 +4,18 @@
@definterface/title[readable-snip<%> ()]{
A @scheme[readable-snip<%>] object is treated specially by the port
generated by @scheme[open-input-text-editor]. When a
generated by @scheme[open-input-text-editor]: When a
@scheme[readable-snip<%>] object is encountered for the input stream,
its @method[readable-snip<%> read-special] method is called to
generate the read result for the snip.
generate the read result for the snip, which is returned from the
port as a ``special'' value in the sense of
@scheme[read-char-or-special].
Since @scheme[read] and @scheme[read-syntax] build on
@scheme[read-char-or-special], a snip can implement
@scheme[readable-snip<%>] so that it produces a whole S-expression or
some other kind of value when @scheme[read] is used on a stream
containing the snip.
@defmethod[(read-special [source any/c]
[line (or/c exact-nonnegative-integer? false/c)]
@ -16,10 +24,10 @@ A @scheme[readable-snip<%>] object is treated specially by the port
any/c]{
The arguments are the same as the arguments to a procedure returned by
a custom input port's @scheme[read]; see @secref[#:doc '(lib
a custom input port's @scheme[_read-in]; see @secref[#:doc '(lib
"scribblings/reference/reference.scrbl") "customport"] for
details. The result is also the same as the result from a
@scheme[read]-produced procedure.
@scheme[_read-in]-produced procedure.
}}