# [NTG-context] How to \processcommalist inside another commalist?

Mojca Miklavec mojca.miklavec.lists at gmail.com
Mon Aug 21 17:23:48 CEST 2006

Hello,

I tried to print out primes (well, I tried to do something else, but I
needed a more illustrative example), but it seems that my approach was
too naive:

\def\arePrime[#1]{%
\bgroup
\getparameters[Prime][p=,#1]
\def\printPrime##1{##1 is prime.\crlf}
\processcommalist[\Primep]\printPrime
\egroup}

\starttext
\arePrime[p={2,3,5}]
\stoptext

I expected something like
2 is prime.
3 is prime.
5 is prime.
But I got
2,3,5 is prime.

Any suggestions or hints about how to change the macro to produce the
desired result (using the same input)?

Thank you a lot,
Mojca