I want to redefine the tabular environment, such that each for example
\begin{tabular}{c|c}
AAA&BBB\\
CCC&DDD\\
\end{tabular}
would produce (for example)
AAA,BBB;CCC,DDD;
Question 1 In order to redefine the &, i use the following :
\catcode`\&=\active
\gdef&{,}
Which works, but i don't know if it is safe. In particular, this works only if i put this outside from the definition of tabular, but i would prefer to have it inside, so that this definition vanishes when i quit the Tabular.
Question 2 I don't know how to redefine the \\.

\letto a normal catcode token..." ? – Loic Rosnay Jun 23 '12 at 11:29&acting as a catcode 4 token (catcode 4Abut that doesn't really matter) and then locally switching to be defined to expand to a comma. – David Carlisle Jun 23 '12 at 13:03tabularact. I would prefer to completely rewrite (and simplify) the definition oftabular. At the end I want to be able to pass it into a\edefand a\write, but maybe it is a different question (see http://tex.stackexchange.com/q/60851/10157) – Loic Rosnay Jun 24 '12 at 14:51\\in a tabular is moot:-) But still the point remains that its best not to change catcode mod document. – David Carlisle Jun 24 '12 at 20:31\def\\{new def}... – Loic Rosnay Jun 25 '12 at 08:31