- -- The design of this spec is a bit awkward, as a result of Ada 95 not
- -- permitting in-out parameters for function formals (most naturally
- -- Generator values would be passed this way). In pure Ada 95, the only
- -- solution would be to add a self-referential component to the generator
- -- allowing access to the generator object from inside the function. This
- -- would work because the generator is limited, which prevents any copy.
-
- -- This is a bit heavy, so what we do is to use Unrestricted_Access to
- -- get a pointer to the state in the passed Generator. This works because
- -- Generator is a limited type and will thus always be passed by reference.