I am using \mathchoice to define a command \norm that acts differently when in displaystyle or not but I have problem with spacing.
My problem is well illustrated in the following example:
\documentclass{minimal}
\newcommand\myBig{\mathchoice{\bigg|}{}{}{}}
\begin{document}
$$\Bigg|_a$$
$$\myBig_a$$
\end{document}
which gives me
The first line is what I want. The second one is not correct because the "_a" is too high.
It seems that using mathchoice acts as if there was a {} after the command. Is it possible to avoid this behaviour?

\mathchoice{\times}{\sin}{=}{(}spaces correctly? Not tried that now, but I know I questioned why did\mathchoicespace correctly things that were “inside”, because I believed it first made a box then put the correct box there. – Manuel Mar 28 '17 at 15:33^2after themathchoiceconstruction, it doesn't seem to be placed as if the construction was an atom. – egreg Mar 28 '17 at 15:38\mathbinin\displaystyle, a\mathopin\textstyle, a\mathrelin\scriptstyle, and a\mathopenin\scriptscriptstyle. I haven't tested it right now, but I remember it behaved weirdly in that sense; and if that's the case (and I'm not mistaken), you can add that info to the answer, I believe it's the perfect excuse. – Manuel Mar 28 '17 at 15:40\mathchoicebehave that way, while the official explanation has always been “it makes four boxes and then chooses the correct one”. – Manuel Mar 28 '17 at 16:19