<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guix/tests/records.scm, branch master</title>
<subtitle>Transactional package manager, declarative GNU/Linux distribution, reproducible deployment tool, and more! https://guix.gnu.org</subtitle>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/'/>
<entry>
<title>records: Warn about shadowing due to inherited field value bindings.</title>
<updated>2026-03-29T20:32:57+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2026-03-23T20:29:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=f0e22ae62c143fbf00bde368c2adbc848cff5ff5'/>
<id>f0e22ae62c143fbf00bde368c2adbc848cff5ff5</id>
<content type='text'>
This is a followup to a7c8e68dc51144a6d3981b770aca9c4897fc7c0c: this commit
introduced a new binding in the body of field values, which could silently
shadow outer bindings.  This new warning catches potentially unwanted
shadowing.

* guix/records.scm (make-syntactic-constructor)[check-shadowing]: New
procedure.
[wrap-field-value]: Use it.
* tests/records.scm ("define-record-type* &amp; inherited value shadowing"): New
test.

Change-Id: I81ad14cf10da7213e9f8db987c8b0bd4c41acba2
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
Merges: #7424
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a followup to a7c8e68dc51144a6d3981b770aca9c4897fc7c0c: this commit
introduced a new binding in the body of field values, which could silently
shadow outer bindings.  This new warning catches potentially unwanted
shadowing.

* guix/records.scm (make-syntactic-constructor)[check-shadowing]: New
procedure.
[wrap-field-value]: Use it.
* tests/records.scm ("define-record-type* &amp; inherited value shadowing"): New
test.

Change-Id: I81ad14cf10da7213e9f8db987c8b0bd4c41acba2
Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
Merges: #7424
</pre>
</div>
</content>
</entry>
<entry>
<title>records: Let thunked fields refer to their inherited value.</title>
<updated>2026-03-20T12:27:15+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2026-03-06T17:46:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=a7c8e68dc51144a6d3981b770aca9c4897fc7c0c'/>
<id>a7c8e68dc51144a6d3981b770aca9c4897fc7c0c</id>
<content type='text'>
* guix/records.scm (make-syntactic-constructor)[field-index]: New procedure.
[wrap-field-value]: Add optional argument ‘parent’.  When it is true, bind F
to the inherited field value.
[field-bindings/inheritance]: New procedure.
Use it.
* tests/records.scm ("define-record-type* &amp; thunked &amp; no inherited value")
("define-record-type* &amp; thunked &amp; inherited value")
("define-record-type* &amp; thunked &amp; inherited value &amp; this-record"): New tests.
* doc/guix.texi (Defining Package Variants): Update ‘modify-inputs’ example to
refer to ‘inputs’.
(Writing Manifests): Likewise.
* doc/guix-cookbook.texi (Package Variants): Likewise for
‘substitute-keyword-arguments’.

Fixes: https://issues.guix.gnu.org/50335
Change-Id: If4e18155ce203637ff9e116ee8098f8997bfebe2
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/records.scm (make-syntactic-constructor)[field-index]: New procedure.
[wrap-field-value]: Add optional argument ‘parent’.  When it is true, bind F
to the inherited field value.
[field-bindings/inheritance]: New procedure.
Use it.
* tests/records.scm ("define-record-type* &amp; thunked &amp; no inherited value")
("define-record-type* &amp; thunked &amp; inherited value")
("define-record-type* &amp; thunked &amp; inherited value &amp; this-record"): New tests.
* doc/guix.texi (Defining Package Variants): Update ‘modify-inputs’ example to
refer to ‘inputs’.
(Writing Manifests): Likewise.
* doc/guix-cookbook.texi (Package Variants): Likewise for
‘substitute-keyword-arguments’.

