mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
records: Add MATCH-RECORD-LAMBDA.
* guix/records.scm (match-record-lambda): New syntax. * tests/records.scm ("match-record-lambda"): New test. Signed-off-by: Josselin Poiret <dev@jpoiret.xyz>
This commit is contained in:
parent
e6dc1d3996
commit
4cd5293621
4 changed files with 27 additions and 1 deletions
|
@ -590,4 +590,16 @@ Description: 1st line,
|
|||
(match-record rec <with-thunked> (normal thunked)
|
||||
(list normal thunked)))))
|
||||
|
||||
(test-equal "match-record-lambda"
|
||||
'("thing: foo" "thing: bar")
|
||||
(begin
|
||||
(define-record-type* <with-text> with-text make-with-text
|
||||
with-text?
|
||||
(text with-text-text))
|
||||
|
||||
(map (match-record-lambda <with-text> (text)
|
||||
(string-append "thing: " text))
|
||||
(list (with-text (text "foo"))
|
||||
(with-text (text "bar"))))))
|
||||
|
||||
(test-end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue