[racket-dev] Please help me to understand the two lines.

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Mon May 30 12:00:53 EDT 2011

Sam, are you referring to this text?

  The any/c contract is similar to any, in that it makes no demands on
  a value. Unlike any, any/c indicates a single value, and it is
  suitable for use as an argument contract.

This would seem to suggest that any is actually more general, because
any/c seems to require a single value whereas any (by implication)
permits more or less than one.  This is compounded by the later text:

  Use any/c as a result contract when it is particularly important to
  promise a single result from a function. Use any when you want to
  promise as little as possible (and incur as little checking as
  possible) for a function's result.

which again points to a single/any-number-of value(s) distinction.

But then in his email Robby says

  As for the any/c vs any: they are two separate things. "any/c" is
  general purpose contract that allows anything. "any" is special
  syntax that is only allowed inside function contracts. You can think
  of "any" as a more restricted form of "any/c" and that's 95% of the
  story.

which I have difficulty reconciling with the docs quotes.

Shriram
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/dev/archive/attachments/20110530/25fbdcf8/attachment.html>

Posted on the dev mailing list.