Skip to content

Commit

Permalink
[nop] Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed Sep 13, 2024
1 parent bd06a92 commit fd7b8f2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ That's everything most users will need to know, but see the [documentation](#doc
## Documentation

- [Wiki][GitHub wiki] (getting started, usage, etc.)
- API reference: [cljdoc][cljdoc docs], [Codox][Codox docs]][cljdoc docs]
- API reference: [cljdoc][cljdoc docs] or [Codox][Codox docs]

## Funding

Expand Down
29 changes: 16 additions & 13 deletions src/taoensso/truss/impl.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,27 @@
(defn #?(:clj ks-nnil? :cljs ^boolean ks-nnil?) [ks m] (revery? #(some? (get m %)) ks)))

#?(:clj
(defn get-source [macro-form macro-env]
(defn get-source "From Encore" [macro-form macro-env]
(let [{:keys [line column file]} (meta macro-form)
file
(if-not (:ns macro-env)
*file* ; Compiling Clj
(or ; Compiling Cljs
(when-let [url (and file (catching (io/resource file)))]
(catching (.getPath (io/file url)))
(do (str url)))
file))]

{:ns (str *ns*)
:line line
:column column
:file
(when (string? file)
(when-not (contains? #{"NO_SOURCE_PATH" "NO_SOURCE_FILE" ""} file)
file))})))
(when-let [url (and file (try (jio/resource file) (catch Exception _)))]
(try (.getPath (jio/file url)) (catch Exception _))
(do (str url)))
file))

file
(when (string? file)
(when-not (contains? #{"NO_SOURCE_PATH" "NO_SOURCE_FILE" ""} file)
file))

m {:ns (str *ns*)}
m (if line (assoc m :line line) m)
m (if column (assoc m :column column) m)
m (if file (assoc m :file file) m)]
m)))

(comment (io/resource "taoensso/truss.cljc"))

Expand Down
5 changes: 3 additions & 2 deletions wiki/1-Getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,9 @@ No need for any special syntax or concepts, just define a function as you'd like

# Motivation

<a href="https://youtu.be/gMB4Y-EIArA" title="Truss talk (YouTube)"><img src="https://raw.githubusercontent.com/ptaoussanis/truss/master/talk.jpg" width="600"/></a>

<p><a href="https://www.youtube.com/watch?v=gMB4Y-EIArA" target="_blank">
<img src="https://img.youtube.com/vi/gMB4Y-EIArA/maxresdefault.jpg" alt="Truss demo video" width="480" border="0" /></a></p>

Clojure is a beautiful language full of smart trade-offs that tends to produce production code that's short, simple, and easy to understand.

But every language necessarily has trade-offs. In the case of Clojure, **dynamic typing** leads to one of the more common challenges that I've observed in the wild: **debugging or refactoring large codebases**.
Expand Down

0 comments on commit fd7b8f2

Please sign in to comment.