Description
Question 1: Theoretical Questions
1.1 Is a function-body with multiple expressions required in a pure functional programming? In
which type of languages is it useful?
- Why are special forms required in programming languages? Why can’t we simply define
them as primitive operators? Give an example
- Can the logical operation ‘or’ be defined as a primitive operator, or must it be defined as
a special form? Refer in your answer to the option of shortcut semantics.
QI .3 What is a syntactic abbreviation? Give two examples
QI.4
- What is the value of the following L3 program? Explain. [2 points]
(define x 1)
(let ( (x 5)
y)
- Read about let* here.
What is the value of the following program? Explain. [2 points]
(define x
(let* ( (x
y)
1)
5)
- Annotate lexical addresses in the given expression [6 points]
(define x 2)
(define y 5)
(let
(f (Lambda (z)
(let*
(f (lambda (z)
- Define the let* expression in section c above as an equivalent let expression [3 points]
- Define the let* expression in section c above as an equivalent application expression
(with no let) [3 points]