From: Chia-Lin Wang
Subject: Error ??
Date: 
Message-ID: <366EB9D8.9A609FE1@is.nyu.edu>
--------------FE51F1D9B7976B28D28B847C
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This's what I got when compiling my program


Error: The function MOTHER_OF_PERSON1 is undefined.
Fast links are on: do (use-fast-links nil) for debugging
Error signalled by IF.
Backtrace: system:universal-error-handler > evalhook > load > compare >
if > let > if > COMPARE

Broken at CONS.

What could be the error in my program?

(setf (get 'GEORGE 'MOTHER) 'JANE)
(setf (get 'JANE 'MOTHER) 'VIRGINIA)
(setf (get 'ALEX 'MOTHER) 'SHARON)
(setf (get 'BUFFY 'MOTHER) 'SHARON)
(setf (get 'ELLRN 'MOTHER) 'BUFFY)
(setf (get 'SHARON 'MOTHER) 'VIRGINIA)
(setf (get 'GEORGE 'FATHER) 'FRED)
(setf (get 'FRED 'FATHER) 'EDWARD)
(setf (get 'VIRGINIA 'FATHER) 'ARTHUR)



(defun COMPARE (person1 person2)
   (if (or (null person1) (null person2))
       'nil
       (let
           ((mother_of_person1 (get person1 'MOTHER))
            (father_of_person1 (get person1 'FATHER)))
           (if (eq mother_of_person1 person2)
               (return person2)
        (COMPARE (mother_of_person1 person2)))
           (if (eq father_of_person1 person2)
        (return person2)
        (COMPARE (father_of_person1 person2))))))

(COMPARE 'SHARON 'JANE)

## mother_of_person1 in my codes is a VARIABLE!##

Chia-lin

--------------FE51F1D9B7976B28D28B847C
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<HTML>
This's what I got when compiling my program
<BR>&nbsp;

<P><B>Error: The function MOTHER_OF_PERSON1 is undefined.</B>
<BR>Fast links are on: do (use-fast-links nil) for debugging
<BR>Error signalled by IF.
<BR>Backtrace: system:universal-error-handler > evalhook > load > compare
> if > let > if > COMPARE

<P>Broken at CONS.

<P>What could be the error in my program?

<P>(setf (get 'GEORGE 'MOTHER) 'JANE)
<BR>(setf (get 'JANE 'MOTHER) 'VIRGINIA)
<BR>(setf (get 'ALEX 'MOTHER) 'SHARON)
<BR>(setf (get 'BUFFY 'MOTHER) 'SHARON)
<BR>(setf (get 'ELLRN 'MOTHER) 'BUFFY)
<BR>(setf (get 'SHARON 'MOTHER) 'VIRGINIA)
<BR>(setf (get 'GEORGE 'FATHER) 'FRED)
<BR>(setf (get 'FRED 'FATHER) 'EDWARD)
<BR>(setf (get 'VIRGINIA 'FATHER) 'ARTHUR)
<BR>&nbsp;
<BR>&nbsp;

<P>(defun COMPARE (person1 person2)
<BR>&nbsp;&nbsp; (if (or (null person1) (null person2))
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'nil
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (let
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ((mother_of_person1
(get person1 'MOTHER))
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(father_of_person1 (get person1 'FATHER)))
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if (eq
mother_of_person1 person2)
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(return person2)
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (COMPARE (mother_of_person1
person2)))
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (if (eq
father_of_person1 person2)
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (return person2)
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (COMPARE (father_of_person1
person2))))))

<P>(COMPARE 'SHARON 'JANE)

<P><B>## mother_of_person1 in my codes is a VARIABLE!##</B><B></B>

<P>Chia-lin</HTML>

--------------FE51F1D9B7976B28D28B847C--
From: Barry Margolin
Subject: Re: Error ??
Date: 
Message-ID: <3Azb2.103$g34.8417@burlma1-snr1.gtei.net>
In article <·················@is.nyu.edu>,
Chia-Lin Wang  <······@is.nyu.edu> wrote:
>This's what I got when compiling my program
>
>
>Error: The function MOTHER_OF_PERSON1 is undefined.
...
>(defun COMPARE (person1 person2)
>   (if (or (null person1) (null person2))
>       'nil
>       (let
>           ((mother_of_person1 (get person1 'MOTHER))
>            (father_of_person1 (get person1 'FATHER)))
>           (if (eq mother_of_person1 person2)
>               (return person2)
>        (COMPARE (mother_of_person1 person2)))

That should probably be:

         (COMPARE mother_of_person1 person2))

>           (if (eq father_of_person1 person2)
>        (return person2)
>        (COMPARE (father_of_person1 person2))))))

And that should be:

         (COMPARE father_of_person1 person2))


>## mother_of_person1 in my codes is a VARIABLE!##

Then why are you using it in the function position of a form?

P.S. We're volunteering to debug your programs, so please make it easy on
us: indent them properly.

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Don't bother cc'ing followups to me.