To help LDC/GDC
Dicebot
m.strashun at gmail.com
Tue Apr 9 08:11:08 PDT 2013
On Tuesday, 9 April 2013 at 14:50:58 UTC, Simen Kjærås wrote:
> On Tue, 09 Apr 2013 16:15:40 +0200, Dicebot
> <m.strashun at gmail.com> wrote:
>
>> On Tuesday, 9 April 2013 at 14:06:31 UTC, Pelle Månsson wrote:
>>> shouldn't be strongly pure (as it can access mutable non
>>> local state).
>>
>> I was under impression that pure is about verifying what
>> function actually does, not what it probably can.
>
> It's based purely on function signature, so we're dealing with
> possibles
> in many cases.
You got me lost here again. Definition of pure in dlang.org says:
"To that end, a pure function:
* does not read or write any global or static mutable state
* cannot call functions that are not pure
* can override an impure function, but an impure function cannot
override a pure one
* is covariant with an impure function
* cannot perform I/O"
It is all about behavior, not function signature. And function
that takes ref parameter and does not read/write it is pure by
this list.
More information about the Digitalmars-d
mailing list