1

Can someone explain call by name, reference, and value in depth and also compare them to each other?

Simple examples would be great as well. I am really focused on call by name, it feels like it's very similar to call by reference.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Jay Velasco
  • 79
  • 1
  • 8
  • 1
    Did you read this first? http://en.wikipedia.org/wiki/Evaluation_strategy – ewernli Dec 07 '13 at 17:24
  • This is standard stuff covered in any principles of programming languages text. There also are earlier questions on the same topic. – ibid Dec 09 '13 at 08:38

1 Answers1

2

call by name : in call by name actual argument is not evaluated at the place of function calling rather they replace all the instance of corresponding formal parameters in text. Actual argument are evaluated as many times as required. Actual argument are evaluated within "caller" environment (if needed) :