A function name should be of the form
\<prefix>_<name>:<signature>
where <prefix> is a string of letters, possibly preceded by __, and <name> is a string of letters and underscores that should remind the function's role.
The <signature> is a string of letters among NnTFcofxVvwp, that should reflect the number of arguments the function has.
However, a function defined with
\cs_new:Nn
\cs_new_protected:Nn
\cs_new_nopar:Nn
\cs_new_protected_nopar:Nn
or the \cs_set analogs, should only have a signature consisting of characters among NnTF. Actually T and F are essentially the same as n and should be used only for functions doing conditional business.
If you say
\cs_new:Nn \my_function:nn { <replacement text> }
you can use #1 and #2 in the replacement text just as if you had said
\cs_new:Npn \my_function:nn #1 #2 { <replacement text> }
because \cs_new:Nn examines its first argument and is able to figure out how many arguments to supply in the parameter text.
The signature of \tl_set:Nx is Nx meaning that it has two arguments, the first of which is a token (the name of the variable to set); the second argument is a normal braced argument, which is subject to full expansion before the value assignment is performed; the protected bit is because a value assignment is involved. However you can't define it as
\cs_new_protected:Nn \tl_set:Nx { <replacement text> }
but you must do
\cs_new_protected:Nn \tl_set:Nn { <replacement text> }
\cs_generate_variant:Nn \tl_set:Nn { Nx }
Note that you can define function with no signature in their name, but in this case the “long form”
\cs_new:Npn
\cs_new_protected:Npn
\cs_new_nopar:Npn
\cs_new_protected_nopar:Npn
should be used, with the parameter text fully spelled out. The same if you want to define functions with w in the signature.
\your_special_function:Nnnhas three arguments (N, n, n). – Ulrike Fischer May 15 '15 at 14:09\foo:nnknows how many arguments it has itself; it means that\cs_new:Nnwill calculate the number of arguments from the signature it sees. That is, with\cs_new:Nn \foo:NNnnthe\cs_new:Nnwill extract theNNnn(the signature, after the colon) and counting it will se thath\foo:NNnnshould have 4 arguments, so it will expand, somehow, to\cs_new:Npn \foo:NNnn #1 #2 #3 #4and then will define a macro (traditionally that would be\def\foowhatever#1#2#3#4. I think that's the part you misunderstood, but I might be wrong. – Manuel May 15 '15 at 15:24