forked from kraison/vivace-graph-v3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinterface.lisp
More file actions
27 lines (23 loc) · 777 Bytes
/
interface.lisp
File metadata and controls
27 lines (23 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
(in-package :graph-db)
(defgeneric copy (node)
(:method (thing)
(error "Cannot save ~S of type ~S" thing (type-of thing)))
(:method ((vertex vertex))
(copy-vertex vertex))
(:method ((edge edge))
(copy-edge edge)))
(defgeneric mark-deleted (node)
(:method (thing)
(error "Cannot delete ~S of type ~S" thing (type-of thing)))
(:method ((vertex vertex))
(delete-vertex vertex))
(:method ((edge edge))
(delete-edge edge)))
(defgeneric save (object &key graph)
(:method (thing &key graph)
(declare (ignore graph))
(error "Cannot save ~S of type ~S" thing (type-of thing)))
(:method ((vertex vertex) &key (graph *graph*))
(update-node vertex graph))
(:method ((edge edge) &key (graph *graph*))
(update-node edge graph)))