Hi
I am running an HP laptop using Ubuntu feisty fawn. I am using the
book 'ANSI Common Lisp' by Paul Graham to try and learn Lisp. On page
16 of the book it gives the following code as an example of Recursion;
(defun our-member (obj lst)
(if (null lst)
nil
(if (eql (car lst) obj)
lst
(our-member obj (cdr lst)))))
Now, I type this code into emacs using slime and it appears to just
hang emacs. I can't close it, I can still type in the screen but
nothing happens. I am using cmucl for lisp.
Any help appreciated
Len Sumnler
Lisp Newbie
len <······@comcast.net> writes:
> Now, I type this code into emacs using slime and it appears to just
> hang emacs.
Did you get as far as actually calling the function? If so, did you pass
it a circular list?
--
Steven E. Harris
Hi,
On 24.06.2007 18:28, len wrote:
here is a newbie-answer ;)
I started slime, opened a new file and put in your/Grahams code:
> (defun our-member (obj lst)
> (if (null lst)
> nil
> (if (eql (car lst) obj)
> lst
> (our-member obj (cdr lst)))))
then i saved the file and pressed C-c C-k in that buffer.
C-c C-k runs the command slime-compile-and-load-file.
Everything was ok.
After that i used your function in *slime-repl sbcl*:
CL-USER> (our-member 5 (list 1 2 3 4 5 6 77 9 ))
(5 6 77 9)
So, this seems ok to me (I am using Linux/Slime/SBCL).
Regards,
Bernd
len <······@comcast.net> writes:
> Hi
>
> I am running an HP laptop using Ubuntu feisty fawn. I am using the
> book 'ANSI Common Lisp' by Paul Graham to try and learn Lisp. On page
> 16 of the book it gives the following code as an example of Recursion;
>
> (defun our-member (obj lst)
> (if (null lst)
> nil
> (if (eql (car lst) obj)
> lst
> (our-member obj (cdr lst)))))
>
> Now, I type this code into emacs using slime and it appears to just
> hang emacs. I can't close it, I can still type in the screen but
> nothing happens. I am using cmucl for lisp.
Another newbie answer:
Works like it should in my CMUCL/Debian.
/andreas
--
A: Because it fouls the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?