Pure functions in D

Sergey Gromov snake.scaly at gmail.com
Mon Sep 22 08:25:37 PDT 2008


bearophile <bearophileHUGS at lycos.com> wrote:
> > Since this wasn't touched on in the article, I want to point out
> > that Haskell allows "pure functions" to throw exceptions, but not
> > catch them.
> 
> This is quite interesting and it has some consequences. So a pure
> function can call another pure function only if the second one can't
> throw?

I cannot see how this follows.  If a function calls another function 
that may throw, it doesn't automatically make it catch.  So the call may 
be of any depth, and an exception may be thrown at any level.  You just 
not allowed to try/catch, nor various forms of scope.



More information about the Digitalmars-d mailing list