From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id OHa9Agkvh2CkpAAAgWs5BA (envelope-from ) for ; Mon, 26 Apr 2021 23:22:17 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2E4IOggvh2BQUQAAB5/wlQ (envelope-from ) for ; Mon, 26 Apr 2021 21:22: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 A1693182F3 for ; Mon, 26 Apr 2021 23:22:16 +0200 (CEST) Received: from localhost ([::1]:60100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lb8gJ-00053j-LE for larch@yhetil.org; Mon, 26 Apr 2021 17:22:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lb8g1-00053a-HJ for guix-devel@gnu.org; Mon, 26 Apr 2021 17:21:57 -0400 Received: from mira.cbaines.net ([212.71.252.8]:34802) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lb8fz-0004Ts-MF for guix-devel@gnu.org; Mon, 26 Apr 2021 17:21:57 -0400 Received: from localhost (unknown [IPv6:2a02:8010:68c1:0:8ac0:b4c7:f5c8:7caa]) by mira.cbaines.net (Postfix) with ESMTPSA id 33E6B27BC7C; Mon, 26 Apr 2021 22:21:53 +0100 (BST) Received: from capella (localhost [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 9a4fd354; Mon, 26 Apr 2021 21:21:52 +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> 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: <20210426161103.0647ee3f@lubrito> Date: Mon, 26 Apr 2021 22:21:50 +0100 Message-ID: <87im48g2s1.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Received-SPF: pass client-ip=212.71.252.8; 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=1619472136; 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=9ks3ckxKyU7IACT3R2q+59PJopxS8gdeiUQGCQ1sP4Q=; b=ccoE5Wox9yqtW+P/1oZ/kS9GBoyJdh52y27aueC1XKCEiDd++ScT+ATkWDmis45OIX/At6 461/lu7970i0+nKW7fVoslpRbxhp7cPTnyzkxvDzmQnItnQIPd7pK/QwwzlZ915D8JAlFI Dno8Tz63ZLtOFNR1PWPN7my/eDOeabCAtktMHsgOkDLZg+qlZ5nChkB4g2ST7h9P2QeNFt dohYbvfMQsn3fezB/qW/ZW9lmGl4cigdGIFlc4tWV7I2vVJtfzRV/t5/cRv1KnEXkxk4yg 67gDZ4aBxOa8hjR9PBZ7aEALtuqn5iIMRJc9yg5018wivE8ubR14IKWeo8y19A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619472136; a=rsa-sha256; cv=none; b=mUeG9dESSNdkAXl3xjCvjiectqcRRVg7i72M4EB0s6o9S59V+Nfp8/21L6AjCiDeAXE/Zg xTecMX4L6WZHsoejxNtPbaU3+yC5ocGZ10pzCCU3ccbdvrwEnbj1hMIv/5aHeruGI089uA 0kOn2LMto/ACbJrUzET+YJsNtzg12iv4dkTdKkbwiNygqaXuesipL8KJGWvGSwglL+ufDH 2cSSNw5G2HdNpZCfT/01KU3h9OXvET4+7rQ+tCX+YWQpEiq3n9Yk3V0xklf6SP/Fd4V7zc Gbwo4EfDfF8y0z6zJUJEvqnrmaX4C50oUA1uL94e9xDzpUy0UEsF2VTqrI5slg== ARC-Authentication-Results: i=1; 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-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: A1693182F3 X-Spam-Score: -4.55 X-Migadu-Scanner: scn0.migadu.com X-TUID: fUIYBSmqGrUU --=-=-= Content-Type: text/plain Luciana Lima Brito writes: > On Mon, 26 Apr 2021 09:15:37 +0100 > Christopher Baines wrote: > >> So, one advantage of alists over lists is that the code is probably >> less brittle when adding elements say, since code parsing the list >> will probably break with a new element, but this is probably less >> likely to happen with an alist. >> >> However, this will happen with an alist if match is used to pick >> elements out. I'd suggest using assq-ref or similar to pluck elements >> out. > > Ok, I changed that on the html.scm. Great :) Rather than writing: (match-lambda ((alist ...) I'd just use (lambda (alist) as I think that's equivalent right? >> 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). >> - Could this be written in a form like: >> >> ,@(map (lambda (name) >> ...) >> '(outputs inputs sources arguments)) > > This only make sense to me inside render-json (because of the ,@), but I > think the code would be less clean and "arguments" would appear in a > different order. What I did was bind the result of a function similar > to this in the let. 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. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmCHLu5fFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh aW5lcy5uZXQACgkQXiijOwuE9XfMyg/9HwvDs57dzIqQooYwZE2saJ06RqQY5SA3 aDmZvCbxNabi6foohE2hOurT9qVC36owp2vEQ+6THCXU1tnZppha80k3R0GbzDB0 9MdjLmWk6ZZ3lWIi8PYw1j6m+Rdu/t8BgkKs0Wq5aX+sNGgJfhWFqDfuuB6TGyJf uXvXA+iHAhMQ32jXUV5Py8DZZrQL+0VCIo1PrBdT+ZV9blI6eyeqZKMURyzVn1he jfrwz674/tzVXVf+BINb2tUVsahdW7E/1amNs6EI1ufcgDSV4rIFxUz0Og0SDzF+ j32vFsHPqoJJw/qhPEsBCRdhtFbUKjKdMbIO0od++GAaBDP5Uwbt+QruQYQsYLPT OFTXGS3wjFW5b1C3nX51da5lMU9oCDSr56XVlpcbn+vfw+yMeWutCFE7HadGZ1ZA Mya1AZHEUVnkrH8Vuvq03kKN3KiWle76B2uVlApJQWjFPOWsCKQr3iwp46D3K6Ht mKw4imy21GpcDOJv4IV39z7rC3tFbBOzQtUOAioiCeSkuWGM0/gw/nq3cLOEYeQs EUBXByAZOEal0iqd0ROMh3jUvsbFvqywkMGtXVPRLpdjQTiAsBDb0SWmnh1plh4C FxienmCNDQHTm8JPtndB0cc4Wcel6oX0UwcdiaAwjAiwh/TcbEFKE8wE33H3ivIY EZXfM8lEd3w= =00zB -----END PGP SIGNATURE----- --=-=-=--