4 ms·
Because you can write person.getName() like this: def getName(): . . this.setName('foo') . . return this.name There's nothing in principle preventing you
by typon 11y ago
Because you can write person.getName() like this:
def getName():
. . this.setName('foo')
. . return this.name
There's nothing in principle preventing you from doing that in the "functional" approach but if your data is immutable then you can't do it.
- Someone 11y agodef getName(person): person.setName('foo') return person.name The problem, from a functional viewpoint, isn't the implicit argument, it is the fact that you can write setName.