Fork me on GitHub
#shadow-cljs
<
2020-05-24
>
knubie16:05:32

It would be great if tap> returned its argument so that you could put it in the middle of thread macros

💯 8
lilactown16:05:14

doto is universally useful for things like that but yes I feel this pain too

knubie16:05:40

Oh, yeah hadn’t thought of using doto

thheller17:05:59

there is a CLJ ticket about tap>, not something shadow-cljs can change

Saikyun20:05:47

more and more I've started adopting bastardized lets:

(let [a (f)
      b (f' a)
      _ (tap> b)
      c (f'' b)]
  c)

Saikyun20:05:32

I don't reach for them immediately, but I feel they solve problems like wanting to do something in the middle of a threading macro

thheller20:05:06

FWIW I started writing an "enhanced" version of tap that has 3 forms ?> ?-> ?->> that captures the source location as well

👀 4
thheller20:05:54

I have only used it in shadow-cljs for CLJ stuff so far though so it doesn't do any of the "do nothing in release builds" stuff yet

thheller20:05:06

plenty of namespaces in shadow-cljs itself have [shadow.debug :refer (?> ?-> ?->>)] in their requires

thheller20:05:54

there is also a (shadow.debug/locals) which dumps all the locals at that location as a tap

thheller20:05:54

none of this is guaranteed to stay though, really just a basic layer to address some of the limits of tap>. no clue how this would look when done properly.

thheller20:05:45

don't really like that all of them take a second arg though, since thats the only reason it has 3 variants .. had some plans for that but not sure it makes sense anymore

nprbst23:05:07

Question: Why would I see this error The required namespace "enqus.views" is not available, it was required by "enqus/main.cljs" with a file tree like this:

src/cljs/enqus/main.cljs
src/cljs/enqus/views/views.cljs
Where views.cljs starts off with (ns enqus.views?

nprbst23:05:53

I'm new to CLJS and it seems like either nested namespaces are disallowed (which would be strange) or I'm doing something wrong (more likely).

nprbst23:05:31

Also, my shadow-cljs.edn includes :source-paths ["src/cljc" "src/cljs"]

lilactown23:05:47

@nathan.probst your namespaces need to match your file system

nprbst23:05:46

Meaning it should be enqus.views.views in that case?