Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Referential transparency

Name: Anonymous 2009-07-28 15:02

A function is RT <=> it can be substituted by its value in any place of the code, right? So what's the difference between a function being referentially transparent and not having side effects? Can I get an example of a function that is one but isn't the other one?

Name: Anonymous 2009-07-28 16:47

>>7
Is reading a global variable a side effect?
The function is accessing data other than its arguments, so yes.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List