Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1997
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1997

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

Search the Archive

Re: Any uses for SequenceHold ?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg7537] Re: Any uses for SequenceHold ?
  • From: "David B. Wagner" <dbwagner at princon.com>
  • Date: Fri, 13 Jun 1997 03:08:51 -0400 (EDT)
  • Organization: Principia Consulting
  • Sender: owner-wri-mathgroup at wolfram.com

Ersek_Ted%PAX1A at mr.nawcad.navy.mil wrote:
> 
> Mma 3.0 has a new Attribute called SequenceHold.
> As far as I can tell this Attribute has no useful application.
> 
> However there are exactly nine built in functions
> that have this Attribute.    They are:
>     Rule
>     RuleDelayed
>     Set
>     SetDelayed
>     TagSet
>     TagSetDelayed
>     Timing
>     UpSet
>     UpSetDelayed
> 
> I used a method in Dave Wagner's book to get the above information.
> In what way would things fail to work if these function didn't have this
> Attribute?

Whether or not you find the following "useful"
is up to you.  Once upon a time I had a real application for this in 
2.2, I can't remember what it was though.

In[1]:=
{a,b,c}/.b->Sequence[b1,b2]

Out[1]=
{a,b1,b2,c}

> 
> How did ealier versions get by without SequenceHold?

You had to use an inefficient pattern like the following:

In[2]:=
{a,b,c}/.{prefix___,b,suffix___}->{prefix,b1,b2,suffix}

Out[2]=
{a,b1,b2,c}

Of course, since you've read my book, you know why the above is
inefficient. :-)

> 
>                Ted Ersek
>                ersek_ted%pax1a at mr.nawcad.navy.mil
-- 
		Dave Wagner
		Principia Consulting
		http://www.princon.com/princon/
		Voice: (500) PRN-CPIA or (303) 258-9178
		Fax:   (303) 258-3859


  • Prev by Date: AutoLoading Packages-License 2079-6702, Sean Ross
  • Next by Date: Re: Re: Just another bug in MMA 3.0
  • Previous by thread: Re: Any uses for SequenceHold ?
  • Next by thread: Re: Any uses for SequenceHold ?