On Mon, 21 Aug 2006 17:23:48 +0200, Mojca Miklavec
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
My 2 cents contribution: \def\printPrime#1{#1 is prime.\crlf} %% Why using parameter for this? \def\arePrime[#1]{% \bgroup \processcommalist[#1]\printPrime \egroup} %% Expand the parameter before processing \def\arePrimeN[#1]{% \bgroup \getparameters[Prime][p=,#1] \expandafter\processcommalist\expandafter[\Primep]\printPrime \egroup} \starttext \arePrime[2,3,5] \arePrimeN[p={2,3,5}] \stoptext Regards, BG