elp with Newlisp
Posted: Fri Jun 06, 2003 4:07 am
Hi, I got a code that works fine on Lisp, but I can't make it work on Newlisp, I am very new to this language.
Here is the code for Lisp
(defun mymax (nums)
(cond ((= (length nums) 1) (car nums))
((> (car nums) (cadr nums))
(mymax (cons (car nums)
(cddr nums))))
(t (mymax (cdr nums)))))
I'd like to know how can it be done with Newlisp, specially the cadr, cddr and cdr functions.
Thanks in advance
Sorry for putting this in the news forum :(
Here is the code for Lisp
(defun mymax (nums)
(cond ((= (length nums) 1) (car nums))
((> (car nums) (cadr nums))
(mymax (cons (car nums)
(cddr nums))))
(t (mymax (cdr nums)))))
I'd like to know how can it be done with Newlisp, specially the cadr, cddr and cdr functions.
Thanks in advance
Sorry for putting this in the news forum :(