Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

On the Form of information

  • To: mathgroup at smc.vnet.net
  • Subject: [mg75436] On the Form of information
  • From: Mariano Suárez-Alvarez <mariano.suarezalvarez at gmail.com>
  • Date: Mon, 30 Apr 2007 03:43:36 -0400 (EDT)

Hi all,

I'm using various MakeBoxes definitions to get things printed in
pretty ways when outputting in StandardForm. This works very
nicely, but I've found that ??, Definition and friends like to return
things in StandardForm, which can be confusing because the
StandardForm of things in the definition may hide its actual form.

A simple example: suppose you say

  Unprotect[NonCommutativeMultiply];
  NonCommutativeMultiply /:
    MakeBoxes[t : NonCommutativeMultiply[x__], StandardForm] :=
      RowBox[
        Rest@ Flatten@ Transpose@
          {Table["=B7", {Length[t]}], MakeBoxes[#, StandardForm] & /@
{x}}
        ];

  f[x__] := {x, NonCommutativeMultiply[x]};

Then asking for the definition of f, with Definition or ??, uses the
MakeBoxes rule to print the right hand side of the definition of f.
In this particular instance, this because misleading. (Of course, the
example is crafted so that is /is/ confusing, but I've fallen for
instances
of this more times than I am proud of...)

Now, one can always say InputForm[Definition[f]], that's slightly
annoying.

Is there a way to change the default output form for definitions?

Cheers,

-- m



  • Prev by Date: Re: functional programming
  • Next by Date: elimination of a real variable from a complex function
  • Previous by thread: An extension of the traveling salesman problem
  • Next by thread: elimination of a real variable from a complex function