Question: I have a question about lisp programming. I want to use the key '(Likes Robbie Samantha) to find the value T, but my code keeps

I have a question about lisp programming. I want to use the key '(Likes Robbie Samantha) to find the value T, but my code keeps giving me the value NIL. I don't know why. I have attached my code below. It is in lisp.

(defun my-func()

(defparameter *KB* (make-hash-table))

(setf (gethash '(ROBOT ROBBIE) *KB*)'T) (setf (gethash '(Likes Robbie Samantha) *KB*) 'T) (setf (gethash '(Dog Rover) *KB*) T) (setf (gethash '(Bark Rover) *KB*) T) (setf (gethash '(Likes Robbie Chocolate) *KB*) T) (setf (gethash '(Lives Robbie California) *KB*) T) (setf (gethash '(Likes Robbie ice-cream) *KB*) T) (setf (gethash '(Eats Robbie petrol) *KB*) T) (format t "Please enter a well formed function ~% ") (terpri) (setq a (read-delimited-list #\~)) (print a) (terpri) (format t "~a ~%" (gethash '(Likes Robbie Samantha) *KB*)) (format t "~a ~%" (gethash 'a *KB*)) (terpri) )

(my-func)

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 Databases Questions!