20 lines
593 B
Common Lisp
20 lines
593 B
Common Lisp
;;;; cl-scopes/shape - really abstract basic data shape definitions.
|
|
|
|
(defpackage :scopes/shape
|
|
(:use :common-lisp)
|
|
(:export #:record #:head-fields #:head #:data
|
|
#:head-plist))
|
|
|
|
(in-package :scopes/shape)
|
|
|
|
(defclass record ()
|
|
((head-fields :reader head-fields :initarg :head-fields :initform '(:taskid :username))
|
|
(head :accessor head :initarg :head)
|
|
(data :accessor data :initform nil)))
|
|
|
|
(defun head-plist (track)
|
|
(let (pl (hv (head track)))
|
|
(dolist (hf (head-fields track))
|
|
(setf (getf pl hf) (if (car hv) (car hv) ""))
|
|
(setf hv (cdr hv)))
|
|
pl))
|