Added documentation example of sequence/c for multiple-valued sequences.

This commit is contained in:
Carl Eastlund 2011-08-27 14:46:43 -04:00
parent fe3d4c9fe6
commit 126d8192ff

View File

@ -201,9 +201,17 @@ for instance, a wrapped list is not guaranteed to satisfy @racket[list?].
#:eval the-eval
(define/contract predicates
(sequence/c (-> any/c boolean?))
(list integer? string->symbol))
(in-list (list integer?
string->symbol)))
(for ([P predicates])
(printf "~s\n" (P "cat")))
(define/contract numbers&strings
(sequence/c number? string?)
(in-dict (list (cons 1 "one")
(cons 2 "two")
(cons 3 'three))))
(for ([(N S) numbers&strings])
(printf "~s: ~a\n" N S))
]
}