From ... Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!npeer.kpnqwest.net!EU.net!nreader2.kpnqwest.net.POSTED!not-for-mail Newsgroups: comp.lang.lisp Subject: Re: Really Dumb Newbie Question References: <3fd88790.0205231209.5bef457f@posting.google.com> Mail-Copies-To: never From: Erik Naggum Message-ID: <3231178315801215@naggum.net> Organization: Naggum Software, Oslo, Norway Lines: 45 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Thu, 23 May 2002 21:31:56 GMT X-Complaints-To: newsmaster@KPNQwest.no X-Trace: nreader2.kpnqwest.net 1022189516 193.71.199.50 (Thu, 23 May 2002 23:31:56 MET DST) NNTP-Posting-Date: Thu, 23 May 2002 23:31:56 MET DST Xref: archiver1.google.com comp.lang.lisp:33778 * Samantha Skyler | How do I just get lisp to return the rounded number without all that junk? Common Lisp supports multiple return values. However, only the primary value is used in expressions that do not explicitly cater to multiple values. The function `values' may return multiple values, but it may also be used to return only one: (values 1 2 3) => 1 => 2 => 3 How the additional values are printed varies from implementation to implementation. I prefer the above, and have programmed my Common Lisp system to print multiple return values that way, but your semicolon- separated list is just another way to do it. E.g., (round 5.9) => 6 => -0.09999999999999964 Consequently, (values (round 5.9)) => 6 I think it is time for you to read up on this language and not just play with an implementation -- this is fairly basic stuff that should have been covered in any reasonable tutorial material. Which textbooks or other tutorials are you currently using that are confusing you? In any case, I recommend the actual specification as it is quite readable and lets you in on the lexicon of this community, too. Start at www.lisp.org and look for the HyperSpec. Depending on your preferred learning mode, a standard like this may or may not be ideal for you, but familiarity with the authoritative reference on Common Lisp is a must sooner or later. I predict you will find much joy in seeing how this language is specified. It is a whole different world from the mostly underspecified languagees that you learn by trial and error. That, too, is a cultural difference that is worth appreciating. -- In a fight against something, the fight has value, victory has none. In a fight for something, the fight is a loss, victory merely relief. 70 percent of American adults do not understand the scientific process.