Re: space for NonCommutativeMultiply
- To: mathgroup at smc.vnet.net
- Subject: [mg102007] Re: space for NonCommutativeMultiply
- From: Maxim <m.r at inbox.ru>
- Date: Sun, 26 Jul 2009 03:55:46 -0400 (EDT)
- References: <h4c1eh$gse$1@smc.vnet.net>
. 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.r at inbox.ru