Nikita Karetnikov <[email protected]> skribis:

> I’d like to know how ‘roll-back’ creates an empty generation because
> it’s necessary to do the same for ‘--delete-generations’.
>
> However, I fail to understand how (profile-derivation (%store) ‘())
> works (or any other function that uses (%store)).  I assume that some
> code should set ‘%store’ to something else.  Like so:
>
> scheme@(guix scripts package)> %store
> $1 = #<<parameter> 934e7f8 proc: #<procedure 934e810 at 
> ice-9/boot-9.scm:3154:17 () | (x)>>
> scheme@(guix scripts package)> (%store)
> $2 = #f
> scheme@(guix scripts package)> (%store "FOO")
> $3 = #f
> scheme@(guix scripts package)> (%store)
> $4 = "FOO"
>
> But I don’t see anything similar in ‘package.scm’.

‘%store’ is a SRFI-39 parameter (info "(guile) Parameters"), aka. a
dynamically-scoped variable.

It is initialized with the ‘parameterize’ form, which sets its value for
the dynamic extent of its body.

HTH,
Ludo’.

Reply via email to