diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2026-03-12 10:00:55 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-03-20 13:28:19 +0100 |
| commit | 6b1a15189e9f02f2962c4885092533f817d0375c (patch) | |
| tree | 48d47c08476a35a2841f9df3e6a75e9ec35ec17d /etc | |
| parent | 72e724cef438a7e16052dd1a38bf03027635f2bc (diff) | |
news: Add entry for record field inherited values.
* etc/news.scm: Add entry.
Change-Id: Id4d40ee995f03a8fe785782513f9451c8bd71389
Merges: #6955
Diffstat (limited to 'etc')
| -rw-r--r-- | etc/news.scm | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/etc/news.scm b/etc/news.scm index a67f8901e43..de3f24edef6 100644 --- a/etc/news.scm +++ b/etc/news.scm | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;; GNU Guix news, for use by 'guix pull'. | 1 | ;; GNU Guix news, for use by 'guix pull'. |
| 2 | ;; | 2 | ;; |
| 3 | ;; Copyright © 2019-2025 Ludovic Courtès <ludo@gnu.org> | 3 | ;; Copyright © 2019-2026 Ludovic Courtès <ludo@gnu.org> |
| 4 | ;; Copyright © 2019–2021, 2024 Tobias Geerinckx-Rice <me@tobias.gr> | 4 | ;; Copyright © 2019–2021, 2024 Tobias Geerinckx-Rice <me@tobias.gr> |
| 5 | ;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@gmail.com> | 5 | ;; Copyright © 2019, 2020 Miguel Ángel Arruga Vivas <rosen644835@gmail.com> |
| 6 | ;; Copyright © 2019, 2020 Konrad Hinsen <konrad.hinsen@fastmail.net> | 6 | ;; Copyright © 2019, 2020 Konrad Hinsen <konrad.hinsen@fastmail.net> |
| @@ -43,6 +43,44 @@ | |||
| 43 | (channel-news | 43 | (channel-news |
| 44 | (version 0) | 44 | (version 0) |
| 45 | 45 | ||
| 46 | (entry (commit "a7c8e68dc51144a6d3981b770aca9c4897fc7c0c") | ||
| 47 | (title | ||
| 48 | (en "Records such as packages can refer to inherited values")) | ||
| 49 | (body | ||
| 50 | (en "A new feature has been added to records—the facility used when | ||
| 51 | defining packages, services, operating systems, and many other things—that, | ||
| 52 | when inheriting from another record, allows you to refer to inherited field | ||
| 53 | values. When defining package variants, you may have seen this pattern: | ||
| 54 | |||
| 55 | @lisp | ||
| 56 | (package | ||
| 57 | (inherit gdb) | ||
| 58 | (inputs (modify-inputs (package-inputs gdb) | ||
| 59 | (delete \"guile\")))) | ||
| 60 | @end lisp | ||
| 61 | |||
| 62 | This can now be written like this: | ||
| 63 | |||
| 64 | @lisp | ||
| 65 | (package | ||
| 66 | (inherit gdb) | ||
| 67 | (inputs (modify-inputs inputs ;<- notice the change | ||
| 68 | (delete \"guile\")))) | ||
| 69 | @end lisp | ||
| 70 | |||
| 71 | Within the @code{inputs} body, the @code{inputs} identifier is now bound to | ||
| 72 | the @dfn{inherited value}—i.e., the value this field inherits from @code{gdb}. | ||
| 73 | The same mechanism can be used when changing other input fields or the | ||
| 74 | @code{arguments} field. It is less verbose but also | ||
| 75 | @uref{https://issues.guix.gnu.org/50335, more accurate}. | ||
| 76 | |||
| 77 | This change applies to all record types produced by | ||
| 78 | @code{define-record-type*}: @code{package}, @code{origin}, | ||
| 79 | @code{operating-system}, @code{home-environment}, and so on. | ||
| 80 | |||
| 81 | Note that this is an incompatible change: the newly introduced | ||
| 82 | bindings—@code{inputs} in the example above—could shadow same-named bindings."))) | ||
| 83 | |||
| 46 | (entry (commit "b52ce9041ad58aeababd2d50d3e72bc23dffff60") | 84 | (entry (commit "b52ce9041ad58aeababd2d50d3e72bc23dffff60") |
| 47 | (title | 85 | (title |
| 48 | (en "GNOME 48 is now available") | 86 | (en "GNOME 48 is now available") |
