Mathematica 9 is now available
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: [mg104617] Re: [mg104568] Bug with Sequence
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 5 Nov 2009 03:48:16 -0500 (EST)
  • Reply-to: hanlonr at cox.net

As stated in the documentation for Sequence:

"Assignment and replacement functions have attribute SequenceHold."

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

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

{2,3}

{3}

{}


Bob Hanlon

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




  • Prev by Date: Aligning framed graphics in rows
  • Next by Date: remote kernel trouble
  • Previous by thread: Re: Bug with Sequence
  • Next by thread: Re: Bug with Sequence