MathGroup Archive 2009

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

Search the Archive

Re: Bug with Sequence


I assume that you will get lots of answers on this but:

RInforeplacing the first element of t with Sequence[] multiple times is
the same as doing it once.  Try replacing t[[j]].

ekt

t = {1, 2, 3}; j = 0;

While[++j < 4, t[[j]] = Sequence[]; Print[t]]



{2,3}

{3}

{}
Information[t]

Global`t

t={Sequence[],Sequence[],Sequence[]}





On Wed, 04 Nov 2009 01:34 -0500, "dh" <dh at metrohm.com> wrote:
> 
> 
> Hello,
> 
> has anybody an explanation for the behavior of "Sequence"? I think it is 
> 
> an ugly bug.
> 
> Consider the following that shoud succesively shorten the list t:
> 
> 
> 
> t = {1, 2, 3}; j = 0;
> 
> While[ ++j < 4, t[[1]] = Sequence[]; Print[t]]
> 
> 
> 
> this returns: {2,3} three times.Dropping of the first element only seems 
> 
> to work once.
> 
> If you say Information[t] you get:
> 
> t={Sequence[],2,3}
> 
> 
> 
> Daniel
> 
> 
> 
Regards,
Kurt Tekolste



  • Prev by Date: Re: what's wrong with these expressions?
  • Next by Date: Re: Bug with Sequence
  • Previous by thread: Re: Bug with Sequence
  • Next by thread: Re: Bug with Sequence