From a6ca926aadeb8239e401a6bd697f5c32a25a45a1 Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 24 Aug 2014 02:11:50 -0500 Subject: [PATCH] add an optional argument example to ->i docs --- .../racket-doc/scribblings/reference/contracts.scrbl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/racket-pkgs/racket-doc/scribblings/reference/contracts.scrbl b/pkgs/racket-pkgs/racket-doc/scribblings/reference/contracts.scrbl index 94d77fa826..66a9a30d98 100644 --- a/pkgs/racket-pkgs/racket-doc/scribblings/reference/contracts.scrbl +++ b/pkgs/racket-pkgs/racket-doc/scribblings/reference/contracts.scrbl @@ -978,6 +978,14 @@ a sequence at all except that the former is more expensive than the latter.} Since the contract for @racket[x] does not depend on anything else, it does not come with any dependency sequence, not even @racket[()]. +This example is like the previous one, except the @racket[x] and @racket[y] +arguments are now optional keyword arguments, instead of mandatory, by-position +arguments: +@racketblock[(->i () + (#:x [x number?] + #:y [y (x) (>=/c x)]) + [result (x y) (and/c number? (>=/c (+ x y)))])] + The contract expressions are not always evaluated in order. First, if there is no dependency for a given contract expression, the contract expression is evaluated at the time that the @racket[->i]