Commits (8)
......@@ -13,5 +13,6 @@
(put 'match 'scheme-indent-function 1)
(put 'with-transaction 'scheme-indent-function 1)
(put 'test-check 'scheme-indent-function 1)
(put 'call-with-cursor 'scheme-indent-function 1)
(put 'call-with-cursor* 'scheme-indent-function 1)
(put 'call-with-cursor 'scheme-indent-function 2)
(put 'with-cnx 'scheme-indent-function 1))))))
AC_INIT([guile-wiredtiger], [0.6.3])
AC_INIT([guile-wiredtiger], [0.6.4])
(define-module (wiredtiger config)
#:export (%libwiredtiger))
(define %libwiredtiger
(define %libwiredtiger "@LIBWIREDTIGER_LIBDIR@/@LIBWIREDTIGER@")
......@@ -30,16 +30,16 @@
(use-modules (wiredtiger feature-space))
(define-record-type* <vertex> uid assoc)
(define-record-type* <vertex> uid assoc) ;; TODO: replace with hygenic macro
(export vertex-assoc vertex-uid)
(export vertex? vertex-assoc vertex-uid)
(define-public (vertex-assoc* vertex)
(acons 'uid (vertex-uid vertex) (vertex-assoc vertex)))
(define-record-type* <edge> uid assoc)
(export edge-uid edge-assoc)
(export edge? edge-uid edge-assoc)
(define-public VERTEX 0)
(define-public EDGE 1)
......@@ -68,6 +68,7 @@
(assoc-ref (vertex-assoc vertex) key))
(define-public (create-edge start end assoc) ;; FIXME: add a "!"
"Link START and END with ASSOC"
(let* ((assoc (acons '%kind EDGE assoc))
(assoc (acons '%start (vertex-uid start) assoc))
(assoc (acons '%end (vertex-uid end) assoc)))
......@@ -294,16 +295,7 @@ the traversi via traversi-deconstruct"
(lambda (uid)
(fs:ref uid '%end)))
;;; other helpers
;;; helpers
(define-public (get-vertex key value)
(let ((uids (traversi->list (traversi-filter (where? '%kind VERTEX) (from key value)))))
(if (null? uids)
(get (car uids)))))
(define-public (get-or-create-vertex key value)
(let ((uids (traversi->list (traversi-filter (where? '%kind VERTEX) (from key value)))))
(if (null? uids)
(values #true (create-vertex (acons key value '())))
(values #false (get (car uids))))))
(define-public (find key value)
(map get (fs:find key value)))
......@@ -375,7 +375,7 @@ NULL))))
(#\Q . ,item->integer)
(#\q . ,item->signed-integer)
(#\r . ,item->integer)
(#\u . ,item->bytes)))
(#\u . ,item->bytes))) ;; TODO: add missing types
(define (pointers->scm formats pointers)
(let loop ((formats (string->list formats))