unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Brendan Tildesley <mail@brendan.scot>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: A better way to access records.
Date: Fri, 13 Nov 2020 22:24:32 +1100	[thread overview]
Message-ID: <657ddf5c-8ee3-7e37-39b0-725df3930f66@brendan.scot> (raw)
In-Reply-To: <87sg9urr6k.fsf@gnu.org>

On 1/11/20 8:01 am, Ludovic Courtès wrote:
> 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’.

I suppose It makes sense that one would want to be explicit about names 
in a source code file.

BTW, if that is the recommended way, would someone with an understanding 
of the records.scm code mind adding support for delayed & thunked fields 
in match-record? There is a TODO there. I wouldn't know how to do it.



  reply	other threads:[~2020-11-13 11:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30 10:28 A better way to access records Brendan Tildesley
2020-10-30 11:04 ` Bengt Richter
2020-10-30 18:17 ` Taylan Kammer
2020-10-31 22:01 ` Ludovic Courtès
2020-11-13 11:24   ` Brendan Tildesley [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-10-30 10:49 Leo Prikler
2020-10-30 10:59 ` Brendan Tildesley
2020-10-30 19:47   ` Danny Milosavljevic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=657ddf5c-8ee3-7e37-39b0-725df3930f66@brendan.scot \
    --to=mail@brendan.scot \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).