The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Any uses for SequenceHold ?
Replies: 2   Last Post: Jun 18, 1997 10:01 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Roman Maeder

Posts: 8
Registered: 12/4/04
Re: Any uses for SequenceHold ?
Posted: Jun 18, 1997 10:01 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

David B. Wagner wrote:
> ...
> > 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. :-)

If you had read *my* book, you'd know that there exists an efficient
way to do it in 2.2 :-)

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

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

Roman Maeder

MathConsult Dr. R. Mäder Aryanastrasse 21
Mathematik- und Informatik-Beratung CH-8704 Herrliberg

T: +41-1-991 6343
F: +41-1-991 6345

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.