Give the results of calls of the following functionsexpressi

Give the results of calls of the following functions/expressions: (CAR \'((A B (C D)) E F (G H))) (CAR \'(CAR \'(AB (CDR \'(C D) U)) E F (G H))) (CONS\' P (CONS \'O (B (CDR \'(C D) E))))

Solution

a) (CAR \'((A B(C D) )E F(G H)))

(CAR \'(A B C D)E F (G H)))

(CAR \'(A B C D E F G H))

= A

b) (CAR \'(CAR \'(A B(CDR \'(C D) U)) E F (G H)))

(CAR \'(CAR \'(A B (D) U)) EF (G H)))

(CAR \'(CAR \'(A B D U) E F (G H)))

(CAR \'(A E F G H))

= A

c) (CONS \'P(CONS \'O(B(CDR \'(C D)E))))

(CONS \'P (CONS \'O(B (D) E))))

(CONS \'P (CONS \'O(B D E)))

(CONS \'P(O B D E))

= P O B D E

 Give the results of calls of the following functions/expressions: (CAR \'((A B (C D)) E F (G H))) (CAR \'(CAR \'(AB (CDR \'(C D) U)) E F (G H))) (CONS\' P (CON

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site