The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Newsgroups: comp.lang.lisp
From: Nils M Holm <news2...@t3x.org>
Date: 25 Sep 2012 17:08:47 GMT
Local: Tues, Sep 25 2012 1:08 pm
Subject: Re: Trying to make my own reverse function
Yves S. Garret <yoursurrogate...@gmail.com> wrote:
> ================================================
Okay, here are a few hints.
> (defun custom-reverse(list-to-reverse) > (if (equal (cdr list-to-reverse) nil) > (car list-to-reverse) > (cons (custom-reverse (cdr list-to-reverse)) > (cons (car list-to-reverse) nil)))) > ================================================ > Now, it doesn't work. At least not very well. The problem is
- How do you reverse an empty list?
- How do you reverse a non-empty list?
- Fill in the missing parts:
(DEFUN R (L)
- You will get extra points for not using APPEND.
BTW:
- (EQUAL X NIL) equals (NULL X)
- (CONS X NIL) equals (LIST X)
-- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||