Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Bug with Sequence

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104616] Re: [mg104568] Bug with Sequence
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Thu, 5 Nov 2009 03:48:02 -0500 (EST)
  • References: <200911040634.BAA08584@smc.vnet.net>

Hi,

no it's not a bug. It's called SequenceHold and is an Attribute which
prevents the stuff from flattening out.

t = {1, 2, 3}; j = 0;
While[++j < 4, t[[1]] = Sequence[]; t = Flatten[t]; Print[t]]

Cheers
Patrick



On Wed, 2009-11-04 at 01:34 -0500, 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]]
> 
> 
> 
> 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
> 
> 
> 



  • Prev by Date: Re: Conventional way of doing "struct"-like things?
  • Next by Date: Re: what's wrong with these expressions?
  • Previous by thread: Re: Bug with Sequence
  • Next by thread: Re: Bug with Sequence