MathGroup Archive 2002

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

Search the Archive

Re: Length and Drop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg32203] Re: Length and Drop
  • From: "Gerhard Neumann" <gneumann at gmx.net>
  • Date: Sat, 5 Jan 2002 00:10:50 -0500 (EST)
  • Organization: UTA Telekom AG
  • References: <a13vdg$dgm$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi !

Mathematica is a mainly functional programming language and so its variables
represent values, not states. In other words the function Drop doesn't
change the value of timexp at all, it just returns the wanted value. So you
have to write:
timexp = Drop[timeexp,1]

mfG Gerhard Neumann

"Steve Gray" <stevebg at adelphia.net> schrieb im Newsbeitrag
news:a13vdg$dgm$1 at smc.vnet.net...
>     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?
>
>




  • Prev by Date: Re: Length and Drop
  • Next by Date: Re: Length and Drop
  • Previous by thread: Re: Length and Drop
  • Next by thread: Re: Length and Drop