Question: please solve this. It is functional programming - - > LISP ( RACKET ) Context Warning - this task is two pages long! Racket Scheme,

please solve this. It is functional programming --> LISP (RACKET) Context
Warning - this task is two pages long!
Racket Scheme, as a dialect of Lisp, is characterized by the use of symbolic expressions to represent
both structured data and code. This task focuses on understanding and manipulating s-expressions,
evaluating expressions in Racket, and using functional constructs such as lists and macros.
Statements that ask about the results of expressions assume that all previous lines that are correct have been executed correctly, and that any lines that are not correct have been skipped.
1.(define (zag)(zag))
2.(define (square \( x)(* x x)\))
3.(define (bar \( x \))(foo 1 x ))
4.(define (my-if cond? val then-expr else-expr)(if [cond? val] then-expr elseexpr))
5.(define (foo \( x y \))(+ x (*2 y\()\)))
6.(define (big-number \( x \))(cond [(\( x_{i}>\).5) 'big][else 'small]))
7.(eval '(bar 1))
8.(if (eg?11)1(zag))
9.(eval (cons 'bar 1))
10.(foo '(12))
11.(square -5)
12.(apply foo '(12))
13.(my-if (eg?11)1(zag))
14.(apply bar (sheet 1))
15.(foo 12)
16.(eval (list bar 1))
17.(eval 'bar 1)
18.(apply foo 12)
19.(eval (cadr '((bar 1)(bar 2))))
20.(eval (quote (bar 1))
21.(sheet 12'a)
22.(map square '())
23.(map square '(123))
Claims
1.\(\square \) With lazy evaluation, the function is always evaluated first, and its arguments as necessary.
2.. Functions in pure functional programming are always evaluated so that the function is evaluated first, a
her arguments as needed.
3.\(\square \) In programming languages that are not purely functional, functions are evaluated so that the values of the arguments
calculated and assigned to the frame within which the function is evaluated.
4.- Everything in Racket, except macros, can be represented as an sexpression.
5. The expression in line 11 is evaluated at 25.
6.\(\square \) Line 2 defines a square function that has side-effects.
7.\(\square \) Line 2 defines the pure function square.
8.- Line 21 creates a list with elements 1,2,'a.
9. Line 23 returns pairs (cons 1(cons 4(cons \(9^{\prime}(\))))).
10.\(\square \) The expression (quote (12 a)) has the same value as line 21.
12.\(\square \) The list is generally empty a list or structure of two elements whose second element is a list.
13. macroexpand returns an expanded version of a macro before its evaluation.
14.\(\square \) The expression baz is a call to the function baz with zero arguments.
15.- Lines 15 and 12 have the same value.
16.\(\square \) Lines 18 and 10 have the same value.
17.- Lines 15 and 10 have the same value.
18.- Lines 15 and 18 have the same value.
19.\(\square \) Lines 14 and 19 have the same value.
20.\(\square \) Lines 14,7 and 19 have the same value.
21.\(\square \) Line 17 contains an error.
22.\(\square \) Line 16 contains an error.
23.\(\square \) The big-number function in line 6 returns the symbol 'big if \( x \) is greater than 5.
24.- Line 8 will return the value 1.
25. Line 8 will hang.
please solve this. It is functional programming -

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!