[plt-scheme] contract naming conventions

From: Robby Findler (robby at cs.uchicago.edu)
Date: Wed Sep 8 12:01:33 EDT 2004

The current set of names come from a hodge-podge of conventions that
evolved as the contract library evolved. Now that it seems a bit more
stable, perhaps it makes sense to go back and re-consider the names. 

Probably the ?s should all disappear and probably all of the /c's and
/p's and /f's should disappear, except those that would conflict with
commonly used functions and built-ins (like `list' and
'list-immutable'). Those should probably all be /c. Sound okay with

As far as sexp goes, the closest one to that in the library is
'printable'. I'm not sure what the canonical definition of sexp is, so
I didn't include it.


At Wed, 8 Sep 2004 11:32:44 -0400, "Richard C. Cobbe" wrote:
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> Greetings, all.
> Have we established any (de facto) naming conventions for contracts?
> I've found it useful to define the following contracts for use in my
> programs, and I'm not entirely sure that I like the -? naming
> convention: after all, they're not exactly predicates, since I cannot
> directly apply them to arguments.
>   ;; contract that recognizes arbitrary s-expressions.
>   (define sexp?
>     (flat-rec-contract sexp
>                        (cons/p sexp sexp)
>                        null?
>                        number?
>                        symbol?
>                        string?
>                        boolean?
>                        char?))
>   (define predicate? (any? . -> . boolean?))
> Also, while the /c and /p suffixes seem to be used for functions from
> contracts to contracts, is there any convention over which gets used
> when?
> Thanks,
> Richard

Posted on the users mailing list.