I'm trying to make definitions from definitions (I don't know if this is how it should be called), here is an example (updated to make clear of my actual aim):
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{ifthen}
\usepackage{lipsum}
\def\street{num. 1, my street}
\def\block{my block}
\def\town{my town, my zipcode}
\def\state{my state}
\def\doordetails{%
\ifthenelse{\equal{\street}{}}{}{\street}%
\ifthenelse{\equal{\street}{} \or \equal{\street}{}}{}{, }%
\ifthenelse{\equal{\block}{}}{}{\block}}
\def\regiondetails{%
\ifthenelse{\equal{\town}{}}{}{\town}%
\ifthenelse{\equal{\town}{} \or \equal{\state}{}}{}{, }%
\ifthenelse{\equal{\state}{}}{}{\state}}
\begin{document}
\ifthenelse{\equal{\doordetails}{}}{}{\doordetails}
\ifthenelse{\equal{\doordetails}{} \or \equal{\regiondetails}{}}{}{~\textbullet~}%
\ifthenelse{\equal{\regiondetails}{}}{}{\regiondetails}}
\end{document}
But I get this error when trying building
! Missing \endcsname inserted.
<to be read again>
\let
l.15 \ifthenelse{\equal{\doordetails}{}}{xxx}{xxx}
\\%


\ifthenelsetests cannot be nested; you can use\ifthenelsein the “true” and “false“ branches, but not inside the test. Maybe some more details about your real aim can help in finding a way out. – egreg Apr 11 '21 at 08:49ifthenhere. I'd use the tools from theetoolboxpackage, especially\ifdefvoid. I have a letter class where all the formatting is using this construction to see if a macro exists, is\relaxor is "empty". – daleif Apr 11 '21 at 11:40