Re: space for NonCommutativeMultiply
- To: mathgroup at smc.vnet.net
- Subject: [mg102117] Re: space for NonCommutativeMultiply
- From: O <kakabomba at gmail.com>
- Date: Thu, 30 Jul 2009 05:30:02 -0400 (EDT)
- References: <h4c1eh$gse$1@smc.vnet.net> <h4h20g$icj$1@smc.vnet.net>
On Jul 26, 12:52 am, Maxim <m... at inbox.ru> wrote: > .... at ntaxa.com wrote: > > Can be changed meaning of input <space> for infix > > NonCommutativeMultiply instead of infix Times? > > Yes, it can be changed, but you need to be aware that Times and > NonCommutativeMultiply have different precedence levels, so with this > definition e.g. (a.b c) and (a.b**c) are still grouped differently: > > In[1]:= MakeExpression[RowBox[L : {_, __}], f_] := With[ > {args = MakeExpression[#, f] & /@ L}, > NonCommutativeMultiply @@@ HoldComplete[args][[All, All, 1]] /; > ! MemberQ[args, _ErrorBox]] > > In[2]:= Hold[1/0 Print[y]] // FullForm > > Out[2]//FullForm= Hold[NonCommutativeMultiply[Times[1,Power > [0,-1]],Print[y]]] > > Maxim Rytin > m... at inbox.ru thanks, it works