Fork me on GitHub

@tkjone Thanks for trying out 1.10.x. You can tell the browser REPL to look for static content in your resources directory by passing :static-dir as a REPL option:

clj --main cljs.main --output-dir out --repl-opts '{:static-dir ["." "out" "resources"]}' --repl -h


This is currently not documented on, but we have a PR in flight to document the browser REPL options


Awesome. I was just looking for that piece of documentation haha


Notice that I also passed --output-dir because in resources/index.html it has

<script src="out/main.js" type="text/javascript"></script>


Yeah, I trying to understand that. Is it possible to define '{:static-dir ["." "out" "resources"]}' in the deps.edn file...or maybe I am misunderstanding the relationship between the cli tool and the deps.edn

Michael Fiano00:03:34

Is braveclojure a good place to start if one is already very familiar with Lisp?


No... deps.edn is only for managing dependencies and classpath


@mfiano: if you already know lisp well, you might like "Joy of Clojure" - one of the best books out there

Michael Fiano00:03:35

@noisesmith Thanks. I've been using Common Lisp daily for the past 10 years. I am totally new to Clojure and even the JVM though.


they are very different books though - brave and true is cute and fun, joc is difficult and accurate


that is pretty much who joc is for I think - an experienced lisper learning a new lisp offshoot

Michael Fiano00:03:36

I spent all day setting up emacs/cider/lein after some snags. ready to start learning now

Michael Fiano00:03:15

Thanks for the advice. I'll check it out


@mfikes is it planned that when one wants to add to --repl-opts one should specify it inline, or is there an alternative?


It also seems like I can omit the --output-dir out part of the command. I tested with clj --main cljs.main --repl-opts '{:static-dir ["." "out" "resources"]}' --watch src --compile drumkit.core --repl and that works. Seems like --output-dir is defaulting to out


I have some question on


If I wrote a ui like above, then I would expect MyComponent to be a component, like in react. But when I use (om/component? MyComponent), the result is false.


Seems the function om/component? would only return true for an instance


right, MyComponent is not a prototype, it's a class you can instantiate


(if I recall correctly)


@tkjone I'm not aware of a plan to support REPL opts outside of the --repl-opts flag. Since you are passing --compile without also specifying --output-dir, it is defaulting to out


I also have <audio data-key="65" src="sounds/clap.wav"></audio> files inside of the resources dir. Seems like they are not being found by the index.html


which is odd because my css files are being found


@noisesmith and (om/component? MyComponent) is false, is it expected?


the structure of the resources looks like this:

├── resources
│   ├── css
│   └── sounds


that’s what I’d expect, as it’s not a component, it’s a class, of which an instance would be a component


ah I see. Thanks.


@tkjone This might be a consequence of .wav not being listed here But I don't have much experience using the browser REPL for actual work. If you are curious, making a change to add that and building the compiler isn't too difficult:


You could even add some print statements to the sent-static function in that file to try to sort out what it is doing for your .wav files

Drew Verlee03:03:40

Can someone explain this? If all the references are removed, why is it “hard to clean up” what is hard to clean? > There’s s a pitfall to hot code reloading however— any thread alive at the time of reloading will keep references to the old code until terminated. The problem is amplified by the fact that all references to these threads are wiped by the time reloading is complete, making it really tricky to clean the messed state up. Fortunately, Stuart Sierra came up with what has been dubbed Reloaded Workflow.


@drewverlee If all the references are actually cleaned up, then the Java garbage collector can do its thing and remove the object. Unfortunately, ensuring that you aren't retaining any references can be difficult. The "Reloaded Workflow" is a set of patterns for ensuring that you always have layers of indirection between your application code and its configuration state which makes it easy to "reload" your configuration without restarting the application (or just your REPL) entirely.


Hi, how do you actually use clojure.spec to validate input and output of a function without actually touching the function? AFAIK, I should use fdef but unfortunately it only validates the args key (not sure about this). So is currently the best way, for pure validation, is using :pre and :post ?


@christian767 This looks great. Thanks!

Vincent Cantin16:03:02

Hi, I don't understand this syntax, could someone explain why there is a ( before the get and the send? (. app (get "/hello" (fn [req res] (. res (send "Hello world"))))) source:

Vincent Cantin23:03:07

Thank you. I was looking at another reference page which did not show that form, probably an outdated one.