I'm looking for some good advice on switching from (La)TeX to LaTeX3
Here is the first questions corresponding to the toy code below.
What is a good way to manage an optional argument with LaTeX3?
What is a good way to define star versions with LaTeX3?
\documentclass[12pt,a4paper]{article}
\usepackage{ifthen}
\makeatletter
\newcommand\test{\@ifstar{\@test@star}{\@test@no@star}}
\newcommand\@test@no@star[1]{%
I am a %
\ifthenelse{\equal{#1}{upper}}%
{TSAR}%
{tsar}%
.
}
\newcommand\@test@star{%
I am a star.%
}
\makeatother
\begin{document}
\test{}
\test{upper}
\test*{}
\end{document}