When to use call-by-name and call-by-value?

后端 未结 5 1817
悲哀的现实
悲哀的现实 2021-02-03 13:15

I understand the basic concept of call-by-name and call-by-value, and I have also looked into handful number of examples. However, I am not very clear about when to use call-by-

5条回答
  •  后悔当初
    2021-02-03 14:00

    Nice put here for the logging use case of call by name: https://www.tutorialspoint.com/scala/functions_call_by_name.htm#:~:text=For%20this%20circumstance%2C%20Scala%20offers,and%20the%20value%20is%20calculated.

提交回复
热议问题