simple function to get column names
Closed this issue · 4 comments
slyrus commented
Is there a better way to get column names than writing my own function to do so such as:
(defun vellum/column-names (table)
(let ((header (vellum.table:header table)))
(loop for i below (vellum:column-count table)
collect (or (ignore-errors
(vellum.header:index-to-name header i))
(format nil "<Column ~a>" i)))))
sirherrbatka commented
Yes, Column-specs in the header. You gotta grab the header first though.
slyrus commented
Ya gotta grab the header, than we gotta get the names. I still think something like this would be useful:
(defun vellum/column-names (table)
(serapeum:~> table
vellum.table:header
vellum.header:column-specs
(mapcar (lambda (x)
(getf x :name))
_)))
sirherrbatka commented
hm, I certainly can see the appeal. I may add such a function.
sirherrbatka commented
It is done.