Hello ALUG,
I thought I'd try and learn LISP for fun!
I've found some good tutorials on the web but I can't seem to find a mailing list. I found common-lisp@ai.sri.com but I can't find archives for it and the description I read makes it sound like they may not like newbie questions. Does anyone know of any LISP lists that would be good for newbies?
And if anyone on ALUG has any experience with LISP:
I've been writing a 'hello world' program which consists of a function that returns T if the given parameter is prime or else it returns NIL; the only thing is, it doesn't work. It always returns NIL which I think its getting from the <then> clause of the second (if ) function. I think I may have misunderstood the way that LISP functions return their results: if the number is prime then it should return the (not ()) from the first (if ) function but it doesn't.
Heres the code in case anyone knows about LISP:
======================================== ; the recursive function: (defun prime-rfunc (x iterator) (print x) ; for debugging (print (1+ iterator)) ; for debugging (if (= x iterator) (not ()) (if (= 0 (mod x (1+ iterator))) () (prime-rfunc x (1+ iterator))) ) )
; because the recursive function takes a second, ; non-variable argument, prime is a wrapper function ; which just takes the intuitive first argument: (defun prime (x) (prime-func x 1))
; test it: (print (prime 7)) ========================================
Cheers, Richard