all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Why do we force the lazy python?
@ 2022-07-10  1:51 jgart
  2022-07-10  8:04 ` Ricardo Wurmus
  0 siblings, 1 reply; 2+ messages in thread
From: jgart @ 2022-07-10  1:51 UTC (permalink / raw)
  To: Guix Help


Hi Guixers,

Why do we check if python is a promise and then "force" it?

I'm just trying to understand the thinking for doing that since I didn't
write this code.

```
(let ((python (if (promise? python)
                  (force python)
                  python)))
     ...
```

I understand that force makes a promise evaluate (laziness). That's
about as much as I know.

guix/build-system/python.scm:119

all best,

jgart


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Why do we force the lazy python?
  2022-07-10  1:51 Why do we force the lazy python? jgart
@ 2022-07-10  8:04 ` Ricardo Wurmus
  0 siblings, 0 replies; 2+ messages in thread
From: Ricardo Wurmus @ 2022-07-10  8:04 UTC (permalink / raw)
  To: jgart; +Cc: help-guix


jgart <jgart@dismail.de> writes:

> Why do we check if python is a promise and then "force" it?

See the comment in this definition:

(define package-with-python2
  ;; Note: delay call to 'default-python2' until after the 'arguments' field
  ;; of packages is accessed to avoid a circular dependency when evaluating
  ;; the top-level of (gnu packages python).
  (package-with-explicit-python (delay (default-python2))
                                "python-" "python2-"
                                #:variant-property 'python2-variant))

-- 
Ricardo


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-10  8:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-10  1:51 Why do we force the lazy python? jgart
2022-07-10  8:04 ` Ricardo Wurmus

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.