[Issue 7314] strong purity should be inferred at call site

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 18 14:49:12 PST 2012


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


bearophile_hugs at eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs at eml.cc


--- Comment #1 from bearophile_hugs at eml.cc 2012-01-18 14:49:09 PST ---
I think there are ways to further improve this idea. And I think such ideas
will lead to quite useful code. I have recently written two posts about related
ideas. I think this is an improvement.


But I think language complexity too should be kept into account. When a
programmer writes code like this:


auto foo(...) pure { ... }
void main() {
    immutable x = foo(...);
}


She should be able to usually guess correctly if such code is correct, or if it
doesn't compile. The more complex D purity becomes, the less easy is to
remember all the rules and exceptions to the rule, and this increases the risk
of turning  programming more into guesswork than design. This sometimes happens
even if every single rule looks like an improvement.

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