Re: syntax extension
- To: mathgroup at smc.vnet.net
- Subject: [mg106446] Re: [mg106427] syntax extension
- From: Jaebum Jung <jaebum at wolfram.com>
- Date: Wed, 13 Jan 2010 05:56:08 -0500 (EST)
- References: <201001120949.EAA15726@smc.vnet.net>
You might want to try Notation package. In[1]:= <<Notation` In[2]:= BetterRules[x_->y_]:=x->y^2 In[3]:= Notation[x__/! y_ \[DoubleLongLeftRightArrow] ReplaceAll[x__,BetterRules[y_]]] In[4]:= (x+y)/!(x->3) Out[4]= 9+y Jaebum On 1/12/10 3:49 AM, Richard Fateman wrote: > Is there a neat way to create a new symbol, > say /!. so that > > expression /. BetterRules[rules] > > could be written as > > expression /!. rules > > I do not find writing something like > > (expression) ~BR~ (rules) > > to be quite adequate, especially with the extra parentheses. > RJF > > >
- References:
- syntax extension
- From: Richard Fateman <fateman@cs.berkeley.edu>
- syntax extension