From dc7202a0338126cef3a756dc6761eb0c3885078e Mon Sep 17 00:00:00 2001 From: Ekaitz Zarraga Date: Sun, 8 Oct 2023 15:23:54 +0200 Subject: as; call-in-module instead of calling in interface Calling in module let's the user write any scheme code they want inside the template. --- src/as.scm | 6 +++--- src/as/atom.scm | 7 +------ src/as/html.scm | 7 +------ src/as/media-list.scm | 15 +++++---------- 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/as.scm b/src/as.scm index b95c096..d309b8a 100644 --- a/src/as.scm +++ b/src/as.scm @@ -4,13 +4,13 @@ (define (call-in-module thunk module) (let* ((curmod (current-module)) - (_ (set-current-module (resolve-interface module))) + (_ (set-current-module (resolve-module module))) (v (thunk)) (_ (set-current-module curmod))) v)) -(define (load-with-interface path module-name) +(define (load-in-module path module-name) (call-in-module (lambda () (load path)) module-name)) (define (as what file) - (load-with-interface file `(src as ,what))) + (load-in-module file `(src as ,what))) diff --git a/src/as/atom.scm b/src/as/atom.scm index 2f88b7e..c55d550 100644 --- a/src/as/atom.scm +++ b/src/as/atom.scm @@ -1,11 +1,6 @@ (define-module (src as atom) #:use-module ((src atom) #:prefix atom:) - #:use-module (src dates) - #:re-export (string/ISO->date) - #:export (main - post - person - media)) + #:use-module (src dates)) (define main atom:feed) (define post atom:entry) diff --git a/src/as/html.scm b/src/as/html.scm index 6a612dc..0ea5434 100644 --- a/src/as/html.scm +++ b/src/as/html.scm @@ -1,11 +1,6 @@ (define-module (src as html) #:use-module (src dates) - #:use-module ((src html) #:prefix html:) - #:re-export (string/ISO->date) - #:export (main - post - person - media)) + #:use-module ((src html) #:prefix html:)) (define main html:index) (define post html:post) diff --git a/src/as/media-list.scm b/src/as/media-list.scm index f5a1eb2..68af2d3 100644 --- a/src/as/media-list.scm +++ b/src/as/media-list.scm @@ -1,13 +1,8 @@ (define-module (src as media-list) #:use-module (src dates) - #:use-module (src media-list) - #:re-export (string/ISO->date) - #:export (main - post - person - media)) + #:use-module ((src media-list) #:prefix media-list:)) -(define main media-list) -(define post ignore) -(define person ignore) -(define media add-to-list) +(define main media-list:media-list) +(define post media-list:ignore) +(define person media-list:ignore) +(define media media-list:add-to-list) -- cgit v1.2.3