mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-25 22:08:16 -05:00
store: Add optional 'references' parameter to 'text-file'.
* guix/store.scm (text-file): Add optional 'references' parameter. Pass it to 'add-text-to-store'. * doc/guix.texi (The Store Monad): Adjust accordingly.
This commit is contained in:
parent
00ab945823
commit
ad3729536a
2 changed files with 8 additions and 5 deletions
|
@ -2358,9 +2358,10 @@ Run @var{mval}, a monadic value in the store monad, in @var{store}, an
|
|||
open store connection.
|
||||
@end deffn
|
||||
|
||||
@deffn {Monadic Procedure} text-file @var{name} @var{text}
|
||||
@deffn {Monadic Procedure} text-file @var{name} @var{text} [@var{references}]
|
||||
Return as a monadic value the absolute file name in the store of the file
|
||||
containing @var{text}, a string.
|
||||
containing @var{text}, a string. @var{references} is a list of store items that the
|
||||
resulting text file refers to; it defaults to the empty list.
|
||||
@end deffn
|
||||
|
||||
@deffn {Monadic Procedure} interned-file @var{file} [@var{name}] @
|
||||
|
|
|
@ -890,11 +890,13 @@ (define (store-lower proc)
|
|||
;; Store monad operators.
|
||||
;;
|
||||
|
||||
(define* (text-file name text)
|
||||
(define* (text-file name text
|
||||
#:optional (references '()))
|
||||
"Return as a monadic value the absolute file name in the store of the file
|
||||
containing TEXT, a string."
|
||||
containing TEXT, a string. REFERENCES is a list of store items that the
|
||||
resulting text file refers to; it defaults to the empty list."
|
||||
(lambda (store)
|
||||
(values (add-text-to-store store name text '())
|
||||
(values (add-text-to-store store name text references)
|
||||
store)))
|
||||
|
||||
(define* (interned-file file #:optional name
|
||||
|
|
Loading…
Reference in a new issue