Typed Big Bang
big-bang works almost exactly the same in Typed Racket. This page explains any differences.
Reminder: you need the 2htdp-typed
package installed.
Differences
-
The type of the model must be given in the big-bang.
-
The clause for the draw function is
to-draw
noton-draw
. -
The last argument to a mouse handler is a
Mouse-Event
but the last argument to the key handler is just aString
.(: draw-circle (-> Real Image)) (define (draw-circle n) (circle n "solid" "blue")) (big-bang 5 : Number (on-tick add1 0.2) (to-draw draw-number 300 200))
Limitations
As of this writing, the limitations I am aware of are:
- You cannot
stop-with
- you must use astop-when
clause in thebig-bang
.