mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
gexp: Add printers for <gexp-input> and <gexp-output>.
* guix/gexp.scm (write-gexp-input, write-gexp-output): New procedures. (<gexp-input>, <gexp-output>): Use them as printers.
This commit is contained in:
parent
c568191a93
commit
f73286345e
1 changed files with 16 additions and 0 deletions
|
@ -179,6 +179,15 @@ (define-record-type <gexp-input>
|
|||
(output gexp-input-output) ;string
|
||||
(native? gexp-input-native?)) ;Boolean
|
||||
|
||||
(define (write-gexp-input input port)
|
||||
(match input
|
||||
(($ <gexp-input> thing output #f)
|
||||
(format port "#<gexp-input ~s:~a>" thing output))
|
||||
(($ <gexp-input> thing output #t)
|
||||
(format port "#<gexp-input native ~s:~a>" thing output))))
|
||||
|
||||
(set-record-type-printer! <gexp-input> write-gexp-input)
|
||||
|
||||
(define* (gexp-input thing ;convenience procedure
|
||||
#:optional (output "out")
|
||||
#:key native?)
|
||||
|
@ -193,6 +202,13 @@ (define-record-type <gexp-output>
|
|||
gexp-output?
|
||||
(name gexp-output-name))
|
||||
|
||||
(define (write-gexp-output output port)
|
||||
(match output
|
||||
(($ <gexp-output> name)
|
||||
(format port "#<gexp-output ~a>" name))))
|
||||
|
||||
(set-record-type-printer! <gexp-output> write-gexp-output)
|
||||
|
||||
(define raw-derivation
|
||||
(store-lift derivation))
|
||||
|
||||
|
|
Loading…
Reference in a new issue