# Is there any reason to define a zero-argument macro using a starred defining command?


One reason to use a starred version could be consistency in the appearance of one's own LaTeX code. A reason against could be if starred variants are slower, but I don't know whether this is the case.

(This has nothing to do with the choice of starredness - \somemacro of \somemacro* - which one is defining (and how to do the latter is btw not obvious, though it's definitely possible). This is about whether the definition of \somemacro should be performed using a starred or unstarred defining command.)

-
@PeterGrill Good information. But just to prevent confusion by other people, I'll draw attention to the fact that your comment uses the letter "O", not the number "0" (from my question). (There is no misunderstanding between us, but this is for others reading what we wrote.) – Lover of Structure Feb 11 '13 at 4:39
Ahhh.. Ok. I don't know for surem but I can't see why it would matter for a zero argument macro -- but I am only guessing... – Peter Grill Feb 11 '13 at 4:44

Be consistent, that's all. In many occasions, parameterless macros are used as "containers"; suppose you have such a container that stores some particular string you want to compare input with:

\newcommand{\fixed}{foobar}


and then you have a complicated macro taking an argument that you want to compare with \fixed:

\newcommand{\complicated}[1]{%
...
\def\test{#1}%
\ifx\test\fixed
%% the user called \complicated{foobar}
<do something>
\else
<do something else>
\fi
...
}


the \ifx comparison will return "false" even if the call is \complicated{foobar}. Why? Because \fixed is \long, while \test isn't (this is actually an issue with some tests for font attributes using the macros in the LaTeX kernel). How to solve the issue? Using \long\def\test or saying

\newcommand{\test}{} % initialization (this line is necessary)




-

As we can fool the compiler as follows,

\documentclass{article}
\usepackage{lipsum}
\newcommand*\accept[1]{#1}
\begin{document}
\accept{\lipsum[1-3]}
\end{document}


Does starred version matter? :-)

-
Um, I think you know that starred \newcommand* (and \DefineRobustCommand*) are just to aid error checking. But +1 for the wit. – Lover of Structure Feb 11 '13 at 5:40