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

MathGroup Archive 2007

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

Search the Archive

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

http://library.wolfram.com/conferences/devconf99/villegas/UnevaluatedExpressions/Links/index_lnk_22.html

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