What is the difference between definitions of reference transparency and deterministic function?

Reference transparency ( Wikipedia ):

An expression is called referentially transparent if it can be replaced by its value without changing the behavior of the program (in other words, inferior to a program that has the same effects and the result at the same input).

And also ( Find out what Erlang you have ):

Functions that always return the same result for the same parameter, called referential transparency

Deterministic Function ( MSDN ):

Deterministic functions always return the same result at any time when they are called with a specific set of input values.

When we talk about deterministic functions, do we mean referential transparency? When we talk about referential transparency, do we mean deterministic functions?

+4
source share
2 answers

, , " " , "". , - , . , , , , (0*rand() , , ).

+2

, " ". , -, , ( ).

, , . , .

, "", , " ", , . , , , , .

+2

Source: https://habr.com/ru/post/1624838/


All Articles