> do you have an example of usage

Yes, I am trying to create the command \operatorname in ConTeXt. I know that in LaTeX \operatorname{xyz} is equivalent to

\mathop{\newmcodes@\kern\z@\operator@font xyz}\csname nolimits@\endcsname}

according to the AMSopn package (http://www.bakoma-tex.com/doc/latex/amsmath/amsopn.pdf), and I am trying to translates that in ConTeXt:

\mathop{\newmcodes@\kern\zeropoint\mfunction{xyz}}\nolimits

but \newmcodes@ produces an error. 

In LaTeX, \newmcodes@ is defined as

\begingroup \catcode`\"=12
    \gdef\newmcodes@{\mathcode`\'39\mathcode`\*42\mathcode`\."613A%
    \ifnum\mathcode`\-=45 \else
        \mathchardef\std@minus\mathcode`\-\relax
    \fi
    \mathcode`\-45\mathcode`\/47\mathcode`\:"603A\relax}
\endgroup

according to the AMSopn package, so I have copied the code in my document (I only removed the @ so that I don't have to convert its catcode) but the if condition gives an error (however it compiles fine without the if condition).

I also know that there is the ConTeXt command \definemathcommand[nolop]{xyz} which I thought stands as an equivalent to the \operatorname wrapper \DeclareMathOperator, but apparently not since it doe not use the 3 commands
1. \newmcodes@
2. \kern\z@
3. \operator@font
in it, so I wonder the point of such a wrapper since all it seems it does is translates to

\mathop{xyz}\nolimits

To sum up, I would like to have a \DeclareMathOperator in ConTeXt, so here are my 2 questions:
1. What is the ConTeXt equivalent of \newmcodes@?
2. What is the point of \definemathcommand?


Maggyero