[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#60225] [PATCH] records: match-record supports specifying a differen
From: |
Ludovic Courtès |
Subject: |
[bug#60225] [PATCH] records: match-record supports specifying a different variable name. |
Date: |
Wed, 21 Dec 2022 23:15:57 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) |
Hi,
Attila Lendvai <attila@lendvai.name> skribis:
> An example:
>
> (match-record obj <my-type>
> (field1 (field2 custom-var-name) field3)
> ...)
Nice! It looks like a useful extension to me.
> - ((_ record type (field rest ...) body ...)
> - #`(let-syntax ((field-offset (syntax-rules ()
> + ((_ record type ((field-name variable-name) rest ...) body ...)
> + #'(let-syntax ((field-offset (syntax-rules ()
I’d just drop ‘-name’, it’s all names anyway. :-)
Could you also add a test in ‘tests/records.scm’ next to the others?
TIA,
Ludo’.