Maybe someone can tell me how to define a new command in \LaTeX, which can take one mandatory value and another optional value (parameter) as input. In this case, depending on the value of the optional argument, the type of the output object should change.
Specifically in my case, I need to specify a command
\dependSet(<arg>, <opt par>) to draw parentheses. in this case, depending on the presence / absence of the optional argument should change the output (presence / absence of a vertical line inside):
Accordingly, for usability it is important that the parameter comes after the arguments of the command, and it is selected with curly brackets, not square ones.
P.S.: Actually, it's a pity that LaTex uses a rather uncomfortable notation (which reeks of something like ALGOL 60) and does nothing to make it possible to define new commands in Python-like style.