Practice 3.8
#lang racket
(define f
(let ((tag #t))
(lambda (x)
(if tag
(cond ((= x 1)
(begin (set! tag #f)
1))
((= x 0)
(begin (set! tag #f)
0))
(else
0))
0))))
;(f 0)
;(f 1)
(f 1)
(f 0)