From 7854ec71414239f2919d651efefc0699c7f8ca55 Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Fri, 30 Aug 2019 16:12:51 +0100 Subject: [PATCH] Fix quote simplification in docs * dev/examples-to-docs.el (simplify-quotes): * dev/examples-to-info.el (simplify-quotes): Also replace 'nil with '(). * README.md: * dash.info: * dash.texi: Regenerate docs. --- README.md | 15 +++---- dash.info | 86 +++++++++++++++++++++-------------------- dash.texi | 18 +++++---- dev/examples-to-docs.el | 4 +- dev/examples-to-info.el | 4 +- 5 files changed, 67 insertions(+), 60 deletions(-) diff --git a/README.md b/README.md index cf82861..262bd2c 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 #'oddp '()) ;; => '() +(-partition-after-pred #'oddp '(1)) ;; => '((1)) +(-partition-after-pred #'oddp '(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 #'oddp '()) ;; => '() +(-partition-before-pred #'oddp '(1)) ;; => '((1)) +(-partition-before-pred #'oddp '(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.info b/dash.info index 61fa519..6c145e8 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. @@ -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 #'oddp '()) ⇒ '() - (-partition-after-pred (function oddp) '(1)) + (-partition-after-pred #'oddp '(1)) ⇒ '((1)) - (-partition-after-pred (function oddp) '(0 1)) + (-partition-after-pred #'oddp '(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 #'oddp '()) ⇒ '() - (-partition-before-pred (function oddp) '(1)) + (-partition-before-pred #'oddp '(1)) ⇒ '((1)) - (-partition-before-pred (function oddp) '(0 1)) + (-partition-before-pred #'oddp '(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 @@ -3277,25 +3279,25 @@ 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 +Ref: -partition-before-pred43010 +Ref: -partition-before-item43361 +Ref: -partition-after-item43672 +Ref: -group-by43978 +Node: Indexing44415 +Ref: -elem-index44617 +Ref: -elem-indices45012 +Ref: -find-index45395 +Ref: -find-last-index45884 +Ref: -find-indices46388 +Ref: -grade-up46796 +Ref: -grade-down47199 +Node: Set operations47609 +Ref: -union47792 +Ref: -difference48234 +Ref: -intersection48651 +Ref: -powerset49088 +Ref: -permutations49301 +Ref: -distinct49601 Node: Other list operations49979 Ref: -rotate50204 Ref: -repeat50574 @@ -3368,21 +3370,21 @@ 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 +Ref: -on88584 +Ref: -flip89110 +Ref: -const89422 +Ref: -cut89766 +Ref: -not90252 +Ref: -orfn90562 +Ref: -andfn90996 +Ref: -iteratefn91491 +Ref: -fixfn92194 +Ref: -prodfn93763 +Node: Development94832 +Node: Contribute95181 +Node: Changes95929 +Node: Contributors98928 +Node: Index100552  End Tag Table diff --git a/dash.texi b/dash.texi index d55097c..6f4dd15 100644 --- a/dash.texi +++ b/dash.texi @@ -2067,15 +2067,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 #'oddp '()) @result{} '() @end group @group -(-partition-after-pred (function oddp) '(1)) +(-partition-after-pred #'oddp '(1)) @result{} '((1)) @end group @group -(-partition-after-pred (function oddp) '(0 1)) +(-partition-after-pred #'oddp '(0 1)) @result{} '((0 1)) @end group @end example @@ -2087,15 +2087,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 #'oddp '()) @result{} '() @end group @group -(-partition-before-pred (function oddp) '(1)) +(-partition-before-pred #'oddp '(1)) @result{} '((1)) @end group @group -(-partition-before-pred (function oddp) '(0 1)) +(-partition-before-pred #'oddp '(0 1)) @result{} '((0) (1)) @end group @end example @@ -2445,6 +2445,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 +4086,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)