[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: package.scm: (profile-derivation (%store) '())
From: |
Ludovic Courtès |
Subject: |
Re: package.scm: (profile-derivation (%store) '()) |
Date: |
Fri, 20 Sep 2013 22:21:15 +0200 |
User-agent: |
Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) |
Nikita Karetnikov <address@hidden> 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’.