| | |
Anyone know pure LISP?
![]() |
•
•
Join Date: Jan 2005
Posts: 31
Reputation:
Solved Threads: 0
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!
(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!
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
http://ibiblio.org/obp/py4fun/lisp/lisp.html
May 'the Google' be with you!
![]() |
Similar Threads
- Lisp Programming defparameter (Computer Science)
- Lisp Programming! (Perl)
- LISP:i changed the load function accidently...HELP (Computer Science)
- Lisp help - is this function right? (Legacy and Other Languages)
- pure virtual destructors (C)
Other Threads in the Legacy and Other Languages Forum
- Previous Thread: Surpassing GW-BASIC memory limit.
- Next Thread: Sql2k, How to set or unset IDENTITY Property of a column through code or stored
| Thread Tools | Search this Thread |






