Talk:Functional programming: Difference between revisions

Content deleted Content added
Line 148:
:{{ping|Greglocock}} I've tried to clarify, let me know if that's enough. It's not just about global variables, but having no state that is not captured in the arguments and return values. [[User:Diego Moya|Diego]] ([[User talk:Diego Moya|talk]]) 12:45, 24 April 2017 (UTC)
:P.S. Technically you can have global variables in a pure functional language, as long as they're immutable. "Global" is a term describing the [[Scope (computer science)|scope]] of a variable, not its changes in state. Having no state changes in ''any'' variable in the whole program is a rather strong requirement, which changes the programming paradigm significantly with respect to imperative programming. [[User:Diego Moya|Diego]] ([[User talk:Diego Moya|talk]]) 12:52, 24 April 2017 (UTC)
::Thanks. So b=2*a is ok, but a=2*a is not? I can see that that is more robust in general, if a tad inconvenient for incrementing indices. [[User:Greglocock|Greglocock]] ([[User talk:Greglocock|talk]]) 00:31, 25 April 2017 (UTC)