
Simple defun list passing question
Quote:
>I was wondering if anyone could tell me what the proper way to pass a list
>in lisp to a function defined using defun.
The same way you pass anything else.
Quote:
>I am basically trying to setup something like this :
>(defun foo (x)
> (first (x)))
>Basically I want to pass a list to the function and have it return the
>first element of the list, and do any other functions that can be done on
>lists. Basically after i load the lsp file i want to be able to type
Just refer to X as a variable:
(defun foo (x)
(first x))
This is something really basic. I'm curious how you could be doing
*anything* in Lisp if you didn't know this.
When you write (x) in your function, you're trying to call a function named
X rather than use the value of the variable.
--
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.