aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2020-10-15 00:12:20 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2020-10-15 00:12:20 +0200
commit99120bc1b7920261e1020d501de139c71a381492 (patch)
tree3cff69ace21de886e8a412b6f1f703efb47b3f3a
parentClarify use of sandbox. (diff)
downloadcalp-99120bc1b7920261e1020d501de139c71a381492.tar.gz
calp-99120bc1b7920261e1020d501de139c71a381492.tar.xz
Datetime bindings for search.
-rw-r--r--module/calp/main.scm6
-rw-r--r--module/vcomponent/search.scm9
2 files changed, 8 insertions, 7 deletions
diff --git a/module/calp/main.scm b/module/calp/main.scm
index 92f33280..e296632a 100644
--- a/module/calp/main.scm
+++ b/module/calp/main.scm
@@ -101,12 +101,6 @@
(if (null? a)
b a))
-(define (bindings-for module-name)
- ;; Wrapping list so we can later export sub-modules.
- (list (cons module-name
- (module-map (lambda (a . _) a)
- (resolve-interface module-name)))))
-
(define (wrapped-main args)
(define opts (getopt-long args (getopt-opt options) #:stop-at-first-non-option #t))
(define stprof (option-ref opts 'statprof #f))
diff --git a/module/vcomponent/search.scm b/module/vcomponent/search.scm
index 7d039a24..fef0b100 100644
--- a/module/vcomponent/search.scm
+++ b/module/vcomponent/search.scm
@@ -52,6 +52,13 @@
(define-public (prepare-string str)
(call-with-input-string (close-parenthese str) read))
+;; TODO place this in a proper module
+(define (bindings-for module-name)
+ ;; Wrapping list so we can later export sub-modules.
+ (list (cons module-name
+ (module-map (lambda (a . _) a)
+ (resolve-interface module-name)))))
+
;; Evaluates the given expression in a sandbox.
;; NOTE Should maybe be merged inte prepare-query. The argument against is that
;; eval-in-sandbox is possibly slow, and that would prevent easy caching by the
@@ -65,7 +72,7 @@
`(
((vcomponent base) prop param children type)
((ice-9 regex) string-match)
- ;; TODO datetime
+ ,@(bindings-for '(datetime))
,@all-pure-bindings)
)))