| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Passing by reference or by parameter in lazy evalutation?Sonsider such two functions:
f(x) = x + 1
g(x) = f(x) + x + 1
Consider lazy evaluation.
If I call g(2+2), it first calls f(2+2), where 2+2 is evaluated. Is that value (2+2=4) returned back to g, so it doesn't evaluate x again, when it needs it in the rest of the function (" + x + 1")?
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator