about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xdump.scm22
1 files changed, 22 insertions, 0 deletions
diff --git a/dump.scm b/dump.scm
index b05af85..1f0a262 100755
--- a/dump.scm
+++ b/dump.scm
@@ -192,6 +192,28 @@ ALIST field-name) forms."
       (string-append
        dump-table "_" (remove-namespace (symbol->string predicate)))))))
 
+(define-syntax blank-node
+  (syntax-rules ()
+    "Allow having set and multiset within the context of a blank-node"
+    [(_ (op predicate object) ...)
+     (let [(node (string-join
+                  (filter-map (match-lambda
+                                ((pred . obj)
+                                 (match obj
+                                   ((and (?  string? obj)
+                                         (?  string-null? obj))
+                                    #f)
+                                   ((?  symbol? obj)
+                                    (format #f "~a ~a" pred (symbol->string obj)))
+                                   (_
+                                    (format #f "~a ~s" pred obj)))))
+                              (map-alist '()
+                                (op predicate object) ...))
+                  " ; "))]
+       (if (string-null? node)
+           ""
+           (format #f "[ ~a ]" node)))]))
+
 (define-syntax syntax-let
   (syntax-rules ()
     "Like match-let, but for syntax.