From ... Path: supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!world!newsfeed.mathworks.com!EU.net!Norway.EU.net!127.0.0.1!nobody From: Erik Naggum Newsgroups: comp.lang.lisp Subject: Re: 12:31:23 Date: 31 Dec 2000 14:28:19 +0000 Organization: Naggum Software; vox: +47 8800 8879; fax: +47 8800 8601; gsm: +47 93 256 360; http://naggum.no; http://naggum.net Lines: 31 Message-ID: <3187261699703063@naggum.net> References: <3A4F1C69.11230F31@eurocom.od.ua> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: oslo-nntp.eunet.no 978275827 24056 195.0.192.66 (31 Dec 2000 15:17:07 GMT) X-Complaints-To: newsmaster@eunet.no NNTP-Posting-Date: 31 Dec 2000 15:17:07 GMT mail-copies-to: never User-Agent: Gnus/5.0803 (Gnus v5.8.3) Emacs/20.7 Xref: supernews.google.com comp.lang.lisp:5877 * "Vladimir V. Zolotych" | (let* ((n (/ (* 3600 200) 170)) | (h (truncate n 3600)) | (m (rem (truncate n 60) 60)) | (s (truncate (rem n 60)))) | (format t "~&~D:~D:~D~%" h m s)) | | this prints | 1:10:35 (multiple-value-bind (mm ss) (floor (round (* 3600 200) 170) 60) (multiple-value-bind (hh mm) (floor mm 60) (format t "~2,'0D:~2,'0D:~2,'0D" hh mm ss))) Note the use of round instead of / which produces an integer instead of a rational number directly. | Is it possible to make this fragment more clear? Is the above more clear? | What is the right way to use only some values from those | returned by (values 1 2 3) ? E.g. second or first ? If you need only one value, use nth-value. If you need more than one value, any values you don't use are discarded, so you can use multiple-value-bind or -setq to get the values you need. #:Erik -- Performance is the last refuge of the miserable programmer.