I need to give specific name to a macro based on a condition.

The first example works, the second does not.

Is using `\csname`/`\endcsname` (i.e., example 1) the only right way? Are there any other ways to make example 2 work?

```
\count255=0
\def\newdef{\advance\count255 by1
 \expandafter\def\csname
  \ifnum\count255=1
    foo%
  \else
    bar%
  \fi
 \endcsname
}
\newdef{hello}
\newdef{world}
\foo\ \bar
\bye

```

```
\count255=0
\def\newdef{\advance\count255 by1
  \ifnum\count255=1
    \def\foo
  \else
    \def\bar
  \fi
}
\newdef{hello}
\newdef{world}
\foo\ \bar
\bye

```