Received: from mail.proteosys.com ([213.139.130.197]) by nummer-3.proteosys with Microsoft SMTPSVC(6.0.3790.3959); Mon, 14 Jan 2008 23:48:43 +0100 Received: by mail.proteosys.com (8.13.8/8.13.8) with ESMTP id m0EMmcJW020806 for ; Mon, 14 Jan 2008 23:48:38 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [129.206.100.94]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id m0EMgE7r011288 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jan 2008 23:42:14 +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 m0EEq2TD008596; Mon, 14 Jan 2008 23:41:25 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 15.0) with spool id 272611 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Mon, 14 Jan 2008 23:41:22 +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 m0EMfMA1013455 for ; Mon, 14 Jan 2008 23:41:22 +0100 Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by relay2.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id m0EMcADY026197 for ; Mon, 14 Jan 2008 23:38:15 +0100 Received: from morse.mittelbach-online.de (p4FD45730.dip.t-dialin.net [79.212.87.48]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1JEXzY2DEv-0002iH; Mon, 14 Jan 2008 23:41:16 +0100 Received: by morse.mittelbach-online.de (Postfix, from userid 501) id 6E62A61D16; Mon, 14 Jan 2008 23:41:13 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <874pdy7tss.fsf@buckbeak.hogwarts> <87abnpmp5c.fsf@buckbeak.hogwarts> X-Mailer: VM 7.19 under Emacs 21.3.1 X-Provags-ID: V01U2FsdGVkX19Olz4beXgN22sOMtivxu1JmbFZQVJT2LQkWhX o/MYTd2NlcAxAcyZkGsc0+W1UdKyLCMD3gqVtB2nDksH5zJ2nw cAjKTpt5YkjNiqzOc3nqwC+7bFpnNgn X-Spam-Whitelist-Provider: Message-ID: <18315.58633.36005.733935@morse.mittelbach-online.de> Date: Mon, 14 Jan 2008 23:41:13 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Frank Mittelbach Subject: Re: Usage of \prg_whiledo:nT To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <87abnpmp5c.fsf@buckbeak.hogwarts> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-ProteoSys-SPAM-Score: -102.464 () BAYES_00,FORGED_RCVD_HELO,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: 14 Jan 2008 22:48:43.0839 (UTC) FILETIME=[9D74DCF0:01C856FF] Status: R X-Status: X-Keywords: X-UID: 5153 Andreas Matthias writes: > > > >> 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: [..] > 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. just got around reading that and somehow I don't think this syntax is right just a minute ago I coded \prg_whiledo:nF {\seq_if_empty_p:N \g_xor_floats_active_seq } { \seq_gpop:NN \g_xor_floats_active_seq \g_xor_curr_float_box_tlp \xor_extract_this_float_values:N \g_xor_curr_float_box_tlp } using this function for the first time and that gave some surprising results (for me) ... then looking at the implementation of \prg_whiledo:nF and this discussion not so surprising. But I don't think that: > The idea behind these generic constructs is to have input as > \prg_whiledo:nT {% or F > > \some_test_function:..T % or :..F > } > { } > this is memorable syntax. it is kind of the mixture between \loop \repeat syntax idea and the argument based TF ideas. And it doesn't go too well with something like \bool_whiledo:NT ------------ I'm not saying that the construct as such isn't useful (though it is playing somewhat badly on the argument stack as this isn't tail recursion, is it?) but I don't think the syntax fits well though I don't have a good alternative suggestion right now ... frank ps ... seems that there has been some documentation change recently ...in my hard copy that I use here the exact requirements about using T or F functions for the test aren't written down ... reading that helps :-)