Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
924 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 Reply

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...