4 ms·
And is another way to say this "side-effect free"?
by e40 5y ago
And is another way to say this "side-effect free"?
- rcfox 5y agoThe Linux shell command 'touch foo' is idempotent, but not side-effect free. Reading a variable shared between threads without a lock is side-effect free but not idempotent.
- omegalulw 5y agoReading a variable isn't side-effect free either :P
- zomglings 5y agoInterestingly, `touch` is not idempotent because it modifies timestamps. Not being pedantic, just an interesting consideration. `mkdir -p` is idempotent, I believe.
- mytailorisrich 5y agoYou're absolutely correct, it's not idempotent for the crucial reason you mention. It's crucial because updating the timestamps is the main purpose of 'touch' in the first place!
- deleted 5y ago[deleted]