Newsgroups: comp.lang.lisp
Path: cantaloupe.srv.cs.cmu.edu!europa.chnt.gtegsc.com!salliemae!uunet!news.erinet.com!malgudi.oar.net!chemabs!usenet
From: zfs60@cas.org (John Shen)
Subject: Re: Help with COND
In-Reply-To: eilman@midget.towson.edu's message of 8 May 1995 19:54:32 GMT
Message-ID: <ZFS60.95May9104614@zfs60mwm.cas.org>
Lines: 27
Sender: usenet@chemabs.uucp
Organization: Chemical Abstracts Service, Columbus, Ohio
References: <3olsng$brt@news.umbc.edu> <3olsto$btu@news.umbc.edu>
Date: Tue, 9 May 1995 14:46:14 GMT

In article <3olsto$btu@news.umbc.edu> eilman@midget.towson.edu (Michael Eilman) writes:

> From: eilman@midget.towson.edu (Michael Eilman)
> Newsgroups: comp.lang.lisp
> Date: 8 May 1995 19:54:32 GMT
> Organization: Towson State University, Towson, MD
> 
> Michael Eilman (eilman@midget.towson.edu) wrote:
> : I am kinda new to LISP and I am having a little trouble with a cond + 
> : others statement.  Basically what I am trying to do is write a condition 
> : statement which compares a word to the first word in a list of lists.  
> : The function looks much like this:
> 
> : (defun look (pathlist room)
> : 	(cond (nil (pathlist) null)
> :               (eq (car(car(pathlist))) room) pprint (cdr(car(pathlist))))
> :               (t (look (cdr(pathlist)) room ))))
> 
> : can anyone help me????
> 
> The error that I get is that " the variable eq is not defined".

some parens are misplaced.  anyway, the test part has to be a form
that returns a value, and eq won't (it is a function, not a symbol
like nil or t).

((eq (car(car(pathlist))) room) (pprint (cdr(car(pathlist)))))
