provide for/flvector, for/extflvector, etc. as aliases for : versions (#534)
Since the type-checker can now handle their expansions. * add typed/racket/flonum and provide typed for/flvector and for*/flvector from it * add typed/racket/extflonum and provide typed for/extflvector and for*/extflvector from it
This commit is contained in:
parent
f0499ffd11
commit
2262eb9eaf
|
@ -174,6 +174,21 @@ and the @racket[URL] and @racket[Path/Param] types from
|
|||
@defmodule/incl[typed/racket/async-channel @history[#:added "1.1"]]
|
||||
@defmodule/incl[typed/racket/date]
|
||||
@defmodule/incl[typed/racket/draw]
|
||||
|
||||
@defmodule/incl[typed/racket/extflonum]{
|
||||
@deftogether[[
|
||||
@defform[(for/extflvector type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for*/extflvector type-ann-maybe (for-clause ...) expr ...+)]
|
||||
]]
|
||||
}
|
||||
|
||||
@defmodule/incl[typed/racket/flonum]{
|
||||
@deftogether[[
|
||||
@defform[(for/flvector type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for*/flvector type-ann-maybe (for-clause ...) expr ...+)]
|
||||
]]
|
||||
}
|
||||
|
||||
@defmodule/incl[typed/racket/gui]
|
||||
@defmodule/incl[typed/racket/gui/no-check]
|
||||
@defmodule/incl[typed/racket/random @history[#:added "1.5"]]
|
||||
|
|
|
@ -251,13 +251,9 @@ annotated with a @racket[Listof] type. All annotations are optional.
|
|||
}
|
||||
|
||||
@deftogether[[
|
||||
@defform[(for/flvector type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for/extflvector type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for/and type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for/first type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for/last type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for*/flvector type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for*/extflvector type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for*/and type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for*/first type-ann-maybe (for-clause ...) expr ...+)]
|
||||
@defform[(for*/last type-ann-maybe (for-clause ...) expr ...+)]
|
||||
|
|
8
typed-racket-more/typed/racket/extflonum.rkt
Normal file
8
typed-racket-more/typed/racket/extflonum.rkt
Normal file
|
@ -0,0 +1,8 @@
|
|||
#lang typed/racket/base
|
||||
|
||||
(provide (all-from-out racket/extflonum)
|
||||
(rename-out [for/extflvector: for/extflvector]
|
||||
[for*/extflvector: for*/extflvector]))
|
||||
|
||||
(require (except-in racket/extflonum for/extflvector for*/extflvector))
|
||||
|
8
typed-racket-more/typed/racket/flonum.rkt
Normal file
8
typed-racket-more/typed/racket/flonum.rkt
Normal file
|
@ -0,0 +1,8 @@
|
|||
#lang typed/racket/base
|
||||
|
||||
(provide (all-from-out racket/flonum)
|
||||
(rename-out [for/flvector: for/flvector]
|
||||
[for*/flvector: for*/flvector]))
|
||||
|
||||
(require (except-in racket/flonum for/flvector for*/flvector))
|
||||
|
|
@ -290,8 +290,8 @@
|
|||
(except-in racket/class class)
|
||||
racket/file
|
||||
racket/fixnum
|
||||
racket/flonum
|
||||
racket/extflonum
|
||||
typed/racket/flonum
|
||||
typed/racket/extflonum
|
||||
racket/function
|
||||
racket/future
|
||||
racket/list
|
||||
|
@ -2557,6 +2557,29 @@
|
|||
(list f1 f2 f3))
|
||||
(-lst* -Flonum -Fixnum -ExtFlonum)]
|
||||
|
||||
;; The typechecker should be able to handle the expansion of
|
||||
;; for/flvector, for*/flvector, for/extflvector, and for*/extflvector
|
||||
[tc-e
|
||||
(for/flvector ([a (list 0 1 1 2 3)]
|
||||
[b (list 1 1 2 3 5)])
|
||||
(real->double-flonum (+ a b)))
|
||||
-FlVector]
|
||||
[tc-e
|
||||
(for*/flvector ([a (list 0 1 1 2 3)]
|
||||
[b (list 1 1 2 3 5)])
|
||||
(real->double-flonum (+ a b)))
|
||||
-FlVector]
|
||||
[tc-e
|
||||
(for/extflvector ([a (list 0 1 1 2 3)]
|
||||
[b (list 1 1 2 3 5)])
|
||||
(real->extfl (+ a b)))
|
||||
-ExtFlVector]
|
||||
[tc-e
|
||||
(for*/extflvector ([a (list 0 1 1 2 3)]
|
||||
[b (list 1 1 2 3 5)])
|
||||
(real->extfl (+ a b)))
|
||||
-ExtFlVector]
|
||||
|
||||
;; for/hash, for*/hash - PR 14306
|
||||
[tc-e (for/hash: : (HashTable Symbol String)
|
||||
([x (in-list '(x y z))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user