[Issue 8185] Pure functions and pointers

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 3 22:36:30 PDT 2012


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



--- Comment #18 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2012-06-04 09:38:21 MSD ---
(In reply to comment #15)
> I really don't know how the documentation could be much clearer.

Once it will have examples showing what asserts have to/may/shouldn't pass
and/or (I prefer and) what optimizations can be done. Even Setting Dynamic
Array Length section has such examples but it is far more simple.

> As for stuff like strlen, in that case, you're doing the @system thing of
saying that yes, I know what I'm doing.

And the missing now words "What exactly does these pure functions consider as
`argument
value` and as `returned value`" from my original question because it's treated
by someone as "only pointer dereferencing" and by someone "access to any
logically accessible address".

Again, all misunderstanding of pure functions in D can be easily solved by just
adding (lots of) examples with difficult cases into docs.

IMHO, Jonathan M Davis e.g. will save at least lots of his time (yes, and our
time too) by just adding such examples with minimal comments into docs instead
of writing such big answers.

-- 
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