[plt-dev] abstract/uncomputable contracts in Scribble

From: Dave Herman (dherman at ccs.neu.edu)
Date: Mon Mar 9 14:25:58 EDT 2009

AFAICT there isn't a standard way to document something with a contract 
that doesn't actually correspond to a Scheme predicate.

One place I miss this is when I want to describe a new parametric type.

Another is when I reuse structs at different types. For example: 1) 
define some AST structs; 2) reuse those structs with #f in place of 
certain subterms to represent contexts. This could be represented as a 
parameteric type, but that's pretty heavyweight. It'd be nice to be able 
to say something like

    An /expression context/ is an expression where...

and then be able to document procedures like

    (fill-context context expr) -> expr
      context : expression context
      expr : expression

I can (and do) get lots of mileage out of `unsyntax' in Scribble, but 
wonder if this is worth adding a new idiom or two to Scribble.

Dave


Posted on the dev mailing list.