CSCI 3137 - Assignment 7- Parameter Evaluation


  • 作业标题:CSCI 3137 - Assignment 7: Parameter Evaluation
  • 课程名称:Dalhouse University CSCI 3137 Principles of Programming Languages
  • 完成周期:1天

Lazy Lists in Java (4 points)

Note: This question is long, but your answer will be short, consisting of only a dozen lines of
Java code.

In Wednesday’s class, we will discuss the evaluation of function parameters. Applicative
order evaluation evaluates expressions provided as function arguments before calling the
function and passes the resulting values to the function call. Normal order evaluation passes
expressions to function calls in unevaluated form. The callee evaluates each expression from
scratch whenever it needs to know the value of the expression. Lazy evaluation is applicative
order evaluation plus caching: Expressions are stored in unevaluated form until their values
are needed for the first time. At that time, the expression is evaluated, and the result is cached.
If and when the value of the expression is needed a second time, the cached value is used,
without evaluating the expression a second time.

。。。

Submission

Assignments are due by 11:59 PM on the due date. Assignments must be submitted electronically via Brightspace. Only a single PDF is accepted. You can do your work on paper and then scan it and submit the scanned. If at all possible, scan your assignment instead of taking a photo. The result will be more readable. If you do need to take a photo, ensure proper lighting and that the camera is properly focused. If the marker cannot read your work, you don’t earn any marks. Even if you take a photo or photos, it is your responsibility to convert the photos to a single PDF with the pages in the correct order.


文章作者: IT神助攻
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 IT神助攻 !
  目录