Fork me on GitHub
#beginners
<
2017-11-16
>
athomasoriginal01:11:30

Naming convention is always something top of mind when I am programming. I notice that a few CLJ libraries like - garden, clj-time, hiccup etc don't start their function names with a verb. For example, I was under the impression that it would be preferred to do something like create-x, get-x, register-x...but I am seeing thing like date-time, css or html - I am not saying this is wrong, I just want to better understand naming conventions in clojure land. Perhaps names for library function is just different than in projects?

rymndhng01:11:11

@tkjone it is definitely a stylisitc thing. Some folks have more opinion on it than others, i'd recommend reading https://leanpub.com/elementsofclojure for ideas (the sample chapter talks about names)

athomasoriginal01:11:04

Thanks! Will do.

seancorfield02:11:17

A big :thumbsup::skin-tone-2: for Elements of Clojure!

madstap02:11:48

There's also this blog post https://stuartsierra.com/2016/01/09/how-to-name-clojure-functions which advocates that naming convention

seancorfield04:11:49

Stuart's really smart and really opinionated. I find myself agreeing really strongly with about half of what he writes (and disagreeing really strongly with the other half) 😆

solf10:11:18

Anyone has a list of good 4clojure users to follow? Checking other people's solutions once you've finished a problem is really fun

solf14:11:00

Oh I can already see the answers once I've solved a problem

solf14:11:28

but following multiple people let's me see different solutions to the same problem, and it's interesting how they are never the same

tony14:11:40

That is why programming is so amazing !

carly18:11:56

@gonewest818 The right margin is 30px, just like you set it. You may want to set the width on the table if that is the problem you want to fix.

gonewest81818:11:16

Really? the table resizes to the div. there are no explicit dimensions other than the margin, so if that’s the case I expected the table to honor the right margin also. Am I missing something?

gonewest81818:11:51

I mean, I expect there to be a consistent 30 px margin on all sides of the table in that grab.

adambard18:11:41

The "Style" window in your screenshot indicates that the table does have a 30px margin on all sides, it looks like the table is just too wide. Maybe an element containing it is larger than the screen? Maybe the styles on the table cells are bumping up the width of the overall table? It could honestly be a thousand things.

shakdwipeea18:11:50

(defn init-tinymce [comp]
  (.init js/tinymce #js {:selector "#editor"}))

(defn editor []
  (r/create-class {:component-did-mount init-tinymce
                   :reagent-render (fn []
                                     [:div#editor "abc"])}))
I am trying to use tinymce editor in a reagent project with figwheel, This renders the editor the first time, but when i change some content (for figwheel reload) eg. the text. The editor is not there and I get just the div element.

shakdwipeea18:11:09

This could be because I have the initialization code in the component-did-mount which is probably not called after reload but I am not sure. Any ideas would help ..

shakdwipeea19:11:09

No worries, found the official wrapper. https://github.com/instructure-react/react-tinymce, works perfectly with adapt-react-class

gonewest81821:11:53

^^^ my previous issue resolved on the semantic ui Gitter channel. The table gets a width 100% by default, so the solution is to embed it inside a another container with padding.

Lucas Barbosa21:11:13

Is there a native queue data structure in clojure?

Lucas Barbosa21:11:40

I want to conj at the back (like a vector) and pop from the front

Lucas Barbosa21:11:20

found it, clojure.lang.PersistentQueue/EMPTY