aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2023-07-11 10:26:21 +0300
committerMunyoki Kilyungi2023-07-21 14:36:37 +0300
commite0de65a1ea4eee21b9d42586145bb2a41ca3c958 (patch)
treec8eabbc9510525245d7d597be7b7aa648a58ab52
parent5545a02c149469c094692fd592064fcec3fc7a67 (diff)
downloadgn-transform-databases-e0de65a1ea4eee21b9d42586145bb2a41ca3c958.tar.gz
Pass port to scm->triples
* dump/triples.scm (scm->triples): Make define have an optional arg fn that defaults to "triple".
-rw-r--r--dump/triples.scm6
1 files changed, 4 insertions, 2 deletions
diff --git a/dump/triples.scm b/dump/triples.scm
index 19817bd..710e00f 100644
--- a/dump/triples.scm
+++ b/dump/triples.scm
@@ -68,12 +68,14 @@ characters with an underscore and prefixing with gn:PREFIX."
(format port pattern subject predicate
(if (symbol? object) (symbol->string object) object))))
-(define (scm->triples alist id)
+(define* (scm->triples alist id
+ #:optional
+ (fn triple))
(for-each (match-lambda
((predicate . object)
(when (cond
((string? object)
(not (string-blank? object)))
(else object))
- (triple id predicate object))))
+ (fn id predicate object))))
alist))