I'm reading SICP, the notion of lazy evaluation and eager evaluation is very interesting.Or called normal-order evaluation and applicative-order evaluation.
In SICP, the exercise 1.6 shows the difference between "if" and "new-if", It illustrates nicely the eager evaluation. So I experimented the C++ and C# lanaguage ,both shows out that three of them are eager evaluation.
Here is the C# code example:
In SICP, the exercise 1.6 shows the difference between "if" and "new-if", It illustrates nicely the eager evaluation. So I experimented the C++ and C# lanaguage ,both shows out that three of them are eager evaluation. Here is the C# code example:
C++ code example:
In C# ,we can use Lazy to show the lazy evaluation, but the normal C# is eager evaluation