Generator/Exponential: Difference between revisions

Content added Content deleted
m (→‎{{header|Ada}}: update comment)
m (→‎{{header|Ada}}: extend comment)
Line 17: Line 17:
{{works with|Ada 2005}}
{{works with|Ada 2005}}


To modify the internal state, the function uses an access parameter. For a different approach, see the Random packages of the Ada compiler, which use the so-called "Rosen trick". With the next release of Ada 2012 functions are allowed to have in-out parameters, which would solve this problem, too.
To modify the internal state, the function uses an access parameter. For a different approach, see the Random packages of the Ada compiler, which use the so-called "Rosen trick". With the next release of Ada 2012 functions are allowed to have in-out parameters, which would solve this problem, too. You could also use procedures instead of functions.


generator.ads:
generator.ads: