2022-05-03 15:51:06 +00:00
|
|
|
#lang typed/syndicate
|
|
|
|
|
|
|
|
(require rackunit/turnstile)
|
|
|
|
|
|
|
|
(define-constructor* (run [distance : Int] [windy? : Bool]))
|
|
|
|
|
|
|
|
(check-type
|
|
|
|
(spawn
|
|
|
|
(start-facet runner
|
|
|
|
(assert (run 5 #t))))
|
|
|
|
: ★/t)
|
|
|
|
|
|
|
|
(check-type
|
|
|
|
(spawn
|
|
|
|
(start-facet longer
|
|
|
|
(on (asserted (run $d $w?))
|
|
|
|
(printf "run ~a ~a\n" (add1 d) (if w? "brr" "")))))
|
|
|
|
: ★/t)
|
|
|
|
|
|
|
|
(check-type
|
|
|
|
(dataspace
|
|
|
|
(spawn
|
|
|
|
(start-facet runner
|
|
|
|
(assert (run 5 #t))))
|
|
|
|
(spawn
|
|
|
|
(start-facet longer
|
|
|
|
(on (asserted (run $d $w?))
|
|
|
|
(printf "run ~a ~a\n" (add1 d) (if w? "brr" ""))))))
|
|
|
|
: ★/t)
|
|
|
|
|
|
|
|
(typecheck-fail
|
|
|
|
(dataspace
|
|
|
|
(spawn
|
|
|
|
(start-facet runner
|
|
|
|
;; NB
|
|
|
|
(assert (run "FAR" #t))))
|
|
|
|
(spawn
|
|
|
|
(start-facet longer
|
|
|
|
(on (asserted (run $d $w?))
|
|
|
|
(printf "run ~a ~a\n" (add1 d) (if w? "brr" ""))))))
|
2022-08-09 17:51:16 +00:00
|
|
|
#:verb-msg "unprepared to handle inputs: (RunT String True)")
|