\documentclass{article}
\input camila.mac
\begin{document}

\SORTS

$\begin{array}{lcll}
txt & \cong & {txtEntry^{\star}}  \\
txtEntry & \cong & {{{str + int} + SYM} + txt}  \\
\end{array}$

\OPERS

$\begin{array}{l}
txtFlat:txt \tfunc{{str^{\star}}} \\ txtFlat(l) \deff \\ \rule{3ex}{0pt}  
\conc (\enlist{
\COND{\is{str}(x)}{\enlist{x}}{
\COND{\is{int}(x)}{\enlist{
itoa(x)}}{
\COND{\is{SYM}(x)}{\enlist{
symstr(x)}}{
txtFlat(x)}}} \asor x \in l})
\end{array}$

\traco

$\begin{array}{l}
txt2File:str \times txt \tfunc{SYM} \\ txt2File(fn,t) \deff \\ \rule{3ex}{0pt}  
\LET 
p = 
txtFlat(t)\\
\_ = 
princ(\!\!\mattt{
\mbox{\texttt{"(cr)Warning: replace *txt2File* by *ioTxt2File* and include *io.cam*(cr) "}}}) 
\IN 
do(
sh(
strcat(\!\!\mattt{
\mbox{\texttt{"rm "}}},fn)),\_f' = 
fopen(fn,\!\!\mattt{
\mbox{\texttt{"w"}}}),
foreach(x,p,
\COND{
x = \!\!\mattt{
""}}{
princ(\!\!\mattt{
\mbox{\texttt{"."}}})}{
fputs(x,\_f)}),
fclose(\_f),
sh(
strcat(\!\!\mattt{
\mbox{\texttt{"ls -l "}}},fn))) 
\TEL
\end{array}$

\traco

$\begin{array}{l}
txtAddNL:txt \tfunc{txt} \\ txtAddNL(l) \deff \\ \rule{3ex}{0pt}  \enlist{
\COND{

\is{str}(a) \vee \is{int}(a) \vee \is{SYM}(a)}{a}{a \conc \enlist{\!\!\mattt{
\mbox{\texttt{"(cr)"}}}}} \asor a \in l}
\end{array}$

\traco
\end{document}
