For what types of procedures would lazy evaluation semantics have an advantage over strict? In what cases is strict evaluation better than lazy evaluation?
Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
I think it's generally a performance thing. Why waste cpu cycles if you don't have to? The best example I can think of is an if statement. The else isn't evaluated unless the if condition is true. When should strict be used? I'll take a shot in the dark here but I'm guessing compilers do some strict evaluation semantics to pick up potential errors.
Lazy evaluation includes performance increase, avoiding error conditions in evaluation of compound expressions, reduction in memory footprint and the best one, the capability of constructing potentially infinite data structures (so my book says). While strict evaluation eliminates the need to track and schedule the evaluation the evaluations expressions and allows the programmer to dictate the order of execution. Are into learning functional programming by any chance?