•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Legacy and Other Languages section within the Software Development category of DaniWeb, a massive community of 391,858 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,593 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Legacy and Other Languages advertiser:
Views: 2725 | Replies: 1
![]() |
•
•
Join Date: Jan 2005
Posts: 31
Reputation:
Rep Power: 4
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!
•
•
Join Date: Oct 2004
Location: Mojave Desert
Posts: 2,394
Reputation:
Rep Power: 9
Solved Threads: 172
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!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Legacy and Other Languages Marketplace
Similar Threads
- Lisp Programming defparameter (Computer Science and Software Design)
- Lisp Programming! (Perl)
- LISP:i changed the load function accidently...HELP (Computer Science and Software Design)
- 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



Linear Mode