From 647f020ccd409e83320e8d11859035856770c91f Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sun, 16 Jan 2022 12:32:40 +0530 Subject: ccwl: Delete plist->alist. plist->alist is not used anywhere. pairify is quite sufficient to take on its functionality. * ccwl/utils.scm (plist->alist): Delete function. * tests/utils.scm ("plist->alist"): Delete test. --- ccwl/utils.scm | 12 ------------ tests/utils.scm | 4 ---- 2 files changed, 16 deletions(-) diff --git a/ccwl/utils.scm b/ccwl/utils.scm index 04938b1..508e884 100644 --- a/ccwl/utils.scm +++ b/ccwl/utils.scm @@ -58,18 +58,6 @@ (cons (cons first second) (pairify tail))))) -(define (plist->alist plist) - "Convert the property list PLIST to an association list. A property -list is a list of the form (#:key1 value1 #:key2 value2 ...). For -example, - -(plist->alist (list #:spam 1 #:ham 2 #:eggs 3)) -=> ((spam . 1) (ham . 2) (eggs . 3))" - (map (match-lambda - ((key . value) - (cons (keyword->symbol key) value))) - (pairify plist))) - (define* (group-keyword-arguments args #:optional (unary-keywords (list))) "Group ARGS, a list of keyword arguments of arbitrary arity. Return a list of unary keyword arguments. n-ary arguments are grouped diff --git a/tests/utils.scm b/tests/utils.scm index 3970a5c..b630b10 100644 --- a/tests/utils.scm +++ b/tests/utils.scm @@ -33,10 +33,6 @@ '((1 . 2) (3 . 4) (5 . 6)) (pairify (list 1 2 3 4 5 6))) -(test-equal "plist->alist" - '((spam . 1) (ham . 2) (eggs . 3)) - (plist->alist (list #:spam 1 #:ham 2 #:eggs 3))) - (test-equal "plist-ref" 2 (plist-ref (list #:spam 1 #:ham 2 #:eggs 3) -- cgit v1.2.3