Received: from mx0.gmx.net (mx0.gmx.net [213.165.64.100]) by h1439878.stratoserver.net (8.14.2/8.14.2/Debian-2build1) with SMTP id p9QAIUJJ001362 for ; Wed, 26 Oct 2011 12:18:31 +0200 Received: (qmail 10858 invoked by alias); 26 Oct 2011 10:18:25 -0000 Delivered-To: GMX delivery to rainer.schoepf@gmx.net Received: (qmail invoked by alias); 26 Oct 2011 10:18:24 -0000 Received: from relay2.uni-heidelberg.de (EHLO relay2.uni-heidelberg.de) [129.206.210.211] by mx0.gmx.net (mx033) with SMTP; 26 Oct 2011 12:18:24 +0200 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 p9QAG6He020442 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Oct 2011 12:16:06 +0200 Received: from listserv.uni-heidelberg.de (localhost.localdomain [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p9QA7HBk030285; Wed, 26 Oct 2011 12:16:06 +0200 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 1895599 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Wed, 26 Oct 2011 12:16:05 +0200 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.1/8.13.1) with ESMTP id p9QAG5Yb021749 for ; Wed, 26 Oct 2011 12:16:05 +0200 Received: from csep02.cliche.se (csep02.cliche.se [195.249.40.184]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id p9QAFoCv007326 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 26 Oct 2011 12:15:53 +0200 Received: from nova-2.local (c-94-255-156-147.cust.bredband2.com [94.255.156.147]) by csep02.cliche.se (Postfix) with ESMTP id B4FEF18666D for ; Wed, 26 Oct 2011 12:15:48 +0200 (CEST) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.22) Gecko/20110902 Thunderbird/3.1.14 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by listserv.uni-heidelberg.de id p9QAG5Yb021750 Message-ID: <4EA7DB88.7020906@residenset.net> Date: Wed, 26 Oct 2011 12:06:00 +0200 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: =?ISO-8859-1?Q?Lars_Hellstr=F6m?= Subject: S combinator and such To: LATEX-L@listserv.uni-heidelberg.de Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: X-GMX-Antispam: 0 (eXpurgate); Detail=5D7Q89H36p7zYQev1Bv5lbePAADPYxfi9uHd7pIg6rBROecaZ6LQzHokYnH4n3273uaGq m1+cUyGz9FtZ9SYL5iUUZqOgxxVj/kr0fkDicqdAft58KU84D+ixfDFPT6wmAp6cAdtLiCByqhU8 7b348vY7R2w+oMxpS37XanXuTtXJ2st1lj1ijIgJGZPh0uSD1aGjetglug=V1; X-Resent-By: Forwarder X-Resent-For: rainer.schoepf@gmx.net X-Resent-To: rainer@rainer-schoepf.de Status: R X-Status: X-Keywords: X-UID: 6954 Continuing my reading up on Lambda calculus and related matters, I've now gotten to the Combinatory logic (http://en.wikipedia.org/wiki/Combinatory_logic), which also turns out to be much easier to understand when one transcribes the whole thing into LaTeX macros. :-) In particular, there are \cs_new:Npn \combinator_I:n #1 { #1 } % AKA \use_i:n \cs_new:Npn \combinator_K:nn #1 #2 { #1 } % AKA \use_i:nn \cs_new:Npn \combinator_S:nnn #1 #2 #3 { #1{#3}{ #2{#3} } } \cs_new:Npn \combinator_B:nnn #1 #2 #3 { #1{ #2{#3} } } \cs_new:Npn \combinator_C:nnn #1 #2 #3 { #1{#3}{#2} } My thought with this mail is mainly to ask whether there are any more of these (or other standard combinators) that are defined in LaTeX3 already. I seem to recall some discussion to the effect that the C combinator might be named \use_i_biii_bii:nnn, but I haven't seen any occurrence in the source of such _bii_ names (then again, maybe I'm not looking close enough). Continuing such a naming scheme, one would arrive at maybe \use_i_biibiii:nnn for the B combinator \use_i_biii_biibiii:nnn for the S combinator which does not seem entirely practical... David Carlisle mentioned in the Church booleans thread that http://www.ctan.org/tex-archive/macros/plain/contrib/lambda provides what amounts to the B and C combinators under the (so far most comprehensible) names \Compose and \Twiddle respectively. It doesn't provide the S combinator up front, but rather \cs_new:Npn \Lift #1 #2 #3 #4 { #1{#4} {#2} {#3} {#4} } the primary intent for which is that #1{#4} should behave as a Church boolean, and thus select whether to apply #2 or #3 to the second #4. I suspect \Lift, \Twiddle, \Compose, and maybe some additional macro could be combined into an S combinator, but it is not immediately clear to me how. (Reading that lambda.tex, I'm surprised that not more of it made it into fontinst -- both projects having the same original author -- but three years was a lot of time in TeX history, back then.) Somewhat relatedly, it occurs to me that the process of converting lambda-terms to combinator formulae /might/ be the beginning of an approach to having "named command parameters" in (high-level) LaTeX without radical modifications of the TeX engine -- the idea being that the named parameters are (upon macro definition) removed from the replacement text as a matter of lambda elimination (conversion of a lambda term to an equivalent combinatorial term). Whether that would be practical is of course an entirely different matter. ;-) Lars Hellström