The One-Letter Nested Function - a sample article for some kind of

Zach the Mystic reachzachatgooglesmailservice at
Mon Feb 13 08:00:52 PST 2012

On 2/13/12 9:14 AM, bearophile wrote:
> Where possible it's good to add "static" to nested functions:
> static ubyte u(in int a, in int b) pure nothrow { return cast(ubyte) uniform(a,b); }

You're right. The only advantage to the way I wrote it is, possibly, 
it's easier for new people (like myself) to grasp the idea. But I'm 
pretty sure uniform is NOT a pure function. In fact, generating random 
numbers is about as far opposite a "pure" function as you can get, 
right? :-)

More information about the Digitalmars-d mailing list