From: smouldering dog
Subject: lost soul needs help with trivial code.
Date: 
Message-ID: <OWHITE.91Feb19091907@haywire.nmsu.edu>
hi I am new to lisp and I think it is incredibly useful for the work I
have been doing in DNA analysis.  I can't get this little hack to
work.  I sincerely would like to understand what is goin wrong and I
sincerely need someone's help:

make-length-list gets a cons-list like ((100 200) (300 400) (455 526))
and I just want it to return a cons-list (100 100 71).

(defun make-length-list(coord)
  (let ((first (car coord))
	(this ())
	(n1 0)
	(n2 0))
    (if coord
	(progn
	  (while coord
	  (let ((first (car coord))
	    (setq n1 (car coord))
	    (setq n2 (car (cdr coord))))
	    (cons (- n2 n1) this))
	  (setq coord (cdr coord)))))))

--

	owen white		(······@nmsu.edu)

-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-*-=-=-*-=-
               got my head on a pole (for better reception)
-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-=-*-=-*-=-=-*-=-

From: Ian Mason
Subject: Re: lost soul needs help with trivial code.
Date: 
Message-ID: <1991Feb19.185818.1282@Neon.Stanford.EDU>
try the following, somewhat more in the spirit of lisp

(define f (list)
   (mapcar (function (lambda (x) (- (cadr x) (car x))) list)))

		-iam-		
From: Jacques Duthen
Subject: Re: lost soul needs help with trivial code.
Date: 
Message-ID: <1991Feb21.125011.10971@ircam.fr>
In article <····················@haywire.nmsu.edu> ······@nmsu.edu (smouldering dog) writes:
>make-length-list gets a cons-list like ((100 200) (300 400) (455 526))
>and I just want it to return a cons-list (100 100 71).

(defun make-length-list (coord)
  (mapcar #'(lambda (elt) (abs (- (second elt) (first elt)))) coord))

(make-length-list '((100 200) (300 400) (455 526)))
;= (100 100 71)

; Welcome to Lisp world !
							[jack]