make-Values now checks its argument for having only 1 element

original commit: 2844dec0a109157a05db51e8494d3f317c96c379
This commit is contained in:
Sam Tobin-Hochstadt 2008-07-07 14:58:22 -04:00
parent e8621eecf0
commit 13384db457
2 changed files with 1 additions and 13 deletions

View File

@ -140,12 +140,6 @@
(define -values make-Values)
;; produce the appropriate type of a list of types
;; that is - if there is exactly one type, just produce it, otherwise produce a values-ty
;; list[type] -> type
(define (list->values-ty l)
(if (= 1 (length l)) (car l) (-values l)))
(define-syntax *Un
(syntax-rules ()
[(_ . args) (make-Union (list . args))]))

View File

@ -56,12 +56,6 @@
(make-ValuesDots (map sb types) (sb dty) dbound))])
target))
;; the other definition is not accessible here
(define (-values args)
(if (= (length args) 1)
(car args)
(make-Values args)))
;; substitute-dots : Listof[Type] Option[type] Name Type -> Type
(define (substitute-dots images rimage name target)
(define (sb t) (substitute-dots images rimage name t))
@ -69,7 +63,7 @@
(type-case sb target
[#:ValuesDots types dty dbound
(if (eq? name dbound)
(-values
(make-Values
(append
(map sb types)
;; We need to recur first, just to expand out any dotted usages of this.