Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In LISP, code the function ( printWOP lis ) which is passed a list. It prints li

ID: 3601993 • Letter: I

Question

In LISP, code the function (printWOP lis) which is passed a list. It prints lis without surrounding parentheses on one line.

It first does a (terpri) to cause printing at the beginning of the line.

If the lis is an atom, simply PRINC it and do not do the next step.

For each entry in the list:

use PRINC to print the item

use PRINC to print a space (PRINC " ")

Finally, it does another (terpri).

Functionally, printWOP returns T.

Hint: break this into two functions. The step where we go through the list should probably be done by another function.

> (printWOP '(A B D))

A B D

T

> (printWOP '(A (B D) E F) )

A (B D) E F

T

> (printWOP NIL)

NIL

T

> (printWOP 'A)

A

T

Explanation / Answer

(defun person-at (loc pers per-locs) (labels ((at-loc-p (pers) (eq (cadr (assoc pers per-locs)) loc))) (remove-if-not #'at-loc-p pers)))

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote