guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

match-record


From: Aleksandr Vityazev
Subject: match-record
Date: Fri, 02 Dec 2022 18:59:23 +0000

Hi,

Before cc9ee514e37f6ec74dd9cab91a13d51f7b8d47e7 commit the code below
worked:

#+begin_src scheme :scheme guile :season guile

(define (iwd-etc-service config)
  (match-record config <iwd-configuration> (config)
    `(("iwd/main.conf"
       ,(apply mixed-text-file
               "main.conf"
               (serialize-ini-config config))))))
#+end_src

then this lead to an error:
Syntax error:
test.scm:109:44: lookup-field: unknown record type field in subform
config of (lookup-field config (+ 1 (+ 1 (+ 1 0))) ())


If you fix the code to the following one, it will work. 

#+begin_src scheme :scheme guile :season guile

(define (iwd-etc-service cfg)
  (match-record cfg <iwd-configuration> (config)
    `(("iwd/main.conf"
       ,(apply mixed-text-file
               "main.conf"
               (serialize-ini-config config))))))
#+end_src

Should the code from the first block work, or should I not write it that
way?

-- 
Best regards, 
Aleksandr Vityazev



reply via email to

[Prev in Thread] Current Thread [Next in Thread]