I have a function that operates on EventData and has a return value that has Properties (or things that act like Properties). I'd like to clean up the return InputForm when queried, but I'm not quite sure how to go about it.
myfunc[x_] := Module[{returnvalue},
returnvalue["Data"] = x;
returnvalue["Mean"] = Mean[x];
Format[returnvalue, StandardForm] := HoldForm["myfunc"][x];
Format[returnvalue, InputForm] := HoldForm["myfunc"][x];
Return[returnvalue]
]
My data is just EventData:
e = {1, 2, 3, 4, 5, 6};
ci = {0, 1, 0, 0, 0, 1};
dat = EventData[e, ci];
a = myfunc[dat]
When I run InputForm[a]
, I get the following:
HoldForm["myfunc"][EventData[Automatic, {{1, 2, 3, 4, 5, 6}, {0, 1, 0, 0, 0, 1}, None}]]
What I'd like to get is:
myfunc[EventData[Automatic, {{1, 2, 3, 4, 5, 6}, {0, 1, 0, 0, 0, 1}, None}]]
How should I define the Format
command in the body of myfunc
to get the output that I'm looking for?