cl-scopes/shape/shape.lisp

22 lines
706 B
Common Lisp

;;;; cl-scopes/shape - really abstract basic data shape definitions.
(defpackage :scopes/shape
(:use :common-lisp)
(:local-nicknames (:util :scopes/util))
(: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) :allocation :class)
(head :accessor head :initarg :head)
(data :accessor data :initarg :data :initform nil)))
(defun head-plist (track)
(let (pl (hv (head track)))
(dolist (hf (head-fields track))
(setf pl (cons hf (cons (util:keyword-to-string (pop hv)) pl))))
(log:info "pl: ~s" pl)
pl))