aboutsummaryrefslogtreecommitdiff
path: root/module/c
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 03:23:44 +0200
committerHugo Hörnquist <hugo@lysator.liu.se>2022-06-23 03:48:22 +0200
commit1976980d4a272fb7fc3694c734bfc6825edfc721 (patch)
tree8460db1176c64895e9968447588953fac85fe7d6 /module/c
parentRemove all inline use-modules. (diff)
downloadcalp-1976980d4a272fb7fc3694c734bfc6825edfc721.tar.gz
calp-1976980d4a272fb7fc3694c734bfc6825edfc721.tar.xz
Centralize (almost) all exports to :export in define-module.
Diffstat (limited to 'module/c')
-rw-r--r--module/c/cpp.scm8
-rw-r--r--module/c/operators.scm11
2 files changed, 10 insertions, 9 deletions
diff --git a/module/c/cpp.scm b/module/c/cpp.scm
index 3f50fb87..a2935352 100644
--- a/module/c/cpp.scm
+++ b/module/c/cpp.scm
@@ -11,6 +11,7 @@
:use-module (c lex)
:use-module (c parse)
:use-module (c operators)
+ :export (do-funcall replace-symbols include#)
)
@@ -31,7 +32,7 @@
(list header-line) #f)))
-(define-public (do-funcall function arguments)
+(define (do-funcall function arguments)
(if (list? arguments)
(apply function arguments)
(function arguments)))
@@ -45,7 +46,7 @@
(!= . (negate =))
))
-(define-public (replace-symbols tree dict)
+(define (replace-symbols tree dict)
(if (not (list? tree))
(or (assoc-ref dict tree) tree)
(map (lambda (node) (replace-symbols node dict))
@@ -139,6 +140,3 @@
`(begin
,@(map (lambda (pair) `(,define-form ,(car pair) ,(cdr pair)))
(resolve-dependency-graph graph))))
-
-
-(export include#)
diff --git a/module/c/operators.scm b/module/c/operators.scm
index f6fa3da9..ab1b3e7c 100644
--- a/module/c/operators.scm
+++ b/module/c/operators.scm
@@ -1,4 +1,7 @@
-(define-module (c operators))
+(define-module (c operators)
+ :export (wordy-binary-operators
+ symbol-binary-operators
+ binary-operators))
;;; Simple operators are those which can be combined with '='
@@ -6,15 +9,15 @@
`(+ - * / & ,(symbol #\|) ^ << >> % < > =))
;; apparently part of C
-(define-public wordy-binary-operators
+(define wordy-binary-operators
'(bitand and_eq and bitor or_eq or xor_eq xor))
-(define-public symbol-binary-operators
+(define symbol-binary-operators
(append (map (lambda (x) (symbol-append x '=)) simple-operators)
`(&& ,(symbol #\| #\|) != ,(symbol #\,)
-> ,(symbol #\.))
simple-operators))
-(define-public binary-operators
+(define binary-operators
(append symbol-binary-operators
wordy-binary-operators))