From d9955860338facec2d36a80ef8959254ac4ef928 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Tue, 11 Jul 2023 10:26:21 +0300 Subject: Pass port to scm->triples * dump/triples.scm (scm->triples): Make define have an optional arg fn that defaults to "triple". --- dump/triples.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'dump') 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)) -- cgit v1.2.3