On 2009-04-21 11:18:39 -0400, Don <nos...@nospam.com> said:

Yes. Actually, marking a nested function as pure doesn't make much sense.
It's entirely equivalent to moving it outside the function; a nested pure function shouldn't be able to access any members of the enclosing function, otherwise it's not pure. But DMD doesn't enforce that, and so it creates inefficient and possibly buggy code.

What about immutable local variables? A pure function can access immutable globals, so it should be able to access immutable locals too.

--
Michel Fortin
michel.for...@michelf.com
http://michelf.com/

Reply via email to