[racket] Definitions in cond-bodies

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Fri Jun 8 12:13:38 EDT 2012

2012/6/8 Sam Tobin-Hochstadt <samth at ccs.neu.edu>:

> What's happening is that `#%top` behaves differently at the REPL than
> in a module.  This enables you to write:
>
> -> (define (even? x) (or (zero? x) (odd? (sub1 x))))
> -> (define (odd? x) (or (= x 1) (even? (sub1 x))))
>
> without getting an error when entering the first line.

Ah!

Thanks,
Jens Axel


Posted on the users mailing list.