Can case-selecting functions like \prg_case_int or \prg_case_str be nested? If so I will provide some examples of very weird results I observe with nesting.
REVISION:
I messed up the syntax suggested in the interface3 document by omitting some of the <code case> strings. The revised code of my experiment now works and looks like this:
%document name: LaTeX3_interface3.tex
%RN 15/3/2012
% OBJECTIVE: Nesting case-selecting functions prg_case_str or prg_case_int.
% REFERENCE: The LaTeX3 Intefaces, 8 Feb 2012 (interface3.pdf), page 38ff.
% COMMENTS:
% (1) on the first attempt failed to define all of the <code case> strings and the whole
% thing turned pear shaped
% (2) the printed messages in the result are not properly formatted but that's due
% to my inexperience in LaTeX2 and needs to be addressed seperately.
%=====================================================================================
\documentclass{article}
%\usepackage{expl3}
\usepackage{amsmath,xparse}
\ExplSyntaxOn
\NewDocumentCommand{\myCommand}{ m m m }
{
\prg_case_str:nnn { #1 }
{
{1a}
{
\prg_case_str:nnn { #2 }
{
{2A} %{case 1a:2A\\}
{
\prg_case_str:nnn { #3 }
{
{3\alpha} {case 1a:2A:3\alpha\\}
{3\beta} {case 1a:2A:3\beta\\}
{3\gamma} {case 1a:2A:3\gamma\\}
}
{None of 1a:2A: 3\alpha, 3\beta, 3\gamma \\}
}
{2B} %{case 1a:2B\\}
{
\prg_case_str:nnn { #3 }
{
{3\alpha} {case 1a:2B:3\alpha\\}
{3\beta} {case 1a:2B:3\beta\\}
{3\gamma} {case 1a:2B:3\gamma\\}
}
{None of 1a:2B: 3\alpha, 3\beta, or 3\gamma\\}
}
{2C} %{case 1a:2C\\}
{
\prg_case_str:nnn { #3 }
{
{3\alpha} {case 1a:2C:3\alpha\\}
{3\beta} {case 1a:2C:3\beta\\}
{3\gamma} {case 1a:2C:3\gamma\\}
}
{None of 1a:2C: 3\alpha, 3\beta, 3\gamma\\}
}
}
{None of 1a: 2A, 2B, 2C\\}
}
{1b}
{
\prg_case_str:nnn { #2 }
{
{2A} {case 1b:2A\\}
{2B} {case 1b:2B\\}
{2C} {case 1b:2C\\}
}
{None of 1b: 2A, 2B, 2C\\}
}
{1c}
{
\prg_case_str:nnn { #2 }
{
{2A} {case 1c:2A\\}
{2B} {case 1c:2B\\}
{2C} {case 1c:2C\\}
}
{None of 1c: 2A, 2B, 2C\\}
}
}
{None of 1a, 1b, 1c\\}
}
%etc. etc.
\ExplSyntaxOff
\begin{document}
$\myCommand{1a}{2A}{3\alpha}$
$\myCommand{1a}{2B}{3\beta}$
$\myCommand{1a}{2C}{3\gamma}$
$\myCommand{1b}{2A}{3gamma}$
$\myCommand{1b}{2B}{3gamma}$
$\myCommand{1b}{2C}{3gamma}$
$\myCommand{x}{2A}{3gamma}$
$\myCommand{1a}{y}{3gamma}$
$\myCommand{1a}{2C}{3gamma}$
$\myCommand{1b}{2A}{3gamma}$
$\myCommand{z}{2B}{3gamma}$
$\myCommand{1b}{2C}{3gamma}$
\end{document}
If I knew how to import the resulting .pdf document I would.
My apologies for starting a wild goose chase. My only excuse is that the LaTeX syntax is quite tricky to get right in the absence of automated editing facilities that would as a minimum generate correct indentations. Perhaps such LaTeX3 editing facilities are already available, if they are I would love to hear about them.