new files
This commit is contained in:
parent
3af7344581
commit
86c034bb8b
1364 changed files with 21352 additions and 0 deletions
13
Task/Assertions/Racket/assertions-1.rkt
Normal file
13
Task/Assertions/Racket/assertions-1.rkt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#lang racket
|
||||
|
||||
(define/contract x
|
||||
(=/c 42) ; make sure x = 42
|
||||
42)
|
||||
|
||||
(define/contract f
|
||||
(-> number? (or/c 'yes 'no)) ; function contract
|
||||
(lambda (x)
|
||||
(if (= 42 x) 'yes 'no)))
|
||||
|
||||
(f 42) ; succeeds
|
||||
(f "foo") ; contract error!
|
||||
Loading…
Add table
Add a link
Reference in a new issue