MathGroup Archive 2009

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

Search the Archive

Re: space for NonCommutativeMultiply

  • To: mathgroup at
  • Subject: [mg102007] Re: space for NonCommutativeMultiply
  • From: Maxim <m.r at>
  • Date: Sun, 26 Jul 2009 03:55:46 -0400 (EDT)
  • References: <h4c1eh$gse$>

. at 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

Maxim Rytin
m.r at

  • Prev by Date: How can I "perturbate" a NDSolve expresion?
  • Next by Date: freeing memory used by Import[]
  • Previous by thread: space for NonCommutativeMultiply
  • Next by thread: Re: space for NonCommutativeMultiply