Purity vs Referential transparency

前端 未结 5 1960
旧时难觅i
旧时难觅i 2020-12-04 18:43

The terms do appear to be defined differently, but I\'ve always thought of one implying the other; I can\'t think of any case when an expression is referentially t

5条回答
  •  囚心锁ツ
    2020-12-04 19:38

    If I gather in one place any three theorists of my acquaintance, at least two of them disagree on the meaning of the term "referential transparency." And when I was a young student, a mentor of mine gave me a paper explaining that even if you consider only the professional literature, the phrase "referentially transparent" is used to mean at least three different things. (Unfortunately that paper is somewhere in a box of reprints that have yet to be scanned. I searched Google Scholar for it but I had no success.)

    I cannot inform you, but I can advise you to give up: Because even the tiny cadre of pointy-headed language theorists can't agree on what it means, the term "referentially transparent" is not useful. So don't use it.


    P.S. On any topic to do with the semantics of programming languages, Wikipedia is unreliable. I have given up trying to fix it; the Wikipedian process seems to regard change and popular voting over stability and accuracy.

提交回复
热议问题