What is the difference between a macro with no arguments and a name?

  • Context: LaTeX 
  • Thread starter Thread starter Eclair_de_XII
  • Start date Start date
  • Tags Tags
    Difference
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 1K views
Eclair_de_XII
Messages
1,085
Reaction score
92
TL;DR
Quick question. Title gives the most straight-forward version of it.
This is some sample code that I drew up.

The name is "\PFlink"
The macro is "\linktoPF"

My question is this: Would you be able to tell which is the name and which is the macro without referring to their respective definitions in the pre-amble below?

[CODE highlight="5-6"]\documentclass{article}

\usepackage{hyperref}

\def\PFlink{\href{https://www.physicsforums.com/}{Welcome to Physics Forums!}}
\newcommand{\linkToPF}{\href{https://www.physicsforums.com/}{Welcome to Physics Forums!}}

\begin{document}

\paragraph{Names vs. Macros}
These are links to PhysicsForums.com. One of them is in the form of a name and the other in the form of a macro.
\begin{description}
\item[name] \PFlink
\item[macro] \linkToPF
\end{description}

\end{document}[/CODE]

Functionality-wise, they both seem to do exactly the same thing: link to this site. Are they different in any way, or no? If so, how would you show someone that they are different without telling the arbitrary novice to just look at the definitions of them in the pre-amble?
 
Physics news on Phys.org
The two are functionally equivalent.

This same phenomenon occurs in symbolic logic, where the objects one works with in a language are predicates (eg '='), functions (eg '+'), variables (eg '##x##') and constants (eg '1'), but the concept of constant is redundant because a constant is just a function with no arguments (a 0-ary function, or function with arity zero, in logic jargon). That is, it requires no inputs, and always gives the same output.