9.1
hash-view-scribble
| (require hash-view/scribble) | package: hash-view-scribble |
The hash-view/scribble module provides a Scribble documentation form for documenting hash-views, similar to how defstruct documents structs.
syntax
(defhashview maybe-link name (field-spec ...) maybe-mutability pre-flow ...)
maybe-link =
| #:link-target? link-target?-expr field-spec = [field-id contract-expr] | [field-id contract-expr #:default default-expr] | [field-id contract-expr #:default/omit default-expr] maybe-mutability =
| #:immutable | #:accept-mutable
Similar to defstruct, but for documenting a hash-view definition.
Unless link-target?-expr is specified and produces #f, all identifiers associated with the hash-view are indexed, and also registered so that racket-typeset uses of those identifiers (with the same for-label binding) are hyperlinked to this documentation:
name and its predicate name?
The constructor make-name
The mutable constructor make-mutable-name, if #:accept-mutable or no mutability option is given
Each field accessor (name-field)
Example usage:
@defhashview[point ([x real?] [y real?]) #:immutable]{ A 2D point with real-valued coordinates. } @defhashview[location ([host string?] [port integer? #:default 80] [proto symbol? #:default/omit 'tcp]) #:accept-mutable]{ A network location with host, port, and protocol. }
Renders like: