How can a "tuple" data structure be implemented in LaTeX? The idea is to store several elements (possibly a predefined number) in one macro and then be able to extract each of these elements by index (numeric or otherwise).
\documentclass{article}
% HOW TO IMPLEMENT THIS?
\newcommand{\definetuple}[...]{...}
\newcommand{\extractfromtuple}[...]{...}
% HOW TO IMPLEMENT THIS?
% YOU ARE FREE TO CHANGE SYNTAX HERE
\definetuple{first}{Alice}{Munich}{Germany}
\definetuple{second}{Bob}{London}{United Kingdom}
\begin{document}
\extractfromtuple{first}{1} lives in \extractfromtuple{first}{2}
which is located in \extractfromtuple{first}{3};
this may or may not be true for \extractfromtuple{second}{1}.
\end{document}
% YOU ARE FREE TO CHANGE SYNTAX HERE
I'd like to split the original question so that nice solutions with a new API have a place to live. Should this be community wiki?