Subject: [bug#30701] [PATCH 1/4] services: Rework the PostgreSQL config file to use a record type.

From: Clément Lassieur <[email-masked]>
Date: Mon, 05 Mar 2018 09:52:11 +0100

Christopher Baines <[email-masked]> writes:

> Clément Lassieur <[email-masked]> writes:
>
>> Hi Christopher,
>>
>> Christopher Baines <[email-masked]> writes:
>>
>>> For the default config file representation. This makes it possible to more
>>> easily change the configuration file, and have dynamic content. In particular,
>>> I'm looking at adding a pid file location to the config file.
>>>
>>> * gnu/services/databases.scm (<postgresql-config-file>): New record type.
>>>   (%default-postgres-config): Remove this, it's been replaced by the
>>>   configuration file.
>>>   (<postgresql-configuration>): Alter the default for the config file field.
>>>   (postgresql-service): Alter the default value for the config-file parameter.
>>> ---
>>>  gnu/services/databases.scm | 86 +++++++++++++++++++++++++++++++++++-----------
>>>  1 file changed, 66 insertions(+), 20 deletions(-)
>>
>> Thank you for this work!
>
> No problem, I've finally got around to going through some patches I've
> had sitting around for a while.
>
>>> +(define-gexp-compiler (postgresql-config-file-compiler
>>> +                       (file <postgresql-config-file>) system target)
>>> +  (match file
>>> +    (($ <postgresql-config-file> log-destination hba-file
>>> +                                 ident-file extra-config)
>>> +     (define (quote string)
>>> +       (if string
>>> +           (list "'" string "'")
>>> +           (list)))
>>
>> I don't think it's a good thing to hide one of the most important lisp
>> functions :-).
>
> I don't quite follow. I was trying to use '() rather than (list) if that
> is what you mean, but I kept getting odd errors from Guile, so I gave
> up, and ended up going with this.

Sorry for not being clear.  I meant that if you define 'quote', you
won't be able to use the Guile 'quote' anymore.  See
https://www.gnu.org/software/guile/manual/html_node/Expression-Syntax.html.

You could just rename it to 'quote-val' or something else.