Feeding a macro with the expansion of an other defined “by” \csname

I have a macro \mymacro@i that I want to "feed" with the expansion of another \test. With \expandafter\mymacro@i\test, it works.

Now, the \test macro can be defined by using \csname, say a /test macro. I can't find the combination of \expandafter to make it work the same way as with \test. How can I do?

\documentclass{standalone}
\makeatletter
\expandafter\def\csname /test\endcsname{%
\foo{bar}}
\def\mymacro#1{%
\expandafter\mymacro@i\csname/#1\endcsname}
\def\mymacro@i\foo#1{%
\def\temp{#1}%
\show\temp}
\mymacro{test}
% Error: Use of \mymacro@i doesn't match its definition.
%
\def\test{\foo{bar}}
\def\mymacro#1{%
\expandafter\mymacro@i\test}
\def\mymacro@i\foo#1{%
\def\temp{#1}%
\show\temp}
\mymacro{test}
\begin{document}
\end{document}

-

You need to expand it twice now, once \csname /#1\endcsname to \/#1 and the expand that macro. You need to add therefore two more \expandafter. The first one will expand the third \expandafter before the second, i.e. allows the third to expand the \csname construct, before the second one expands the resulting macro before \mymacro@i.
\def\mymacro#1{%

I consider the construction with \let to be clearer. I think in this case it would be \expandafter\let\expandafter\reserved@a\csname/#1\endcsname \expandafter\mymacro@i\reserved@a or something different. I always get very confused with nested \expandaafter's. –  tohecz Jan 27 '12 at 0:15