2 ms·
In many languages, it is an explicit parameter though. For instance, in Python, one would define a function with `def fun(state)` or a class method with `def f
by jabirali 6y ago
In many languages, it is an explicit parameter though.
For instance, in Python, one would define a function with `def fun(state)` or a class method with `def fun(self)`. In the function body, one would use respectively `state.var` or `self.var` to refer to a variable `var` in the state object. Running it is then done using `fun(state)` or `state.fun()`.
There are some minor syntactic differences between the two, but I find both these examples to be just as explicit...