From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: guix-package --roll-back Date: Sun, 13 Jan 2013 21:40:58 +0100 Message-ID: <87pq18stnp.fsf@gnu.org> References: <871uejyq9z.fsf@karetnikov.org> <874nj4sbfe.fsf@karetnikov.org> <87y5gf8sm1.fsf@gnu.org> <87hamy4yaj.fsf@karetnikov.org> <87pq1m5nxy.fsf@gnu.org> <87obh43j7r.fsf@karetnikov.org> <87vcbbqvw1.fsf@gnu.org> <87fw2ai3e1.fsf@karetnikov.org> <8738y8ekst.fsf@gnu.org> <87vcb4jmm8.fsf@karetnikov.org> <87obgvale8.fsf@gnu.org> <871udqp0zr.fsf@karetnikov.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:32992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuUMd-0008Pn-Gb for bug-guix@gnu.org; Sun, 13 Jan 2013 15:41:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TuUMZ-0007Rm-Ry for bug-guix@gnu.org; Sun, 13 Jan 2013 15:41:07 -0500 Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:49705) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TuUMZ-0007RZ-Lo for bug-guix@gnu.org; Sun, 13 Jan 2013 15:41:03 -0500 In-Reply-To: <871udqp0zr.fsf@karetnikov.org> (Nikita Karetnikov's message of "Sat, 12 Jan 2013 16:03:40 -0500") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: bug-guix@gnu.org Nikita Karetnikov skribis: >> It actually does, but it has no side effect. > > I know that printing is a side effect. Why do you recommend to use > 'alist-cons'? If it's not possible to display anything, then > 'roll-back' won't be able to print the following messages. It=E2=80=99s just the /option handler/ (the procedure passed to SRFI-37 =E2=80=98option=E2=80=99) that should not print anything. It is then OK to= print things, of course, like is done for other options. Check how the other options are handled: during =E2=80=98args-fold=E2=80=99= , the option handler just adds to RESULT an element saying that this option was passed. Once =E2=80=98args-fold=E2=80=99 has completed, we check its resul= t: if it contains a pair whose key is =E2=80=98install=E2=80=99, then it means we wa= nt to install something, and so on. >> When =E2=80=98--profile=E2=80=99 is passed, the result of =E2=80=98parse= -options=E2=80=99 contains a >> pair whose key is =E2=80=98profile=E2=80=99. The (assoc-ref opts 'profi= le) calls that >> you see retrieve the argument given to =E2=80=98--profile=E2=80=99. > > It's clear. But where should I call (assoc-ref opts 'profile)? Should > I do it in 'process-query'? In =E2=80=98process-actions=E2=80=99 more precisely, because roll-back is a= n action, not a query. And =E2=80=98process-actions=E2=80=99 already does that. HTH, Ludo=E2=80=99.