| > He's right though :) Not in the world at large. There’s considerable variation in what different programming languages/paradigms call ‘code units’ with varying properties. For example, pascal has functions that cannot change the values of their arguments, and procedures that cannot return values. Both would be called functions in C and JavaScript. Common Lisp has defun to define functions because it is a lisp, but introduces defmethod to make something that’s highly similar, except [1] that it can be called when code calls a generic function defined by defgeneric (https://gigamonkeys.com/book/object-reorientation-generic-fu...; https://opendylan.org/intro-dylan/methods-generic-functions.... may be easier to understand because it, IMO, is better written and because, for many, Dylan’s pascal syntax is easier to understand) Also, functional language purists will argue that functions must be pure (https://en.wikipedia.org/wiki/Pure_function), as they are in mathematics. [1] I probably am ignoring/forgetting details, possibly even essential ones, here. |
'pure' macros -> no state, everything registers as global.
functions -> stack state, everything's local. non-locals get what ever maxwell's deamon decides to provide.
methods -> heap state, methods to madness of functional local globals. at runtime, allows for everything to be routine or not.