News for hackers. Stuff that matters.
Re:Functional Programming – How and Why by kaba0 on Tuesday January 03, 2023 @10:12AM (#34232329)
Java is referentially transparent. It just really doesn’t mean what you believe it does. It means that one can replace a reference to a thing with the thing itself.

It is a syntax level term, muddying execution model is just not correct usage, see https://stackoverflow.com/questions/210835/what-is-referenti...

What you are looking for is simply and plainly “pureness”.

Re:Functional Programming – How and Why by valenterry on Tuesday January 10, 2023 @04:02AM (#34322199)
> Java is referentially transparent

Referential transparency is not a property of programming languages but expressions (or more general, parts of computer programs).

> It means that one can replace a reference to a thing with the thing itself.

That's not the common definition at all. Read the link I posted. In any case, I'm talking about evaluatable expressions, you talk about "references" - however you define that.

Even in your own stackoverflow link, the accepted answer says this:

> the thing that an expression refers to

Re:Functional Programming – How and Why by kaba0 on Tuesday January 10, 2023 @06:56AM (#34323452)
But expressions don’t mean the thing they evaluate to, this is an ad hoc meaning used in FP circles only. Is `fibonacci 1000` the integer value it evaluates to? No, it is an expression denoting the calculation of that value.

What’s missing from side-effect freedom or pureness? That is the property that allows replacing an expression with its value.

Re:Functional Programming – How and Why by valenterry on Tuesday January 10, 2023 @07:49AM (#34324040)
> But expressions don’t mean the thing they evaluate to, this is an ad hoc meaning used in FP circles only. Is `fibonacci 1000` the integer value it evaluates to? No, it is an expression denoting the calculation of that value.

Not sure what you are talking about now.

> What’s missing from side-effect freedom or pureness? That is the property that allows replacing an expression with its value.

I think you are just unfamiliar with the terminology, that's all.

See Wikpedia again:

> If a pure function is called with arguments that cause no side-effects, the result is constant with respect to that argument list (sometimes called referential transparency or idempotence), i.e., calling the pure function again with the same arguments returns the same result. (This can enable caching optimizations such as memoization.)

(https://en.wikipedia.org/wiki/Functional_programming#Pure_fu...)

There you go. All 3 terms in once sentence. Maybe, again, you disagree with Wikipedia and the definition and that's your good right, but I don't see any point in prolonging the discussion over that.