[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A better way to access records.
From: |
Ludovic Courtès |
Subject: |
Re: A better way to access records. |
Date: |
Sat, 31 Oct 2020 23:01:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
Hi,
Brendan Tildesley <mail@brendan.scot> skribis:
> In the guix codebase, on many occasions there appear things like this:
>
> (match-lambda
> (($ <agetty-configuration> agetty tty term baud-rate auto-login
> login-program login-pause? eight-bits? no-reset? remote?
> flow-control?
> host no-issue? init-string no-clear? local-line extract-baud?
> skip-login? no-newline? login-options chroot hangup?
> keep-baud? timeout
> detect-case? wait-cr? no-hints? no-hostname? long-hostname?
> erase-characters kill-characters chdir delay nice extra-options)
> (list
> ....
This has officially been Bad Practice for a while. Instead, the
recommended approach is to use ‘match-record’ from (guix records).
There are examples of that primarily in (gnu services …).
Does that help?
Thanks,
Ludo’.