RightComposition) has shorthand syntax I am more inclined to use it, however what I feel should be one of its best advantages over the plain
foo @ bar @ ## & doesn't exist: held arguments. For example I wish for the following behavior:
Composition[ToString, HoldForm][2 + 2]
(* desired output: "2 + 2" *)
I am aware that the form
head[a__][b__] doesn't normally allow holding of arguments
b but this has always seemed like a place an exception should have been made.
Unless the first head applied has hold Attributes this would not alter behavior. Does anyone regularly make use of the evaluation of arguments that I am seeing as undesirable?
Presumptuously assuming that others find desirable the behavior that I want I see this as a sorely missed opportunity:
- the shorthand forms
foo @* barand
foo /* barcould have been made to parse as
- these new operators could have been made to hold arguments as I describe without breaking backwards-compatibility with
Compositionin past versions.
I wonder what can now be done to improve the situation.
I suppose it is too late to get such changes made to natively. Has such a change ever been made to Mathematica (or Wolfram Langauge) after an initial release?
I am tempted to try to force this behavior myself using one of the methods available. All public code except what I see as edge cases would work on my machine but my own code would fail on others.
Sadly it is not possible to define custom compound operators so there is no true alternative, but I could define e.g.
comp[fn1, fn2]to work as I desire.
My questions therefore:
Is there some reason not to have a
Composition expression hold its arguments?
Is there another option that I am failing to consider?
How can one robustly implement option #2 or #3?