Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: a question about (get-time): msg#00005

Subject: Re: a question about (get-time)
At 11:15 Uhr +0200 28.05.2004, Cristina Gema Muñoz Maya wrote:
>Hello!!
>
>  How can i get to introduce the time with the format HH:MM:SS, in a list, for 
> example (10:49:24) ?, The function (get-time), returns 4 values, but i don't 
> know how to do it.
>
>
>CL-USER 12 : 6 > (get-time)
>10
>49
>24
>370

You have not said which Lisp you are using and where the function
comes from.

If a function returns multiple values you can use them like this:

CL-USER 6 > (defun foo ()
              (values 12 13 17 410))
FOO

If you want all values in a list:

CL-USER 7 > (multiple-value-list (foo))
(12 13 17 410)

If you want to access the values individually:

CL-USER 8 > (multiple-value-bind (hour minute second) (foo)
              (describe (list hour minute second)))

(12 13 17) is a LIST
0      12
1      13
2      17




<Prev in Thread] Current Thread [Next in Thread>