A function with the same parameter should always return the same result:
x = add_two_to(3) = 5 ∴ x = 5
Functions always returning the same result for the same parameter is called referential transparency. It's what lets us replace add_two_to(3) with 5, as the result of 3+2 will always be 5.
Liked By
Write Answer
What is Referential Transprency in Erlang
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
24-Jun-2015Functions always returning the same result for the same parameter is called referential transparency. It's what lets us replace add_two_to(3) with 5, as the result of 3+2 will always be 5.