From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:46657) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i2Qn9-0001N8-UK for guix-patches@gnu.org; Mon, 26 Aug 2019 22:01:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i2Qn8-00082F-JY for guix-patches@gnu.org; Mon, 26 Aug 2019 22:01:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:38589) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i2Qn8-00082A-FZ for guix-patches@gnu.org; Mon, 26 Aug 2019 22:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i2Qn8-00005o-CA for guix-patches@gnu.org; Mon, 26 Aug 2019 22:01:02 -0400 Subject: [bug#36875] [PATCH] doc: Document the use of `program-file' for mcron jobs. Resent-Message-ID: From: Maxim Cournoyer References: <875znhbugu.fsf@gmail.com> <87h872t2me.fsf@elephly.net> <87wofwa0wl.fsf@gmail.com> <87y2zrd0a3.fsf@gnu.org> <8736hog8jh.fsf@gmail.com> <87mufw1g8e.fsf@gnu.org> Date: Tue, 27 Aug 2019 19:59:25 +0900 In-Reply-To: <87mufw1g8e.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 26 Aug 2019 10:30:09 +0200") Message-ID: <87o90aeuwi.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 36875-done@debbugs.gnu.org Hello Ludovic, Ludovic Court=C3=A8s writes: > Hi Maxim, > > Maxim Cournoyer skribis: > >> Ludovic Court=C3=A8s writes: >> >>> Hello! >>> >>> Maxim Cournoyer skribis: >>> >>>> From 0fffed46b4899bf0485926399d3971a4b5e94408 Mon Sep 17 00:00:00 2001 >>>> From: Maxim Cournoyer >>>> Date: Thu, 1 Aug 2019 07:34:17 +0900 >>>> Subject: [PATCH] doc: Document the use of `program-file' for mcron job= s. >>>> >>>> * doc/guix.texi (Scheduled Job Execution): Explain why using `program-= file' >>>> for an mcron job can be necessary. Add an example. [...] >>> Macros are a very good example of the problem, but I wonder if it would >>> be clearer to simply write something like: >>> >>> For more complex jobs defined in Scheme where you need control over >>> the top level, for instance to introduce a @code{use-modules} form, y= ou >>> can move your code to a separate program using the @code{program-file} >>> procedure of the @code{(guix gexp)} module (@pxref{G-Expressions}). >>> The example below illustrates that. >> >> I like your version, which feels to me more elegant. But, from my >> experimentation, using (use-modules) in a nested form is fine for >> anything else than syntax (macros). > > That=E2=80=99s right, but I strongly recommend not relying on non-toplevel > =E2=80=98use-modules=E2=80=99 because (1) it=E2=80=99s =E2=80=9Cugly=E2= =80=9D because it introduces new bindings > at run time, and (2) it=E2=80=99s not guaranteed to work in the future=E2= =80=94in fact, > the just-released Guile 2.9.4 introduces =E2=80=9Cdeclarative modules=E2= =80=9D, which is > probably a first step in the direction of less run-time trickery with > modules. Oh! That's good to know! Then using your proposed text as-is makes even more sense. Done in commit 4183105de0. Thank you! Maxim