Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

computer science - I was reading the book of theory of programming languages by Diana Phelps-Terasaki and got stuck at this question which has been asked by my professor

what are the effects providing lazy evaluation in Imperative Languages? my answer was "It is a technique which is being used to postpone the evaluation of the expression until it’s components are needed, Basically why are you running a block of code when you don’t need to use it somewhere so lazy evaluation postpones all these type of expressions. It is also called call-by-need." and then I start explaining what actually imperative languages but the Prof. Said my boy you are wrong? please explain in detail what are the effects basically?

question from:https://stackoverflow.com/questions/65890682/i-was-reading-the-book-of-theory-of-programming-languages-by-diana-phelps-terasa

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Lazy evaluation is the postponing of an evaluation until the result of the evaluation is needed. So really it is: Why evaluate the expression if the result is not used.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...