From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: New =?utf-8?Q?=E2=80=98--list-generations=E2=80=99?= and =?utf-8?Q?=E2=80=98--delete-generations=E2=80=99?= options Date: Thu, 05 Sep 2013 22:00:05 +0200 Message-ID: <87hadz9gze.fsf@gnu.org> References: <87vc2o4qwc.fsf@gnu.org> <87y57kljro.fsf@karetnikov.org> <87hae81uvo.fsf@gnu.org> <87bo4fcbcz.fsf@karetnikov.org> <878uzj6nev.fsf@gnu.org> <877gf1yftq.fsf@karetnikov.org> <87bo4dspl2.fsf@gnu.org> <87a9jxeh05.fsf@gnu.org> <87r4d9r2lv.fsf@gnu.org> <874na4jfp4.fsf_-_@karetnikov.org> <87eh97616m.fsf@gnu.org> <87bo48xdgb.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 ([2001:4830:134:3::10]:55016) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHfnm-0004Ua-GS for guix-devel@gnu.org; Thu, 05 Sep 2013 16:05:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHfng-0006vh-P7 for guix-devel@gnu.org; Thu, 05 Sep 2013 16:05:14 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:38815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHfng-0006uJ-Jh for guix-devel@gnu.org; Thu, 05 Sep 2013 16:05:08 -0400 In-Reply-To: <87bo48xdgb.fsf@karetnikov.org> (Nikita Karetnikov's message of "Thu, 05 Sep 2013 05:30:12 +0400") List-Id: 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: guix-devel@gnu.org Nikita Karetnikov skribis: > The attached procedure will be invoked when either option is called with > an argument. Nice. BTW, what did you think of the idea of using recutils format as the output? (Either as the sole output format, or otherwise as a secondary format.) > Do you see any problems? Please check everything (especially the > =E2=80=98first-month=E2=80=99 and =E2=80=98last-month=E2=80=99 functions). Better yet: write test cases. :-) > ;; XXX: (avail-generations "") returns () (because of (csi)). This case > ;; should be handled by a different procedure. Basically, it means that = no > ;; arguments were passed to '--list-generations' or '--delete-generations= '. > (define* (avail-generations str #:optional (profile %current-profile)) Please, never use abbreviations in public identifiers, and avoid them in private identifiers too (=E2=80=98valid-generation?=E2=80=99, =E2=80=98mayb= e-integer=E2=80=99 instead of =E2=80=98int=E2=80=99, etc.) > "Return a list of generations matching the pattern in STR." What about splitting it in two functions: =E2=80=98string->time-range=E2=80=99 =E2=86=92 return two SRFI-19 time ob= jects representing a time interval, or #f and #f on failure =E2=80=98generation-within-time-range?=E2=80=99 Writing tests for the former will be easy. The code otherwise looks OK, but disentangling parsing from validation will make it even more pleasant IMO. Thanks, Ludo=E2=80=99.