Is this function pure?
Bruce Adams
tortoise_74 at yeah.who.co.uk
Tue Sep 18 17:29:55 PDT 2007
0ffh Wrote:
> Nathan Reed wrote:
> > Exception throwing and catching is deterministic too as long as the
> > condition that generates the exception is (which dividing by zero would
> > be). I think it is perfectly reasonable to allow pure functions to
> > throw and catch exceptions.
>
> We might even want go all the way, and *require* a pure function to throw
> an exception if it detects that functional purity has been compromised
> like in Janice's out-of-memory example.
>
> Regards, frank
My understanding is that pure is a compile time concept. If your function can violate it its not pure, unless you have a scheme for compile time exception handling - yeauch.
Bruce.
More information about the Digitalmars-d
mailing list