&rest parameters
- From: simplynitaai <simply.nitaai@xxxxxxxxx>
- Date: Tue, 26 Apr 2011 06:55:19 -0700 (PDT)
hi all
i am new to this group and common lisp, which i started to learn and
practice only some time ago.
if you could kindly help me with the following problem. i am writing
this function:
(defun get-day-minutes (&rest params)
(labels ((params-cons (if (= (length params) 1) t))
(h (if params-cons (caar params) (car params)))
(m (if params-cons (cdar params) (cadr params))))
(+ (* h 60) m)))
it should compute the total number of minutes if hours and minutes are
supplied as an argument. they can be supplied either as:
(get-day-minutes 3 45) or
(get-day-minutes '(3 . 45))
when calling the function i am getting the following error:
*** - APPLY: Argumentliste für SYSTEM::ERROR-OF-TYPE ist dotted (mit
"Invalid specialized parameter in method lambda list (IF (=
(LENGTH PARAMS
) 1) T): (= (LENGTH PARAMS) 1)"
am Ende).
can somebody tell what does this error mean and what is wrong with my
function definition?
thank you
simplynitaai
.
- Follow-Ups:
- Re: &rest parameters
- From: Pascal J. Bourguignon
- Re: &rest parameters
- Prev by Date: Re: The Lisp Curse
- Next by Date: Re: &rest parameters
- Previous by thread: Urgent Needed----- System Analyst / Informatica ETL Developer at NYC
- Next by thread: Re: &rest parameters
- Index(es):