In Mathematica there are different objects like InterpolatingFunction or SparseArray? How can I define a custom data object with special data structure?
Example:
f = Interpolation[{1, 2, 3, 5, 8, 5}];
f // InputForm
returns us
InterpolatingFunction[{{1, 6}}, {4, 3, 0, {6}, {4}, 0, 0, 0, 0, Automatic},
{{1, 2, 3, 4, 5, 6}}, {{1}, {2}, {3}, {5}, {8}, {5}}, {Automatic}]
But if one evaluates the above output one gets back
InterpolatingFunction[{{1, 6}}, <>]
I could not find any documentation how to do it for any custom data object that I want to define for my program.
MakeBoxes) should be independent of other definitions so this form should still work, e.g.diag[m_?MatrixQ]["Det"] := Det[m]and thendiag[mat]["Det"]evaluates to120just asDet[mat]does. – Mr.Wizard Jul 07 '16 at 20:40