doc
This commit is contained in:
parent
c17136b052
commit
3ae3abf2e6
1 changed files with 22 additions and 21 deletions
|
|
@ -412,10 +412,11 @@ The namespace `babashka.curl` is a tiny wrapper around curl. It's aliased as
|
||||||
A note on style. Babashka recommends the following:
|
A note on style. Babashka recommends the following:
|
||||||
|
|
||||||
- Only use `*input*` and aliases without an explicit require in bash one-liners.
|
- Only use `*input*` and aliases without an explicit require in bash one-liners.
|
||||||
|
- Use an explicit namespace form in scripts.
|
||||||
|
|
||||||
Do this:
|
Do this:
|
||||||
|
|
||||||
```
|
``` shell
|
||||||
$ ls | bb -i '(-> *input* first (str/includes? "m"))'
|
$ ls | bb -i '(-> *input* first (str/includes? "m"))'
|
||||||
true
|
true
|
||||||
```
|
```
|
||||||
|
|
@ -423,14 +424,14 @@ A note on style. Babashka recommends the following:
|
||||||
But not this:
|
But not this:
|
||||||
|
|
||||||
script.clj:
|
script.clj:
|
||||||
```
|
``` clojure
|
||||||
(-> *input* first (str/includes? "m"))
|
(-> *input* first (str/includes? "m"))
|
||||||
```
|
```
|
||||||
|
|
||||||
Rather do this:
|
Rather do this:
|
||||||
|
|
||||||
script.clj:
|
script.clj:
|
||||||
```
|
``` clojure
|
||||||
(ns script
|
(ns script
|
||||||
(:require [clojure.java.io :as io]
|
(:require [clojure.java.io :as io]
|
||||||
[clojure.string :as str]))
|
[clojure.string :as str]))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue