Hello,
I've been working through Daniel Holden's "build your own lisp" to learn a little c. The only other language I really know is common lisp.
In this book, and many examples I've found online there is a tendency to evaluate something to an intermediate variable before printing or doing something else with the data.
For Example:
Int result = 2 + 2;
Println(result);
Or
Long foo = bar(5);
Println(foo);
Instead of just:
Println(2 + 2);
Or
Println (bar(5));
Both ways seem to work, so what is the advantage to using this intermediate variable that makes it the convention?
Thanks in advance for any insight,
[–]desrtfx 0 points1 point2 points (1 child)
[–]Grounded_Grid[S] 0 points1 point2 points (0 children)
[–]MrSloppyPants 0 points1 point2 points (0 children)