From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: [PATCH 6/6] gnu: Improve error reporting of the use-.*modules macros. Date: Sat, 11 Nov 2017 09:00:34 -0800 Message-ID: <87d14obvil.fsf@gmail.com> References: <87zi7xwvso.fsf_-_@gnu.org> <20171108130921.25202-1-ludo@gnu.org> <20171108130921.25202-7-ludo@gnu.org> <87d14po9mv.fsf@gmail.com> <87h8u0hqay.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:4830:134:3::10]:37790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eDZ9A-0005u4-2R for guix-devel@gnu.org; Sat, 11 Nov 2017 12:00:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eDZ95-0007Ex-7r for guix-devel@gnu.org; Sat, 11 Nov 2017 12:00:44 -0500 In-Reply-To: <87h8u0hqay.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 11 Nov 2017 14:56:37 +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.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 ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Heya, > > Chris Marusich skribis: > >> Ludovic Court=C3=A8s writes: >> >>> +(define-syntax-rule (try-use-modules hint modules ...) >>> + (eval-when (expand load eval) >>> + (%try-use-modules '(modules ...) >>> + (source-properties->location >>> + (current-source-location)) >>> + hint))) >>> + >> >> Why is it necessary to use eval-when here? The Guile manual makes it >> sound like eval-when is intended to be used with syntax-case macros, not >> syntax-rules macros. > > It=E2=80=99s necessary because =E2=80=98use-modules=E2=80=99 (and =E2=80= =98try-use-modules=E2=80=99 here) > doesn=E2=80=99t allow you to specify the =E2=80=9Cphase=E2=80=9D (run-tim= e or expansion-time) at > which you=E2=80=99re =E2=80=9Cusing=E2=80=9D the module. Thus, it assume= s you=E2=80=99re using it both > at expansion-time and at run-time. > > The (gnu packages =E2=80=A6) modules happen to export a few macros, so it > doesn=E2=80=99t work if you import them at run-time only. I see. Thank you for the explanation. I think I need to read up more on how Guile loads, evaluates, compiles, etc. its code. =2D-=20 Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAloHLLIACgkQ3UCaFdgi Rp16MA/+Lfa7bRJ4HAYcyB/6zPlhXpoX6vc4UdwD6FC5oH+osatMOs4gwO1V1RXz ISLFyErujF3K6oj3sm5ePLpcRx0j+55YbCePT0asOaX6JjyEXQkQKyiQ0hRhcrpf KyvlPj18zgJeea2tY8rozmK+MKMhVvNBXdO0ul5+Dg3X3c/5WQ5TzYcRqbsZr5r+ L2ocvis8sFiPT16K4tbb90BombcEACBlTKPmFe5uR3qwJFZCzk8G6VqbaThs0JpX /K8Si7SvhzN/SHevEiURgpT41RbaN+/tmiPPpw3OcasgrdzeNFmXfzwUGDhvH4bu QbyoegbmW5NgfNQIMLNhuSPvz7qTtedGorq0kilihk/5akLBnidTjdd6Q0cM4V0k tO541F0LEC4d0NXDQQDih8woeBnIM81sfkvwV8gr+EgWlvX84lgrQ2M6PJGgd8pu Vi0Z+t+DUWEBM3mFwql8KL4rzdLvgM2Y5+5+3Lus0/3pd5tgnzIPdD8xsElgO58p bM3UsfyNtnUPZQ41mouTVKO+dUrIvl0mt35ye9WTlc9iqvtKLZBeCOaajHRtWrkS Ke2AhTIDfNN6RCJRqpC0KnBF1CSbwdDK8EmLgsbfeiS934+2TDp82RMyQbdbjvrl yEAo1Q/GBgHMS+Bqv3z1C2Nmml8/UNVDwuEcllSyXxVOuBmHm5g= =fe63 -----END PGP SIGNATURE----- --=-=-=--