|
530 | 530 | [x] (. clojure.lang.Delay (force x))) |
531 | 531 |
|
532 | 532 | (defmacro if-not |
533 | | - "Evaluates test. If logical false, evaluates and returns then expr, otherwise else expr, if supplied, else nil." |
| 533 | + "Evaluates test. If logical false, evaluates and returns then expr, |
| 534 | + otherwise else expr, if supplied, else nil." |
534 | 535 | ([test then] `(if-not ~test ~then nil)) |
535 | 536 | ([test then else] |
536 | 537 | `(if (not ~test) ~then ~else))) |
|
1154 | 1155 | `(. ~(with-meta multifn {:tag 'clojure.lang.MultiFn}) addMethod ~dispatch-val (fn ~@fn-tail))) |
1155 | 1156 |
|
1156 | 1157 | (defn remove-method |
1157 | | - "Removes the method of multimethod associated with dispatch-value." |
| 1158 | + "Removes the method of multimethod associated with dispatch-value." |
1158 | 1159 | [#^clojure.lang.MultiFn multifn dispatch-val] |
1159 | 1160 | (. multifn removeMethod dispatch-val)) |
1160 | 1161 |
|
1161 | 1162 | (defn prefer-method |
1162 | | - "Causes the multimethod to prefer matches of dispatch-val-x over dispatch-val-y when there is a conflict" |
| 1163 | + "Causes the multimethod to prefer matches of dispatch-val-x over dispatch-val-y |
| 1164 | + when there is a conflict" |
1163 | 1165 | [#^clojure.lang.MultiFn multifn dispatch-val-x dispatch-val-y] |
1164 | 1166 | (. multifn preferMethod dispatch-val-x dispatch-val-y)) |
1165 | 1167 |
|
|
1189 | 1191 | (defmacro if-let |
1190 | 1192 | "bindings => binding-form test |
1191 | 1193 |
|
1192 | | - If test is true, evaluates then with binding-form bound to the value of test, if not, yields else" |
| 1194 | + If test is true, evaluates then with binding-form bound to the value of |
| 1195 | + test, if not, yields else" |
1193 | 1196 | ([bindings then] |
1194 | 1197 | `(if-let ~bindings ~then nil)) |
1195 | 1198 | ([bindings then else & oldform] |
|
3504 | 3507 |
|
3505 | 3508 | (defmacro amap |
3506 | 3509 | "Maps an expression across an array a, using an index named idx, and |
3507 | | - return value named ret, initialized to a clone of a, then setting each element of |
3508 | | - ret to the evaluation of expr, returning the new array ret." |
| 3510 | + return value named ret, initialized to a clone of a, then setting |
| 3511 | + each element of ret to the evaluation of expr, returning the new |
| 3512 | + array ret." |
3509 | 3513 | [a idx ret expr] |
3510 | 3514 | `(let [a# ~a |
3511 | 3515 | ~ret (aclone a#)] |
|
3518 | 3522 |
|
3519 | 3523 | (defmacro areduce |
3520 | 3524 | "Reduces an expression across an array a, using an index named idx, |
3521 | | - and return value named ret, initialized to init, setting ret to the evaluation of expr at |
3522 | | - each step, returning ret." |
| 3525 | + and return value named ret, initialized to init, setting ret to the |
| 3526 | + evaluation of expr at each step, returning ret." |
3523 | 3527 | [a idx ret init expr] |
3524 | 3528 | `(let [a# ~a] |
3525 | 3529 | (loop [~idx (int 0) ~ret ~init] |
|
0 commit comments