Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive

Re: Defining an UpValue for a specific List?

  • To: mathgroup at
  • Subject: [mg23203] Re: [mg23153] Defining an UpValue for a specific List?
  • From: Bojan Bistrovic <bojanb at>
  • Date: Mon, 24 Apr 2000 01:12:09 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

> Hello, 
> I would like to make the following definition:
> df[[a_, b_]] ^:= DFPart[df, a_, b_]
> where df is a list of three components.
> I get the folowing error:
> UpSetDelayed::write: Tag List in {<<l>>}[[a_,b_]] is Protected.
> Is there a possibility to redefine Part[] for some symbols?
> Please email directly to
>         schnoerr at
> Thank you very much!
> Claudius
Here's a different approach: define the funcion "MyPart" with properties
you like, and then use MakeExpression to reinterpret the sequence
df[[a,b]] as MyPart[df,a,b]:

In[1]:= MakeExpression[ RowBox[{aaa_,"[",RowBox[{"[",bbb_String,"]"}],"]"}],
  MakeExpression[ RowBox[{"MyPart","[",aaa,",",bbb,"]"}],StandardForm]

In[2]:= MakeExpression[ RowBox[{aaa_,"[",RowBox[{"[",
  MakeExpression[ RowBox[{"MyPart","[",aaa,",",bbb,"]"}],StandardForm]

It's not a general solution to the problem since it will only work if 
you're using Graphical Front End, but it might be enough.


Bojan Bistrovic,                                      bojanb at
Old Dominion University, Norfolk VA & Jefferson Lab, Newport News, VA

  • Prev by Date: Re: Remote kernel with ssh
  • Next by Date: Re: Demonstrate that 1==-1
  • Previous by thread: Defining an UpValue for a specific List?
  • Next by thread: Inverting a matrix with symbolic bounds