Package renamed.
[clldap.git] / convert.lisp
blobcd1feda190356c1dedd4ce6d8dd93a4b9620b420
1 (in-package :clldap)
3 (defun record->add-record (record)
4 "Returns a change record with the ADD change type designed to create RECORD."
5 (destructuring-bind (distinguished-name object-classes attributes)
6 record
7 (list distinguished-name
8 'add
9 (fold-object-classes-and-attributes object-classes attributes))))
11 (defun record->replace-record (record)
12 "Returns a change record with the MODIFY change type designed to replace all attributes in RECORD."
13 (destructuring-bind (distinguished-name object-classes attributes)
14 record
15 (list distinguished-name
16 'modify
17 (mapcar (lambda (attribute)
18 (apply 'list
19 (car attribute) 'replace (cdr attribute)))
20 (fold-object-classes-and-attributes object-classes attributes)))))