Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Jan 2008 18:37:05 +0100 Received: by mail.proteosys.com (8.13.8/8.13.8) with ESMTP id m01Hav4r028594 for ; Tue, 1 Jan 2008 18:36:58 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id m01HPuPW013286 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Jan 2008 18:25:56 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id lBVN1oRI025070; Tue, 1 Jan 2008 18:28:36 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.0) with spool id 237216 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 1 Jan 2008 18:28:35 +0100 Received: from relay2.uni-heidelberg.de (relay2.uni-heidelberg.de [129.206.210.211]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id m01HSZse006217 for ; Tue, 1 Jan 2008 18:28:35 +0100 Received: from mx03.kabsi.at (mx03.kabsi.at [195.202.128.130]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id m01HPbNJ012946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 1 Jan 2008 18:25:42 +0100 Received: from buckbeak.hogwarts (h081217001071.dyn.cm.kabsi.at [81.217.1.71]) by mx03.kabsi.at (8.13.8/8.13.8) with SMTP id m01HSJgO028111 for ; Tue, 1 Jan 2008 18:28:19 +0100 Received: by buckbeak.hogwarts (Postfix, from userid 1000) id 3DDE7330520; Tue, 1 Jan 2008 18:28:15 +0100 (CET) References: <874pdy7tss.fsf@buckbeak.hogwarts> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id m01HSZse006218 Message-ID: <87abnpmp5c.fsf@buckbeak.hogwarts> Date: Tue, 1 Jan 2008 18:28:15 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Andreas Matthias Subject: Re: Usage of \prg_whiledo:nT To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: ("Morten =?iso-8859-15?Q?H=F8gholm=22's?= message of "Tue\, 1 Jan 2008 17\:01\:02 +0100") Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -2.464 () BAYES_00,FORGED_RCVD_HELO X-Scanned-By: MIMEDefang 2.57 on 213.139.130.197 Return-Path: owner-latex-l@LISTSERV.UNI-HEIDELBERG.DE X-OriginalArrivalTime: 01 Jan 2008 17:37:05.0264 (UTC) FILETIME=[ECDDFF00:01C84C9C] Status: R X-Status: X-Keywords: X-UID: 5144 Morten Høgholm wrote: > On Mon, 31 Dec 2007 16:44:35 +0100, Andreas Matthias wrote: > > Hi Andreas, > >> 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 > > This last line should just be > \bool_if:NT \a_tlp > and I can see we left out \bool_set:Nn functions which evaluate > such predicate expressions. It would make sense for such a > function to work that way, wouldn't it? Yes, I missed it, too. But maybe one doesn't need it? At least, if one uses \prg_whiledo:nT in a straight-forward way as in: > The entire test could be simplified to > > \prg_whiledo:nT { > \predicate:nT{ > \int_compare_p:nNn \a_int < 4 && > \c_true % some complex tests here > } > }{ > \io_put_term:x{Loop~ \int_use:N \a_int} > \int_incr:N \a_int > } Oh, yes. That's it: \predicate:nT. That's what I was looking for. But yesterday I stubbornly sticked to \predicate_p:n again and again. >> 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. Well, again I was misleadingly thinking of \int_compare_p:nNn. But \int_compare:nNnT succeeds, of course. Thanks! Ciao Andreas