# How to make a custom function as inbuilt

I have a custom function like following:

SyntaxInformation[
TwoNumberSameQ] = {"ArgumentsPattern" -> {_, _, OptionsPattern[]}};
Options[TwoNumberSameQ] = {ShowDifference -> False};
TwoNumberSameQ[x_, OptionsPattern[]] := {x,
OptionValue[ShowDifference]}
TwoNumberSameQ[a_, b_, OptionsPattern[]] :=
If[OptionValue[ShowDifference],
If[a === b, True, {False, Abs[a - b]}], If[a === b, True, False]]


Usage:

TwoNumberSameQ[3,4]


False

TwoNumberSameQ[3,4,ShowDifference->True]


{False, 1}

 TwoNumberSameQ[3,3]


True

I have some dissatisfaction to this function.But the documentation have a little relative explanation for this area.

# Question one

How to make the option have a black color like as a in-built function,but blue like:

# Question two

How to make TwoNumberSameQ's definition more concise.I just test one option but result so many repetitive code.I cannot imagine how mess when I set three or more option.

If I can make the option have some optional values to choice.I'll be happy more. :)

1. Global symbols are blue unless they have a value but if you use any other context that is on \$ContextPath the symbol color will be black just because it was created.

So use System by mentioning option name when it is parsed for the first time:

Options[TwoNumberSameQ] = {SystemShowDifference -> True}


or define your function in Begin/EndPackage where the option name is exported. Keep in mind conflicts so choose your names wisely.

BeginPackage["Numbers"];

TwoNumberSameQ; ShowDifference;

Begin["Private"];