Call by name/reference/value

2.7k views Asked by At

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.

1

There are 1 answers

0
Sandeep Sharma On

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) :