Coordinate `generator?` with `eval`?

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))
> (eval #'(generator () (yield 1)) nm)

I have to ensure that it is a generator and generator-state is available. What can I do to fix it?

This problem (and its solution) is detailed in

((eval #'generator? nm) (eval #'(generator () (yield 1)) nm))

Thanks. I'll go through the documentation.

Thanks. But I suppose namespace-attach-module is a better choice.