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 uLiSEGGoeWBVfQAAgWs5BA (envelope-from ) for ; Fri, 16 Apr 2021 17:08: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 YGtlC2GoeWC9KQAAB5/wlQ (envelope-from ) for ; Fri, 16 Apr 2021 15:08:17 +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 D2C2F1A8E4 for ; Fri, 16 Apr 2021 17:08:16 +0200 (CEST) Received: from localhost ([::1]:34640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lXQ4t-0005IA-Ur for larch@yhetil.org; Fri, 16 Apr 2021 11:08:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55748) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXQ4b-0005Hr-LZ for guix-devel@gnu.org; Fri, 16 Apr 2021 11:07:57 -0400 Received: from mout01.posteo.de ([185.67.36.65]:56653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lXQ4Z-0006iv-B5 for guix-devel@gnu.org; Fri, 16 Apr 2021 11:07:57 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id C7D20240027 for ; Fri, 16 Apr 2021 17:07:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1618585670; bh=cPnuA+fc3S2qO7vQGhk/LpI+69J+A6qpTcF+SDYQuf8=; h=Date:From:To:Cc:Subject:From; b=q834xxcBulklJq60rOoySGHmWpykuOnDK21agGXqFVKTdLVWg6K3H0zTF8/Vf1u87 RFHIpdK8Oo24Pipc5JuTeJvBvQ8rsJjyN/7qowGi3tmMMr628i+ZB8wXvfT6PzyD51 RqYakniE5A6d2NNqbXhnueo09qdhVb98lrRdtqsaDaNzryXXzb3/0MW6Ua6+Ny56cG cG9bQWww56g1eE2xodgh+5DT3NtorvyoN5KfId1EJeHaEyH8g/Tp7mu16OBYid7a23 y3J3AytK3EFmOU/tz9VYsklHWxnTUbIGT6tlWMMt8+xjj7ALVcbNRcX8ojeN1G4ETT uxfiz7f+2Misg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FMKMS5kyxz6tmf; Fri, 16 Apr 2021 17:07:48 +0200 (CEST) Date: Fri, 16 Apr 2021 15:07:40 +0000 From: Luciana Lima Brito To: Christopher Baines Subject: Re: Outreachy - Guix Data Service: implementing basic json output for derivation comparison page Message-ID: <20210416120740.05a819ca@lubrito> In-Reply-To: <87o8efxhil.fsf@cbaines.net> References: <20210414164859.7acc631f@lubrito> <87wnt4x7e3.fsf@cbaines.net> <20210415130947.7387a546@lubrito> <87o8efxhil.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=185.67.36.65; envelope-from=lubrito@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=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=1618585697; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=3cqTj66dgtkPs4FtqpCh29J3V34+Wprlq7mzWrHehuA=; b=hzFkNm/edKSrX2Au9z9iPwbZte4soExuHPxXOyA/iu4hBLlAjNuj7NV+grXuPawbmIPcm+ dPQFIe+bVvynYPdMYItsc4l9IzpfaVbRMEaBtk9uh+exz5z75JI9VzU6GH0R6OfiVeLwr6 LthVSFHNgbxRnXhzmvKZFB/pTjwFSPCMWzb2lYmUJVkPv/Wju1l0apkC+QmyKjOxZjn8wb XG0wCMyxqCfQ/3YIRXdrgIHH1wv1VqWlbSSZq6y7JYqEWlB3t8YfyOMu5472QnRRpmHw8Y ZvS7kwjJNsEVPYfTrCSD5igScxQOarxPPAGOcpkaA1d2NRaGpkX/vI40ArMN/w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1618585697; a=rsa-sha256; cv=none; b=s0cq/I5D55183d3zp0+9xCPxo8Cqb6F8cFXmH/aRnpojKCANEuq3jWM6uEsfXWv2B+CT6U 3sqaz2EZSF3kpPi7BoTkH8DCe7QrOM3VQXiPnBb+ZhrcP2VK5R9jW7DtRwGTwKaHu9ZTt/ ctzhGnfZ8wu5o4xvislo6WVdWjDMZHXgHbTvio/O6Tlq72MtZu5uqQzMMyZRKTSa5oVdhu mN57SPO/WTlJbaNeZVsyNO1f0nK3MDhFpSuKYFRXj8st+tRU13d+fsULl10QI/EH+4R4K2 9m6JTLX2zJlnXA6jrVmxi00guW+UHF9Ci5Hf0yQYTm0/bv4t49OU43SAzSRezA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=q834xxcB; dmarc=pass (policy=none) header.from=posteo.net; 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: -3.25 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=q834xxcB; dmarc=pass (policy=none) header.from=posteo.net; 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: D2C2F1A8E4 X-Spam-Score: -3.25 X-Migadu-Scanner: scn0.migadu.com X-TUID: wzfwDEfmAPaq On Fri, 16 Apr 2021 00:19:46 +0100 Christopher Baines wrote: Hi, > Ok, I looked at the overall diff, and it looks to me like these > changes should probably be one commit. I don't actually understand what you mean saying it should be one commit. Do I have to make my seven commits become a single one? How do I do that? > On the get-derivation-data function, I wouldn't use the same function > to process the inputs, outputs and sources. The data for each is > different, so I would separate the code as well. I understand that, but the logic to map the values for these three bindings is the same, wouldn't it generate redundancies implementing the same logic separately? > > To avoid having to call a procedure three times, on the base, target > and common items, I'd consider following the same pattern in the HTML > generating code, map over a list of the lists, so something like: > > (map (lambda (name data) > (cons name > (match data > ((name path hash-alg hash recursive) > ...)))) > '(base target common) > (list (assq-ref outputs 'base) > (assq-ref outputs 'target) > (assq-ref outputs 'common))) > > Does that make sense? Actually I did it in a similar way before, but it resulted in a list with all the values for base, target and common together, in which I had to have another way to separate them and render on json, for example, I tried appending "base", "target" or "common" names to each list (similar to your function?), but them I had to convert this list to a vector. Calling the function for each separately gave me a cleaner output. Also, I think that sometimes you might have more than one output for base, target like it does for common, and I fail to see how your example function addresses this. In short, I couldn't see the benefit of this over calling the function three times. Is it for organizational purpose or am I simply wrong? This time I'm just not understanding. :) -- Best Regards, Luciana Lima Brito MSc. in Computer Science