MathGroup Archive 2009

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

Search the Archive

Re: Bug with Sequence

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104625] Re: [mg104568] Bug with Sequence
  • From: Sseziwa Mukasa <mukasa at jeol.com>
  • Date: Thu, 5 Nov 2009 03:49:47 -0500 (EST)
  • References: <200911040634.BAA08584@smc.vnet.net>

On Nov 4, 2009, at 1:34 AM, dh 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]]
>

You are only assigning t[[1]] at each iteration, t itself remains of  
length 3.

> 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}

Which is what happens when you assign Sequence[] to the first element  
of t.  If you want to remove elements from t use t = Rest[t].

Regards,

Ssezi



  • Prev by Date: remote kernel trouble
  • Next by Date: Re: Conventional way of doing "struct"-like things?
  • Previous by thread: Bug with Sequence
  • Next by thread: Re: Bug with Sequence