Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN LISP Define the function my-assoc that takes an atom A and a list L and returns the association pair for A. L is of

IN LISP

  1. Define the function my-assoc that takes an atom A and a list L and returns the association pair for A. L is of the form ((key1 . value1)(key2 . value2) (keyn . valuen)) Examples:
    • (my-assoc 'a nil) --> nil
    • (my-assoc 'a '((a . b)(c e f)(b))) --> (a . b)
    • (my-assoc 'c '((a . b)(c e f)(b))) --> (c e f)
    • (my-assoc 'b '((a . b)(c e f)(b))) --> (b)

I have my-length, my-memq, my-append, and my-attach and can only use

  • defun
  • cond
  • cons
  • car
  • cdr
  • operators +, -, <, and >
  • null
  • eq
  • listp
  • atom
  • symbolp

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Automating Access Databases With Macros

Authors: Fish Davis

1st Edition

1797816349, 978-1797816340

More Books

Students also viewed these Databases questions