GNU bug report logs

#50349 [PATCH] packages: Add 'define-package' syntax.

PackageSource(s)Maintainer(s)
guix PTS Buildd Popcon
Full log

Message #14 received at 50349@debbugs.gnu.org (full text, mbox, reply):

Received: (at 50349) by debbugs.gnu.org; 4 Sep 2021 08:42:18 +0000
From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 04 04:42:18 2021
Received: from localhost ([127.0.0.1]:46563 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	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 <maximedevos@telenet.be>) 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>
Subject: Re: [bug#50349] [PATCH] packages: Add 'define-package' syntax.
From: Maxime Devos <maximedevos@telenet.be>
To: Sarah Morgensen <iskarian@mgsn.dev>, 50349@debbugs.gnu.org
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-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 50349
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.7 (-)
[Message part 1 (text/plain, inline)]
Sarah Morgensen schreef op do 02-09-2021 om 21:06 [-0700]:
> Hello Guix,
> 
> This patch adds a shorthand for "(define-public name (package ...))":
> 
> (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-package"
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 could
> eventually transition to using this syntax as the primary syntax and only use
> 'define-public' when necessary.
> 
> There are some downsides... it's one more form to keep track of, and 'let'
> forms can't easily be used with it.
> 
> 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.
> 
> This probably deserves a documentation addition, but I wasn't sure where to
> add it without confusing newcomers.  Suggestions welcome!

‘Defining Packages’ 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.
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Sun Dec 22 16:25:26 2024; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.