New member
"Richard Lewis" <[email protected]> Fri, 15 Apr 2005 17:53:01 +0100
| Newsgroups | gmane.lisp.common-lisp |
|---|---|
| Message-ID | <[email protected]> |
Hello Common-lisp, I've just joined this list. I'm completely new to LISP and I'm not sure what the sort of tone to this list is; are newbie questions alright? I'll take a bit of a gamble and post my first ever LISP program for scrutiny, it takes a number as an argument and returns T if its prime and NIL if its not. (It doesn't do the non-algorithmic primes...) ======================================== (defun prime-rfunc (x iterator) (if (= x iterator) (not ()) (if (= 0 (mod x iterator)) () (prime-rfunc x (1+ iterator))))) (defun prime (x) (prime-rfunc x 2)) (print (prime 1471)) ======================================== Look forward to some comments! Cheers, Richard