How to understand that "calling get arguably breaks referential transparency"? on page 99?

23 views
Skip to first unread message

Dahui

unread,
May 29, 2018, 10:55:33 PM5/29/18
to scala-functional
On chapter 7, page 99, it says that "But if unit begins evaluating its argument concurrently, then calling get arguably breaks referential transparency.". 
I can't figure out what is the RT here? Could anyone help to explain it? Thanks.

Raymond Tay

unread,
May 29, 2018, 11:20:47 PM5/29/18
to scala-fu...@googlegroups.com
Hi Dahui,

From that chapter's context, i believe what is meant here given that "def unit[A](a: => A)" is defined, is that we generally have no idea what the type parameter "A" represents - infact it could be anything e.g. closures over vars or some side-effects etc and the authors go to explain how in the code snippet in that same page i.e. page 99.

On Wed, May 30, 2018 at 10:55 AM Dahui <dhy...@gmail.com> wrote:
On chapter 7, page 99, it says that "But if unit begins evaluating its argument concurrently, then calling get arguably breaks referential transparency.". 
I can't figure out what is the RT here? Could anyone help to explain it? Thanks.

--
You received this message because you are subscribed to the Google Groups "scala-functional" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-function...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Dahui

unread,
May 30, 2018, 1:01:19 AM5/30/18
to scala-functional
Thanks! 
I found another reply which explained very good.  
https://groups.google.com/d/msg/scala-functional/7o4_ZRJEoQA/kNBZmM_HG4EJ


在 2018年5月30日星期三 UTC+8上午11:20:47,raymondtay1974写道:

Raymond Tay

unread,
May 30, 2018, 1:47:02 AM5/30/18
to scala-fu...@googlegroups.com
Glad to hear that.
Reply all
Reply to author
Forward
0 new messages