Adding Sam's test for value dots.
This commit is contained in:
parent
b90e1505d3
commit
3dbf0f7ccc
29
collects/tests/typed-scheme/succeed/values-dots.ss
Normal file
29
collects/tests/typed-scheme/succeed/values-dots.ss
Normal file
|
@ -0,0 +1,29 @@
|
|||
#lang typed-scheme
|
||||
|
||||
(require "private/extra-procs.ss")
|
||||
|
||||
|
||||
(call-with-values (lambda () (values 1 2)) (lambda: ([x : Number] [y : Number]) (+ x y)))
|
||||
|
||||
(#{call-with-values* @ Integer Integer Integer} (lambda () (values 1 2)) (lambda: ([x : Integer] [y : Integer]) (+ x y)))
|
||||
|
||||
|
||||
(call-with-values* (lambda () (values 1 2)) (lambda: ([x : Integer] [y : Integer]) (+ x y)))
|
||||
|
||||
(: map-with-funcs (All (b ...) ((b ... b -> b) ... b -> (b ... b -> (values b ... b)))))
|
||||
(define (map-with-funcs . fs)
|
||||
(lambda bs
|
||||
(apply values* (map (lambda: ([f : (b ... b -> b)])
|
||||
(apply f bs)) fs))))
|
||||
|
||||
#;(map-with-funcs + - * /)
|
||||
|
||||
(inst map-with-funcs Integer Integer)
|
||||
|
||||
#;(map-with-funcs (lambda: ([x : Integer] [y : Integer]) (+ x y))
|
||||
(lambda: ([x : Integer] [y : Integer]) (- x y)))
|
||||
|
||||
(((inst map-with-funcs Integer Integer)
|
||||
(lambda: ([x : Integer] [y : Integer]) (+ x y))
|
||||
(lambda: ([x : Integer] [y : Integer]) (- x y)))
|
||||
3 4)
|
Loading…
Reference in New Issue
Block a user