Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.4K Views
|
4 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Is there any equivalent to macroexpand-1 in WL?

POSTED BY: Mark Green
4 Replies

It is possible mucking about with holdform could yield something, but I can't work out how I'd go about that I'm afraid. If you get desperate you could overload Commute with specific debug procedures.

POSTED BY: David Gathercole

Thanks, but I don't want to change the definition of Commute. That makes it into a function that can only ever return that form, whereas I just want to return the unevaluated form this once for testing/debugging purposes (which is what macroexpand-1 does)

POSTED BY: Mark Green

Commute[Times[x_, y_]] := HoldForm[Times[y, x]]

timesing

POSTED BY: David Gathercole
Reverse[Inactive[Times][1, 2]]
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard