Disabled multi-valued seq-exprs in the for: macros because using them
triggers an internal error in the typechecker.
This commit is contained in:
parent
c92ae73859
commit
e9a0014630
|
@ -10,6 +10,7 @@
|
||||||
;; matter how many #:when clauses we throw at them.
|
;; matter how many #:when clauses we throw at them.
|
||||||
;; Of course, for*/list: and co won't work, since they are equivalent
|
;; Of course, for*/list: and co won't work, since they are equivalent
|
||||||
;; to for/list: and co with #:when clauses.
|
;; to for/list: and co with #:when clauses.
|
||||||
|
;; These are currently documented as not working.
|
||||||
(for/list: : (Listof Integer)
|
(for/list: : (Listof Integer)
|
||||||
((i : Exact-Positive-Integer '(1 2 3))
|
((i : Exact-Positive-Integer '(1 2 3))
|
||||||
#:when (odd? i)
|
#:when (odd? i)
|
||||||
|
@ -27,8 +28,10 @@
|
||||||
(j : Exact-Positive-Integer '(10 20 30)))
|
(j : Exact-Positive-Integer '(10 20 30)))
|
||||||
(list i j))
|
(list i j))
|
||||||
|
|
||||||
;; The right type for the return value would be (values (Listof Integer) (Listof Integer)).
|
;; The right type for the return value would be:
|
||||||
;; The problem here is with the error message. Somehow, source location information is lost and the whole module is blamed.
|
;; (values (Listof Integer) (Listof Integer)).
|
||||||
|
;; The problem here is with the error message. Somehow, source location
|
||||||
|
;; information is lost and the whole module is blamed.
|
||||||
(for/lists: : (Listof Integer)
|
(for/lists: : (Listof Integer)
|
||||||
((x : (Listof Integer))
|
((x : (Listof Integer))
|
||||||
(y : (Listof Integer)))
|
(y : (Listof Integer)))
|
||||||
|
@ -36,7 +39,10 @@
|
||||||
(j : Exact-Positive-Integer '(10 20 30)))
|
(j : Exact-Positive-Integer '(10 20 30)))
|
||||||
(values i j))
|
(values i j))
|
||||||
|
|
||||||
;; This is a legitimate use of multi-valued seq-exprs, but it causes the typechecker to throw an internal error.
|
;; This is a legitimate use of multi-valued seq-exprs, but it causes
|
||||||
|
;; the typechecker to throw an internal error.
|
||||||
|
;; Multi-valued seq-exprs are currently turned off and documented as
|
||||||
|
;; not working.
|
||||||
(for/list: : (Listof Integer)
|
(for/list: : (Listof Integer)
|
||||||
((([i : Exact-Positive-Integer]
|
((([i : Exact-Positive-Integer]
|
||||||
[j : Exact-Positive-Integer])
|
[j : Exact-Positive-Integer])
|
||||||
|
|
|
@ -11,7 +11,8 @@
|
||||||
(pattern (var:annotated-name seq-expr:expr)
|
(pattern (var:annotated-name seq-expr:expr)
|
||||||
#:with (expand ...) (list #'(var.ann-name seq-expr)))
|
#:with (expand ...) (list #'(var.ann-name seq-expr)))
|
||||||
;; multi-valued seq-expr
|
;; multi-valued seq-expr
|
||||||
(pattern ((v:annotated-name ...) seq-expr:expr)
|
;; currently disabled because it triggers an internal error in the typechecker
|
||||||
|
#;(pattern (((v:annotated-name) ...) seq-expr:expr)
|
||||||
#:with (expand ...) (list #'((v.ann-name ...) seq-expr)))
|
#:with (expand ...) (list #'((v.ann-name ...) seq-expr)))
|
||||||
;; when clause
|
;; when clause
|
||||||
(pattern (~seq #:when guard:expr)
|
(pattern (~seq #:when guard:expr)
|
||||||
|
@ -23,7 +24,8 @@
|
||||||
(pattern (var:annotated-name seq-expr:expr)
|
(pattern (var:annotated-name seq-expr:expr)
|
||||||
#:with (expand ...) (list #'(var.ann-name seq-expr) #'#:when #'#t))
|
#:with (expand ...) (list #'(var.ann-name seq-expr) #'#:when #'#t))
|
||||||
;; multi-valued seq-expr
|
;; multi-valued seq-expr
|
||||||
(pattern ((v:annotated-name ...) seq-expr:expr)
|
;; currently disabled because it triggers an internal error in the typechecker
|
||||||
|
#;(pattern (((v:annotated-name) ...) seq-expr:expr)
|
||||||
#:with (expand ...) (list #'((v.ann-name ...) seq-expr) #'#:when #'#t))
|
#:with (expand ...) (list #'((v.ann-name ...) seq-expr) #'#:when #'#t))
|
||||||
;; when clause
|
;; when clause
|
||||||
(pattern (~seq #:when guard:expr)
|
(pattern (~seq #:when guard:expr)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user