Is inc function part of the library ?

Imperatorn johan_forsberg_86 at hotmail.com
Thu May 13 21:41:48 UTC 2021


On Thursday, 13 May 2021 at 17:48:34 UTC, kdevel wrote:
> On Thursday, 13 May 2021 at 13:45:50 UTC, Adam D. Ruppe wrote:
>> On Thursday, 13 May 2021 at 13:30:29 UTC, Alain De Vos wrote:
>>> [...]
>>
>> pure means it doesn't depend on any mutable info outside its 
>> arguments.
>>
>> You are only working on the arguments there so it is ok.
>
> Then D's pure does not match up with WP's definition [1] of 
> pure, at least not
>
>     2. The function application has no side effects (no 
> mutation of local
>     static variables, non-local variables, mutable reference 
> arguments
>     or input/output streams).
>
> WP quotes Bartosz Milewski:
>
>    2. A function has no side effects. Calling a function once 
> is the same as
>    calling it twice and discarding the result of the first call.
>
> [1] https://en.wikipedia.org/wiki/Pure_function

Just fyi:
https://dlang.org/articles/safed.html


More information about the Digitalmars-d-learn mailing list