PDA

Click to See Complete Forum and Search --> : LISP question


abcdefg
Apr 28th, 2004, 05:23 PM
Okay I could not find a forum for lisp so ill put it here. There is a function called member.

Here are some examples of its use:

(member 3 '(1 2 3 4 5)
Answer: (3 4 5)
(member 'hey '(whats going on here))
Answer: NIL
(member 'key '(where did (i (put) the (key))))
Asnwer: NIL

Now im supposed to write a recursive function which checks for an atom like say 3 inside of nested lists.

This function should evaluate the functions:
Examples: (somefunction 3 '(1 2 3 4 5))
T
(somefunction 'hey '(whats going on here))
NIL

Acidic
Apr 29th, 2004, 08:56 AM
I usnderstood nothing of that post. Please clarify a bit. What data do you want the function to work on? If it is an array, please post an array. what do you want the function to do?

What do you mean by atom? and a nested list? do you mean an array?

visualAd
Apr 29th, 2004, 12:30 PM
Its LISP - List Processing. A programming language I believe. I havn't got a clue how to do it though.

http://www.engin.umd.umich.edu/CIS/course.des/cis400/lisp/lisp.html

ccoder
Apr 29th, 2004, 01:15 PM
I did a little bit of Lisp coding in school back in the '70s but I'm not going to be able to answer your question after all these years. :p However, I did Google for 'lisp forum' and had over 100k hits. Here are some of the more interesting ones:

http://forums.belution.com/en/lisp/

http://www.planet-source-code.com/vb/discussion/AskAProMain.asp?lngWid=13

http://www.artofprogramming.com/bb/index.php

http://www.tek-tips.com/gthreadminder.cfm/lev2/4/lev3/32/pid/217

For Acidic, here is the definition of atom (http://www.gnu.org/software/emacs/emacs-lisp-intro/html_node/Lisp-Atoms.html).
and here is a list of atoms and lists(nested) ((A B) (B) C (D E F)) and an example of processing lists (http://t3x.dyndns.org/LISP/CL/caaar.html).