Improvement in pure functions specification

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 22 10:49:02 PST 2016


On Thursday, 22 December 2016 at 18:04:51 UTC, Observer wrote:

> (1) Serve as a convenient breakpoint handle in the debugger, 
> perhaps
>     as a kind of centralized this_cannot_ever_happen() function.
> (2) conditionally_die(conditions);
> (3) Sleep for some run-time-computable length of time.
> (4) Yield the thread so other threads can take execution 
> priority.
> (5) Yield the entire process so other processes can take 
> execution
>     priority.
> (6) Wait for an external trigger (perhaps a hardware interrupt, 
> for
>     instance).
> (7) Invoke a pass of garbage collection.


A function that does any of that cannot be pure.


More information about the Digitalmars-d mailing list