diff options
author | Arun Isaac | 2021-12-23 15:48:39 +0530 |
---|---|---|
committer | Arun Isaac | 2021-12-23 15:48:39 +0530 |
commit | 846ab4613bb134587dac9d997cb2d35417e0a106 (patch) | |
tree | 8f00e94b4bb776da5fc1b26746476fcbc8744a56 | |
parent | b4bc965ba4022b4dda1ee9e75cce5815ab0defa2 (diff) | |
download | gn-transform-databases-846ab4613bb134587dac9d997cb2d35417e0a106.tar.gz |
Add runtime type checking for triple.
* dump.scm (triple): Add runtime type checking.
-rwxr-xr-x | dump.scm | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -142,6 +142,19 @@ characters with an underscore and prefixing with gn:PREFIX." alist)) (define (triple subject predicate object) + (unless (or (string? subject) + (symbol? subject)) + (error "Triple subject not a string or symbol:" + (list subject predicate object))) + (unless (or (string? predicate) + (symbol? predicate)) + (error "Triple predicate not a string or symbol:" + (list subject predicate object))) + (unless (or (string? object) + (symbol? object) + (number? object)) + (error "Triple object not a string, symbol or number:" + (list subject predicate object))) (format #t "~a ~a ~s .~%" subject predicate object)) (define (field->key x) |