[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash a09a4b2 318/426: Add code markup for docstrings an
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash a09a4b2 318/426: Add code markup for docstrings and fix erroneous whitespace in docstring |
Date: |
Tue, 04 Aug 2015 19:38:34 +0000 |
branch: externals/dash
commit a09a4b295a96bdabb1597144b203310ea52205b3
Author: Matus Goljer <address@hidden>
Commit: Matus Goljer <address@hidden>
Add code markup for docstrings and fix erroneous whitespace in docstring
---
README.md | 27 ++++++++++++++-------------
dash.el | 19 ++++++++++---------
dev/examples-to-docs.el | 3 ++-
3 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/README.md b/README.md
index 0e73195..e61d300 100644
--- a/README.md
+++ b/README.md
@@ -611,7 +611,8 @@ Operations dual to reductions, building lists from seed
value rather than consum
Return a list of iterated applications of `fun` to `init`.
This means a list of form:
- '(init (fun init) (fun (fun init)) ...)
+
+ (init (fun init) (fun (fun init)) ...)
`n` is the length of the returned list.
@@ -867,9 +868,9 @@ Applies `fn` to each item in `list`, splitting it each time
`fn` returns a new v
#### -partition-by-header `(fn list)`
Applies `fn` to the first item in `list`. That is the header
- value. Applies `fn` to each item in `list`, splitting it each time
- `fn` returns the header value, but only after seeing at least one
- other value (the body).
+value. Applies `fn` to each item in `list`, splitting it each time `fn`
+returns the header value, but only after seeing at least one
+other value (the body).
```cl
(--partition-by-header (= it 1) '(1 2 3 1 2 1 2 3 4)) ;; => '((1 2 3) (1 2) (1
2 3 4))
@@ -1429,8 +1430,8 @@ If `val` evaluates to non-nil, bind it to `var` and
execute body.
#### -when-let* `(vars-vals &rest body)`
If all `vals` evaluate to true, bind them to their corresponding
- `vars` and execute body. `vars-vals` should be a list of (`var` `val`)
- pairs (corresponding to bindings of `let*`).
+`vars` and execute body. `vars-vals` should be a list of (`var` `val`)
+pairs (corresponding to bindings of `let*`).
```cl
(-when-let* ((x 5) (y 3) (z (+ y 4))) (+ x y z)) ;; => 15
@@ -1450,8 +1451,8 @@ otherwise do `else`. `var-val` should be a (`var` `val`)
pair.
#### -if-let* `(vars-vals then &rest else)`
If all `vals` evaluate to true, bind them to their corresponding
- `vars` and do `then`, otherwise do `else`. `vars-vals` should be a list
- of (`var` `val`) pairs (corresponding to the bindings of `let*`).
+`vars` and do `then`, otherwise do `else`. `vars-vals` should be a list
+of (`var` `val`) pairs (corresponding to the bindings of `let*`).
```cl
(-if-let* ((x 5) (y 3) (z 7)) (+ x y z) "foo") ;; => 15
@@ -1680,7 +1681,7 @@ In types: (a -> a) -> Int -> a -> a.
This function satisfies the following law:
- (funcall (-iteratefn fn n) init) = (-last-item (-iterate fn init (1+ n))).
+ (funcall (-iteratefn fn n) init) = (-last-item (-iterate fn init (1+ n))).
```cl
(funcall (-iteratefn (lambda (x) (* x x)) 3) 2) ;; => 256
@@ -1698,10 +1699,10 @@ In types (for n=2): ((a -> b), (c -> d)) -> (a, c) ->
(b, d)
This function satisfies the following laws:
- (-compose (-prodfn f g ...) (-prodfn f' g' ...)) = (-prodfn (-compose f f')
(-compose g g') ...)
- (-prodfn f g ...) = (-juxt (-compose f (-partial 'nth 0)) (-compose g
(-partial 'nth 1)) ...)
- (-compose (-prodfn f g ...) (-juxt f' g' ...)) = (-juxt (-compose f f')
(-compose g g') ...)
- (-compose (-partial 'nth n) (-prod f1 f2 ...)) = (-compose fn (-partial 'nth
n))
+ (-compose (-prodfn f g ...) (-prodfn f' g' ...)) = (-prodfn (-compose f
f') (-compose g g') ...)
+ (-prodfn f g ...) = (-juxt (-compose f (-partial 'nth 0)) (-compose g
(-partial 'nth 1)) ...)
+ (-compose (-prodfn f g ...) (-juxt f' g' ...)) = (-juxt (-compose f f')
(-compose g g') ...)
+ (-compose (-partial 'nth n) (-prod f1 f2 ...)) = (-compose fn (-partial
'nth n))
```cl
(funcall (-prodfn '1+ '1- 'int-to-string) '(1 2 3)) ;; => '(2 1 "3")
diff --git a/dash.el b/dash.el
index 5af9905..08943ab 100644
--- a/dash.el
+++ b/dash.el
@@ -717,9 +717,9 @@ those items are discarded."
(defun -partition-by-header (fn list)
"Applies FN to the first item in LIST. That is the header
- value. Applies FN to each item in LIST, splitting it each time
- FN returns the header value, but only after seeing at least one
- other value (the body)."
+value. Applies FN to each item in LIST, splitting it each time FN
+returns the header value, but only after seeing at least one
+other value (the body)."
(--partition-by-header (funcall fn it) list))
(defmacro --group-by (form list)
@@ -899,7 +899,7 @@ combinations created by taking one element from each list in
order. The results are flattened, ignoring the tensor structure
of the result. This is equivalent to calling:
- (-flatten-n (1- (length lists)) (-table fn lists))
+ (-flatten-n (1- (length lists)) (-table fn lists))
but the implementation here is much more efficient.
@@ -1042,8 +1042,8 @@ VAR-VAL should be a (VAR VAL) pair."
(defmacro -when-let* (vars-vals &rest body)
"If all VALS evaluate to true, bind them to their corresponding
- VARS and execute body. VARS-VALS should be a list of (VAR VAL)
- pairs (corresponding to bindings of `let*')."
+VARS and execute body. VARS-VALS should be a list of (VAR VAL)
+pairs (corresponding to bindings of `let*')."
(declare (debug ((&rest (symbolp form)) body))
(indent 1))
(if (= (length vars-vals) 1)
@@ -1074,8 +1074,8 @@ otherwise do ELSE. VAR-VAL should be a (VAR VAL) pair."
(defmacro -if-let* (vars-vals then &rest else)
"If all VALS evaluate to true, bind them to their corresponding
- VARS and do THEN, otherwise do ELSE. VARS-VALS should be a list
- of (VAR VAL) pairs (corresponding to the bindings of `let*')."
+VARS and do THEN, otherwise do ELSE. VARS-VALS should be a list
+of (VAR VAL) pairs (corresponding to the bindings of `let*')."
(declare (debug ((&rest (symbolp form)) form body))
(indent 2))
(let ((first-pair (car vars-vals))
@@ -1264,7 +1264,8 @@ The items for the comparator form are exposed as \"it\"
and \"other\"."
"Return a list of iterated applications of FUN to INIT.
This means a list of form:
- '(init (fun init) (fun (fun init)) ...)
+
+ (init (fun init) (fun (fun init)) ...)
N is the length of the returned list."
(if (= n 0) nil
diff --git a/dev/examples-to-docs.el b/dev/examples-to-docs.el
index 2353b81..eb2ce7d 100644
--- a/dev/examples-to-docs.el
+++ b/dev/examples-to-docs.el
@@ -57,7 +57,8 @@ FUNCTION may reference an elisp function, alias, macro or a
subr."
(let (case-fold-search)
(--> docstring
(replace-regexp-in-string "\\b\\([A-Z][A-Z-]*[0-9]*\\)\\b"
'quote-and-downcase it t)
- (replace-regexp-in-string "`\\([^ ]+\\)'" "`\\1`" it t))))
+ (replace-regexp-in-string "`\\([^ ]+\\)'" "`\\1`" it t)
+ (replace-regexp-in-string "^ " " " it))))
(defun function-to-md (function)
(if (stringp function)
- [elpa] externals/dash 3eb91fe 280/426: Add `-find-last-index`, (continued)
- [elpa] externals/dash 3eb91fe 280/426: Add `-find-last-index`, Phillip Lord, 2015/08/04
- [elpa] externals/dash ec9afcb 255/426: Merge pull request #54 from Fuco1/index/modify, Phillip Lord, 2015/08/04
- [elpa] externals/dash 930b390 278/426: Add -list function., Phillip Lord, 2015/08/04
- [elpa] externals/dash adaeff7 274/426: Merge pull request #65 from rejeep/same-items-predicate, Phillip Lord, 2015/08/04
- [elpa] externals/dash e6cae0b 279/426: Merge pull request #68 from rejeep/list-function, Phillip Lord, 2015/08/04
- [elpa] externals/dash f18a520 326/426: Release 2.7.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7eb8307 283/426: Merge pull request #71 from Fuco1/find-last-index, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7f0fadc 317/426: Add -prodfn, Phillip Lord, 2015/08/04
- [elpa] externals/dash 960b05f 276/426: Set -each, -each-while and -dotimes indent levels to 1., Phillip Lord, 2015/08/04
- [elpa] externals/dash d948086 315/426: Add -iteratefn, Phillip Lord, 2015/08/04
- [elpa] externals/dash a09a4b2 318/426: Add code markup for docstrings and fix erroneous whitespace in docstring,
Phillip Lord <=
- [elpa] externals/dash 38307e3 223/426: Partition docs, Phillip Lord, 2015/08/04
- [elpa] externals/dash f3b0a55 321/426: Change -predicate-p examples to -predicate? to maintain consistency, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7e4adb5 319/426: Add missing keywords to highlight list, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2ecc073 316/426: Reorder the partition examples to follow more logical order, add tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash eea928a 320/426: Add -replace, Phillip Lord, 2015/08/04
- [elpa] externals/dash d9879e9 329/426: Release 2.8.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash f8873a0 327/426: Update readme-template with changes from last release, Phillip Lord, 2015/08/04
- [elpa] externals/dash 25c114c 330/426: Implementing a shallow copy counterpart to -clone., Phillip Lord, 2015/08/04
- [elpa] externals/dash f257fb9 328/426: Add -butlast, Phillip Lord, 2015/08/04
- [elpa] externals/dash 174747e 323/426: Add -splice and -splice-list, Phillip Lord, 2015/08/04