branch: externals/dash
commit 9a149bf85acef70292b97ee6c8f860dcfb385795
Author: Magnar Sveen <[email protected]>
Commit: Magnar Sveen <[email protected]>

    Add anaphoric example to --max-by and --min-by
---
 dev/examples.el |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/dev/examples.el b/dev/examples.el
index 8c750eb..55aaa8a 100644
--- a/dev/examples.el
+++ b/dev/examples.el
@@ -117,6 +117,7 @@
 (defexamples -min-by
   (-min-by '> '(4 3 6 1)) => 1
   (-min-by (-on '> 'length) '((1 2 3) (1) (1 2))) => '(1)
+  (--min-by (> (length it) (length other)) '((1 2 3) (1) (1 2))) => '(1)
   (-min-by (-on 'string-lessp 'int-to-string) '(2 100 22)) => 22
   (-min-by '< '(4 3 6 1)) => 6)
 
@@ -128,6 +129,7 @@
 (defexamples -max-by
   (-max-by '> '(4 3 6 1)) => 6
   (-max-by (-on '> 'car) '((2 2 3) (3) (1 2))) => '(3)
+  (--max-by (> (car it) (car other)) '((2 2 3) (3) (1 2))) => '(3)
   (-max-by (-on '> 'string-to-int) '("1" "2" "3")) => "3"
   (-max-by '< '(4 3 6 1)) => 1)
 

Reply via email to