[Issue 8185] Pure functions and pointers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jun 2 01:42:24 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8185


klickverbot <code at klickverbot.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |code at klickverbot.at
           Severity|major                       |enhancement


--- Comment #1 from klickverbot <code at klickverbot.at> 2012-06-02 01:44:18 PDT ---
The current behavior is by design, and perfectly fine – note that `pure` in D
just means that a function doesn't access global (mutable) state. A pointer
somewhere isn't a problem either, since the caller must have obtained the
address from somewhere, and if it was indeed from global state, the calling
code couldn't be pure.

Do you have any suggestions on how to make this clearer in the spec? I admit
that the design can take some time to wrap one's head around, but I'm not sure
what's the best way to make the concept easier to grasp.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list