diff --git a/.gitignore b/.gitignore index 4ec8ea2..347367c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ -/dash.elc -/dash-functional.elc +# Byte-compiled Elisp +*.elc + /dash-autoloads.el /dash-pkg.el + +# ctags, etags. +TAGS diff --git a/README.md b/README.md index cf82861..9c13678 100644 --- a/README.md +++ b/README.md @@ -1417,9 +1417,9 @@ other value (the body). Partition directly after each time `pred` is true on an element of `list`. ```el -(-partition-after-pred (function oddp) '()) ;; => '() -(-partition-after-pred (function oddp) '(1)) ;; => '((1)) -(-partition-after-pred (function oddp) '(0 1)) ;; => '((0 1)) +(-partition-after-pred #'odd? '()) ;; => '() +(-partition-after-pred #'odd? '(1)) ;; => '((1)) +(-partition-after-pred #'odd? '(0 1)) ;; => '((0 1)) ``` #### -partition-before-pred `(pred list)` @@ -1427,9 +1427,9 @@ Partition directly after each time `pred` is true on an element of `list`. Partition directly before each time `pred` is true on an element of `list`. ```el -(-partition-before-pred (function oddp) '()) ;; => '() -(-partition-before-pred (function oddp) '(1)) ;; => '((1)) -(-partition-before-pred (function oddp) '(0 1)) ;; => '((0) (1)) +(-partition-before-pred #'odd? '()) ;; => '() +(-partition-before-pred #'odd? '(1)) ;; => '((1)) +(-partition-before-pred #'odd? '(0 1)) ;; => '((0) (1)) ``` #### -partition-before-item `(item list)` @@ -1625,6 +1625,7 @@ Alias: `-uniq` ```el (-distinct '()) ;; => '() (-distinct '(1 2 2 4)) ;; => '(1 2 4) +(-distinct '(t t t)) ;; => '(t) ``` @@ -2680,7 +2681,7 @@ expects a list with n items as arguments ```el (-map (-applify '+) '((1 1 1) (1 2 3) (5 5 5))) ;; => '(3 6 15) -(-map (-applify (lambda (a b c) (\` ((\, a) ((\, b) ((\, c))))))) '((1 1 1) (1 2 3) (5 5 5))) ;; => '((1 (1 (1))) (1 (2 (3))) (5 (5 (5)))) +(-map (-applify (lambda (a b c) `(,a (,b (,c))))) '((1 1 1) (1 2 3) (5 5 5))) ;; => '((1 (1 (1))) (1 (2 (3))) (5 (5 (5)))) (funcall (-applify '<) '(3 6)) ;; => t ``` diff --git a/dash-template.texi b/dash-template.texi index fed63b7..5150652 100644 --- a/dash-template.texi +++ b/dash-template.texi @@ -81,8 +81,7 @@ Development @node Installation @chapter Installation -It's available on @uref{http://marmalade-repo.org/,marmalade} and -@uref{https://melpa.org/,Melpa}; use @code{M-x +It's available on @uref{https://melpa.org/,Melpa}; use @code{M-x package-install}: @table @kbd diff --git a/dash.el b/dash.el index f48c517..c86c116 100644 --- a/dash.el +++ b/dash.el @@ -33,6 +33,12 @@ ;;; Code: +;; TODO: `gv' was introduced in Emacs 24.3, so remove this and all +;; calls to `defsetf' when support for earlier versions is dropped. +(eval-when-compile + (unless (fboundp 'gv-define-setter) + (require 'cl))) + (defgroup dash () "Customize group for dash.el" :group 'lisp @@ -682,7 +688,10 @@ See also: `-third-item'. \(fn LIST)") -(defalias '-third-item 'caddr +(defalias '-third-item + (if (fboundp 'caddr) + #'caddr + (lambda (list) (car (cddr list)))) "Return the third item of LIST, or nil if LIST is too short. See also: `-fourth-item'. @@ -703,28 +712,18 @@ See also: `-last-item'." (declare (pure t) (side-effect-free t)) (car (cdr (cdr (cdr (cdr list)))))) -;; TODO: gv was introduced in 24.3, so we can remove the if statement -;; when support for earlier versions is dropped -(eval-when-compile - (require 'cl) - (if (fboundp 'gv-define-simple-setter) - (gv-define-simple-setter -first-item setcar) - (require 'cl) - (with-no-warnings - (defsetf -first-item (x) (val) `(setcar ,x ,val))))) - (defun -last-item (list) "Return the last item of LIST, or nil on an empty list." (declare (pure t) (side-effect-free t)) (car (last list))) -;; TODO: gv was introduced in 24.3, so we can remove the if statement -;; when support for earlier versions is dropped -(eval-when-compile +;; Use `with-no-warnings' to suppress unbound `-last-item' or +;; undefined `gv--defsetter' warnings arising from both +;; `gv-define-setter' and `defsetf' in certain Emacs versions. +(with-no-warnings (if (fboundp 'gv-define-setter) (gv-define-setter -last-item (val x) `(setcar (last ,x) ,val)) - (with-no-warnings - (defsetf -last-item (x) (val) `(setcar (last ,x) ,val))))) + (defsetf -last-item (x) (val) `(setcar (last ,x) ,val)))) (defun -butlast (list) "Return a list of all items in list except for the last." diff --git a/dash.info b/dash.info index 61fa519..426fa40 100644 --- a/dash.info +++ b/dash.info @@ -1,4 +1,4 @@ -This is dash.info, produced by makeinfo version 6.5 from dash.texi. +This is dash.info, produced by makeinfo version 6.6 from dash.texi. This manual is for ‘dash.el’ version 2.12.1. @@ -91,8 +91,8 @@ File: dash.info, Node: Installation, Next: Functions, Prev: Top, Up: Top 1 Installation ************** -It’s available on marmalade (http://marmalade-repo.org/) and Melpa -(https://melpa.org/); use ‘M-x package-install’: +It’s available on Melpa (https://melpa.org/); use ‘M-x +package-install’: ‘M-x package-install dash’ Install the dash library. @@ -1322,22 +1322,22 @@ Functions partitioning the input list into a list of lists. Partition directly after each time PRED is true on an element of LIST. - (-partition-after-pred (function oddp) '()) + (-partition-after-pred #'odd? '()) ⇒ '() - (-partition-after-pred (function oddp) '(1)) + (-partition-after-pred #'odd? '(1)) ⇒ '((1)) - (-partition-after-pred (function oddp) '(0 1)) + (-partition-after-pred #'odd? '(0 1)) ⇒ '((0 1)) -- Function: -partition-before-pred (pred list) Partition directly before each time PRED is true on an element of LIST. - (-partition-before-pred (function oddp) '()) + (-partition-before-pred #'odd? '()) ⇒ '() - (-partition-before-pred (function oddp) '(1)) + (-partition-before-pred #'odd? '(1)) ⇒ '((1)) - (-partition-before-pred (function oddp) '(0 1)) + (-partition-before-pred #'odd? '(0 1)) ⇒ '((0) (1)) -- Function: -partition-before-item (item list) @@ -1535,6 +1535,8 @@ Operations pretending lists are sets. ⇒ '() (-distinct '(1 2 2 4)) ⇒ '(1 2 4) + (-distinct '(t t t)) + ⇒ '(t)  File: dash.info, Node: Other list operations, Next: Tree operations, Prev: Set operations, Up: Functions @@ -2597,7 +2599,7 @@ offered in a separate package: ‘dash-functional‘. (-map (-applify '+) '((1 1 1) (1 2 3) (5 5 5))) ⇒ '(3 6 15) - (-map (-applify (lambda (a b c) (\` ((\, a) ((\, b) ((\, c))))))) '((1 1 1) (1 2 3) (5 5 5))) + (-map (-applify (lambda (a b c) `(,a (,b (,c))))) '((1 1 1) (1 2 3) (5 5 5))) ⇒ '((1 (1 (1))) (1 (2 (3))) (5 (5 (5)))) (funcall (-applify '<) '(3 6)) ⇒ t @@ -3185,204 +3187,204 @@ Index Tag Table: Node: Top946 Node: Installation2425 -Node: Using in a package3001 -Node: Syntax highlighting of dash functions3365 -Node: Functions3748 -Node: Maps4959 -Ref: -map5254 -Ref: -map-when5595 -Ref: -map-first6178 -Ref: -map-last6656 -Ref: -map-indexed7129 -Ref: -annotate7609 -Ref: -splice8099 -Ref: -splice-list8880 -Ref: -mapcat9342 -Ref: -copy9718 -Node: Sublist selection9922 -Ref: -filter10115 -Ref: -remove10567 -Ref: -remove-first10978 -Ref: -remove-last11505 -Ref: -remove-item12026 -Ref: -non-nil12420 -Ref: -slice12579 -Ref: -take13111 -Ref: -take-last13419 -Ref: -drop13742 -Ref: -drop-last14015 -Ref: -take-while14275 -Ref: -drop-while14625 -Ref: -select-by-indices14981 -Ref: -select-columns15495 -Ref: -select-column16200 -Node: List to list16663 -Ref: -keep16855 -Ref: -concat17358 -Ref: -flatten17655 -Ref: -flatten-n18414 -Ref: -replace18801 -Ref: -replace-first19264 -Ref: -replace-last19760 -Ref: -insert-at20249 -Ref: -replace-at20576 -Ref: -update-at20971 -Ref: -remove-at21462 -Ref: -remove-at-indices21950 -Node: Reductions22532 -Ref: -reduce-from22701 -Ref: -reduce-r-from23467 -Ref: -reduce24234 -Ref: -reduce-r24968 -Ref: -reductions-from25838 -Ref: -reductions-r-from26553 -Ref: -reductions27278 -Ref: -reductions-r27903 -Ref: -count28538 -Ref: -sum28762 -Ref: -running-sum28951 -Ref: -product29244 -Ref: -running-product29453 -Ref: -inits29766 -Ref: -tails30014 -Ref: -common-prefix30261 -Ref: -common-suffix30558 -Ref: -min30855 -Ref: -min-by31081 -Ref: -max31604 -Ref: -max-by31829 -Node: Unfolding32357 -Ref: -iterate32596 -Ref: -unfold33041 -Node: Predicates33849 -Ref: -any?33973 -Ref: -all?34293 -Ref: -none?34623 -Ref: -only-some?34925 -Ref: -contains?35410 -Ref: -same-items?35799 -Ref: -is-prefix?36184 -Ref: -is-suffix?36507 -Ref: -is-infix?36830 -Node: Partitioning37184 -Ref: -split-at37372 -Ref: -split-with37657 -Ref: -split-on38060 -Ref: -split-when38736 -Ref: -separate39376 -Ref: -partition39818 -Ref: -partition-all40270 -Ref: -partition-in-steps40698 -Ref: -partition-all-in-steps41195 -Ref: -partition-by41680 -Ref: -partition-by-header42062 -Ref: -partition-after-pred42666 -Ref: -partition-before-pred43037 -Ref: -partition-before-item43415 -Ref: -partition-after-item43726 -Ref: -group-by44032 -Node: Indexing44469 -Ref: -elem-index44671 -Ref: -elem-indices45066 -Ref: -find-index45449 -Ref: -find-last-index45938 -Ref: -find-indices46442 -Ref: -grade-up46850 -Ref: -grade-down47253 -Node: Set operations47663 -Ref: -union47846 -Ref: -difference48288 -Ref: -intersection48705 -Ref: -powerset49142 -Ref: -permutations49355 -Ref: -distinct49655 -Node: Other list operations49979 -Ref: -rotate50204 -Ref: -repeat50574 -Ref: -cons*50837 -Ref: -snoc51224 -Ref: -interpose51637 -Ref: -interleave51935 -Ref: -zip-with52304 -Ref: -zip53021 -Ref: -zip-fill53827 -Ref: -unzip54150 -Ref: -cycle54684 -Ref: -pad55057 -Ref: -table55380 -Ref: -table-flat56170 -Ref: -first57179 -Ref: -some57551 -Ref: -last57860 -Ref: -first-item58194 -Ref: -second-item58610 -Ref: -third-item58890 -Ref: -fourth-item59168 -Ref: -fifth-item59434 -Ref: -last-item59696 -Ref: -butlast59988 -Ref: -sort60235 -Ref: -list60723 -Ref: -fix61054 -Node: Tree operations61594 -Ref: -tree-seq61790 -Ref: -tree-map62648 -Ref: -tree-map-nodes63091 -Ref: -tree-reduce63946 -Ref: -tree-reduce-from64828 -Ref: -tree-mapreduce65429 -Ref: -tree-mapreduce-from66289 -Ref: -clone67575 -Node: Threading macros67903 -Ref: ->68048 -Ref: ->>68540 -Ref: -->69045 -Ref: -as->69606 -Ref: -some->70061 -Ref: -some->>70435 -Ref: -some-->70871 -Node: Binding71342 -Ref: -when-let71554 -Ref: -when-let*72039 -Ref: -if-let72567 -Ref: -if-let*72962 -Ref: -let73579 -Ref: -let*79667 -Ref: -lambda80608 -Ref: -setq81410 -Node: Side-effects82226 -Ref: -each82420 -Ref: -each-while82827 -Ref: -each-indexed83187 -Ref: -each-r83705 -Ref: -each-r-while84138 -Ref: -dotimes84513 -Ref: -doto84816 -Ref: --doto85243 -Node: Destructive operations85518 -Ref: !cons85691 -Ref: !cdr85897 -Node: Function combinators86092 -Ref: -partial86366 -Ref: -rpartial86761 -Ref: -juxt87163 -Ref: -compose87595 -Ref: -applify88153 -Ref: -on88600 -Ref: -flip89126 -Ref: -const89438 -Ref: -cut89782 -Ref: -not90268 -Ref: -orfn90578 -Ref: -andfn91012 -Ref: -iteratefn91507 -Ref: -fixfn92210 -Ref: -prodfn93779 -Node: Development94848 -Node: Contribute95197 -Node: Changes95945 -Node: Contributors98944 -Node: Index100568 +Node: Using in a package2958 +Node: Syntax highlighting of dash functions3322 +Node: Functions3705 +Node: Maps4916 +Ref: -map5211 +Ref: -map-when5552 +Ref: -map-first6135 +Ref: -map-last6613 +Ref: -map-indexed7086 +Ref: -annotate7566 +Ref: -splice8056 +Ref: -splice-list8837 +Ref: -mapcat9299 +Ref: -copy9675 +Node: Sublist selection9879 +Ref: -filter10072 +Ref: -remove10524 +Ref: -remove-first10935 +Ref: -remove-last11462 +Ref: -remove-item11983 +Ref: -non-nil12377 +Ref: -slice12536 +Ref: -take13068 +Ref: -take-last13376 +Ref: -drop13699 +Ref: -drop-last13972 +Ref: -take-while14232 +Ref: -drop-while14582 +Ref: -select-by-indices14938 +Ref: -select-columns15452 +Ref: -select-column16157 +Node: List to list16620 +Ref: -keep16812 +Ref: -concat17315 +Ref: -flatten17612 +Ref: -flatten-n18371 +Ref: -replace18758 +Ref: -replace-first19221 +Ref: -replace-last19717 +Ref: -insert-at20206 +Ref: -replace-at20533 +Ref: -update-at20928 +Ref: -remove-at21419 +Ref: -remove-at-indices21907 +Node: Reductions22489 +Ref: -reduce-from22658 +Ref: -reduce-r-from23424 +Ref: -reduce24191 +Ref: -reduce-r24925 +Ref: -reductions-from25795 +Ref: -reductions-r-from26510 +Ref: -reductions27235 +Ref: -reductions-r27860 +Ref: -count28495 +Ref: -sum28719 +Ref: -running-sum28908 +Ref: -product29201 +Ref: -running-product29410 +Ref: -inits29723 +Ref: -tails29971 +Ref: -common-prefix30218 +Ref: -common-suffix30515 +Ref: -min30812 +Ref: -min-by31038 +Ref: -max31561 +Ref: -max-by31786 +Node: Unfolding32314 +Ref: -iterate32553 +Ref: -unfold32998 +Node: Predicates33806 +Ref: -any?33930 +Ref: -all?34250 +Ref: -none?34580 +Ref: -only-some?34882 +Ref: -contains?35367 +Ref: -same-items?35756 +Ref: -is-prefix?36141 +Ref: -is-suffix?36464 +Ref: -is-infix?36787 +Node: Partitioning37141 +Ref: -split-at37329 +Ref: -split-with37614 +Ref: -split-on38017 +Ref: -split-when38693 +Ref: -separate39333 +Ref: -partition39775 +Ref: -partition-all40227 +Ref: -partition-in-steps40655 +Ref: -partition-all-in-steps41152 +Ref: -partition-by41637 +Ref: -partition-by-header42019 +Ref: -partition-after-pred42623 +Ref: -partition-before-pred42967 +Ref: -partition-before-item43318 +Ref: -partition-after-item43629 +Ref: -group-by43935 +Node: Indexing44372 +Ref: -elem-index44574 +Ref: -elem-indices44969 +Ref: -find-index45352 +Ref: -find-last-index45841 +Ref: -find-indices46345 +Ref: -grade-up46753 +Ref: -grade-down47156 +Node: Set operations47566 +Ref: -union47749 +Ref: -difference48191 +Ref: -intersection48608 +Ref: -powerset49045 +Ref: -permutations49258 +Ref: -distinct49558 +Node: Other list operations49936 +Ref: -rotate50161 +Ref: -repeat50531 +Ref: -cons*50794 +Ref: -snoc51181 +Ref: -interpose51594 +Ref: -interleave51892 +Ref: -zip-with52261 +Ref: -zip52978 +Ref: -zip-fill53784 +Ref: -unzip54107 +Ref: -cycle54641 +Ref: -pad55014 +Ref: -table55337 +Ref: -table-flat56127 +Ref: -first57136 +Ref: -some57508 +Ref: -last57817 +Ref: -first-item58151 +Ref: -second-item58567 +Ref: -third-item58847 +Ref: -fourth-item59125 +Ref: -fifth-item59391 +Ref: -last-item59653 +Ref: -butlast59945 +Ref: -sort60192 +Ref: -list60680 +Ref: -fix61011 +Node: Tree operations61551 +Ref: -tree-seq61747 +Ref: -tree-map62605 +Ref: -tree-map-nodes63048 +Ref: -tree-reduce63903 +Ref: -tree-reduce-from64785 +Ref: -tree-mapreduce65386 +Ref: -tree-mapreduce-from66246 +Ref: -clone67532 +Node: Threading macros67860 +Ref: ->68005 +Ref: ->>68497 +Ref: -->69002 +Ref: -as->69563 +Ref: -some->70018 +Ref: -some->>70392 +Ref: -some-->70828 +Node: Binding71299 +Ref: -when-let71511 +Ref: -when-let*71996 +Ref: -if-let72524 +Ref: -if-let*72919 +Ref: -let73536 +Ref: -let*79624 +Ref: -lambda80565 +Ref: -setq81367 +Node: Side-effects82183 +Ref: -each82377 +Ref: -each-while82784 +Ref: -each-indexed83144 +Ref: -each-r83662 +Ref: -each-r-while84095 +Ref: -dotimes84470 +Ref: -doto84773 +Ref: --doto85200 +Node: Destructive operations85475 +Ref: !cons85648 +Ref: !cdr85854 +Node: Function combinators86049 +Ref: -partial86323 +Ref: -rpartial86718 +Ref: -juxt87120 +Ref: -compose87552 +Ref: -applify88110 +Ref: -on88541 +Ref: -flip89067 +Ref: -const89379 +Ref: -cut89723 +Ref: -not90209 +Ref: -orfn90519 +Ref: -andfn90953 +Ref: -iteratefn91448 +Ref: -fixfn92151 +Ref: -prodfn93720 +Node: Development94789 +Node: Contribute95138 +Node: Changes95886 +Node: Contributors98885 +Node: Index100509  End Tag Table diff --git a/dash.texi b/dash.texi index d55097c..24c655a 100644 --- a/dash.texi +++ b/dash.texi @@ -96,8 +96,7 @@ Development @node Installation @chapter Installation -It's available on @uref{http://marmalade-repo.org/,marmalade} and -@uref{https://melpa.org/,Melpa}; use @code{M-x +It's available on @uref{https://melpa.org/,Melpa}; use @code{M-x package-install}: @table @kbd @@ -2067,15 +2066,15 @@ Partition directly after each time @var{pred} is true on an element of @var{list @example @group -(-partition-after-pred (function oddp) '()) +(-partition-after-pred #'odd? '()) @result{} '() @end group @group -(-partition-after-pred (function oddp) '(1)) +(-partition-after-pred #'odd? '(1)) @result{} '((1)) @end group @group -(-partition-after-pred (function oddp) '(0 1)) +(-partition-after-pred #'odd? '(0 1)) @result{} '((0 1)) @end group @end example @@ -2087,15 +2086,15 @@ Partition directly before each time @var{pred} is true on an element of @var{lis @example @group -(-partition-before-pred (function oddp) '()) +(-partition-before-pred #'odd? '()) @result{} '() @end group @group -(-partition-before-pred (function oddp) '(1)) +(-partition-before-pred #'odd? '(1)) @result{} '((1)) @end group @group -(-partition-before-pred (function oddp) '(0 1)) +(-partition-before-pred #'odd? '(0 1)) @result{} '((0) (1)) @end group @end example @@ -2445,6 +2444,10 @@ Alias: @code{-uniq} (-distinct '(1 2 2 4)) @result{} '(1 2 4) @end group +@group +(-distinct '(t t t)) + @result{} '(t) +@end group @end example @end defun @@ -4082,7 +4085,7 @@ expects a list with n items as arguments @result{} '(3 6 15) @end group @group -(-map (-applify (lambda (a b c) (\` ((\, a) ((\, b) ((\, c))))))) '((1 1 1) (1 2 3) (5 5 5))) +(-map (-applify (lambda (a b c) `(,a (,b (,c))))) '((1 1 1) (1 2 3) (5 5 5))) @result{} '((1 (1 (1))) (1 (2 (3))) (5 (5 (5)))) @end group @group diff --git a/dev/examples-to-docs.el b/dev/examples-to-docs.el index bc1f65f..848972c 100644 --- a/dev/examples-to-docs.el +++ b/dev/examples-to-docs.el @@ -153,8 +153,8 @@ FUNCTION may reference an elisp function, alias, macro or a subr." (defun simplify-quotes () (goto-char (point-min)) - (while (search-forward "(quote nil)" nil t) - (replace-match "'()")) + (while (re-search-forward (rx (or "'nil" "(quote nil)")) nil t) + (replace-match "'()" t t)) (goto-char (point-min)) (while (search-forward "(quote " nil t) (forward-char -7) diff --git a/dev/examples-to-info.el b/dev/examples-to-info.el index 8c940be..3b26085 100644 --- a/dev/examples-to-info.el +++ b/dev/examples-to-info.el @@ -159,8 +159,8 @@ FUNCTION may reference an elisp function, alias, macro or a subr." (defun simplify-quotes () (goto-char (point-min)) - (while (search-forward "(quote nil)" nil t) - (replace-match "'()")) + (while (re-search-forward (rx (or "'nil" "(quote nil)")) nil t) + (replace-match "'()" t t)) (goto-char (point-min)) (while (search-forward "(quote " nil t) (forward-char -7) diff --git a/dev/examples.el b/dev/examples.el index 7142370..6c11df4 100644 --- a/dev/examples.el +++ b/dev/examples.el @@ -24,6 +24,9 @@ (require 'dash) +;; FIXME: These definitions ought to be exported along with the +;; examples, if they are going to be used there. +(defun odd? (num) (= 1 (% num 2))) (defun even? (num) (= 0 (% num 2))) (defun square (num) (* num num)) (defun three-letters () '("A" "B" "C")) @@ -592,19 +595,19 @@ new list." (-partition-by-header 'even? '(2 1 1 1 4 1 3 5 6 6 1)) => '((2 1 1 1) (4 1 3 5) (6 6 1))) (defexamples -partition-after-pred - (-partition-after-pred #'oddp '()) => '() - (-partition-after-pred #'oddp '(1)) => '((1)) - (-partition-after-pred #'oddp '(0 1)) => '((0 1)) - (-partition-after-pred #'oddp '(1 1)) => '((1) (1)) - (-partition-after-pred #'oddp '(0 0 0 1 0 1 1 0 1)) => '((0 0 0 1) (0 1) (1) (0 1))) + (-partition-after-pred #'odd? '()) => '() + (-partition-after-pred #'odd? '(1)) => '((1)) + (-partition-after-pred #'odd? '(0 1)) => '((0 1)) + (-partition-after-pred #'odd? '(1 1)) => '((1) (1)) + (-partition-after-pred #'odd? '(0 0 0 1 0 1 1 0 1)) => '((0 0 0 1) (0 1) (1) (0 1))) (defexamples -partition-before-pred - (-partition-before-pred #'oddp '()) => '() - (-partition-before-pred #'oddp '(1)) => '((1)) - (-partition-before-pred #'oddp '(0 1)) => '((0) (1)) - (-partition-before-pred #'oddp '(1 1)) => '((1) (1)) - (-partition-before-pred #'oddp '(0 1 0)) => '((0) (1 0)) - (-partition-before-pred #'oddp '(0 0 0 1 0 1 1 0 1)) => '((0 0 0) (1 0) (1) (1 0) (1))) + (-partition-before-pred #'odd? '()) => '() + (-partition-before-pred #'odd? '(1)) => '((1)) + (-partition-before-pred #'odd? '(0 1)) => '((0) (1)) + (-partition-before-pred #'odd? '(1 1)) => '((1) (1)) + (-partition-before-pred #'odd? '(0 1 0)) => '((0) (1 0)) + (-partition-before-pred #'odd? '(0 0 0 1 0 1 1 0 1)) => '((0 0 0) (1 0) (1) (1 0) (1))) (defexamples -partition-before-item (-partition-before-item 3 '()) => '() diff --git a/readme-template.md b/readme-template.md index cb2d876..4d12809 100644 --- a/readme-template.md +++ b/readme-template.md @@ -4,7 +4,7 @@ A modern list api for Emacs. No 'cl required. ## Installation -It's available on [marmalade](http://marmalade-repo.org/) and [Melpa](https://melpa.org/): +It's available on [Melpa](https://melpa.org/): M-x package-install dash diff --git a/run-tests.sh b/run-tests.sh index 7e6d053..41a187f 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -16,19 +16,13 @@ if [ -z "$ERT_SELECTOR" ] ; then ERT_SELECTOR="nil" fi -$EMACS -batch \ +$EMACS -Q -batch \ -l dash.el \ -l dash-functional.el \ -l dev/examples-to-tests.el \ -l dev/examples.el \ - --eval "(ert-run-tests-batch-and-exit (quote ${ERT_SELECTOR}))" + -eval "(ert-run-tests-batch-and-exit (quote ${ERT_SELECTOR}))" -VERSION=`$EMACS -version | head -1 | cut -d" " -f3` - -if [[ $VERSION == "24.1.1" ]] || [[ $VERSION == "24.2.1" ]] ; then - echo Skipping byte compile check for early Emacs version -else - $EMACS -Q --batch \ - --eval '(setq byte-compile-error-on-warn t)' \ - -f batch-byte-compile dash.el -fi +$EMACS -Q -batch \ + -eval '(setq byte-compile-error-on-warn t)' \ + -f batch-byte-compile dash.el