GNU bug report logs - #15284
wish: make the (name) field optional

Previous Next

Package: guix;

Reported by: arne_bab <at> web.de

Date: Fri, 6 Sep 2013 09:07:02 UTC

Severity: wishlist

Tags: patch

Merged with 50349

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: Arne Babenhauserheide <arne_bab <at> web.de>
Cc: 15284 <at> debbugs.gnu.org
Subject: bug#15284: wish: make the (name) field optional
Date: Fri, 06 Sep 2013 14:06:49 +0200
Arne Babenhauserheide <arne_bab <at> web.de> skribis:

> Currently when defining a package, I have to write the name at least
> twice:
>
> (define-public NAME
>   (name "NAME"))
>
> This gives the flexibility to use different names for the visual
> output and the technical name. But for most packages it likely just
> adds useless duplication.
>
> So I think the (name) field should be optional, and if it is not
> present, the packages technical name should be used automatically.

As discussed on IRC, the main issue is that package objects exist
whether or not the exist a variable bound to them; and really there can
be any number of variables whose value is a given package object.  IOW,
there is no direct connection between the variable name and the package
name.

That said, for cases like the above, we could have:

  (define-syntax-rule (define-package package-name fields ...)
    (define-public package-name
      (package
        (name (symbol->string 'package-name))
        fields ...)))

However, I prefer treating packages just like any other Scheme object,
and to avoid introducing “magic” with macros like this.

WDYT?

Ludo’.




This bug report was last modified 3 years and 282 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.