utils: Add string->date*.
* haunt/utils.scm (string->date*): New procedure.
This commit is contained in:
parent
2e136d15a5
commit
35bb74497d
|
@ -27,13 +27,15 @@
|
||||||
#:use-module (ice-9 ftw)
|
#:use-module (ice-9 ftw)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:use-module (srfi srfi-1)
|
#:use-module (srfi srfi-1)
|
||||||
|
#:use-module (srfi srfi-19)
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:export (flatten
|
#:export (flatten
|
||||||
flat-map
|
flat-map
|
||||||
string-split-at
|
string-split-at
|
||||||
absolute-file-name
|
absolute-file-name
|
||||||
clean-directory
|
clean-directory
|
||||||
mkdir-p))
|
mkdir-p
|
||||||
|
string->date*
|
||||||
|
|
||||||
(define* (flatten lst #:optional depth)
|
(define* (flatten lst #:optional depth)
|
||||||
"Return a list that recursively concatenates the sub-lists of LST,
|
"Return a list that recursively concatenates the sub-lists of LST,
|
||||||
|
@ -98,3 +100,8 @@ flattened."
|
||||||
(loop tail path)
|
(loop tail path)
|
||||||
(apply throw args))))))
|
(apply throw args))))))
|
||||||
(() #t))))
|
(() #t))))
|
||||||
|
|
||||||
|
(define (string->date* str)
|
||||||
|
"Convert STR, a string in '~Y~m~d ~H:~M' format, into a SRFI-19 date
|
||||||
|
object."
|
||||||
|
(string->date str "~Y~m~d ~H:~M"))
|
||||||
|
|
Loading…
Reference in New Issue