Fixes: https://issues.guix.gnu.org/50335
Change-Id: If4e18155ce203637ff9e116ee8098f8997bfebe2
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: records: Add test for ellipsis in body.</title>
<updated>2023-06-04T08:59:28+00:00</updated>
<author>
<name>Josselin Poiret</name>
<email>dev@jpoiret.xyz</email>
</author>
<published>2023-06-04T08:31:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=178ffed3b7fe1784fff67b963c5c4bb667fbad2a'/>
<id>178ffed3b7fe1784fff67b963c5c4bb667fbad2a</id>
<content type='text'>
* tests/records.scm ("match-record, ellipsis in body"): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/records.scm ("match-record, ellipsis in body"): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>records: Add MATCH-RECORD-LAMBDA.</title>
<updated>2023-06-04T08:59:25+00:00</updated>
<author>
<name>(unmatched-parenthesis ew syntax</name>
<email>paren@disroot.org</email>
</author>
<published>2023-04-28T19:19:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=4cd529362108086eeec25d4d465261415cff45b3'/>
<id>4cd529362108086eeec25d4d465261415cff45b3</id>
<content type='text'>
* guix/records.scm (match-record-lambda): New syntax.
* tests/records.scm ("match-record-lambda"): New test.

Signed-off-by: Josselin Poiret &lt;dev@jpoiret.xyz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/records.scm (match-record-lambda): New syntax.
* tests/records.scm ("match-record-lambda"): New test.

Signed-off-by: Josselin Poiret &lt;dev@jpoiret.xyz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>records: match-record: Support thunked and delayed fields.</title>
<updated>2023-06-04T08:34:35+00:00</updated>
<author>
<name>(unmatched-parenthesis d</name>
<email>paren@disroot.org</email>
</author>
<published>2023-04-28T19:19:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=b88e38d4b51b9aa0e857baeb614c000e491ad309'/>
<id>b88e38d4b51b9aa0e857baeb614c000e491ad309</id>
<content type='text'>
* guix/records.scm (match-record): Unwrap matched thunked and delayed fields.
* tests/records.scm ("match-record, thunked field",
"match-record, delayed field"): New tests.

Signed-off-by: Josselin Poiret &lt;dev@jpoiret.xyz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/records.scm (match-record): Unwrap matched thunked and delayed fields.
* tests/records.scm ("match-record, thunked field",
"match-record, delayed field"): New tests.

Signed-off-by: Josselin Poiret &lt;dev@jpoiret.xyz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>records: match-record supports specifying a different variable name.</title>
<updated>2022-12-27T22:53:42+00:00</updated>
<author>
<name>Attila Lendvai</name>
<email>attila@lendvai.name</email>
</author>
<published>2022-12-22T02:14:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=363b20b68584d71556c2d8912dd07cbdacabdb25'/>
<id>363b20b68584d71556c2d8912dd07cbdacabdb25</id>
<content type='text'>
An example:

(match-record obj &lt;my-type&gt;
  (field1 (field2 custom-var-name) field3)
  ...)

* guix/records.scm (match-record-inner): Add support for the new syntax.
* tests/records.scm ("match-record, simple"): Add a simple test case for the
new syntax.

Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
An example:

(match-record obj &lt;my-type&gt;
  (field1 (field2 custom-var-name) field3)
  ...)

* guix/records.scm (match-record-inner): Add support for the new syntax.
* tests/records.scm ("match-record, simple"): Add a simple test case for the
new syntax.

Signed-off-by: Ludovic Courtès &lt;ludo@gnu.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>records: 'match-record' checks fields at macro-expansion time.</title>
<updated>2022-12-01T23:02:12+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2022-11-19T16:23:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=7c1161dba4c8930d3a500a72ccaaaf50df73f466'/>
<id>7c1161dba4c8930d3a500a72ccaaaf50df73f466</id>
<content type='text'>
This allows 'match-record' to be more efficient (field offsets are
computed at compilation time) and to report unknown fields at
macro-expansion time.

* guix/records.scm (map-fields): New macro.
(define-record-type*)[rtd-identifier]: New procedure.
Define TYPE as a macro and use a separate identifier for the RTD.
(lookup-field, match-record-inner): New macros.
(match-record): Rewrite in terms of 'match-error-inner'.
* tests/records.scm ("match-record, simple")
("match-record, unknown field"): New tests.
* gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file'
local variable to 'main-log-file'.
* gnu/services/getmail.scm (serialize-getmail-configuration-file): Move
after &lt;getmail-configuration-file&gt; definition.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows 'match-record' to be more efficient (field offsets are
computed at compilation time) and to report unknown fields at
macro-expansion time.

* guix/records.scm (map-fields): New macro.
(define-record-type*)[rtd-identifier]: New procedure.
Define TYPE as a macro and use a separate identifier for the RTD.
(lookup-field, match-record-inner): New macros.
(match-record): Rewrite in terms of 'match-error-inner'.
* tests/records.scm ("match-record, simple")
("match-record, unknown field"): New tests.
* gnu/services/cuirass.scm (cuirass-shepherd-service): Rename 'log-file'
local variable to 'main-log-file'.
* gnu/services/getmail.scm (serialize-getmail-configuration-file): Move
after &lt;getmail-configuration-file&gt; definition.
</pre>
</div>
</content>
</entry>
<entry>
<title>tests: Add sanitizer test.</title>
<updated>2022-07-01T10:10:29+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2022-07-01T10:08:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=741895676b124a8a9a6656a54b5b58fd35d8e0f9'/>
<id>741895676b124a8a9a6656a54b5b58fd35d8e0f9</id>
<content type='text'>
* tests/records.scm ("define-record-type* &amp; sanitize without default
value"): New test.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* tests/records.scm ("define-record-type* &amp; sanitize without default
value"): New test.
</pre>
</div>
</content>
</entry>
<entry>
<title>records: Support field sanitizers.</title>
<updated>2021-08-12T10:34:13+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2021-05-20T13:40:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=5291fd7a4205394b863a8705b32fbb447321dc60'/>
<id>5291fd7a4205394b863a8705b32fbb447321dc60</id>
<content type='text'>
* guix/records.scm (make-syntactic-constructor): Add #:sanitizers.
[field-sanitizer]: New procedure.
[wrap-field-value]: Honor F's sanitizer.
(define-record-type*)[field-sanitizer]: New procedure.
Pass #:sanitizer to 'make-syntactic-constructor'.
* tests/records.scm ("define-record-type* &amp; sanitize")
("define-record-type* &amp; sanitize &amp; thunked"): New tests.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/records.scm (make-syntactic-constructor): Add #:sanitizers.
[field-sanitizer]: New procedure.
[wrap-field-value]: Honor F's sanitizer.
(define-record-type*)[field-sanitizer]: New procedure.
Pass #:sanitizer to 'make-syntactic-constructor'.
* tests/records.scm ("define-record-type* &amp; sanitize")
("define-record-type* &amp; sanitize &amp; thunked"): New tests.
</pre>
</div>
</content>
</entry>
<entry>
<title>diagnostics, ui: Adjust to 'read-error' and 'syntax-error' in Guile 3.0.6.</title>
<updated>2021-04-28T23:22:04+00:00</updated>
<author>
<name>Ludovic Courtès</name>
<email>ludo@gnu.org</email>
</author>
<published>2021-04-28T22:38:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.vineetk.net/guix/commit/?id=524c9800afb433cc474132185d8e37f72004adb3'/>
<id>524c9800afb433cc474132185d8e37f72004adb3</id>
<content type='text'>
* guix/diagnostics.scm (source-properties-&gt;location): Add clause for
vectors.
* guix/ui.scm (report-load-error): Tweak 'read-error' handling for 3.0.6.
* tests/guix-package.sh: Relax regexp for the "unbound variable"
diagnostic check.
* tests/guix-system.sh: Adjust "missing closing paren" check for 3.0.6.
* tests/records.scm (location-alist): New procedure.
("define-record-type* &amp; wrong field specifier")
("define-record-type* &amp; wrong field specifier, identifier")
("define-record-type* &amp; duplicate initializers"): Use it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* guix/diagnostics.scm (source-properties-&gt;location): Add clause for
vectors.
* guix/ui.scm (report-load-error): Tweak 'read-error' handling for 3.0.6.
* tests/guix-package.sh: Relax regexp for the "unbound variable"
diagnostic check.
* tests/guix-system.sh: Adjust "missing closing paren" check for 3.0.6.
* tests/records.scm (location-alist): New procedure.
("define-record-type* &amp; wrong field specifier")
("define-record-type* &amp; wrong field specifier, identifier")
("define-record-type* &amp; duplicate initializers"): Use it.
</pre>
</div>
</content>
</entry>
</feed>
