3 ms·
I disagree that your ‘ echo hello’ example is free of side effects. It writes to stdout. It overwrites $?. It changes the value of the last executed history co
by ComputerGuru 9y ago
I disagree that your ‘ echo hello’ example is free of side effects. It writes to stdout. It overwrites $?. It changes the value of the last executed history command. Etc.
About the only side effect free operation at a blank line terminal prompt is _probably_ hitting enter or ctrl c. Or ‘#something<Enter>’
But your idempotency examples are spot on.
Basically, idempotency is a very useful concept. Side effect free isn’t.
- twic 9y ago> I disagree that your ‘ echo hello’ example is free of side effects. I posit that you understand perfectly well what i was getting at! If it helps, imagine that you are spawning a fresh shell to execute each command line, through system(3) or some such.
- ComputerGuru 9y agoFair enough!