From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AOnIL/iCM2FrcgAAgWs5BA (envelope-from ) for ; Sat, 04 Sep 2021 16:30: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 kE5kK/iCM2FUHwAAB5/wlQ (envelope-from ) for ; Sat, 04 Sep 2021 14:30: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 C344C13A71 for ; Sat, 4 Sep 2021 16:30:15 +0200 (CEST) Received: from localhost ([::1]:44306 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMWgP-0003XY-Ru for larch@yhetil.org; Sat, 04 Sep 2021 10:30:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMWgE-0003XF-Qv for bug-guix@gnu.org; Sat, 04 Sep 2021 10:30:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMWgE-00027Y-Hl for bug-guix@gnu.org; Sat, 04 Sep 2021 10:30:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mMWgE-0006Sx-3k for bug-guix@gnu.org; Sat, 04 Sep 2021 10:30:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#50349: [PATCH] packages: Add 'define-package' syntax. Resent-From: Taylan Kammer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 04 Sep 2021 14:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50349 X-GNU-PR-Package: guix X-GNU-PR-Keywords: patch To: Tobias Geerinckx-Rice , Maxime Devos Received: via spool by submit@debbugs.gnu.org id=B.163076579724805 (code B ref -1); Sat, 04 Sep 2021 14:30:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Sep 2021 14:29:57 +0000 Received: from localhost ([127.0.0.1]:48344 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMWg8-0006S1-OJ for submit@debbugs.gnu.org; Sat, 04 Sep 2021 10:29:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:47710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMWg7-0006Rt-0a for submit@debbugs.gnu.org; Sat, 04 Sep 2021 10:29:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMWg6-0003Wl-RB for guix-patches@gnu.org; Sat, 04 Sep 2021 10:29:54 -0400 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]:45978) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMWg4-0001yH-8H for guix-patches@gnu.org; Sat, 04 Sep 2021 10:29:54 -0400 Received: by mail-wm1-x32d.google.com with SMTP id j17-20020a05600c1c1100b002e754875260so1495485wms.4 for ; Sat, 04 Sep 2021 07:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=bb6pH1j/rp/E3UEBUIYCqusd/6L5a0LqCZZvF7Iifr0=; b=kKe+0n6NJQDIoHDbDTx4l+DAFpt3gmTcmcjF/QSjZzZR+3gQWouua6l7iGkN5ewwX+ xoXq4USA9gl+MBa/qoa6HzY3xSEVjC8wxLxA6GVtpCQcMnDwmzCTW0Mv5RkownsR+8aq EeAUyBVfzmLSNdEIZnxmCcDGi7G+oNXCiIE1RXRQPJ308MVe1vNLhi0amqxq4SVQ7VYT hn/l0PRoXtpLOSwc/tGnI3ePWGeEPKOCZnNy6ptKP9Q0T5Gk4ThhEurLP4+XM7ZI3SqK vzfIrmBYeuiuaAZoz7ymgStyQ4L2rd3BlNK20LcXENo2Dm14RD/vbpkqY1L6qZtvMbkR 5FfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=bb6pH1j/rp/E3UEBUIYCqusd/6L5a0LqCZZvF7Iifr0=; b=tv501TGzdJS8jjGIL2dwQPGfa3OHGHYzcQGS1gQHHSoL4VQLunQXxL7B+Ua8/KiybT p3aAKoJZKdVqdM/2Wr3eBEBFGFWh503IES7uELpGkC8dSYKrlqRLjM0UShed4GqB3k68 AIl6S9O4FD3V01s8OsOBmbHBDD8eq7zwzwkwpa3CDPaoJ40FVQGzpv+j7zcFWbPLHMpx 5hg16c/5OqmW+JYd5wIfoYYmrNbjkOPb7wOxIogGWs2ypJEAyqOArWl6Nx7cdc1zoANU nHfIDdMoCl8qeAadoNR7LN1bDW+b+mKmnRqqxZvItElB0HL1TWvo3D6MldD+Y9a1AUXc zl0Q== X-Gm-Message-State: AOAM531uR2AF411KOSGQouJfQNZOcodCTngnxsC+L7e8Un/6W7d+zd/C K0cswffjKq4/v65rsfCFHmYwkbb11dtXPQ== X-Google-Smtp-Source: ABdhPJxVKuzVP9tPPdazt4w9o/XzIfKFmXKxucl1353lpp3xCYeshj5ndzAVR4AlAIrOXG7xiTMX7Q== X-Received: by 2002:a1c:7e12:: with SMTP id z18mr3572409wmc.60.1630765790734; Sat, 04 Sep 2021 07:29:50 -0700 (PDT) Received: from [192.168.178.20] (b2b-109-90-125-150.unitymedia.biz. [109.90.125.150]) by smtp.gmail.com with ESMTPSA id v21sm2406752wra.92.2021.09.04.07.29.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 04 Sep 2021 07:29:50 -0700 (PDT) References: <15d01b32313f5f2f291b120597719ae92bd26acd.1630639896.git.iskarian@mgsn.dev> <757b7543b931335c3725264edfbc79c012aa10fc.camel@telenet.be> <87y28caazy.fsf@nckx> From: Taylan Kammer Message-ID: <95c92fc5-1fcf-b347-370e-d1943f22c2c3@gmail.com> Date: Sat, 4 Sep 2021 16:29:49 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <87y28caazy.fsf@nckx> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=taylan.kammer@gmail.com; helo=mail-wm1-x32d.google.com X-Spam_score_int: -58 X-Spam_score: -5.9 X-Spam_bar: ----- X-Spam_report: (-5.9 / 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-3.832, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sarah Morgensen , 50349@debbugs.gnu.org, guix-patches@gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1630765816; 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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=bb6pH1j/rp/E3UEBUIYCqusd/6L5a0LqCZZvF7Iifr0=; b=nuRg8WWUoqUor0CkG2dEs58taYP5VDBIdqHFu2qBDJcKLRjDPOTrWWmD14m8K8z/D0C0zS uOnhvyuC7dCFVWq2ZX1QM/ql6u6B3m0sU1jjiAzgml08EwWSjSApAxT7Pj/R3/5FnPntiP YglTb8BjuT2wh+lT9+Jp/885JuMCYCRmNVS5BiS5SWtflGNhC133C66Zcypwz8YkM0eTMo s10RrvueiuGV6SOM0Cwy7wDZZ5qnx6aqUc8D8kVYyrk3i1j0xSczvI63ZkgfJRG8rCS7cd 6DKvKGgcPMhkfwRAsh1vYIgST5/3XOaDd0Y/gTdLyxDjxCSfTKFe4rT/FOb6nA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630765816; a=rsa-sha256; cv=none; b=ZABKOuZsUOM8NNWLJ/kRsFF5m7GdF7ppswl1hhCssCe2fG9WCCennp+OzNlsdXlkPkGL3c VJnH2VhExj5k+wHEkHUHi/NbaAE4BRfZkAkd8RhORLo6rrrVmF5Y5NG93EB1i3bjCPVg2K nYWe6osFCqN/T/YEwIno6KClMPfsEPo15LE85gf/Rjsrf8czB7eF5LZrM0YIPZY4UOxfMT lbnBV3e9KzKVNOnBFHH/PfMNjxYLsqxxrL9+Ewl8JJ8nPDxnZME0wz+kR8aHr2qI6/cAVf 6FfZz8GBSyvyeXOoT4AV3aPxiMJAr270hmAdUI8WsbKZcOtHH0EJFATgV30AAg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=kKe+0n6N; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Spam-Score: 0.18 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=kKe+0n6N; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: C344C13A71 X-Spam-Score: 0.18 X-Migadu-Scanner: scn1.migadu.com X-TUID: QDEKHjkl49s8 On 04.09.2021 12:09, Tobias Geerinckx-Rice via Bug reports for GNU Guix wrote: > All, > > To keep a link with previous ‘define-package’ discussion, I've merged this bug with #15284.  It was never resolved IMO and things have changed since 2013 with the label-less input style. > > Maxime Devos 写道: >> This could be even shorter in the special case that the variable name >> and package name are the same (modulo types): >> >> (define-package "my-favorite-package" >>   (version ...) >>   ...) > > (define-anything STRING ...) is just too weird to ack.  Are there any package names that aren't currently valid symbols?  Is there a good reason for them? > > Kind regards, > > T G-R To me the most obvious thing to do seems (define-package foo ...) ;no explicit name needed to bind the variable 'foo' and use symbol->string for the name of the package, with the possibility to override the name like (define-package foo (name "foobar") ...) which would bind the variable 'foo' to a package named "foobar". Here's a syntax-case definition: (define-syntax define-package (lambda (stx) (syntax-case stx () ((_ ( ...) ...) (if (memq 'name (map syntax->datum #'( ...))) #'(define-public (package ( ...) ...)) #`(define-public (package (name #,(symbol->string (syntax->datum #'))) ( ...) ...))))))) -- Taylan