emacs-elpa-diffs
[Top][All Lists]
Advanced

[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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]