moving machines
This commit is contained in:
parent
561ac12a91
commit
79d0c581d4
59
collects/racket/contract/scratch.rkt
Normal file
59
collects/racket/contract/scratch.rkt
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
#lang racket/base
|
||||||
|
(require racket/contract)
|
||||||
|
|
||||||
|
(->i (#:kwd1 [x number?]
|
||||||
|
#:kwd2 [y number?])
|
||||||
|
#:rest [x any/c]
|
||||||
|
any)
|
||||||
|
;=> duplicate identifier 'x'
|
||||||
|
|
||||||
|
|
||||||
|
#|
|
||||||
|
test cases:
|
||||||
|
|
||||||
|
(->i (#:kwd1 [x number?]
|
||||||
|
#:kwd2 [x number?])
|
||||||
|
(values [y number?]
|
||||||
|
[z number?]))
|
||||||
|
=> duplicate identifier 'x'
|
||||||
|
|
||||||
|
|
||||||
|
(->i (#:kwd1 [w number?]
|
||||||
|
#:kwd1 [x number?])
|
||||||
|
(values [y number?]
|
||||||
|
[z number?]))
|
||||||
|
=> duplicate keyword
|
||||||
|
|
||||||
|
|
||||||
|
(->i (#:kwd1 [w number?]
|
||||||
|
#:kwd2 [x number?])
|
||||||
|
(values [y number?]
|
||||||
|
[w number?]))
|
||||||
|
=> duplicate variable 'w'
|
||||||
|
|
||||||
|
|
||||||
|
(->i (#:kwd1 [w number?]
|
||||||
|
#:kwd2 [x number?])
|
||||||
|
(values [y number?]
|
||||||
|
[y number?]))
|
||||||
|
=> duplicate variable 'y'
|
||||||
|
|
||||||
|
|
||||||
|
(->i (#:kwd1 [w number?]
|
||||||
|
#:kwd2 [x number?])
|
||||||
|
(values [y number?]
|
||||||
|
[w number?]))
|
||||||
|
=> duplicate identifier 'w'
|
||||||
|
|
||||||
|
(let ([values (λ (x) x)])
|
||||||
|
(->i (#:kwd1 [w number?]
|
||||||
|
#:kwd2 [x number?])
|
||||||
|
(values number?)))
|
||||||
|
;=> no error(?)
|
||||||
|
|
||||||
|
(->i (#:kwd1 [x number?]
|
||||||
|
#:kwd2 [y number?])
|
||||||
|
[x number?])
|
||||||
|
;=> duplicate identifier 'x'
|
||||||
|
|
||||||
|
|#
|
Loading…
Reference in New Issue
Block a user