Timeline for Referential Transparency by using Zero References?
Current License: CC BY-SA 3.0
7 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Oct 21, 2020 at 22:33 | comment | added | user377672 | @AndresF I would generally count the console output as a form of state mutation. Is that not quite right? I get knee-deep in low-level programming very often so it's kind of confusing to me. A simpler term I feel more confident throwing around is external side effects. | |
| Jun 3, 2016 at 3:51 | comment | added | Jack | @clinux And that interpreter may also be pure. For example, an interpreter that tests a series of file read and write actions could use an in memory file. | |
| Jun 3, 2016 at 3:03 | comment | added | Andres F. |
To elaborate on @Jack's comment, the following C function is not referentially transparent, even though it doesn't mutate anything: int f(int x) { printf("hello\n"); return x; }.
|
|
| Jun 2, 2016 at 23:11 | comment | added | clinux | Leaving you to represent side effects as a pure value, then passing that pure value to an interpreter later on. | |
| Jun 2, 2016 at 23:10 | vote | accept | clinux | ||
| Jun 2, 2016 at 22:02 | comment | added | Jack | In addition to mutation, referential transparency bans side effects such as writing to the console. | |
| Jun 2, 2016 at 21:37 | history | answered | Jon Chesterfield | CC BY-SA 3.0 |