I would like to be able to perform an "indexed" assign by concatenating two (or more) portions of a command name, both for creating a new command and for referencing an existing command. Here is an example that shows that I need. Non-working, of course.
\documentclass[10pt]{article}
\usepackage{mathtools}
\usepackage{fontspec}
\usepackage{unicode-math}
\usepackage{lualatex-math}
\setmainfont{STIX Two Text}
\setmathfont{STIX Two Math}
\usepackage{logix} % Load logix font for additional symbols.
\newCommand oldabc 123 % Existing value.
\newcommand indexedSet[1] { % Macro to do an indexed assign and an indexed reference.
\newcommand val##1 {old##1}
}
\indexedSet{abc} % Defines valabc as 123
\begin{document}
\end{document}


\documentclass[10pt]{article} \newcommand\oldabc{123} \newcommand\indexedSet[1]{\expandafter\def\csname val#1\endcsname{\csname old#1\endcsname}} \begin{document} \indexedSet{abc} \valabc \end{document}– Jun 05 '19 at 00:02