From 8b490c4282fad0e796ef50549e3255a2b129a3ec Mon Sep 17 00:00:00 2001 From: AJ Rossini Date: Wed, 25 Mar 2009 15:56:32 +0100 Subject: [PATCH] supporting functions for creating and accessing elements of the dataframes (store, metadata). Signed-off-by: AJ Rossini --- src/data/data-clos.lisp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/data/data-clos.lisp b/src/data/data-clos.lisp index 88c6f9c..c13c6d6 100644 --- a/src/data/data-clos.lisp +++ b/src/data/data-clos.lisp @@ -64,7 +64,7 @@ ;;; - -;;; Misc Functions +;;; Misc Functions (to move into a lisp data manipulation support package) (defun gen-seq (n &optional (start 1)) "There has to be a better way -- I'm sure of it! default count from 1. @@ -75,9 +75,19 @@ (if (>= n start) (append (gen-seq (- n 1) start) (list n)))) +(defun repeat-seq (n item) + "FIXME: There has to be a better way -- I'm sure of it! + (repeat-seq 3 \"d\") ; => (\"d\" \"d\" \"d\") + (repeat-seq 3 'd) ; => ('d 'd 'd) +" + (if (>= n 1) + (append (repeat-seq (1- n) item) (list item)))) + + (defun strsym->indexnum (df strsym) - "Probably should be a method dispatching on the type of + "Returns a number indicating which column in DF has STRSYM labeling +it. Probably should be a method dispatching on the type of DATAFRAME-LIKE." (position strsym (varlabels df))) -- 2.11.4.GIT