2.6 Controlling Evaluation
Accepts two arguments and returns its second argument. When the result is forced, the first argument
will also be evaluated to weak head normal form. This can be used to reduce laziness.
A simple partial function that crashes the program with a message when evaluated.
2.6.1 Incomplete Programs
value that crashes the program when evaluated.
A form that expands to a partial
value of type
(forall [a] a)
that crashes the program with a message containing its expected type when
evaluated. Uses of this form serve as an indicator that a part of the program is not yet written. The
s provided to todo!
are ignored, allowing the contents to contain
not-yet-working sketches and notes.
|> (not (todo!))|
eval:2.0: todo! with type Bool
|> (+ 42 (todo!))|
eval:3.0: todo! with type Integer
|> (+ 42 ((todo!) "hello"))|
eval:4.0: todo! with type (-> String Integer)
Additionally, todo! attaches a syntax property containing its expected type to its expansion
to cooperate with editors that know how to display that information. See
the Todo List for DrRacket documentation for