Talk:D (programming language): Difference between revisions

Content deleted Content added
Line 67:
</source>
::will not compile, and compiler will report the issue:
 
<source>
a.d:10:18: error: immutable function 'a.main.mysum' cannot access mutable data 'pivot'
10 | if (b <= pivot) // ref to enclosing-scope
</source>
 
::If the pivot is made const or immutable, it will compile. In this sense the function will become strongly pure, but only during current execution of the scope. The context will be takes implicitly. https://dlang.org/spec/function.html#pure-functions provides some extra details, but details of pure functions inside other functions is not really well explained. [[Special:Contributions/81.6.34.172|81.6.34.172]] ([[User talk:81.6.34.172|talk]]) 20:15, 29 April 2020 (UTC)
 
== Pull the C# reference until examples? ==