I want to use eval
to produce a generator and enforce generator?
on the result of the evaluation.
But it seems that the result is just an ordinary procedure instead of a generator.
Welcome to Racket v8.8.0.8 [cs].
> (define nm (make-base-namespace))
> (parameterize ((current-namespace nm))
(namespace-require 'racket/generator))
> (require racket/generator)
> (generator? (eval #'(generator () (yield 1)) nm))
#f
> (eval #'(generator () (yield 1)) nm)
#<procedure:generator>
I have to ensure that it is a generator and generator-state
is available. What can I do to fix it?