Commit Graph

186 Commits

Author SHA1 Message Date
Robby Findler
6b3b59e4a8 more "this function is useless" notes in old contract functions 2012-12-04 21:07:34 -06:00
Robby Findler
d30e7c6771 clarify that flat-contract is essentially useless now 2012-12-04 19:58:19 -06:00
Danny Yoo
dcf4d8b040 adding close-eval at the end of scribble files that have a toplevel evaluator 2012-11-01 15:32:53 -06:00
Asumu Takikawa
0d30c43a68 Add call/cc contracts to prompt-tag/c 2012-10-27 11:06:17 -04:00
Robby Findler
fc03ab6c69 add a mention of the flat/chaperone/impersonator contract hierarchy to the contract docs 2012-08-28 13:19:05 -05:00
Robby Findler
1ad2c75531 add the ability to specify #:parent to struct/dc (and fix struct/c to use it)
closes PR 13049
2012-08-23 18:59:11 -05:00
Matthew Flatt
ef525233a2 references: link "A parameter that..." to the definition of "parameter" 2012-08-22 10:28:56 -06:00
Asumu Takikawa
46ece20b09 Fix typo introduced by 965a74453f
(Moral of story: be careful with regexps)
2012-08-21 16:35:37 -04:00
Asumu Takikawa
9a65f9aaf0 Delete trailing whitespace 2012-08-21 16:20:26 -04:00
Asumu Takikawa
965a74453f Add #:forall, #:∀ to contract-out 2012-08-21 16:20:26 -04:00
Robby Findler
8a0b6549a5 adjust the contract error messages to follow the error message
conventions in 9.2.1 of the reference (altho the messages do
not yet do the extra level of indenting when a field is too
long, nor are there any field names ending in ...)

