Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Jan 2008 17:07:38 +0100 Received: by mail.proteosys.com (8.13.8/8.13.8) with ESMTP id m01G7WOD027561 for ; Tue, 1 Jan 2008 17:07:32 +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 m01FxAcf027494 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Jan 2008 16:59:10 +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 lBVN1oQC025070; Tue, 1 Jan 2008 17:01:34 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.0) with spool id 237133 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 1 Jan 2008 17:01:33 +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 m01G1XP1004589 for ; Tue, 1 Jan 2008 17:01:33 +0100 Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.184]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id m01Fwc8x026972 for ; Tue, 1 Jan 2008 16:58:42 +0100 Received: by fk-out-0910.google.com with SMTP id 26so6091318fkx.10 for ; Tue, 01 Jan 2008 08:01:21 -0800 (PST) Received: by 10.82.108.9 with SMTP id g9mr23835435buc.34.1199203281071; Tue, 01 Jan 2008 08:01:21 -0800 (PST) Received: from macintosh.local ( [87.60.18.122]) by mx.google.com with ESMTPS id d26sm5475225nfh.39.2008.01.01.08.01.15 (version=SSLv3 cipher=OTHER); Tue, 01 Jan 2008 08:01:20 -0800 (PST) Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-1 MIME-Version: 1.0 References: <874pdy7tss.fsf@buckbeak.hogwarts> User-Agent: Opera Mail/9.25 (MacPPC) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from Quoted-Printable to 8bit by listserv.uni-heidelberg.de id m01G1XP1004590 Message-ID: Date: Tue, 1 Jan 2008 17:01:02 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: =?iso-8859-1?Q?Morten_H=F8gholm?= Subject: Re: Usage of \prg_whiledo:nT To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <874pdy7tss.fsf@buckbeak.hogwarts> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -102.599 () BAYES_00,USER_IN_WHITELIST 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 16:07:38.0542 (UTC) FILETIME=[6E0D34E0:01C84C90] Status: R X-Status: X-Keywords: X-UID: 5142 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? 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 } > 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. The idea behind these generic constructs is to have input as \prg_whiledo:nT {% or F \some_test_function:..T % or :..F } { } So the construction in xtheorem.sty ought to work. (It should be replaced by a simpler \int_whiledo:nNnT but that is not important.) -- Morten