File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed
Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change 191191 ([^String hostname ^Integer port]
192192 (host-port-up? hostname port host-up-timeout))
193193 ([^String hostname ^Integer port ^Integer timeout]
194- (try
195- (let [sock-addr (InetSocketAddress. hostname port)]
196- (with-open [sock (Socket. )]
197- (.connect sock sock-addr timeout)
198- true ))
199- (catch Throwable _ false ))))
194+ (try
195+ (let [sock-addr (InetSocketAddress. hostname port)]
196+ (with-open [sock (Socket. )]
197+ (.connect sock sock-addr timeout)
198+ true ))
199+ (catch Throwable _ false ))))
200200
201201(defn maybe?
202202 " Returns `true` if X is `nil`, otherwise calls (F X).
231231 (-> s .trim .isEmpty not)
232232 false ))
233233
234- (defmacro ^:private when-let*
234+ (defmacro when-let*
235+ " The extended version of when-let what allows multiple bindings"
235236 ([bindings & body]
236237 (if (seq bindings)
237238 `(when-let [~(first bindings) ~(second bindings)]
238239 (when-let* ~(drop 2 bindings) ~@body))
239- `(do ~@body))))
240+ `(do ~@body))))
241+
242+ (defmacro def-
243+ " Yields a private definitions as 'def the same way as defn- does"
244+ [name & body]
245+ (list* `def (with-meta name
246+ (assoc (meta name) :private true ))
247+ body))
You can’t perform that action at this time.
0 commit comments