LATEX-L Archives

Mailing list for the LaTeX3 project

LATEX-L@LISTSERV.UNI-HEIDELBERG.DE

Options: Use Forum View

Use Monospaced Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Andreas Matthias <[log in to unmask]>
Reply To:
Mailing list for the LaTeX3 project <[log in to unmask]>
Date:
Mon, 31 Dec 2007 16:44:35 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (42 lines)
I struggled a while to understand how to use \prg_whiledo:nT.
I think I figured it out, but it seems to be rather clumsy:


\RequirePackage{l3prg}
\ExplSyntaxOn

\tlp_new:N \a_tlp
\int_new:N \a_int
\int_zero:N \a_int

\prg_whiledo:nT {
  \tlp_set:Nx \a_tlp {
    \predicate_p:n {
      \int_compare_p:nNn \a_int < 4 &&
      \c_true % some complex tests here
    }
  }
  \exp_after:NN \tlp_if_eq:NNT \a_tlp
}{
  \io_put_term:x{Loop~ \int_use:N \a_int}
  \int_incr:N \a_int
}

\stop


Is this the way how to use it? Or did I miss something?

In xtheorem.sty it is used as:

    \prg_whiledo:nT{
      \int_compare:nNnT \etex_lastnodetype:D = \c_eleven
    }{\tex_unskip:D}

And actually, this was the way it expected it to work? But
it doesn't work, does it? I didn't run xtheorem.sty, though.


Ciao
Andreas

ATOM RSS1 RSS2