Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • $\begingroup$ Nice answer, +1 $\endgroup$ Commented Oct 4, 2015 at 4:46
  • $\begingroup$ thanks a lot, the idea to move b to right is great!! Could you please explain why we need ncm[a_]:>a to stop the loop of replacement? And what's the difference of a_, a__, and a___ in this answer? I have read the manual, but still confused when I try to use it, if possible, please explain it to me the difference, Thanks again! $\endgroup$ Commented Oct 4, 2015 at 5:39
  • $\begingroup$ by the way, the second rule should be replaced to be ncm[c,i,d], or it may produce ncm[]. $\endgroup$ Commented Oct 5, 2015 at 1:21
  • $\begingroup$ @vanabel: Yes absolutely, thanks for pointing that out! I'll fix it now. $\endgroup$ Commented Oct 5, 2015 at 1:31