Spacing for homogeneous coordinates

Homogeneous coordinates in projective geometry are usually denoted like this: $[x:y:z]$. However, I think that ':' plays the role of a comma, and should be surrounded by much smaller spaces than for other uses of ':'. Is there a simple way in LaTeX to automatically adjust the spacing in homogeneous coordinates, without messing with the spacing of other uses of ':'?

-
Personally, I think the colon should be treated like a binary operator (written as \mathbin:) in this context. No, I understand it is not binary, it's n-ary, but it still walks and quacks like an operator to me, not as punctuation. (To me, the square brackets are incidental, and I'd just as soon do without them. It is the colons that turn the list of coordinates into a point in projective space.) –  Harald Hanche-Olsen Feb 14 '11 at 16:42

Set it as a {:} or use \mathpunct{:}

\documentclass{article}
\usepackage[french]{babel}
\makeatletter
\def\Coor#1{\begingroup\mathcode`\:="603A[\Coor@i#1::\@nil}
\def\Coor@i#1:#2:#3\@nil{%
#1\ifx\relax#2\relax ]\else\mathpunct{:}\Coor@i#2:#3\@nil\fi\endgroup}
\makeatother

\begin{document}

$\Coor{1}$
foo $\Coor{1:2}$ bar $\Coor{1:2:3}$ baz $[1:2:3]$

\end{document}
-
Thank you, but the number of coordinates may vary. Is there a way to ask LaTeX to systematically treat ':' specially inside a given command? –  Benoît Kloeckner Feb 14 '11 at 14:22
see edited answer –  Herbert Feb 14 '11 at 14:39
I think you can remove \@nil and #3. –  Bruno Le Floch Feb 14 '11 at 15:07
Thanks, your solution works... except it's overrun by babel (I write in French). –  Benoît Kloeckner Feb 14 '11 at 15:19
@Benoît, I edited the code for french and an active : –  Herbert Feb 14 '11 at 16:15