From 2c5b86ed0c15c963973c5a549530eed16ad5a141 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 13 Nov 2012 18:33:28 +0100 Subject: [PATCH] Add -join as alias to -distinct. --- README.md | 2 ++ dash.el | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b93499e..2bacc0a 100644 --- a/README.md +++ b/README.md @@ -425,6 +425,8 @@ Return a new list with all duplicates removed. The test for equality is done with `equal`, or with `-compare-fn` if that's non-nil. +Alias: `-uniq` + ```cl (-distinct '()) ;; => '() (-distinct '(1 2 2 4)) ;; => '(1 2 4) diff --git a/dash.el b/dash.el index 4ed2a8d..e76a81e 100644 --- a/dash.el +++ b/dash.el @@ -468,11 +468,15 @@ in in second form, etc." (defun -distinct (list) "Return a new list with all duplicates removed. The test for equality is done with `equal', -or with `-compare-fn' if that's non-nil." +or with `-compare-fn' if that's non-nil. + +Alias: `-uniq'" (let (result) (--each list (when (not (-contains? result it)) (!cons it result))) (nreverse result))) +(defalias '-uniq '-distinct) + (defun -intersection (list list2) "Return a new list containing only the elements that are members of both LIST and LIST2. The test for equality is done with `equal',