[racket] Matthew's "doc-define.rkt"

From: Greg Hendershott (greghendershott at gmail.com)
Date: Thu May 8 20:45:45 EDT 2014

FWIW in a similar spirit I have a `defn` I've been using (for an
unreleased project) in both untyped and typed flavors.

I like `#::` as the keyword name for the contract (untyped flavor) or
`:` type (typed flavor).

Also `#:doc` as above (although I haven't yet wired that up for real
to scribble/srcdoc).

#lang at-exp racket/base
(defn (f x)
  #:: (-> real? real?)
  #:doc @{Returns @racket[x].}
  ....)

#lang at-exp typed/racket/base
(defn (f x)
  #:: (Real -> Real)
  #:doc @{Returns @racket[x].}
  ....)

Also zero or more `#chk` for unit tests.

Plus, I like the idea (not yet implemented) of zero or more `#:ex` for
short examples. I think it could be spiffy for those to be included
(a) in the documentation and (b) as unit tests -- both.

Posted on the users mailing list.