racket/collects/scribblings/gui/readable-snip-intf.scrbl
Eli Barzilay ac26fe7554 A ton of @scheme*' -> @racket*' and related updates.
Also, updates some of the mzlib files to point at `racket/*' libraries
rather than to `scheme/*' ones.
2011-06-25 04:08:47 -04:00

35 lines
1.3 KiB
Racket

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