GNU bug report logs -
#15284
wish: make the (name) field optional
Previous Next
Full log
Message #8 received at 15284 <at> debbugs.gnu.org (full text, mbox):
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.