Re: Plus Behavior Inside a Notation Box?
- To: mathgroup at smc.vnet.net
- Subject: [mg64910] Re: Plus Behavior Inside a Notation Box?
- From: Peter Pein <petsie at dordos.net>
- Date: Tue, 7 Mar 2006 06:12:10 -0500 (EST)
- References: <duh39s$5ui$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Josh schrieb: > I was trying to set up some aliases using the Notation package and > noticed some odd behavior when Plus[] is included in the right hand > side. I distilled it down to the following, and I'm hoping someone can > shed some light on this. The command I set up is: > > Notation[a <=> Plus[b,c] ] > > With the following behavior: > > In[1]:= b + c > Out[1]= a > > In[2]:= b + c + 1 > Out[2]= 1+b+c > > In[3]:= b + c + 0 > Out[3]= a > > Case 1 and 3 work as expected, but case 2 is not. Any ideas? The goal > is to set up aliases for Bessel and Hankel functions in some EM work, > and it was working very nicely until I hit this 'minor' roadblock. > > Thanks, > > Josh > The Notation Package seems strange to me. After calling In[1]:= <<Utilities`Notation` the cursor jumps between the first an second "<" in the input line. If I try In[2]:= Notation[a \[DoubleLongLeftRightArrow] (b + c)] I get From In[2]:= Notation::noexbtag:The external representation a does not have an embedded \ NotationBoxTag TagBox. The Notation statement Notation[a\ \[DoubleLongLeftRightArrow](b+c)] may not have been entered using the \ palette, or the embedded TagBox may have been deleted. The embedded TagBox \ ensures correct parsing and retention of proper styling and grouping \ information. Out[2]= $Failed This package & me, we can't coexist in the same universe...:-\ I prefer the simple: In[3]:= b + c + 1 /. b -> a - c Out[3]= 1 + a