A little bit more of intelligence can be given with
\begingroup\lccode`\~=`\:\lowercase{\endgroup
\unexpanded\def~}{\futurelet\tmptoken\docolon}
\unexpanded\def\docolon{\ifx=\tmptoken\mathrel{\mathop{\mathchar`\:}}\else\colon\fi}
\mathcode`\:="8000 %
That lets you do $f: A \to B$ and $f(x) := x^2$
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________