► |  | The Racket Graphical Interface Toolkit

1 | Windowing
2 | Windowing Classes
3 | Windowing Functions
4 | Editors
5 | Snip and Style Classes
6 | Editor Classes
7 | Editor Functions
8 | WXME Decoding
9 | Preferences
10 | Dynamic Loading
11 | Startup Actions
12 | Platform Dependencies
| Index

▼ | 5 | Snip and Style Classes

5.1 | add-color<%>
5.2 | image-snip%
5.3 | mult-color<%>
5.4 | readable-snip<%>
5.5 | snip%
5.6 | snip-admin%
5.7 | snip-class%
5.8 | snip-class-list<%>
5.9 | string-snip%
5.10 | style<%>
5.11 | style-delta%
5.12 | style-list%
5.13 | tab-snip%

On this page:

read-special

top← prev up next →

interface readable-snip<%> : interface?

A readable-snip<%> object is treated specially by the port generated by open-input-text-editor: When a readable-snip<%> object is encountered for the input stream, its 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 read-char-or-special.

Since read and read-syntax build on read-char-or-special, a snip can implement readable-snip<%> so that it produces a whole S-expression or some other kind of value when read is used on a stream containing the snip.

> > method
> > (send a-readable-snip read-special |  | source |  |  |  |
> > |  | line |  |  |  |
> > |  | column |  |  |  |
> > |  | position) |  | → |  | any/c
> source : any/c
> line : (or/c exact-nonnegative-integer? #f)
> column : (or/c exact-nonnegative-integer? #f)
> position : (or/c exact-nonnegative-integer? #f)

The arguments are the same as the arguments to a procedure returned by a custom input port’s read-in; see Custom Ports for details. The result is also the same as the result from a read-in-produced procedure.
top← prev up next →