From 99120bc1b7920261e1020d501de139c71a381492 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Thu, 15 Oct 2020 00:12:20 +0200 Subject: Datetime bindings for search. --- module/calp/main.scm | 6 ------ module/vcomponent/search.scm | 9 ++++++++- 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) ))) -- cgit v1.2.3