From a2beb6635a5401f4a31237274f577ecb176379b7 Mon Sep 17 00:00:00 2001 From: Jonathan Lamothe Date: Sun, 11 May 2025 22:04:45 -0400 Subject: [PATCH] &key isn't valid? --- pivot-table.el | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/pivot-table.el b/pivot-table.el index fffbedc..d0dfe59 100644 --- a/pivot-table.el +++ b/pivot-table.el @@ -23,25 +23,18 @@ ;;; Code: -(defun pt-build (source &key rows cols vals) +(defun pt-build (source &rest params) "Build a pivot table -The SOURCE value should be the table the data is being taken -from. ROWS and COLS should be lists of column references from -the source table to be used as rows and columns for the pivot -table. These can either be integers representing the column -number, or strings representing column names. - -VALUES should be a list containing information about the values -in the body of the pivot table. Each element of the list should -be in the following format (REF FUNC &optional LABEL). - TODO: more documentation" - (let ((col-index (pt-get-columns source)) - (index (pt-column-names source)) - src-cols - (src-body (pt-get-body source)) - (buckets (make-hash-table))) + (let* ((rows (assoc :rows params)) + (cols (assoc :cols params)) + (vals (assoc :vals params)) + (col-index (pt-get-columns source)) + (index (pt-column-names source)) + src-cols + (src-body (pt-get-body source)) + (buckets (make-hash-table))) (pt--index-columns rows) (pt--index-columns cols) (pt--index-columns vals car)