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-drawnoton-draw. -
The last argument to a mouse handler is a
Mouse-Eventbut 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-whenclause in thebig-bang.
Last modified August 24, 2021: intermediate cs and initial hugo changeover (1784229)