CodeFormatter icon indicating copy to clipboard operation
CodeFormatter copied to clipboard

A pretty-printer for Mathematica language, working on the box level

Results 11 CodeFormatter issues
Sort by recently updated
recently updated
newest added

f@x and x//f are replaced with f[x], which although equivalent may not what one wants to see

``` FullCodeFormat@MakeBoxes@Table[Piecewise[{ {1.999, -Pi < \[Theta] < -7 Pi/8}, {(2 Sin[-6 Pi/7])/ Sin[\[Theta]], -6 Pi/ 7 < \[Theta] < -2.0909003694838066`}, {1.001, \ -2.26998149133592` < \[Theta] < -0.6662394324925154`}, {(2 Sin[-(Pi/10)])/ Sin[\[Theta]],...

`CodeFormatterPrint` should IMO be named something like `PrettyPrintSymbolDefintions`. I don't think the names should include `CodeFormatter` as they are already in that package. Maybe have prefixes to avoid conflicts. `FullCodeFormat`...

http://mathematica.stackexchange.com/questions/2809/programmatic-formatting-for-mathematica-code-possible/2810#2810

I'd like to use `CodeFormatterPrint` to serialize definitions and a canonical but readable way. For this, all the code it produces should, when evaluated, restore the definitions I had in...

From the code it seems as if `CodeFormatterPrint` uses `FullCodeFormat`, but on a given definition their output still differs: ``` ClearAll[f] f[x : _a | _b] := 0; CodeFormatterPrint@f ```...

Modified `preprocess` so it can handle this case: ``` cellbox = RowBox[{RowBox[{"gcd", "[", RowBox[{"m0_", ",", "n0_"}], "]"}], ":=", "\[IndentingNewLine]", RowBox[{"Module", "[", RowBox[{RowBox[{"{", RowBox[{RowBox[{"m", "=", "m0"}], ",", RowBox[{"n", "=", "n0"}]}], "}"}],...

a^b or Power[a, b] throws $Failed. Maybe typesetting boxes (like SuperscriptBox here and FractionBox in scdevries's example) should all be avoided?

Mathematica allows the use of colorsetters as part of the code (so that the programmer can conveniently choose a new color right in the middle of the source by just...

This may or may not be considered an issue: bitmaps used as part of the source code (which mathematica happily allows and advocates) are replaced with elaborate Image functions.