Adding Sam's test for value dots.

This commit is contained in:
Sam Tobin-Hochstadt 2008-07-07 12:54:45 -04:00
parent b90e1505d3
commit 3dbf0f7ccc

View 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)