Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Passing by reference or by parameter in lazy evalutation?

Posted by Michael_Rybak at 2006-08-13 15:59:39 on Problem 2963
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator