[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash a09a4b2 318/439: Add code markup for docstrings an
From: |
Phillip Lord |
Subject: |
[elpa] externals/dash a09a4b2 318/439: Add code markup for docstrings and fix erroneous whitespace in docstring |
Date: |
Tue, 04 Aug 2015 20:29:37 +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 a3021eb 313/439: Merge pull request #93 from lunaryorn/patch-1, (continued)
- [elpa] externals/dash a3021eb 313/439: Merge pull request #93 from lunaryorn/patch-1, Phillip Lord, 2015/08/04
- [elpa] externals/dash 624c501 306/439: Add `-table` and `-table-flat`, Phillip Lord, 2015/08/04
- [elpa] externals/dash 0384eee 312/439: Improve Travis CI configuration, Phillip Lord, 2015/08/04
- [elpa] externals/dash 3132ae0 314/439: Alias -tail to nthcdr, Phillip Lord, 2015/08/04
- [elpa] externals/dash 2ecc073 316/439: Reorder the partition examples to follow more logical order, add tests, Phillip Lord, 2015/08/04
- [elpa] externals/dash bbc1d9c 309/439: `--each-while` should also expose `it-index`, Phillip Lord, 2015/08/04
- [elpa] externals/dash d948086 315/439: Add -iteratefn, Phillip Lord, 2015/08/04
- [elpa] externals/dash 7f0fadc 317/439: Add -prodfn, Phillip Lord, 2015/08/04
- [elpa] externals/dash eea928a 320/439: Add -replace, Phillip Lord, 2015/08/04
- [elpa] externals/dash f3b0a55 321/439: Change -predicate-p examples to -predicate? to maintain consistency, Phillip Lord, 2015/08/04
- [elpa] externals/dash a09a4b2 318/439: Add code markup for docstrings and fix erroneous whitespace in docstring,
Phillip Lord <=
- [elpa] externals/dash 7e4adb5 319/439: Add missing keywords to highlight list, Phillip Lord, 2015/08/04
- [elpa] externals/dash 174747e 323/439: Add -splice and -splice-list, Phillip Lord, 2015/08/04
- [elpa] externals/dash 5637bd6 322/439: Add alias from -find to -first, Phillip Lord, 2015/08/04
- [elpa] externals/dash 9ebcce6 325/439: Add some niceties to font-locking of examples, Phillip Lord, 2015/08/04
- [elpa] externals/dash f8873a0 327/439: Update readme-template with changes from last release, Phillip Lord, 2015/08/04
- [elpa] externals/dash f18a520 326/439: Release 2.7.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash f257fb9 328/439: Add -butlast, Phillip Lord, 2015/08/04
- [elpa] externals/dash d9879e9 329/439: Release 2.8.0, Phillip Lord, 2015/08/04
- [elpa] externals/dash 25c114c 330/439: Implementing a shallow copy counterpart to -clone., Phillip Lord, 2015/08/04
- [elpa] externals/dash 6fc652d 331/439: Merge pull request #95 from Wilfred/shallow-copy-function, Phillip Lord, 2015/08/04