aboutsummaryrefslogtreecommitdiff
path: root/module/datetime
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-02-13 22:12:33 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-02-13 22:12:33 +0100
commitba48718b5bc6d0eb4eef1f8ead91940e1c011206 (patch)
tree9ac399554174d29f03bd91eda57ed62e5948491f /module/datetime
parentDatetime remove old commented parse-month. (diff)
downloadcalp-ba48718b5bc6d0eb4eef1f8ead91940e1c011206.tar.gz
calp-ba48718b5bc6d0eb4eef1f8ead91940e1c011206.tar.xz
Datetime restrict imports.
We might want to break datetime out into its own (independent) module, but for that we should have a clear understanding of what it uses.
Diffstat (limited to 'module/datetime')
-rw-r--r--module/datetime/timespec.scm8
-rw-r--r--module/datetime/zic.scm15
2 files changed, 12 insertions, 11 deletions
diff --git a/module/datetime/timespec.scm b/module/datetime/timespec.scm
index 9b236e2d..712ff327 100644
--- a/module/datetime/timespec.scm
+++ b/module/datetime/timespec.scm
@@ -4,8 +4,10 @@
;;; Code:
(define-module (datetime timespec)
- :use-module (hnh util)
- :use-module (hnh util exceptions)
+ :export (make-timespec
+ timespec? timespec-time timespec-sign timespec-type)
+ :use-module ((hnh util) :select (set define*-public unless let*))
+ :use-module ((hnh util exceptions) :select (warning))
:use-module (datetime)
:use-module (srfi srfi-1)
:use-module (srfi srfi-9 gnu)
@@ -26,8 +28,6 @@
;; u, g, z - Universal time
(type timespec-type)) ; char
-(export make-timespec timespec? timespec-time timespec-sign timespec-type)
-
(define-public (timespec-zero)
(make-timespec (time) '+ #\w))
diff --git a/module/datetime/zic.scm b/module/datetime/zic.scm
index 6343dce3..b07c2bfa 100644
--- a/module/datetime/zic.scm
+++ b/module/datetime/zic.scm
@@ -11,14 +11,18 @@
;; See zic(8) for data format
;;; Code:
(define-module (datetime zic)
- :use-module (hnh util)
- :use-module (hnh util exceptions)
+ :use-module ((hnh util)
+ :select (awhen group set when sort* iterate group-by let*))
+ :use-module ((hnh util exceptions) :select (warning))
:use-module (datetime)
:use-module (datetime timespec)
- :use-module (ice-9 rdelim)
+ :use-module ((ice-9 rdelim) :select (read-line))
:use-module (srfi srfi-1)
:use-module (srfi srfi-9)
- :use-module (srfi srfi-9 gnu))
+ :use-module (srfi srfi-9 gnu)
+ :use-module ((vcomponent recurrence internal)
+ :select (byday make-recur-rule bymonthday))
+ )
(define-public (read-zoneinfo ports-or-filenames)
@@ -342,9 +346,6 @@ expries rules aren't yet implemented." type)]
(datetime time: (timespec-time timespec)))
))
-
-(use-modules (vcomponent recurrence internal))
-
(define-public (rule->rrule rule)
(if (eq? 'only (rule-to rule))
#f