Also, fix the docs for the #:stronger argument to
make-contract, make-chaperone-contract, and make-flat-contract
2012-08-05 20:09:09 -05:00
Asumu Takikawa
e8dfd1d8df Improve docs for exn:fail:contract:blame 2012-07-03 02:16:13 -04:00
Stevie Strickland
d16c3f68fa Add empty case for with-contract's clause for free variable contracts.
Also reorder the single and multiple cases to match result-spec's ordering.
2012-06-28 03:28:04 -04:00
Asumu Takikawa
095d47fc3d racket/contract: rename prompt/c & continuation-mark/c
The new names are `prompt-tag/c` and `continuation-mark-key/c`
to keep the names consistent with the values that are being
contracted. Also updated the HISTORY file.
2012-06-26 21:11:58 -04:00
Asumu Takikawa
ddf91c201a Documentation for mark key proxies and contracts 2012-06-26 13:39:36 -04:00
Robby Findler
2d8f41bfb9 clarify has-contract? and prop:contracted relationship 2012-06-18 11:26:27 -05:00
Asumu Takikawa
4ce4d7531b Improve docs & errors for control proxies
In particular, use consistent terminology for errors
and provide usage examples
2012-06-12 12:16:56 -04:00
Asumu Takikawa
87ecb55d40 Documentation for control proxies & prompt/c 2012-06-11 18:18:37 -04:00
Matthew Flatt
9e7548de61 new error message convention
Add `raise-argument-error', `raise-result-error', `raise-arguments-error',
and `raise-range-error'.

The old convention was designed for reporting on a single (sometimes very
long line). The new convention is

 <name>: <short message>
   <field>: <detail>
   ...

If <detail> is long or itself spans multiple lines, then it may
also use the form

   <field>:
    <detail>

where each line of <detail> is indented by 3 spaces.

Backtrace information is shown as a multi-line "context" field.
2012-05-25 15:08:05 -06:00
Robby Findler
3fceae2715 adjusted the contract error messages so that the words expected/promised
are switched in and out based on the sense of the blame (similar to a recent
change that made given/produced swap in and out)
2012-05-15 22:08:42 -05:00
Robby Findler
52fa588f7a deprecate define-contract-struct (also fix a broken require in the contract docs) 2012-05-12 22:10:04 -05:00
Matthew Flatt
bfbccb918d fix reference to non-existant private contract module 2012-05-12 01:37:51 -06:00
Asumu Takikawa
a8994c7261 Revert "Add contract-add-context to contract system."
This reverts commit f3b687c8ed.

After discussion with Robby and Stevie, we concluded that
this procedure isn't necessary for now. If we ever think
of more examples where it's useful we can bring it back.
2012-05-08 12:58:49 -04:00
Robby Findler
5996e8f480 finish up struct/dc 2012-05-07 10:36:44 -05:00
Robby Findler
64603d0c27 adjust the opter protocol so that opters can say either: "yes this is
a chaperone contract", "no it definitely isn't" or "evaluate this code
at runtime to find out"; previously only the first two options
were available to opters

(this commit also includes other tweaks here and there so won't stand alone)
2012-05-07 10:36:44 -05:00
Robby Findler
04017d83d5 start adding struct/dc contracts 2012-05-07 10:36:39 -05:00
Asumu Takikawa
f3b687c8ed Add contract-add-context to contract system.
This procedure is used to add blame contexts to an
existing contract. This prevents the need to re-create
the contract in order to add blame contexts.
2012-05-04 02:52:46 -04:00
Robby Findler
17a723a63e Improve the contract error messages:
- add context information, so we can see which part of the contract failed
 - re-arrange some of the information in the contracts
2012-04-21 16:55:03 -05:00
Stevie Strickland
95d784db84 Fix a ->d contract example in the reference. 2012-04-18 17:42:14 -04:00
Robby Findler
5e03c7cf99 Added struct/dc and cleaned up a bunch of stuff in the contract
library (mostly in opt/c)

Specifically:

- add inlining declaration for ->i helper function

- modernized the opt/c contracts and improved them so that mutually
  recursive define-opt/c functions recognize each other instead of
  bailing out to the slow path.

- added =/c as an optimized contract

- improve the error message for the between and comparison opt
  contracts

- adjust the blame struct so the name is created lazily, since opt/c
  contracts just stick a copy o the contract into the thunk that
  creates the name and we don't want to run those effects twice if we
  can help it.
2012-04-12 22:49:50 -05:00
Robby Findler
483dde9ea8 add keywords as values that coerce into contracts
adjust 'one-of/c' and 'symbols' so they just use or/c (when possible)

improve or/c's stronger check so that, in the case that or/c is
getting eq or equal contracts, or/c's stronger check is as good as
'symbols'/'one-of/c's stronger check is.
2012-04-06 16:21:07 -05:00
David Van Horn
f029117266 Fixes spelling errors in reference. 2012-02-21 14:21:43 -05:00
Ryan Culpepper
933965b2c2 moved unstable/prop-contract into racket/contract/base 2011-12-18 13:57:50 -07:00
Robby Findler
e0ea64c758 rename contract-generate to contract-random-generate 2011-11-25 09:09:18 -06:00
Robby Findler
b7d2d5da62 Some small cleanups of Andy's contract generator code 2011-11-23 22:54:21 -06:00
Andy Gocke
b8847a53bf Started on random testing for contracts 2011-11-23 22:54:21 -06:00
Robby Findler
870c8d28f4 move predicate/c from unstable/contract to racket/contract. In process,
change the implementation to special case struct procedures and to use
it in provide/contract.

This speeds up the rendering phase of the Guide documentation by more than 2x.
Thanks to Matthew for spotting the opportunity!
2011-11-13 17:19:15 -06:00
Robby Findler
8edfd4e87e add docs for the #:stronger argument to the contract constructors
closes PR 12312
2011-10-31 16:59:19 -05:00
Robby Findler
48f9b8895c add documentation for racket/contract/base (also trim some
of the longer lines in the file)

closes PR 12311
2011-10-25 16:16:23 -05:00
Robby Findler
533b898277 clarify the role of the #:rest portion of the contract
closes PR 12244
2011-10-01 15:58:50 -05:00
Matthew Flatt
e226dd7e26 add `contract-out' 2011-09-24 22:30:56 +09:00
Eli Barzilay
d61eb53686 Lots of documentation formatting.
Started as fixing misindented definitions, then more indentations, then
a bunch of similar things (square brackets, huge spaces at end-of-lines,
etc).
2011-08-15 07:50:04 -04:00
Ryan Culpepper
73230537ba removed merge conflict artifact
Merge to release branch
2011-07-08 15:34:59 -06:00
Eli Barzilay
ac26fe7554 A ton of @scheme*' -> @racket*' and related updates.
Also, updates some of the mzlib files to point at `racket/*' libraries
rather than to `scheme/*' ones.
2011-06-25 04:08:47 -04:00
Asumu Takikawa
7f143f03ed Add impersonator-contract? along with docs/tests.
The impersonator-contract? function checks if its argument is
a contract that is neither flat nor a chaperone contract.
2011-05-26 00:37:05 -04:00
Robby Findler
1fdfd8406d made sure that all of the mzlib/contract exports are documented
(some by using racket/contract exports and some by adding
   more docs)
2011-04-25 11:54:14 -05:00
Robby Findler
be1a0e62f7 added docs for current-contract-region 2011-04-25 11:53:23 -05:00
Robby Findler
21cbd9ad81 added the racket/contract/combinator library,
and documented and adjusted these libraries:
     racket/contract/base
     racket/contract/exists
     racket/contract/parametric (renamed from exists)
     racket/contract/region
2011-04-25 11:51:44 -05:00
Stevie Strickland
bdd5ac2d41 Document prop:contracted and impersonator-prop:contracted. 2011-04-15 16:29:17 -04:00
Robby Findler
ec50a8c5a2 additional fixes to the docs and racket/contract's exports to make them match up 2011-04-15 12:44:44 -05:00