(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 38709, 1075] NotebookOptionsPosition[ 32805, 940] NotebookOutlinePosition[ 33184, 956] CellTagsIndexPosition[ 33141, 953] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Basic Examples", "Subsection", CellID->462042388], Cell["Issue a message:", "Text", CellChangeTimes->{{3.7529583114897637`*^9, 3.7529583135377045`*^9}}, CellID->13078159], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ InterpretationBox[ TagBox[ StyleBox[ StyleBox[ FrameBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->Rational[10, 13] Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ StyleBox["\<\"ResourceFunctionMessage\"\>", "ResourceFunctionLabel"], ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited]} }]], "ResourceFunctionFrame"], FrameBoxOptions->{Background->GrayLevel[0.5, 0.15], BaseStyle->{ "StandardForm", LineSpacing -> {0, 0}, LineBreakWithin -> False}, FrameMargins->{{3, 3}, {0, 0}}, FrameStyle->Directive[ GrayLevel[0.5, 0.35], AbsoluteThickness[0.5]], RoundingRadius->4}, GridBoxOptions->{FrameStyle->GrayLevel[1, 0], GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0.25}}, "Rows" -> {-0.1, {}, 0}}}], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "\"ResourceFunctionMessage\""}], ResourceFunction["ResourceFunctionMessage"], BoxID -> "ResourceFunctionMessage", Selectable->False], "[", RowBox[{ RowBox[{"f", "::", "argx"}], ",", "1", ",", "2"}], "]"}]], "Input", CellChangeTimes->{{3.7529583181005383`*^9, 3.7529583220044327`*^9}}, CellLabel->"In[1]:=", CellID->443871870], Cell[BoxData[ TemplateBox[{ "ResourceFunction","usermessage", "\"\\!\\(\\*TemplateBox[List[StyleBox[RowBox[List[\\\"f\\\", \\\"::\\\", \ \\\"argx\\\"]], \\\"MessageName\\\"], \\\"\\\\\\\": \\\\\\\"\\\", \ \\\"\\\\\\\"\\\\\\\\!\\\\\\\\(\\\\\\\\*RowBox[{\\\\\\\\\\\\\\\"1\\\\\\\\\\\\\\\ \"}]\\\\\\\\) called with \ \\\\\\\\!\\\\\\\\(\\\\\\\\*RowBox[{\\\\\\\\\\\\\\\"2\\\\\\\\\\\\\\\"}]\\\\\\\\\ ) arguments; 1 argument is expected.\\\\\\\"\\\"], \\\"RowDefault\\\"]\\)\"", 2,1,59,31127369278172669751,"Local"}, "MessageTemplate"]], "Message", "MSG", CellChangeTimes->{3.752958363836113*^9, 3.752959231591563*^9, 3.7529600541462765`*^9, 3.7561263039067183`*^9, 3.756126334866717*^9, 3.7561268080665503`*^9, 3.7566522435280266`*^9}, CellLabel->"During evaluation of In[1]:=", CellID->275001298] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[Cell["\t", "ExampleDelimiter"], $Line = 0; Null]], "ExampleDelimiter", Selectable->False, ShowCellBracket->Automatic, CellMargins->{{66, 14}, {5, 10}}, Evaluatable->True, CellGroupingRules->{"SectionGrouping", 58}, CellEvaluationFunction->(($Line = 0; Null)& ), ShowCellLabel->False, CellLabelAutoDelete->True, TabFilling->"\[LongDash]\[NegativeThickSpace]", TabSpacings->{100}, StyleMenuListing->None, FontFamily->"Verdana", FontWeight->Bold, FontSlant->"Plain", FontColor->GrayLevel[0.905882]], Cell["\<\ Define a function to issue a message and return unevaluated upon an error:\ \>", "Text", CellChangeTimes->{3.7529583804665585`*^9}, CellID->4425302], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"rsqrt", "[", "x_", "]"}], "/;", RowBox[{"If", "[", RowBox[{ RowBox[{"TrueQ", "[", RowBox[{"x", "\[GreaterEqual]", "0"}], "]"}], ",", "True", ",", RowBox[{ RowBox[{ InterpretationBox[ TagBox[ StyleBox[ StyleBox[ FrameBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->Rational[10, 13] Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ StyleBox["\<\"ResourceFunctionMessage\"\>", "ResourceFunctionLabel"], ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited]} }]], "ResourceFunctionFrame"], FrameBoxOptions->{Background->GrayLevel[0.5, 0.15], BaseStyle->{ "StandardForm", LineSpacing -> {0, 0}, LineBreakWithin -> False}, FrameMargins->{{3, 3}, {0, 0}}, FrameStyle->Directive[ GrayLevel[0.5, 0.35], AbsoluteThickness[0.5]], RoundingRadius->4}, GridBoxOptions->{FrameStyle->GrayLevel[1, 0], GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{ "Columns" -> {{0.25}}, "Rows" -> {-0.1, {}, 0}}}], {"FunctionResourceBox", RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "\"ResourceFunctionMessage\""}], ResourceFunction["ResourceFunctionMessage"], BoxID -> "ResourceFunctionMessage", Selectable->False], "[", RowBox[{ RowBox[{"rsqrt", "::", "nnarg"}], ",", "x"}], "]"}], ";", " ", "False"}]}], "]"}]}], " ", ":=", RowBox[{"Sqrt", "[", "x", "]"}]}]], "Input", CellChangeTimes->{3.752958415222473*^9, 3.752960031122024*^9}, CellLabel->"In[1]:=", CellID->578546949], Cell["Define the message:", "Text", CellChangeTimes->{3.7529583941301403`*^9}, CellID->17953048], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"rsqrt", "::", "nnarg"}], "=", "\"\\""}], ";"}]], "Input", CellLabel->"In[2]:=", CellID->143877908], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"rsqrt", "[", "2.25", "]"}]], "Input", CellLabel->"In[3]:=", CellID->221664925], Cell[BoxData["1.5`"], "Output", CellChangeTimes->{{3.7529584056457577`*^9, 3.752958433962875*^9}, 3.752959231738545*^9, 3.7529600542872744`*^9, 3.7561263354423447`*^9, 3.7561268085280285`*^9, 3.756652244074644*^9}, CellLabel->"Out[3]=", CellID->285644492] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"rsqrt", "[", RowBox[{"-", "2.25"}], "]"}]], "Input", CellLabel->"In[4]:=", CellID->14701213], Cell[BoxData[ TemplateBox[{ "ResourceFunction","usermessage", "\"\\!\\(\\*TemplateBox[List[StyleBox[RowBox[List[\\\"rsqrt\\\", \ \\\"::\\\", \\\"nnarg\\\"]], \\\"MessageName\\\"], \\\"\\\\\\\": \ \\\\\\\"\\\", \\\"\\\\\\\"The argument \ \\\\\\\\!\\\\\\\\(\\\\\\\\*RowBox[{\\\\\\\\\\\\\\\"-\\\\\\\\\\\\\\\", \ \\\\\\\\\\\\\\\"2.25`\\\\\\\\\\\\\\\"}]\\\\\\\\) is not greater than or equal \ to zero.\\\\\\\"\\\"], \\\"RowDefault\\\"]\\)\"",2,4,60,31127369278172669751, "Local"}, "MessageTemplate"]], "Message", "MSG", CellChangeTimes->{{3.7529584101996307`*^9, 3.7529584351058445`*^9}, 3.752959231758527*^9, 3.752960054321272*^9, 3.756126335537957*^9, 3.7561268086294947`*^9, 3.7566522441760955`*^9}, CellLabel->"During evaluation of In[4]:=", CellID->418264772], Cell[BoxData[ RowBox[{"rsqrt", "[", RowBox[{"-", "2.25`"}], "]"}]], "Output", CellChangeTimes->{{3.752958410202631*^9, 3.7529584351328373`*^9}, 3.7529592317765446`*^9, 3.7529600543392887`*^9, 3.7561263355574703`*^9, 3.7561268086392517`*^9, 3.7566522441878033`*^9}, CellLabel->"Out[4]=", CellID->48448369] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Applications", "Subsection", CellID->568056528], Cell["Here\[CloseCurlyQuote]s a function that prints a message for invalid \ inputs:", "Text", CellChangeTimes->{{3.752958543153411*^9, 3.752958560961846*^9}}, CellID->432212936], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"MyFactorial", "::", "positive"}], "=", "\"\\""}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"MyFactorial", "[", "0", "]"}], "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"MyFactorial", "[", RowBox[{"n_Integer", "?", "Positive"}], "]"}], ":=", RowBox[{"n", "*", RowBox[{"MyFactorial", "[", RowBox[{"n", "-", "1"}], "]"}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"MyFactorial", "[", "n_", "]"}], ":=", RowBox[{"(", RowBox[{ RowBox[{"Message", "[", RowBox[{ RowBox[{"MyFactorial", "::", "positive"}], ",", "n"}], "]"}], ";", " ", "$Failed"}], ")"}]}], ";"}]}], "Input", CellLabel->"In[1]:=", CellID->77544037], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MyFactorial", "[", "5", "]"}]], "Input", CellChangeTimes->{{3.752958572071493*^9, 3.752958576442354*^9}}, CellLabel->"In[5]:=", CellID->60000440], Cell[BoxData["120"], "Output", CellChangeTimes->{3.7529585772673087`*^9, 3.752959231906522*^9, 3.7529600545072913`*^9, 3.756126340183958*^9, 3.7561268089504814`*^9, 3.7566522444736834`*^9}, CellLabel->"Out[5]=", CellID->163043873] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"MyFactorial", "[", RowBox[{"-", "5"}], "]"}]], "Input", CellChangeTimes->{{3.7529585780623016`*^9, 3.7529585803382287`*^9}}, CellLabel->"In[6]:=", CellID->106520339], Cell[BoxData[ TemplateBox[{ "MyFactorial","positive", "\"The argument \\!\\(\\*RowBox[{\\\"-\\\", \\\"5\\\"}]\\) is not a \ positive integer.\"",2,6,61,31127369278172669751,"Local","Global`MyFactorial"}, "MessageTemplate2"]], "Message", "MSG", CellChangeTimes->{3.7529585809991913`*^9, 3.752959231928546*^9, 3.752960054530265*^9, 3.7561263402912784`*^9, 3.756126809038289*^9, 3.7566522445683203`*^9}, CellLabel->"During evaluation of In[6]:=", CellID->252585348], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.75295858100419*^9, 3.7529592319455395`*^9, 3.75296005454828*^9, 3.7561263403137183`*^9, 3.7561268090470695`*^9, 3.756652244578076*^9}, CellLabel->"Out[6]=", CellID->87371] }, Open ]], Cell[TextData[{ "When printing messages from a ", Cell[BoxData[ TagBox[ ButtonBox[ StyleBox["ResourceFunction", "SymbolsRefLink", ShowStringCharacters->True, FontFamily->"Source Sans Pro"], BaseStyle->Dynamic[ FEPrivate`If[ CurrentValue["MouseOver"], { "Link", FontColor -> RGBColor[0.854902, 0.396078, 0.145098]}, { "Link"}]], ButtonData->"paclet:ref/ResourceFunction"], MouseAppearanceTag["LinkHand"]]], "InlineFormula", FontFamily->"Source Sans Pro", FontSize->0.9428571428571428 Inherited], ", symbols can appear with lengthy contexts:" }], "Text", CellChangeTimes->{{3.7529585020577154`*^9, 3.7529585237700243`*^9}, 3.752960129744894*^9}, CellID->49981850], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"rf", "=", RowBox[{"DefineResourceFunction", "[", "MyFactorial", "]"}]}]], "Input", CellChangeTimes->{ 3.752958476338535*^9, 3.752958539419527*^9, {3.7529585878889756`*^9, 3.7529585978816833`*^9}}, CellLabel->"In[7]:=", CellID->92171733], Cell[BoxData[ InterpretationBox[ TagBox[ StyleBox[ StyleBox[ FrameBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->GrayLevel[0.15]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->Rational[10, 13] Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ StyleBox["\<\"MyFactorial\"\>", "ResourceFunctionLabel"], ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited]} }]], "ResourceFunctionFrame"], FrameBoxOptions->{Background->GrayLevel[0.5, 0.15], BaseStyle->{ "StandardForm", LineSpacing -> {0, 0}, LineBreakWithin -> False}, FrameMargins->{{3, 3}, {0, 0}}, FrameStyle->Directive[ GrayLevel[0.5, 0.35], AbsoluteThickness[0.5]], RoundingRadius->4}, GridBoxOptions->{FrameStyle->GrayLevel[1, 0], GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0.25}}, "Rows" -> {-0.1, {}, 0}}}], {"FunctionResourceBox", GrayLevel[0.15], "\"MyFactorial\""}], ResourceFunction[ ResourceObject[ Association[ "Name" -> "MyFactorial", "ShortName" -> "MyFactorial", "SymbolName" -> "FunctionRepository`$75fce158cca840ae9363d698721a8659`Global`\ MyFactorial", "ResourceType" -> "Function", "UUID" -> "75fce158-cca8-40ae-9363-d698721a8659", "FunctionLocation" -> None, "Version" -> None]]], Selectable->False]], "Output", CellChangeTimes->{3.7529585994016075`*^9, 3.7529592326045012`*^9, 3.7529600546512613`*^9, 3.7561263453509502`*^9, 3.756126809483182*^9, 3.7566522457361727`*^9}, CellLabel->"Out[7]=", CellID->85658731] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"rf", "[", RowBox[{"-", "5"}], "]"}]], "Input", CellChangeTimes->{{3.7529586008555603`*^9, 3.75295860323351*^9}}, CellLabel->"In[8]:=", CellID->120517745], Cell[BoxData[ TemplateBox[{ "FunctionRepository`$75fce158cca840ae9363d698721a8659`Global`MyFactorial", "positive", "\"The argument \\!\\(\\*RowBox[{\\\"-\\\", \\\"5\\\"}]\\) is not a \ positive integer.\"",2,8,62,31127369278172669751,"Local", "FunctionRepository`$75fce158cca840ae9363d698721a8659`Global`MyFactorial"}, "MessageTemplate2"]], "Message", "MSG", CellChangeTimes->{3.7529586038984823`*^9, 3.752959232706498*^9, 3.7529600546792603`*^9, 3.7561263456582775`*^9, 3.7561268098217297`*^9, 3.7566522459542284`*^9}, CellLabel->"During evaluation of In[8]:=", CellID->856964973], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.75295860390149*^9, 3.7529592327245207`*^9, 3.7529600546962757`*^9, 3.756126345669009*^9, 3.756126809843192*^9, 3.756652245964961*^9}, CellLabel->"Out[8]=", CellID->78743797] }, Open ]], Cell[TextData[{ "Using ", Cell[BoxData[ StyleBox["ResourceFunctionMessage", "InlineResourceFunction"]], "InlineFormula", FontFamily->"Source Sans Pro", FontSize->0.9428571428571428 Inherited], " instead of ", Cell[BoxData[ TagBox[ ButtonBox[ StyleBox["Message", "SymbolsRefLink", ShowStringCharacters->True, FontFamily->"Source Sans Pro"], BaseStyle->Dynamic[ FEPrivate`If[ CurrentValue["MouseOver"], { "Link", FontColor -> RGBColor[0.854902, 0.396078, 0.145098]}, { "Link"}]], ButtonData->"paclet:ref/Message"], MouseAppearanceTag["LinkHand"]]], "InlineFormula", FontFamily->"Source Sans Pro", FontSize->0.9428571428571428 Inherited], " will attach the message to ", Cell[BoxData[ TagBox[ ButtonBox[ StyleBox["ResourceFunction", "SymbolsRefLink", ShowStringCharacters->True, FontFamily->"Source Sans Pro"], BaseStyle->Dynamic[ FEPrivate`If[ CurrentValue["MouseOver"], { "Link", FontColor -> RGBColor[0.854902, 0.396078, 0.145098]}, { "Link"}]], ButtonData->"paclet:ref/ResourceFunction"], MouseAppearanceTag["LinkHand"]]], "InlineFormula", FontFamily->"Source Sans Pro", FontSize->0.9428571428571428 Inherited], " and add a formatted label:" }], "Text", CellChangeTimes->{{3.7529586300896587`*^9, 3.752958654008876*^9}, { 3.7529586884788017`*^9, 3.7529587080981703`*^9}}, CellID->306784196], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"MyFactorial", "[", "n_", "]"}], ":=", RowBox[{"(", RowBox[{ RowBox[{ InterpretationBox[ TagBox[ StyleBox[ StyleBox[ FrameBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->Rational[10, 13] Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ StyleBox["\<\"ResourceFunctionMessage\"\>", "ResourceFunctionLabel"], ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited]} }]], "ResourceFunctionFrame"], FrameBoxOptions->{Background->GrayLevel[0.5, 0.15], BaseStyle->{ "StandardForm", LineSpacing -> {0, 0}, LineBreakWithin -> False}, FrameMargins->{{3, 3}, {0, 0}}, FrameStyle->Directive[ GrayLevel[0.5, 0.35], AbsoluteThickness[0.5]], RoundingRadius->4}, GridBoxOptions->{FrameStyle->GrayLevel[1, 0], GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0.25}}, "Rows" -> {-0.1, {}, 0}}}], {"FunctionResourceBox", RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "\"ResourceFunctionMessage\""}], ResourceFunction["ResourceFunctionMessage"], BoxID -> "ResourceFunctionMessage", Selectable->False], "[", RowBox[{ RowBox[{"MyFactorial", "::", "positive"}], ",", "n"}], "]"}], ";", " ", "$Failed"}], ")"}]}], ";"}]], "Input", CellChangeTimes->{{3.752958656657815*^9, 3.752958659129736*^9}}, CellLabel->"In[9]:=", CellID->830459108], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"rf", "=", RowBox[{"DefineResourceFunction", "[", "MyFactorial", "]"}]}]], "Input", CellLabel->"In[10]:=", CellID->511850086], Cell[BoxData[ InterpretationBox[ TagBox[ StyleBox[ StyleBox[ FrameBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->GrayLevel[0.15]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->Rational[10, 13] Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ StyleBox["\<\"MyFactorial\"\>", "ResourceFunctionLabel"], ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited]} }]], "ResourceFunctionFrame"], FrameBoxOptions->{Background->GrayLevel[0.5, 0.15], BaseStyle->{ "StandardForm", LineSpacing -> {0, 0}, LineBreakWithin -> False}, FrameMargins->{{3, 3}, {0, 0}}, FrameStyle->Directive[ GrayLevel[0.5, 0.35], AbsoluteThickness[0.5]], RoundingRadius->4}, GridBoxOptions->{FrameStyle->GrayLevel[1, 0], GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0.25}}, "Rows" -> {-0.1, {}, 0}}}], {"FunctionResourceBox", GrayLevel[0.15], "\"MyFactorial\""}], ResourceFunction[ ResourceObject[ Association[ "Name" -> "MyFactorial", "ShortName" -> "MyFactorial", "SymbolName" -> "FunctionRepository`$7a9f51bbd81e408eb5deca3631d8d445`Global`\ MyFactorial", "ResourceType" -> "Function", "UUID" -> "7a9f51bb-d81e-408e-b5de-ca3631d8d445", "FunctionLocation" -> None, "Version" -> None]]], Selectable->False]], "Output", CellChangeTimes->{3.752958675818206*^9, 3.7529592328985167`*^9, 3.752960054867281*^9, 3.7561263510701585`*^9, 3.756126810099787*^9, 3.7566522463713284`*^9}, CellLabel->"Out[10]=", CellID->177858101] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"rf", "[", RowBox[{"-", "5"}], "]"}]], "Input", CellLabel->"In[11]:=", CellID->150937357], Cell[BoxData[ TemplateBox[{ "ResourceFunction","usermessage", "\"\\!\\(\\*TemplateBox[List[StyleBox[RowBox[List[\\\"MyFactorial\\\", \ \\\"::\\\", \\\"positive\\\"]], \\\"MessageName\\\"], \\\"\\\\\\\": \ \\\\\\\"\\\", \\\"\\\\\\\"The argument \ \\\\\\\\!\\\\\\\\(\\\\\\\\*RowBox[{\\\\\\\\\\\\\\\"-\\\\\\\\\\\\\\\", \ \\\\\\\\\\\\\\\"5\\\\\\\\\\\\\\\"}]\\\\\\\\) is not a positive integer.\\\\\\\ \"\\\"], \\\"RowDefault\\\"]\\)\"",2,11,63,31127369278172669751,"Local"}, "MessageTemplate"]], "Message", "MSG", CellChangeTimes->{3.75295868066805*^9, 3.7529592329165144`*^9, 3.752960054894257*^9, 3.7561263512262583`*^9, 3.756126810211986*^9, 3.756652246468876*^9}, CellLabel->"During evaluation of In[11]:=", CellID->124777921], Cell[BoxData["$Failed"], "Output", CellChangeTimes->{3.752958680671026*^9, 3.7529592329355164`*^9, 3.7529600549142537`*^9, 3.7561263512350388`*^9, 3.756126810234424*^9, 3.7566522464776573`*^9}, CellLabel->"Out[11]=", CellID->41849165] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Properties and Relations", "Subsection", CellID->754506620], Cell[TextData[{ "Use ", Cell[BoxData[ TagBox[ ButtonBox[ StyleBox["Quiet", "SymbolsRefLink", ShowStringCharacters->True, FontFamily->"Source Sans Pro"], BaseStyle->Dynamic[ FEPrivate`If[ CurrentValue["MouseOver"], { "Link", FontColor -> RGBColor[0.854902, 0.396078, 0.145098]}, { "Link"}]], ButtonData->"paclet:ref/Quiet"], MouseAppearanceTag["LinkHand"]]], "InlineFormula", FontFamily->"Source Sans Pro", FontSize->0.9428571428571428 Inherited], " to prevent ", Cell[BoxData[ StyleBox["ResourceFunctionMessage", "InlineResourceFunction"]], "InlineFormula", FontFamily->"Source Sans Pro", FontSize->0.9428571428571428 Inherited], " from printing messages:" }], "Text", CellChangeTimes->{{3.752958799625264*^9, 3.752958827468383*^9}, { 3.752959025809085*^9, 3.752959025961083*^9}}, CellID->19990569], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Quiet", "[", RowBox[{ RowBox[{ InterpretationBox[ TagBox[ StyleBox[ StyleBox[ FrameBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->Rational[10, 13] Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ StyleBox["\<\"ResourceFunctionMessage\"\>", "ResourceFunctionLabel"], ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited]} }]], "ResourceFunctionFrame"], FrameBoxOptions->{Background->GrayLevel[0.5, 0.15], BaseStyle->{ "StandardForm", LineSpacing -> {0, 0}, LineBreakWithin -> False}, FrameMargins->{{3, 3}, {0, 0}}, FrameStyle->Directive[ GrayLevel[0.5, 0.35], AbsoluteThickness[0.5]], RoundingRadius->4}, GridBoxOptions->{FrameStyle->GrayLevel[1, 0], GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0.25}}, "Rows" -> {-0.1, {}, 0}}}], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "\"ResourceFunctionMessage\""}], ResourceFunction["ResourceFunctionMessage"], BoxID -> "ResourceFunctionMessage", Selectable->False], "[", RowBox[{ RowBox[{"f", "::", "argx"}], ",", "1", ",", "2"}], "]"}], ";", " ", RowBox[{"1", "+", "1"}]}], "]"}]], "Input", CellChangeTimes->{{3.7529590277970033`*^9, 3.7529590620409327`*^9}}, CellLabel->"In[1]:=", CellID->378057303], Cell[BoxData["2"], "Output", CellChangeTimes->{3.752959062373905*^9, 3.7529592330295024`*^9, 3.752960055017265*^9, 3.756126355298582*^9, 3.7561268103973565`*^9, 3.756652246726446*^9}, CellLabel->"Out[1]=", CellID->403894831] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[Cell["\t", "ExampleDelimiter"], $Line = 0; Null]], "ExampleDelimiter", Selectable->False, ShowCellBracket->Automatic, CellMargins->{{66, 14}, {5, 10}}, Evaluatable->True, CellGroupingRules->{"SectionGrouping", 58}, CellEvaluationFunction->(($Line = 0; Null)& ), ShowCellLabel->False, CellLabelAutoDelete->True, TabFilling->"\[LongDash]\[NegativeThickSpace]", TabSpacings->{100}, StyleMenuListing->None, FontFamily->"Verdana", FontWeight->Bold, FontSlant->"Plain", FontColor->GrayLevel[0.905882]], Cell["Suppress specific messages:", "Text", CellChangeTimes->{{3.7529591323447027`*^9, 3.752959144441317*^9}}, CellID->549915831], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Quiet", "[", RowBox[{ RowBox[{ RowBox[{ InterpretationBox[ TagBox[ StyleBox[ StyleBox[ FrameBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->Rational[10, 13] Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ StyleBox["\<\"ResourceFunctionMessage\"\>", "ResourceFunctionLabel"], ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited]} }]], "ResourceFunctionFrame"], FrameBoxOptions->{Background->GrayLevel[0.5, 0.15], BaseStyle->{ "StandardForm", LineSpacing -> {0, 0}, LineBreakWithin -> False}, FrameMargins->{{3, 3}, {0, 0}}, FrameStyle->Directive[ GrayLevel[0.5, 0.35], AbsoluteThickness[0.5]], RoundingRadius->4}, GridBoxOptions->{FrameStyle->GrayLevel[1, 0], GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0.25}}, "Rows" -> {-0.1, {}, 0}}}], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "\"ResourceFunctionMessage\""}], ResourceFunction["ResourceFunctionMessage"], BoxID -> "ResourceFunctionMessage", Selectable->False], "[", RowBox[{ StyleBox[ RowBox[{"Power", "::", "infy"}], "MessageName"], ",", "\[Infinity]"}], "]"}], ";", RowBox[{ InterpretationBox[ TagBox[ StyleBox[ StyleBox[ FrameBox[GridBox[{ { StyleBox[ StyleBox[ AdjustmentBox["\<\"[\[FilledSmallSquare]]\"\>", BoxBaselineShift->-0.25, BoxMargins->{{0, 0}, {-1, -1}}], "ResourceFunctionIcon", FontColor->RGBColor[ 0.8745098039215686, 0.2784313725490196, 0.03137254901960784]], ShowStringCharacters->False, FontFamily->"Source Sans Pro Black", FontSize->Rational[10, 13] Inherited, FontWeight->"Heavy", PrivateFontOptions->{"OperatorSubstitution"->False}], StyleBox[ StyleBox["\<\"ResourceFunctionMessage\"\>", "ResourceFunctionLabel"], ShowStringCharacters->False, FontSize->Rational[12, 13] Inherited]} }]], "ResourceFunctionFrame"], FrameBoxOptions->{Background->GrayLevel[0.5, 0.15], BaseStyle->{ "StandardForm", LineSpacing -> {0, 0}, LineBreakWithin -> False}, FrameMargins->{{3, 3}, {0, 0}}, FrameStyle->Directive[ GrayLevel[0.5, 0.35], AbsoluteThickness[0.5]], RoundingRadius->4}, GridBoxOptions->{FrameStyle->GrayLevel[1, 0], GridBoxAlignment->{"Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxSpacings->{"Columns" -> {{0.25}}, "Rows" -> {-0.1, {}, 0}}}], {"FunctionResourceBox", RGBColor[0.8745098039215686, 0.2784313725490196, 0.03137254901960784], "\"ResourceFunctionMessage\""}], ResourceFunction["ResourceFunctionMessage"], BoxID -> "ResourceFunctionMessage", Selectable->False], "[", RowBox[{ StyleBox[ RowBox[{"f", "::", "argx"}], "MessageName"], ",", "1", ",", "2"}], "]"}], ";", RowBox[{"1", "+", "1"}]}], ",", RowBox[{"{", StyleBox[ RowBox[{"Power", "::", "infy"}], "MessageName"], "}"}]}], "]"}]], "Input",\ CellChangeTimes->{3.7529591477381954`*^9}, CellLabel->"In[1]:=", CellID->146209657], Cell[BoxData[ TemplateBox[{ "ResourceFunction","usermessage", "\"\\!\\(\\*TemplateBox[List[StyleBox[RowBox[List[\\\"f\\\", \\\"::\\\", \ \\\"argx\\\"]], \\\"MessageName\\\"], \\\"\\\\\\\": \\\\\\\"\\\", \ \\\"\\\\\\\"\\\\\\\\!\\\\\\\\(\\\\\\\\*RowBox[{\\\\\\\\\\\\\\\"1\\\\\\\\\\\\\\\ \"}]\\\\\\\\) called with \ \\\\\\\\!\\\\\\\\(\\\\\\\\*RowBox[{\\\\\\\\\\\\\\\"2\\\\\\\\\\\\\\\"}]\\\\\\\\\ ) arguments; 1 argument is expected.\\\\\\\"\\\"], \\\"RowDefault\\\"]\\)\"", 2,1,64,31127369278172669751,"Local"}, "MessageTemplate"]], "Message", "MSG", CellChangeTimes->{3.7529591489201574`*^9, 3.7529592330665035`*^9, 3.752960055114273*^9, 3.7561263590147963`*^9, 3.756126810827615*^9, 3.75665224713575*^9}, CellLabel->"During evaluation of In[1]:=", CellID->719756882], Cell[BoxData["2"], "Output", CellChangeTimes->{3.752959148924156*^9, 3.752959233083502*^9, 3.752960055132273*^9, 3.7561263590245533`*^9, 3.7561268108500547`*^9, 3.756652247145507*^9}, CellLabel->"Out[1]=", CellID->78863265] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{808, 855}, WindowMargins->{{436, Automatic}, {Automatic, 50}}, FrontEndVersion->"12.0 for Mac OS X x86 (64-bit) (April 8, 2019)", StyleDefinitions->"Default.nb", $CellContext`ClosingSaveDialog -> False ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 56, 1, 70, "Subsection",ExpressionUUID->"d100c334-cd4c-4bcb-9fa4-535d6fe7c4d6", CellID->462042388], Cell[639, 25, 121, 2, 70, "Text",ExpressionUUID->"28306be5-9a42-4fd6-8555-27222335f116", CellID->13078159], Cell[CellGroupData[{ Cell[785, 31, 2034, 51, 70, "Input",ExpressionUUID->"657b55ae-e89a-4ff5-b312-89aa9df72df8", CellID->443871870], Cell[2822, 84, 810, 15, 70, "Message",ExpressionUUID->"0d6e1e7f-16e0-4b13-8797-5f370d8cd111", CellID->275001298] }, Open ]], Cell[CellGroupData[{ Cell[3669, 104, 545, 17, 70, "ExampleDelimiter",ExpressionUUID->"073734b9-31d2-4a3d-b782-3fa2be32455f", Evaluatable->True, CellGroupingRules->{"SectionGrouping", 58}], Cell[4217, 123, 160, 4, 70, "Text",ExpressionUUID->"be14a5bc-c3d9-4249-ab34-cf27cc1e4f83", CellID->4425302], Cell[4380, 129, 2654, 68, 70, "Input",ExpressionUUID->"c50b3e09-4231-4389-82f9-ee95940084d2", CellID->578546949], Cell[7037, 199, 98, 2, 70, "Text",ExpressionUUID->"781c0079-ca3b-41a5-8123-c0dcfb46ab8b", CellID->17953048], Cell[7138, 203, 211, 7, 70, "Input",ExpressionUUID->"de975d7e-249c-451d-a13a-4b14512246b5", CellID->143877908], Cell[CellGroupData[{ Cell[7374, 214, 104, 3, 70, "Input",ExpressionUUID->"a28406a9-51dc-4a26-8850-5aaada2f443f", CellID->221664925], Cell[7481, 219, 266, 5, 70, "Output",ExpressionUUID->"9a77b7a6-9c8b-4cd4-98b1-983ab006cc34", CellID->285644492] }, Open ]], Cell[CellGroupData[{ Cell[7784, 229, 121, 4, 70, "Input",ExpressionUUID->"fed37d00-0050-4624-9bd0-cbbbc4e4a866", CellID->14701213], Cell[7908, 235, 782, 15, 70, "Message",ExpressionUUID->"e9b92534-20f0-446f-b8b6-826682869498", CellID->418264772], Cell[8693, 252, 319, 7, 70, "Output",ExpressionUUID->"59eef73a-39fe-4153-b8db-a60f6f55930f", CellID->48448369] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[9073, 266, 54, 1, 70, "Subsection",ExpressionUUID->"50f3f6d9-12d5-4725-8596-2275739e18a1", CellID->568056528], Cell[9130, 269, 180, 3, 70, "Text",ExpressionUUID->"b0a88aad-3e44-4426-9bfc-45d5a30e83eb", CellID->432212936], Cell[9313, 274, 843, 27, 70, "Input",ExpressionUUID->"a946c478-5696-472a-bc0c-a18be6268143", CellID->77544037], Cell[CellGroupData[{ Cell[10181, 305, 172, 4, 70, "Input",ExpressionUUID->"e0040c2f-6c06-415c-a1b4-7e3b40ea3aad", CellID->60000440], Cell[10356, 311, 239, 5, 70, "Output",ExpressionUUID->"94d4926e-5eaf-47d9-bf6a-7a23c2b1038c", CellID->163043873] }, Open ]], Cell[CellGroupData[{ Cell[10632, 321, 195, 5, 70, "Input",ExpressionUUID->"1e8c4acc-1e71-4973-8f05-75e4b56c4c76", CellID->106520339], Cell[10830, 328, 479, 10, 70, "Message",ExpressionUUID->"2e4b86d8-8ac3-4c87-9265-cd261ef4dfee", CellID->252585348], Cell[11312, 340, 235, 5, 70, "Output",ExpressionUUID->"b041addb-7efa-4479-a81f-0237f6f8ecc3", CellID->87371] }, Open ]], Cell[11562, 348, 731, 21, 70, "Text",ExpressionUUID->"ffc998c0-157d-4554-9e19-a1d21a1d972b", CellID->49981850], Cell[CellGroupData[{ Cell[12318, 373, 272, 7, 70, "Input",ExpressionUUID->"2961a683-221d-4992-8f00-75ef0c6f1abe", CellID->92171733], Cell[12593, 382, 2085, 51, 70, "Output",ExpressionUUID->"f8fa3fc8-74b0-4a97-aa66-c8ae2811fa0a", CellID->85658731] }, Open ]], Cell[CellGroupData[{ Cell[14715, 438, 183, 5, 70, "Input",ExpressionUUID->"75e01974-29b5-4219-bbc6-9b959713f137", CellID->120517745], Cell[14901, 445, 607, 13, 70, "Message",ExpressionUUID->"7ba3ebef-ea18-4a98-aed1-09ad2ce973ab", CellID->856964973], Cell[15511, 460, 237, 5, 70, "Output",ExpressionUUID->"a21cccf7-29eb-4245-ab7f-0c5101a55d18", CellID->78743797] }, Open ]], Cell[15763, 468, 1433, 43, 70, "Text",ExpressionUUID->"9ef5783d-928d-48c9-b97e-4a188e2d208d", CellID->306784196], Cell[17199, 513, 2410, 60, 70, "Input",ExpressionUUID->"86b772de-0e82-47c3-a12a-018b6533f843", CellID->830459108], Cell[CellGroupData[{ Cell[19634, 577, 153, 4, 70, "Input",ExpressionUUID->"fd878c4a-f534-4f69-9925-65b0f60b6474", CellID->511850086], Cell[19790, 583, 2083, 51, 70, "Output",ExpressionUUID->"45b367f3-d53d-4fe2-9b2a-dd34bc6cff71", CellID->177858101] }, Open ]], Cell[CellGroupData[{ Cell[21910, 639, 117, 4, 70, "Input",ExpressionUUID->"3cc41c2d-ba51-4a9e-acf1-67b757e0362d", CellID->150937357], Cell[22030, 645, 743, 14, 70, "Message",ExpressionUUID->"3399bd35-b0e4-4af2-b303-32783217e4ae", CellID->124777921], Cell[22776, 661, 243, 5, 70, "Output",ExpressionUUID->"425d593e-6345-41e5-ac7e-dc0d409c5924", CellID->41849165] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[23068, 672, 66, 1, 70, "Subsection",ExpressionUUID->"be79594e-0fd8-419b-972f-cf5ff4f5da82", CellID->754506620], Cell[23137, 675, 877, 27, 70, "Text",ExpressionUUID->"48d57a16-3cf2-4477-bd6d-892b1f0a09de", CellID->19990569], Cell[CellGroupData[{ Cell[24039, 706, 2221, 55, 70, "Input",ExpressionUUID->"02aa9fd3-0340-4e4a-894c-7373e93e3234", CellID->378057303], Cell[26263, 763, 233, 5, 70, "Output",ExpressionUUID->"c700d3fd-941a-42e0-a76c-b0af90fec3be", CellID->403894831] }, Open ]], Cell[CellGroupData[{ Cell[26533, 773, 545, 17, 70, "ExampleDelimiter",ExpressionUUID->"0fc3a157-a734-4d61-bbe2-deb9e7278297", Evaluatable->True, CellGroupingRules->{"SectionGrouping", 58}], Cell[27081, 792, 131, 2, 70, "Text",ExpressionUUID->"97f751b5-e305-4a11-afb4-fcd569829dff", CellID->549915831], Cell[CellGroupData[{ Cell[27237, 798, 4505, 113, 70, "Input",ExpressionUUID->"64a29d84-1969-4fcb-9b53-8759720b7b18", CellID->146209657], Cell[31745, 913, 785, 15, 70, "Message",ExpressionUUID->"4a9ee3bf-9965-43f7-a175-141ab11777fc", CellID->719756882], Cell[32533, 930, 232, 5, 70, "Output",ExpressionUUID->"1a330e56-bbb3-474b-b8d4-4801b9894a59", CellID->78863265] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)