Commit Graph

174 Commits

Author SHA1 Message Date
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
Robby Findler
570a3e58b9 renamed parametric/c to parametric->/c
and cleaned up the organization of the related files
2011-04-09 21:45:49 -05:00
Ryan Culpepper
f49412add8 moved unstable/poly-c to racket/contract/parametric 2011-04-08 08:25:22 -06:00
Matthew Flatt
0b496d5275 a round of doc corrections from Gwyth 2011-03-10 06:34:33 -06:00
Robby Findler
07a2ace943 added the #:pre/name and #:post/name keywords to ->i 2011-02-25 13:42:09 -06:00
Robby Findler
4b68377af1 Revert "started adding comments to the #:pre and #:post parts of ->i"
This reverts commit a27b7d5c61.

ack, sorry.
2011-02-25 09:44:34 -06:00
Robby Findler
a27b7d5c61 started adding comments to the #:pre and #:post parts of ->i 2011-02-25 09:42:23 -06:00
David Van Horn
c9519fd113 Fixed various spelling errors. 2011-02-03 17:42:33 -05:00
Robby Findler
51ad306af2 changed real-in to be an alias for between/c 2011-01-04 15:40:32 -06:00
Matthew Flatt
3bb120545f fix ~300 typos reported by Vladimir Nesterovich (a.k.a. Gwyth)
--- but Gwyth's amazingly helpful review of chapters 1-11
     pointed out a few problems that are more difficult to fix
     and are still pending
2011-01-04 09:53:31 -07:00
Stevie Strickland
37349ca053 Allow uses of recursive-contract to specify the type of contract to create. 2010-12-07 18:30:20 -05:00
Stevie Strickland
5b8e5d6380 Extend struct/c to allow impersonator contracts for mutable fields.
Also, flat contracts for immutable fields are only evaluated at contract
wrapping time.
2010-12-07 14:29:07 -05:00
Stevie Strickland
10eb818f95 Conversion of struct/c to chaperones when appropriate. 2010-12-07 04:11:26 -05:00