MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Length and Drop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32192] Re: [mg32183] Length and Drop
  • From: Adriano Pascoletti <pascolet at dimi.uniud.it>
  • Date: Sat, 5 Jan 2002 00:10:29 -0500 (EST)
  • References: <200201041003.FAA13779@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

At 5:03 -0500 4-01-2002, Steve Gray wrote:
>     The following sequence seems wrong to  me, in that
>after dropping some elements from a list, its Length is
>still the same. I copied this directly from the notebook
>but removed the In[] and Out[] statements.
>
>timexp={{0,0}} -> {{0,0}}        [this is ok]
>
>timexp=Append[timexp,{7,8}] -> {{0,0},{7,8}}       [this is ok]
>
>Length[timexp] -> 2             [this is ok]
>
>Drop[timexp,1] -> {{7,8}}         [this is ok]
>
>Length[timexp] -> 2                    [ this is what I did not expect!]
>
>     Should not Drop reduce the Length of the list by the amount
>dropped?


Steve,

Drop[timexp,1] does not affect timex, so its length remains 2; the 
most recent output has the length you expected

Length[%] -> 1

Adriano Pascoletti


  • Prev by Date: Re: 1 equals 3 (among others)
  • Next by Date: Re: A question of Fit
  • Previous by thread: Re: Length and Drop
  • Next by thread: Re: Length and Drop