emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29926: closed ([PATCH 1/5] gexp: Add 'eval-gexp'.)


From: GNU bug Tracking System
Subject: bug#29926: closed ([PATCH 1/5] gexp: Add 'eval-gexp'.)
Date: Wed, 12 May 2021 11:13:02 +0000

Your message dated Wed, 12 May 2021 19:12:01 +0800
with message-id 
<OSZP286MB06646499F30864E598E5BBF1A3529@OSZP286MB0664.JPNP286.PROD.OUTLOOK.COM>
and subject line Re: [PATCH 0/5] Optimize profile hooks
has caused the debbugs.gnu.org bug report #29925,
regarding [PATCH 1/5] gexp: Add 'eval-gexp'.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
29925: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=29925
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH 1/5] gexp: Add 'eval-gexp'. Date: Mon, 1 Jan 2018 18:33:32 +0800
* guix/gexp.scm (eval-gexp): New procedure.
---
 guix/gexp.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index f005c4d29..9709c5ecb 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -76,6 +76,7 @@
             gexp->derivation
             gexp->file
             gexp->script
+            eval-gexp
             text-file*
             mixed-text-file
             file-union
@@ -1167,6 +1168,21 @@ and '%load-compiled-path' to honor EXP's imported 
modules."
                          #:local-build? #t
                          #:substitutable? #f)))))
 
+(define* (eval-gexp exp #:optional (name "computed-value"))
+  "Return as a monadic value the EXP (a gexp) evaluate to.  This is
+implemented by building a store file NAME that contains the textual
+representation of EXP's value, and then @code{read} from it."
+  (mlet* %store-monad
+      ((drv (gexp->derivation
+             name
+             (gexp (with-output-to-file (ungexp output)
+                     (lambda ()
+                       (write (eval (quote (ungexp exp)) (current-module))))))
+             #:local-build? #t
+             #:substitutable? #f))
+       (_   (built-derivations (list drv))))
+    (return (call-with-input-file (derivation->output-path drv) read))))
+
 (define* (text-file* name #:rest text)
   "Return as a monadic value a derivation that builds a text file containing
 all of TEXT.  TEXT may list, in addition to strings, objects of any type that
-- 
2.13.3




--- End Message ---
--- Begin Message --- Subject: Re: [PATCH 0/5] Optimize profile hooks Date: Wed, 12 May 2021 19:12:01 +0800 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)
Leo Prikler <leo.prikler@student.tugraz.at> writes:

> merge 29928 29926
> merge 29928 29927
> thanks
>
> This series (29928 29926 29927 29925 29929 29930) has by now slept on
> the mailing list for more than three years.
> Should we still try to merge it?  If so, could you send an updated
> version, that is not spread across six threads?

Hello, thoes patches are obsoleted, should be rewrite to use
`with-build-handler` (I haven't figure it out how yet).

Look like they were all merged as #29925, I think we can close it for
now, thank you!


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]