From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: G-Expressions and Scope Preservation Date: Wed, 22 Jan 2020 22:43:35 -0800 Message-ID: <875zh27jvs.fsf@gmail.com> References: <87wo9lakdl.fsf@gmail.com> <87muafb07o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:53597) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iuWDN-00078i-RZ for guix-devel@gnu.org; Thu, 23 Jan 2020 01:43:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iuWDM-0000xu-LV for guix-devel@gnu.org; Thu, 23 Jan 2020 01:43:41 -0500 In-Reply-To: <87muafb07o.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Wed, 22 Jan 2020 23:22:35 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, Ludovic Court=C3=A8s writes: > Hello! > > Chris Marusich skribis: > >> In your paper "Code Staging in GNU Guix" [1], you use the following >> example to illustrate how G-Expressions are hygienic ("they preserve >> lexical scope across stages"): >> >> (let ((gen-body (lambda (x) >> #~(let ((x 40)) >> (+ x #$x))))) >> #~(let ((x 2)) >> #$(gen-body #~x))) >> >> You explain that it expands to something like this: >> >> (let ((x-1bd8-0 2)) >> (let ((x-4f05-0 40)) >> (+ x-4f05-0 x-1bd8-0))) >> >> However, when I write this gexp to disk, it doesn't look like that: > > Ah ha! That bit is still in the =E2=80=98wip-gexp-hygiene=E2=80=99 branc= h. > > The reason I haven=E2=80=99t merged it, other than I didn=E2=80=99t take = the time, is > that the output depends on Guile=E2=80=99s =E2=80=98hash=E2=80=99 functio= n, which is not > necessarily stable. Actually, it changed between 2.0 and 2.2, but I > think it=E2=80=99s the same in 2.2 and 3.0. This needs to be checked, be= cause > if it differs, then people will get different results depending on the > Guile version they use, and that=E2=80=99d be a serious issue. > > I thought I had mentioned this before, but apparently not: > > https://lists.gnu.org/archive/html/guix-devel/2017-07/msg00181.html > https://lists.gnu.org/archive/html/guix-devel/2017-09/msg00093.html > > We should also do some more testing to make sure nothing breaks. > > Ludo=E2=80=99. Ah! I see. That explains it. Thank you for pointing this out. I'm still finalizing my presentation, but if I find time after that, I might play around with that branch. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAl4pQJcACgkQ3UCaFdgi Rp3DzQ//QUNW37gtZahzXLzehX6eWpHokGuzG517ElRZveLbGg+wD5Wzner2LRBR gHsukaKQILb+yOl5ctUvGVkgJUz/L6tMg8kIgGFPmikX8+zkq/WyHewaOepU9LEm HeUbh8e0cJL0o83CqDk3816xkHrcaNB/txpdvAr1TW4F9yq2DrrOP5hy31XJNt/E t7cl/hXoWVhi9QIv09+Qwr4wIGOsk2f9cWnXCCQM0YV3WikvRhV3FZ/aRy/C8FYS DIh+HOhhtZYhGmWc1h9jnl2YoPGO6ywZ440HVWyrVyHwGKppovAFH9IYS/fO7YoH VJaDfZ1+1nljPNrRqGQ2ufdmwQLTVy+kBoj4VOfDZRmX3D4R+puXfQQ14Ba5rzvw ChFklC7fcnT6IWoDcNdfYA9UnxCxs9NJsqYpemxL89ITCRz2U/qAoqyEHbl0T2iq GV8zqA9yL6/iURa6el4wdVslYLe0gWvW19POnSrkXH2hKboZgWF21niAsFJtI+Ud LlpJPvkAbrGXCcwC9VYF6wrFOPiAJX6rLAEQQ3i/rWA6ejWJhX03v8qMbn90/p0p HPMGHJM1+uRi2K82rH0ZZcd4r6kEsS9mwuUriAz5vxnjoCAIyZCQZGPl7u4kOf+H E96hU3Ivibgnnfk9VdS+T5zw5jb1jzS4y90sShrhRhpCOywXvXc= =gmRE -----END PGP SIGNATURE----- --=-=-=--