Skip to content

Commit

Permalink
adding helper function to print and return a value
Browse files Browse the repository at this point in the history
to help during debugging
  • Loading branch information
Alexander Voigt authored and Alexander Voigt committed Sep 6, 2018
1 parent 3d3fd2b commit c663e4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions meta/Utils.m
Expand Up @@ -132,6 +132,8 @@ occurrence of the given rule is replaced (if it exists) or added (if

FSFancyLine::usage = "Print separator line in command line mode";

PrintAndReturn::usage = "Print result and return it";

Begin["`Private`"];

AppendOrReplaceInList[values_List, elem_, test_:SameQ] :=
Expand Down Expand Up @@ -261,6 +263,8 @@ occurrence of the given rule is replaced (if it exists) or added (if
FSFancyLine[type_:"-", style__:Bold] :=
If[!$Notebooks, Print[Style[StringJoin[Array[type&, 70]], style]]];

PrintAndReturn[e___] := (Print[e]; e)

End[];

EndPackage[];

0 comments on commit c663e4a

Please sign in to comment.