Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - gaD-

#1
newLISP in the real world / elp with Newlisp
June 05, 2003, 09:07:18 PM
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 :(
#2
newLISP newS / Help with Newlisp
June 05, 2003, 09:05:32 PM
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