From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ILm5NZsxM2GwcQEAgWs5BA (envelope-from ) for ; Sat, 04 Sep 2021 10:43:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QEJgMZsxM2EXMAAAB5/wlQ (envelope-from ) for ; Sat, 04 Sep 2021 08:43:07 +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 B2ACF11362 for ; Sat, 4 Sep 2021 10:43:07 +0200 (CEST) Received: from localhost ([::1]:39448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mMRGU-0005MN-LT for larch@yhetil.org; Sat, 04 Sep 2021 04:43:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mMRGP-0005MD-VK for guix-patches@gnu.org; Sat, 04 Sep 2021 04:43:01 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mMRGP-0008Lt-O0 for guix-patches@gnu.org; Sat, 04 Sep 2021 04:43:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mMRGP-00053J-LY for guix-patches@gnu.org; Sat, 04 Sep 2021 04:43:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50349] [PATCH] packages: Add 'define-package' syntax. Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 Sep 2021 08:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50349 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Sarah Morgensen , 50349@debbugs.gnu.org Received: via spool by 50349-submit@debbugs.gnu.org id=B50349.163074493819355 (code B ref 50349); Sat, 04 Sep 2021 08:43:01 +0000 Received: (at 50349) by debbugs.gnu.org; 4 Sep 2021 08:42:18 +0000 Received: from localhost ([127.0.0.1]:46563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMRFi-000526-0V for submit@debbugs.gnu.org; Sat, 04 Sep 2021 04:42:18 -0400 Received: from laurent.telenet-ops.be ([195.130.137.89]:52822) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mMRFd-00051v-RM for 50349@debbugs.gnu.org; Sat, 04 Sep 2021 04:42:17 -0400 Received: from ptr-bvsjgyjmffd7q9timvx.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:aaf1:9810:a0b8:a55d]) by laurent.telenet-ops.be with bizsmtp id pkiB2500Q0mfAB401kiBB1; Sat, 04 Sep 2021 10:42:12 +0200 Message-ID: <757b7543b931335c3725264edfbc79c012aa10fc.camel@telenet.be> From: Maxime Devos Date: Sat, 04 Sep 2021 10:42:02 +0200 In-Reply-To: <15d01b32313f5f2f291b120597719ae92bd26acd.1630639896.git.iskarian@mgsn.dev> References: <15d01b32313f5f2f291b120597719ae92bd26acd.1630639896.git.iskarian@mgsn.dev> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-zmWTNKeAvQv7YpgDsQG/" User-Agent: Evolution 3.34.2 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r21; t=1630744932; bh=QIQ9/+U50VNJ/m3kq5gmUWD/XEeVlBaI/3vtAUaJ4G8=; h=Subject:From:To:Date:In-Reply-To:References; b=ZDVKuWNuH5bI45/qk0CeJK7fxGK7ACPED+c7z+ksdNSylSyhJUFESmCPVt43h5ZZA RW4ryjZAZXy8J4M80pZ4vfa58/ZcbvXx9LFmYd7aqcr+RAKXl84q6sXca6OycNgXcK bmW5X+uFDKke/H2sRV5SYce5zXdyR2CRNYWSL3k9kB+s9DnWK7O8pw+QMn44jkST4j zUQfJ8l2+xvWi4HCazWzp2s3lGhKRF487QrSTL/kEmRxmRM4pShsK4ILBaB05NFSwC AZGM3gM9vwoX9slPm5tSFy8mlsiuiEh/CA9rcwoS84sNaOc1rIMe2gg8ZIR7vmior7 H/exZtlce4TqA== X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.00 Authentication-Results: aspmx1.migadu.com; none X-Migadu-Queue-Id: B2ACF11362 X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: 4C5bKDi9xIID --=-zmWTNKeAvQv7YpgDsQG/ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sarah Morgensen schreef op do 02-09-2021 om 21:06 [-0700]: > Hello Guix, >=20 > This patch adds a shorthand for "(define-public name (package ...))": >=20 > (define-package my-favorite-package > (name "my-favorite-package") > ...) 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 ...) ...) 'datum->syntax' and 'string->symbol' can be used to turn "my-favorite-packa= ge" into an identifier. A 'define-unexported-package' might be required in some places. > The purpose is primarily to save the horizontal indent, but IMO it looks > better, and is marginally more clear for newcomers. I think ideally we c= ould > eventually transition to using this syntax as the primary syntax and only= use > 'define-public' when necessary. >=20 > There are some downsides... it's one more form to keep track of, and 'let= ' > forms can't easily be used with it. >=20 > Since it's a syntax rule, it doesn't cause packages to rebuild (tested). = I've > also tested the indentation rules, indent-code.el, and the snippets. >=20 > This probably deserves a documentation addition, but I wasn't sure where = to > add it without confusing newcomers. Suggestions welcome! =E2=80=98Defining Packages=E2=80=99 would be a good place I think. > What do you all think? This looks nice to me. IIUC, the define-package is intended to be clearer to newcomers, so you might want to ask for feedback on the new syntax on help-guix@gnu.org. Greetings, Maxime. --=-zmWTNKeAvQv7YpgDsQG/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYTMxWhccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7sKYAP9w+XTSzxWZhmUnqm6b2HrJBnke pSydXdNSCWBe9TK8qgD/VHtoAU9jniP90C59rVH8baidLxFnPW7dJ7wctbyXeg4= =+pGj -----END PGP SIGNATURE----- --=-zmWTNKeAvQv7YpgDsQG/--