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