From: Slapstiq
Subject: floor
Date: 
Message-ID: <RgEq4.1897$W5.87176@typhoon.nyroc.rr.com>
I need to use the floor function but it returns two numbers.  Is there any
for me to break a list in two halves?

Thank you

Slapstiq

From: Barry Margolin
Subject: Re: floor
Date: 
Message-ID: <srEq4.78$M31.4268@burlma1-snr2>
In article <···················@typhoon.nyroc.rr.com>,
Slapstiq <········@rochester.rr.com> wrote:
>I need to use the floor function but it returns two numbers.  Is there any
>for me to break a list in two halves?

It doesn't return a list, it returns two values.  If you don't use
multiple-value-bind or multiple-value-list to receive the values, only the
first value (the one you probably care about) will be used.  E.g. if you
do:

(+ (floor 10.4) 5)

you'll get 15.  The remainder 0.4 will be ignored.

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Erik Naggum
Subject: Re: floor
Date: 
Message-ID: <3159729676010387@naggum.no>
* "Slapstiq" <········@rochester.rr.com>
| I need to use the floor function but it returns two numbers.

  if you are talking about Common Lisp, the two numbers are returned as
  multiple values, which means that the primary value is the only value you
  will see if you don't do something special to capture the others.

  if you are talking about Emacs Lisp, the two numbers are returned as a
  list of two values if you use the Common Lisp-like FLOOR* function
  because Emacs Lisp can only return one value from any function.

| Is there any for me to break a list in two halves?

  consider VALUES-LIST.  <grin>

#:Erik
From: Eugene Zaikonnikov
Subject: Re: floor
Date: 
Message-ID: <88glss$tdu$1@nnrp1.deja.com>
In article <···················@typhoon.nyroc.rr.com>,
  "Slapstiq" <········@rochester.rr.com> wrote:
> I need to use the floor function but it returns two numbers.  Is
there any
> for me to break a list in two halves?
>
FLOOR returns not a list, but multiple values. Usually you need not
care about the second value as it will be ignored unless you bind with
something like MULTIPLE-VALUE-BIND. If you like, you may explicitly
suppress the second value by writing (VALUES (FLOOR X Y)).

--
  Eugene.


Sent via Deja.com http://www.deja.com/
Before you buy.