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))
#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?

This problem (and its solution) is detailed in https://docs.racket-lang.org/guide/mk-namespace.html#%28part..Sharing.Data_and_.Code_.Across_.Namespaces%29

((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.