Skip to content

Commit 533ce70

Browse files
author
Duncan Mak
committed
Add macro for exporting edwin-specific names.
1 parent 5281644 commit 533ce70

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

config-macros.scm

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
;;;
2+
;;; Macro used to exporting edwin-specific bindings.
3+
;;;
4+
;;; (edwin:export (variable a)
5+
;;; (command b)
6+
;;; (mode c))
7+
;;; This is equivalent to
8+
;;;
9+
;;; (export edwin-variable$a
10+
;;; edwin-command$b
11+
;;; edwin-mode$c)
12+
;;;
13+
(define-syntax edwin:export
14+
(lambda (form rename compare)
15+
`(,(rename 'export)
16+
,@(apply append
17+
(map (lambda (specifier)
18+
(let ((category (car specifier))
19+
(names (cdr specifier)))
20+
(map (lambda (name)
21+
(string->symbol
22+
(apply string-append
23+
(map symbol->string
24+
`(edwin - ,category $ ,name)))))
25+
names)))
26+
(cdr form)))))
27+
(export))

load.scm

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010

1111
(user)
1212

13+
;;; EDWIN-EXPORT
14+
(config '(load "config-macros.scm"))
15+
1316
(config '(load "terminfo/interfaces.scm"
1417
"terminfo/scsh-packages.scm"))
1518

0 commit comments

Comments
 (0)