Hi,

Vincent Legoll <vincent.leg...@gmail.com> skribis:

>> +(define (ntp-service-activation config)
>> +  "Return the activation gexp for config"
>> +  #~(begin
>> +      (use-modules (guix build utils))
>> +
>> +      (define %user
>> +        (getpw "ntpd"))
>> +
>> +      (let ((directory "/var/run/ntpd"))
>> +          (mkdir-p directory)
>> +          (chown directory (passwd:uid %user) (passwd:gid %user)))))
>> +
>
> Excuse my scheme-newbie questions, but
>
> - why did you use %user (I thought %s were for kind of global vars) ?

In the context of this gexp it’s a global variable.

> - why did you use define and not put it in the let just below ? Idon't see
> it being used elsewhere...

Both styles are OK, though putting it in the ‘let’ would have made it
more concise, indeed.  :-)

Ludo’.

Reply via email to