Sequence as a universal UpValue

• To: mathgroup at smc.vnet.net
• Subject: [mg74586] Sequence as a universal UpValue
• From: "Chris Chiasson" <chris at chiasson.name>
• Date: Tue, 27 Mar 2007 04:02:30 -0500 (EST)

```In his presentation on working with held expressions at

Villegas says:

"In fact, Sequence itself could almost be implemented as a universal
UpValue (maybe Dave Withoff or Roman Maeder remembers if that's not
quite true)."

So, I am wondering, does the following input disprove that Sequence
can be implemented as a universal UpValue? How should I think of
Sequence? Importantly, why doesn't blocking Sequence work like
blocking the arbitrary symbol?

In[1]:=
blahblah/:h_[l___,blahblah[blahblahArgs___],r___]=h[l,blahblahArgs,r]

UpValues@blahblah

a[1,blahblah[2,3]]

Block[{Sequence},f/@Sequence[1,2,3]]

Block[{blahblah},f/@blahblah[1,2,3]]

Out[1]=
h[l,blahblahArgs,r]

Out[2]=
{HoldPattern[h_[l___,blahblah[blahblahArgs___],r___]]\[RuleDelayed]
h[l,blahblahArgs,r]}

Out[3]=
a[1,2,3]

Map::nonopt: Options expected (instead of 3) beyond position 3 in
Map[f,1,2,3]. An option must be a rule or a list of rules.

Out[4]=

Map[f,1,2,3]

Out[5]=
blahblah[f[1],f[2],f[3]]

Thanks for your input,

--
http://chris.chiasson.name/

```

• Prev by Date: Cantor Function problem
• Next by Date: Re: Inverse of arbitrary functions
• Previous by thread: Re: Cantor Function problem
• Next by thread: Re: Sequence as a universal UpValue