From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SOBtCtBWiGCRCQAAgWs5BA (envelope-from ) for ; Tue, 27 Apr 2021 20:24:16 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id wDwgBtBWiGBUOQAAB5/wlQ (envelope-from ) for ; Tue, 27 Apr 2021 18:24:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CF9431162A for ; Tue, 27 Apr 2021 20:24:15 +0200 (CEST) Received: from localhost ([::1]:50314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbSNa-0002JU-Ve for larch@yhetil.org; Tue, 27 Apr 2021 14:24:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56382) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lbSNO-0002JO-R5 for guix-devel@gnu.org; Tue, 27 Apr 2021 14:24:02 -0400 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]:38471) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lbSNL-0005Ds-WD for guix-devel@gnu.org; Tue, 27 Apr 2021 14:24:02 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 8439427BC7C; Tue, 27 Apr 2021 19:23:57 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 3dd85c42; Tue, 27 Apr 2021 18:23:57 +0000 (UTC) References: <20210421152914.461bbdbb@lubrito> <87bla6iwli.fsf@cbaines.net> <20210422170040.37941083@lubrito> <875z0ehyl3.fsf@cbaines.net> <20210422180208.28473e41@lubrito> <87zgxqggw9.fsf@cbaines.net> <20210423181551.01c42455@lubrito> <87bla4hdto.fsf@cbaines.net> <20210425171507.6a259017@lubrito> <87o8e1foly.fsf@cbaines.net> <20210426161103.0647ee3f@lubrito> <87im48g2s1.fsf@cbaines.net> <20210427101001.0242f90e@lubrito> User-agent: mu4e 1.4.15; emacs 27.1 From: Christopher Baines To: Luciana Lima Brito Subject: Re: Outreachy - Guix Data Service: questions about improving the data for derivation comparisons. In-reply-to: <20210427101001.0242f90e@lubrito> Date: Tue, 27 Apr 2021 19:23:53 +0100 Message-ID: <87czuffux2.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619547855; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=gL031gzlDygrkIXD+sDEuIGG7QH7BKIIhnx892RFaEA=; b=R+lZoPQCnH4YGneqI+Ph5mthD86oUSoaIojPYEJZgBNrohhFov1IJPslPg9gEEl2UJ95iD DwcKtxRGekstztLZ+IlW5wB17AOqmro9YdG4wB3cbUuewY2+bJRSQJNi5b+FRXkcor/XkQ PSdsWYduZsP/8k0OacKFknBjjF8tEmxzhFMPOFzGNxDH2LzZXmRUA5g4xUyHDuZ94ZNP+9 qmIRDtOlsc+aRbTwSiHGN/aBaw1uVfiWviZ94Jxto3V3qlRobl7yOC3Sc+WWPFsUfxu6LH b9Lr4Gj5xfBxFnZ7T3lWDcUnUDvyiwiskXEPz4ks9DkufNgcVdKNl5+lyhWXYQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619547855; a=rsa-sha256; cv=none; b=rOlUGkYimtG3Dl/XtWsfVR+zU3kp0ia8vTXBCLKZ0LC+xGhGUujcmD3Z/iJel0FJ2VQt06 nX0Nsae3AmmKlWPKeTL8UP/c5UG/Dzqk0fIptHJY4MIGVWtCZB5aqB+OhHwmjOBlZOGfnM Cq7dF/Uryl65opjYa3JeoHBaFSS6E6OpamATOVnUVa29ZF+nshuljn5CZZQ/bB5HLwwc0d 89OlyzNt2mV5Y6AujS7oS8LTADo2nzwg0jys+wQoxVM2CwT3n9xFffdY2fjvdhi50l1zwv XBaUWoLoHOwT0MlqZANiZPWo4cCxtJYPRIIyQRYM8KF9hBc7tblajMBNEyHQLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -4.55 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: CF9431162A X-Spam-Score: -4.55 X-Migadu-Scanner: scn0.migadu.com X-TUID: hC9uZmkvPWKN --=-=-= Content-Type: text/plain Luciana Lima Brito writes: > On Mon, 26 Apr 2021 22:21:50 +0100 > Christopher Baines wrote: > >> >> Rather than writing: >> >> (match-lambda >> ((alist ...) >> >> I'd just use >> >> (lambda (alist) >> >> as I think that's equivalent right? > > Right, I did this. Great. Unfortunately I missed a few things similar to this when I last looked. For this bit: (match-lambda ((label args ...) `(,label . ,(list->vector args)))) Given the thing being matched is a pair in an alist, I'd use (label . args). I'd also perhaps use cons rather than `(, . ,) for creating the pair. >> >> I'd consider these options first probably: >> >> >> >> - Could the data coming from derivation-differences-data have >> >> vectors where appropriate already? The HTML code would probably >> >> need to be adjusted, but I think that's fine. >> > >> > I tried this for days but with no success. Maybe the only way would >> > be to tweak group-to-alist, but it touches many places, and I >> > didn't want to mess with it. >> >> Maybe add another procedure that combines group-to-alist but generates >> an alist with vectors as the values? (group-to-alist/vector maybe). > >> I think using let is OK, but I think just unpacking data-groups as >> you've called it directly in to the alist is fine (so ,@data-groups), >> rather than picking out the elements. JSON objects are unordered, so >> the ordering isn't something that really matters. >> >> If you do go down this route though, I'd probably add a comment saying >> what things are being added to the outer most alist, just to make the >> code quicker to read. > > Well, I went down the second route, now I'm calling the ,@data-groups > and I added a comment explaining its use. > The main point here is, the code is working and it looks nice, but to > get the data with the vectors seems to be right too. I'm sending the > new patch for your review and I'll wait for your call, if you think I > should try the first route or not. This looks OK now. The other thing I forgot to mention last time was using empty objects (() in the code) for the hash and hash-algorithm for derivations where those aren't applicable. I'd probably suggest using the symbol null, or not including those fields in the object. Hopefully that's all the bits to fix up, apologies for not mentioning them last time. Chris --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmCIVrpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfoBhAAle+ru25yZO2INxri3G0jLxoZF7uL6Zbh 1hQpmKrepVBODuaNeedVjKBDsELHAUWKXKiPlaOV0qy6K5XLoUfH5R1QQ5/Nvgom F+V2nQubFrlxggjxEKwcWpCNW5jvvHE/lcHwwlUQDgFOspRVR09f56Bf1Z8bZTBK zddr5LucY7nvf2H6ytyVVqpenI12up1FVM1LhkwypzxPHrvrqoxltcVVQ6UtgVMy G8llPc4sFtk5YxndOmTaKIltzwwpv3r+d1rNmJdcO5wzQMQSbXdX0FEfGbpudPoG rDCy6sAVAuTAZr23kPRSG/8yQhuv/+OWlwJwfY9Brz8XLheiQnbrqMwSSEXLRW2R n94DlSmO04Ys8ykNef1SMaBcmsdfoXUe+EDG0XBvDhV+VJGWUSDBA1xGSrGCikDS I9OmLbi7g+pJH4EbjpTElB6ThN9vvyjhQklGyYXfuUI33D+yCqep/MlDvJxkthp2 SU/mHRDlp+KH/AZu+NcF/75vCQ5yzP8066noBoEoutB24HC327XZXMXyXwyX8/qs DJYJuNE3eWbkucFUGYAXzGfpp3789ZvbwhRP8I8T1TYuTB57xoRoC2OlR5cobbr6 6p0H9A0wsPe8JckRyZ6a+Jumz5R1DZV6ogLxk4mJOP2hAttaNLQr7ispUcRbEzMS QvuMCP5Xjgc= =vJ+m -----END PGP SIGNATURE----- --=-=-=--