943,970 Members | Top Members by Rank

Ad:
Feb 6th, 2005
0

Anyone know pure LISP?

Expand Post »
I am having some trouble understanding pure LISP. I am confused about the concepts of atoms and flat lists vs. any lists. I have a problem that should be fairly simple, although it uses recursion, which I am not very familiar with using. The function takes 1 argument which can be any list. It returns the number of atoms named A in the list. I was trying to see if there was only one element in the list and, if so, is it an A. If it is, return a 1. This is what I have:

(defun A-Count (L)
(cond
((null L) nil) ;This works fine
((equal (atom a) L) 1)
)
)

I do not have the default set up yet. Was just trying to get the first working. However, when I run it I get an "error - unbound function" or "error - unbound variable", depending on which example I try to enter. Thanks for any info anyone may have.

It's all Greek to me!
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
tat2dlady is offline Offline
32 posts
since Jan 2005
Mar 29th, 2005
0

Re: Anyone know pure LISP?

Here is a little insight into Lisp from a Python programmer. I found it interesting to read ...
http://ibiblio.org/obp/py4fun/lisp/lisp.html
Moderator
Reputation Points: 1333
Solved Threads: 1403
DaniWeb's Hypocrite
vegaseat is offline Offline
5,792 posts
since Oct 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Legacy and Other Languages Forum Timeline: Surpassing GW-BASIC memory limit.
Next Thread in Legacy and Other Languages Forum Timeline: Sql2k, How to set or unset IDENTITY Property of a column through code or stored





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC