Fork me on GitHub
Endre Bakken Stovner11:08:34

In Bulma CSS a class is called <div class="notification is-danger">, but in reagent it is written like Why do they match? Is . considered whitespace in a class name since you presumably cannot have a nested class? I guess the latter is true and that I realized the answer while writing the question XD


That's just syntax sugar in reagent Hiccup and its origin is CSS, not method calls. Classes in CSS are referred to using a dot and ids using #, so in Hiccup you can just do [:div.myclass.myotherclass#myid] and it will get converted to [:div {:class "myclass myotherclass ", :id "myid"}]

๐Ÿ‘ 1
Endre Bakken Stovner19:08:59

Thanks for the reminder. The final one is > which I think just creates a new element ๐Ÿ™‚

Endre Bakken Stovner12:08:07

Are there formatters that can turn

(cond (true? loading?) :loading
      user :authenticated
      :else :anonymous)
(cond (true? loading?) :loading
      user             :authenticated
      :else            :anonymous)
? (I use emacs btw)


There is an Emacs' package: aggressive-indent


Note that there is a downside to this approach when it comes to version control. If you change (true? loading?) to something longer or shorter, youโ€™ll get a diff spanning three lines rather than one.

๐Ÿ˜“ 1

;; Indentation of function forms
  (setq clojure-indent-style 'align-arguments)
  ;; Vertically align s-expressions
  (setq clojure-align-forms-automatically t)
  ;; Auto-indent code automatically
  (add-hook 'clojure-mode-hook #'aggressive-indent-mode)

Endre Bakken Stovner15:08:50

Thanks to all of you! ๐Ÿ™‚


i hit C-c <space> and it aligned it like that for me. clojure-align is what that is bound to for me. can probably get more clarification in #emacs

๐Ÿ‘ 1

Hello everyone! Where can I find documentation about the :forms key of metadata map? Is it only for documentation purposes or the compiler does something with its value?


Thanks :D


Can I use it on my docs or is it only for clojure.core functions?


go for it!

๐Ÿ˜ 1

they're used by doc if they exist so it's the best place to hand-craft an arglist form if the default is not conveying what you want. this is a common need with macros which might just take a bunch of syntax that they have to parse


Thatโ€™s exactly what Iโ€™m writing. Thanks!


also note that if you supply a spec with fdef and :args, that will printed by doc as well


(doc defn) for an example

๐Ÿ‘€ 1

just wanted to share with the community. As a clojure beginner, I've commited my first lines of Clojure in the project of the Java project of one of our customer. It's some HoneySQL code to generate test data on the development server ๐Ÿ™‚

๐ŸŽ‰ 16
๐Ÿ‘ 2

If you continue down this path, it would be very interesting to read about it (in a blog post or such). Not only interesting by itself but it also teaches the Clojure community what is looked for when migrating systems to Clojure.

๐Ÿ‘ 2
drewverlee18:08:45 @UPQTL73ML I made a library that might interest you. I'm sure someone else has created a more robust version.

๐Ÿ‘ 1

@U0DJ4T5U1 thx. I'll check this


The problem I'm solving is that postures tables demand more information then you might care about testing.


is it prudent to run ring app in production with "lein run"


Create an uberjar of the Clojure project and run using the java command line. This is the most common approach

java -jar project-uberjar.jar


can core logic ask questions?