This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-05-12
Channels
- # bangalore-clj (1)
- # beginners (28)
- # boot (33)
- # chestnut (3)
- # cider (35)
- # cljs-dev (64)
- # cljsrn (16)
- # clojure (95)
- # clojure-android (6)
- # clojure-austin (1)
- # clojure-italy (5)
- # clojure-korea (1)
- # clojure-russia (55)
- # clojure-sg (1)
- # clojure-spec (25)
- # clojure-uk (57)
- # clojurescript (120)
- # code-reviews (7)
- # community-development (2)
- # core-async (3)
- # cursive (6)
- # data-science (3)
- # datascript (10)
- # datomic (12)
- # devcards (1)
- # emacs (9)
- # gsoc (7)
- # hoplon (18)
- # lumo (2)
- # off-topic (10)
- # om (24)
- # onyx (17)
- # pedestal (46)
- # powderkeg (1)
- # protorepl (7)
- # re-frame (31)
- # ring-swagger (34)
- # spacemacs (10)
- # specter (9)
- # sql (39)
- # unrepl (9)
- # untangled (3)
- # utah-clojurians (1)
yeah, used it a fair bit. Also nice for embedding diagrams in asciidoc - there’s a plugin for asciidoctor that will do inline diagrams via plantuml and a bunch of other similar tools.
morning
adhoc @dominicm ?
adoc, asciidoc. @mccraigmccraig
rcfotd:
-------------------------
clojure.core/find-keyword
([name] [ns name])
Returns a Keyword with the given namespace and name if one already
exists. This function will not intern a new keyword. If the keyword
has not already been interned, it will return nil. Do not use :
in the keyword strings, it will be added automatically.
I’ve been moving my github pages to asciidoc - thought you don’t get plantuml there 🙂 but it’s nice for tables and things that markdown just can’t handle.
lol need ☕
There’s a plantuml-type thing that runs in the browser: https://knsv.github.io/mermaid/
The main thing I like about adoc is that you convert it to DocBook - http://tdg.docbook.org/tdg/5.2/ -which means you can treat a document as a strongly-typed data-structure - so you can do things like extract index terms, count notes, process hyperlinks, fix things, insert boilerplate
The DocBook-to-PDF toolchain is mature and works great, the DocBook-to-HTML is mature and looks like the web 15 years ago 😞 But it's remarkably easy to process a valid DocBook structure with Clojure and transform it to the HTML of your choice...
@glenjamin http://www.plantuml.com/plantuml/uml/SyfFKj2rKt3CoKnELR1Io4ZDoSa70000 I use the official one
@glenjamin oops, I see yours uses http://knsv.github.io/mermaid/index.html
Trying to refactor some es6 to be more immutable. I’m trying to work out, which is better - to use raw es6, which means ugly strange things like Object.assign({}, thing, { newKey: newVal });
or to use immutable.js
which is great and clojure-y, but also requires the audience to accept using an extra library
(I’m trying to encourage good FP practices in JavaScript, and attempting to avoid mutating objects.)
if you are sticking with plain js, I hear rambda is good, but i’d at least wrap up patterns like that in well-named helper functions
yeah - but it means instead of saying “You’re doing JavaScript badly, the language now has all these great FP things”, I have to say “the language has all these great FP things, but you need a 3rd party library as well” 🙂
well, at least you get a better Map, though as I was ranting yesterday the keys are still handled badly.
https://github.com/markerikson/redux-ecosystem-links/blob/master/immutable-data.md might be helpful
I think for my simple example I’m going to stick with pure es6, and add a comment that immutable.js and others would be much better for a real project.
Most of my code didn’t mutate things anyway, but I did have to do a couple of “take a big data structure and add extra bits to it” operations, which makes it very tempting to just iterate and mutate 🙂
yeah, i often do function update(obj, extra) { return Object.assign({}, obj, extra); }
(heap usage dropping to 60MB after a GC 😄 )
it's after i fixed a thread-leak in java-nats... prior to that every user connection was leaking one or more threads and a single vm would be using 10GB of RAM in a few hours
@glenjamin that’s pretty well verbatim what I use. If I were using babel I could say {...obj, newKey: newVal}
but that hasn’t made it into browsers yet.
you see some really weird inline syntax tricks to do immutable updates in redux code in the wild
I’ve given up when it comes to reduce
- reduce
with immutable results and without decent data structures is just horrible. 😞
i find in JS that a closure over a mutable var + .forEach is usually more readable than a reduce
depends a bit on the reduce, and willingness to mutate the memo rather than returning a new value each time. A cheat’s reduce, really.
yeah, i often end up doing it with plain objects, so the mutate doesn’t return the new value
https://github.com/asciidoctor/asciidoctor-diagram supports mermaid. Neat.
ah, slight drawback to mermaid vs plantuml: Limited shape support. There's an open issue for it. But no activity for a while.
Behaviour of http://www.plantuml.com/plantuml/png/YtQCLT2rKt3YSWHHpW00 vs https://knsv.github.io/mermaid/live_editor/#/view/Z3JhcGggTFI7CiAgQSAtLT4gQgogIEEgLS0-IEM is quite telling though
https://github.com/knsv/mermaid/issues/274 if it had this, it would replace plantuml for me I think. I'll probably use it for ideas though.
to each their own…