What are three features of Haskell that make it different than Scheme/LISP? 1. (
ID: 3536966 • Letter: W
Question
What are three features of Haskell that make it different than Scheme/LISP? 1. (5pts) What does lazy evaluation mean? Give an example not given in class. Note this is not the same as short circuit evaluation. 2 (5pts) What are the common solutions to the nesting problem for two-way selectors? 3. (5pts) List the design issues for counter controlled loop statements? 4. (5pts) In what way is c for statement more flexible than that of many other languages? 5 (5pts) What is user defined iteration controlExplanation / Answer
Your answers
What are three features of Haskell that make it different than Scheme/LISP?
1. Haskell is pure lambda calculus where as Scheme is about semantics and assignments.
2. Haskell uses lazy evaluation where as Scheme uses eager evaluation.
3. Haskell has static typing where as Scheme doesnt have.
What does lazy evaluation mean?
Lazy evaluation, as the word tells is about delaying the computation until you need the result. It is like, you dont need to compute until you need the result for further computation or anything else.
Example-
in Scheme, a function call %u201C(f x y)%u201D will evaluate %u201Cx%u201D and %u201Cy%u201D before invoking %u201Cf%u201D; but in Haskell it is done this way . %u201Cf x y%u201D
What are the common solutions to the nesting problem for two-way selectors?
You can use brackets
or compound statements may be used.
List the design issues for counter controlled loop statements?
type and scope of the loop variable
is it be legal for the loop variable or loop parameters to be changed in the loop, and if so, does the change affect loop control?
Should the loop parameters be evaluated only once, or once for every iteration?
In what way is c for statement more flexible than that of many other languages?
Any or all of the three header elements may be omitted, although the semicolons are required. Also the statements for initialization, condition, and increment can be any valid C statements with unrelated variables, and use any C datatypes including floats.
What is user defined iteration control
A user-defined iteration control is control iteration dependent on data structure order and number, iterator that returns the next element in some selected order if one exists and exit loops if it does not.
Let me know if you face any difficulties
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.