Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by h1439878.stratoserver.net (8.14.4/8.14.4/Debian-2ubuntu2.1) with ESMTP id sB20XSrZ001183 for ; Tue, 2 Dec 2014 01:33:29 +0100 Received: from relay2.uni-heidelberg.de ([129.206.210.211]) by mx-ha.gmx.net (mxgmx101) with ESMTPS (Nemesis) id 0MU0Hl-1XV2711Rzt-00QkPr for ; Tue, 02 Dec 2014 01:33:22 +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 sB20VN3U008301 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 2 Dec 2014 01:31:23 +0100 Received: from listserv.uni-heidelberg.de (listserv.uni-heidelberg.de [127.0.0.1]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id sB1N15K2031172; Tue, 2 Dec 2014 01:31:22 +0100 Received: by LISTSERV.UNI-HEIDELBERG.DE (LISTSERV-TCP/IP release 16.0) with spool id 11496707 for LATEX-L@LISTSERV.UNI-HEIDELBERG.DE; Tue, 2 Dec 2014 01:31:21 +0100 Received: from relay.uni-heidelberg.de (relay.uni-heidelberg.de [129.206.100.212]) by listserv.uni-heidelberg.de (8.13.8/8.13.8) with ESMTP id sB20VKOB009371 for ; Tue, 2 Dec 2014 01:31:20 +0100 Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by relay.uni-heidelberg.de (8.14.1/8.14.1) with ESMTP id sB20T4Qh006416 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=FAIL) for ; Tue, 2 Dec 2014 01:29:07 +0100 Received: by mail-lb0-f182.google.com with SMTP id f15so10609135lbj.13 for ; Mon, 01 Dec 2014 16:29:04 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.112.52.37 with SMTP id q5mr58539681lbo.32.1417480144565; Mon, 01 Dec 2014 16:29:04 -0800 (PST) Received: by 10.25.217.149 with HTTP; Mon, 1 Dec 2014 16:29:04 -0800 (PST) References: <54728579.9060106@clear.net.nz> Content-Type: text/plain; charset=UTF-8 Message-ID: Date: Tue, 2 Dec 2014 01:29:04 +0100 Reply-To: Mailing list for the LaTeX3 project Sender: Mailing list for the LaTeX3 project From: Bruno Le Floch Subject: Re: 1+1=2, calculyx, and musings on l3fp To: LATEX-L@LISTSERV.UNI-HEIDELBERG.DE In-Reply-To: <54728579.9060106@clear.net.nz> Precedence: list List-Help: , List-Unsubscribe: List-Subscribe: List-Owner: List-Archive: Envelope-To: X-GMX-Antispam: 0 (Mail was not recognized as spam); Detail=V3; X-GMX-Antivirus: 0 (no virus found) X-UI-Filterresults: notjunk:1;V01:K0:TauGKFAlX1U=:vo2yk1HQkp8xcfDd3/o3wK1MkZ 05SMycK0hEq1jb16cbDOwIc9Xrz7qwqt+B4JghQt9e3wLvIvutfYesQb+GyuQiE+/B5wS24ts HXfYdRTtEZWfosPgIhODBkswexiqhyfaoVfyAZaFQk+o8PEYl7xK0k3Z4x2WG0S2J17fxu1dQ xuSsMhDNASvP7FZ4DPgM4Fzv9MbTgakHrMx/bESL1RWIe0KpK0lXJu4evPo0t9oozQz/fp/F7 NCJ+kMv31eC+IYhfjRj80J8ZBj9sWKehzdAiMwjoTmhVf2WXBrn670RlhPOPu9ijC3kh/131m nMbZWqXgYZnnTErbsdZM8mRZLdc7dc2nYvILO287mcK/qhhmvThsbCFTsGqnlV4TdezqSDFiZ L8j+/FclQ6eXfXZhNNEUMooPFrjqA/QKO7OTW1NgDB0YsIru01Zk79eAnRDA5Mf5qURdFeQmk yvWATPhnHy1hkl20YkQkaU4YgQMjAx5XVrj+lKIKeWE9cN4QYIJDxIXI5pAng4xhfE2iep87U DqXZ4FQSgkVPuHyWKvv62nW3s0SyCpHFML1zUF4NEggGckx6Lis+0bipznvbEkJHuGFT76NvD XC48ljBheoJNbGD4u+0PcNpuSo2cavIUcz+oJNhn1dE3syzom3GtgB0qeE1NhVAheSjMm9GuL qPRmj0lPymXRJ2hQxaT1p/0g19jWZCvGXKeyp8V0SHq4/a/9P1uZBFzgIiGxU3d4VJPWugq8z PPRxeEksq3SPuBF4XW1lpcXJA5gVJCcOFuklM/b9JIFtlEBjzelpPL+lmb78oU8ChqGdWlCpZ nMIQrC7DN7MAPYzcBRUbaL3MiHpMAizcAw46ScNNFDH86bBJNQOpy3z/L5I/vyf0PK8fwRDZi bvULzJyf3rF3Icye5KueOWOYiadb57qsKYD7y9kjJ+YSP2yOVxUa8UkxQN8mBAnBisKI8kVdC sKLTCiH8QWpE5sVmS28tc1Tq3C4jbxTD0A0CqtneYo8TcxcWEJEYp2MZZqCVmXv/Z2HVGs4bN 8NczWR6jAkMS7bUGKiuVwxBeSIBIfwVCv3TUbdou8yrWOiqBTElMtqFrcslYy8k6PAVrT/UNN PKhNn7VsZT2BeKLX9V9/faX44UfjrGLnWmuGtqi9UgMAWCMuqBxBa4fYaikf40QGWhSCcOzy3 4oDSUgJp8nQFZ/q5C7HA84IE5+MvFFhIVGM0nidrSK3jC5hb/JASRU9Rp0rQu/+PMxwx00zWD a692KrqhgtqUxgZscWZfRi5qdENgbVN5zLgFkCeXYyO3ku3RILN6QqdxrBIlzbRqKTvnhtY5D 64UY7BSTbnhMsYzTojAZSD87o6nVGqec2Bxyy5+TmI4Teo6n/KsGJPDcgb6qcUkYYZ670mP89 ASRXeO6QoGTBdnm1XCXHwNGMF39UF1j+cg0qcXw86c2jVYW6/Hx8A9SlO7d0BhHoIZ9KbULq7 oUF6Bz0cMAB01E6R2bSqLVczeiPWCMy4SycV5PL9PJ77FvBowK X-UI-Loop:V01:SGbZqKD98iw=:K6fY+0bjm8NdxxYEnXFn+7sx9o8zbPDI0FCfKYjknJA= X-UI-Out-Filterresults: notjunk:1; X-Scanned-By: MIMEDefang 2.71 on 85.214.41.38 Status: R X-Status: X-Keywords: X-UID: 7633 Hello Andrew, I have received and read your email, and will have some thoughts about it, but right now I have quite a bit too much work to think thoroughly about these things. I will get back to you most likely around Christmas. Sorry for the delay. Bruno On 11/24/14, aparsloe wrote: > About a century ago in their "Principia Mathematica" Russell and > Whitehead established, after enormous labour (p.379 apparently), that > 1+1=2. It delights me that now, late in 2014, we can put this to the > test and, indeed, confirm it: > > \fp_eval:n { .^. + .**. } > > The march of progress! > > Please view the preceding little joke as a pre-emptive strike. I have > just "finished" a package called calculyx.sty. Among much else it makes > use of this unusual deployment of the decimal point (specifically > \fp_eval:n { . } ), and it would inconvenience me considerably were this > to be prevented. Calculyx runs to about 3900 lines of code (but with > many formatting lines). Considering that I had never managed more than > 10 to 20 lines of TeX/LaTeX code before, it is a tribute to the enabling > powers of expl3. I even began to feel that coding with expl3 was > intuitive (god help me). > > The "roadmap" in interface3.pdf remarks of l3fp that "this module is > mostly meant as an underlying tool for higher-level commands. For > example, one could provide a function to typeset nicely the result of > floating point computations." When I saw the calculation preceding the > remark, I realised that it was "made to measure" for the instant preview > facility in LyX. That is what I have done. One enters an expression in > the LyX math editor, moves the cursor outside the editor, and after a > (brief) pause, the calculation is effected and the answer snaps into view. > > As well as many modules from l3kernel, the package uses xparse from > l3packages and l3regex from l3experimental. Because a main routine uses > the command \clist_reverse:N, which was introduced to l3kernel on 18 > July 2014, the version of l3kernel must be later than this. There is a > link at http://wiki.lyx.org/Examples/Calculyx to a zipped archive > currently in a Dropbox folder. I shall wait a while for any feedback > before considering a more permanent location. > > I have tried to ensure as much as possible that calculyx reads > expressions as mathematicians write them. For instance it will "digest" > \sin 3x - 3\sin x + 4\sin^{3} x (for a specified value of x, say \pi/6) > without parentheses around the arguments and with the superscript in the > "wrong" but familiar place. The l3fp machinery is hidden from view. > Although written specifically for LyX, the package can be used > independently but one needs to bear in mind that it expects LyXian > LaTeX. I think this amounts to the following conditions: superscripts > and subscripts are *always* wrapped in braces and, for the limits on > summation signs, product signs and integrals, the lower limit *always* > precedes the upper (e.g. \sum_{n=1}^{7} ). The link > https://www.dropbox.com/s/7djkyjs44bpraol/Screenshot%202014-11-24%2013.52.07.png?dl=0 > > gives a screenshot (.png format) of a one page LaTeX document > illustrating some examples of calculations, and the resulting pdf. > > Calculyx will "digest" a number of functions not covered in l3fp. I have > implemented the three principal hyperbolic functions and their inverses > (with the -1 notation: \tanh^{-1} ), factorials (the ! notation -- and > why on earth do mathematicians write it *after* the number it > qualifies?), binomial coefficients, gcd, sums and products, including > "infinite" sums and products, limits, derivatives (1st & 2nd order) and > definite integrals in a single variable. I found the pull from one > function to the next irresistible. Having implemented sums (and > products), it's hard not to consider factorials and binomial > coefficients, and doubly hard to resist the siren song of infinite sums. > Infinite sums lead naturally to limits generally, and it is then only a > small step to derivatives, and you can hardly have derivatives without > also having integrals. > > In fact I began to feel that there is a tension in l3fp, as if it is > caught between two forces: one, a restrictive force limiting the set of > functions to those appropriate to l3kernel, the other an expansionary > pull of the kind I experienced. What does the kernel need? Let me > display my ignorance: the four arithmetic functions, integral powers, > and square roots. That covers things like scaling of fonts and paper > sizes, calculation of margins, and most shaped paragraphs. But the l3fp > roadmap mentions things like factorials, the gamma function(!), arrays, > complex numbers. Yes please, but in the kernel? I am deeply thankful for > what Bruno has already provided but can't help thinking that the module > should "go the whole hog" and implement everything (so to speak). To my > mind that would fit much more naturally as a full-blown LaTeX package > (in l3packages?). > > Andrew >