From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Add helper for .desktop file creation? Date: Sat, 25 May 2019 15:33:22 +0200 Message-ID: <87r28m64m5.fsf@nicolasgoaziou.fr> References: <878suwz3tg.fsf@ambrevar.xyz> <87d0k67n7n.fsf@nicolasgoaziou.fr> <878suu7mhk.fsf@nicolasgoaziou.fr> <87r28mofxd.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:50661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hUWxz-0003Yd-Rx for guix-devel@gnu.org; Sat, 25 May 2019 09:44:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hUWnl-0006fV-KM for guix-devel@gnu.org; Sat, 25 May 2019 09:33:34 -0400 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:41043) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hUWnl-0006dZ-EO for guix-devel@gnu.org; Sat, 25 May 2019 09:33:33 -0400 In-Reply-To: <87r28mofxd.fsf@ambrevar.xyz> (Pierre Neidhardt's message of "Sat, 25 May 2019 14:51:42 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." 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" To: Pierre Neidhardt Cc: Guix-devel Pierre Neidhardt writes: > You are absolutely right, my initial implementation is not ready for > merge, but it's already useful as a proof of concept. Certainly. Also, it is a step in the right direction. > Would you happen to know where this is implemented in Nix? It is very straightforward, actually. There is not much to borrow. > Or... I'm thinking we could do even better: use #:allow-other-keys then > generate the entry from the key symbol (e.g. #:categories would generate > "Categories"). This way the function would not have to hard-code the > keys. Making typos would be easier, then. I'd rather have a more limited, yet more robust, function. I.e., I think it is better to stick to standard keys. Otherwise, it adds little over current solution. > Regarding your point on the string vs. list values, I suggest we accept > both for all arguments and we string-join the lists. If we go the "limited" route, we should also pay attention to expected value types, i.e., only accept list of strings for entries with "string(s)" values. Semicolons would need to be escaped when a list of strings is allowed, too. In a nutshell, my suggestion would be: - string, boolean, numeric : string, possibly with a check for boolean (throw an error if not "true" or "false"), - string(s) : string, or list of strings, semicolons are escaped automatically, - localestring : alist with "lang" as keys and strings as values, with a default key (possibly #f), or a plain string if there is only the default key. This is more work than on the #:allow-other-keys options, but I think it would make for a better tool. WDYT?