This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-01
Channels
- # aws (2)
- # aws-lambda (18)
- # beginners (68)
- # boot (6)
- # cider (2)
- # clara (2)
- # clojars (27)
- # clojure (68)
- # clojure-austin (5)
- # clojure-berlin (6)
- # clojure-dev (28)
- # clojure-greece (7)
- # clojure-italy (46)
- # clojure-japan (3)
- # clojure-nl (1)
- # clojure-russia (8)
- # clojure-sg (1)
- # clojure-spec (17)
- # clojure-uk (86)
- # clojurescript (82)
- # community-development (2)
- # cursive (18)
- # datomic (11)
- # duct (5)
- # fulcro (254)
- # garden (2)
- # graphql (6)
- # hoplon (19)
- # instaparse (4)
- # kekkonen (2)
- # leiningen (4)
- # luminus (3)
- # lumo (9)
- # off-topic (28)
- # om (7)
- # onyx (38)
- # other-languages (27)
- # portkey (7)
- # protorepl (1)
- # re-frame (56)
- # reagent (64)
- # ring (14)
- # ring-swagger (7)
- # shadow-cljs (255)
- # sql (2)
- # vim (11)
- # yada (10)
(def trick-or-treat-but-basically-treat {:witches 0 :wizards 0 :just-dressed-in-black 5 :princesses 7})
nihilism is the scariest costume @jasonbell
we didn't get any trick-or-treaters... hasn't caught on yet in the Netherlands apparently
my village was crawling with trick-or-treaters. some of the costumes were quite good
We went “guising” in Kinlochard (little village halfway between us and civilisation) with some of our kids’ school chums and a lot of very jovial parents. Was AWESOMES!
I’ve asked in #clojurescript but will ask here too… So I want to “de-render” a Reagent component, so that I can render another one in the same place / section on the page… Is there an obvious way to do that..? (This is day #2 of my cljs life, so please forgive me if I’m being numb)
de-render?
if I've understood you correct, reagent/react should take care of that for you
if your render function returns the new component instead of the old one
react will take care of removing from the dom
@maleghast you may find reading the React docs helpful: https://reactjs.org/docs/
@danieleneal - That’s an interesting idea; I will have a go at that…
@sundarj - I can see what you mean… Just a couple of pages and I am confronted with the suggestion that @danieleneal’s comment is dead on the money. Thanks chaps.
has anyone encountered an issue using namespace qualified vars in core.match?
ie. (match ... some-symbol ...)
is fine, but (match ... some-ns/some-symbol ...)
blows up with spec errors.
it’s easy enough to work around, but I just wondered…
oh - I think I see what I’m doing wrong
@danieleneal @sundarj - Just wanted to thank you both; your assistance has got me to where I wanted to be 🙂
New Question… I am using Reagent, and I want to write a little bit of clojurescript to monitor the DOM for <td> elements with a specific class attached to them and based on their “value” change them to an empty cell with a coloured background (I am “doing” traffic lights based on 1,0,-1 for green, amber, red). Am I thinking about this the wrong way around? Should I interpreting the data when I render the component and turning the number into a coloured cell at render?
yes you are exactly right
you should interpret the data when you render and choose the class
[:td {:class (if (< v 3) "red" "yellow")}]
kinda thing
@danieleneal - Excellent 🙂
@maleghast have a vector with the colours and use the number as the index? no need for an if
function I think
I want my module to reference the init function in my clojurescript file, but I am hitting the document order problem.
@thomas - It is, yes, but I want the status values to be -1,0,1 so that they have meaning in and of themselves
if you want it to be really self-documenting, why not :red
, :amber
, :green
?
@peterwestmacott that’s a perfectly good point - it might come to that
i.e. I am near the bottom of the file, but I want to invoke a function defined at the bottom and the compiler is giving me warnings…
(declare ...)
?
forward declarations
you can declare a var before you define it
just occasionally it is not possible to order everything straightforwardly
higher level languages like Java () handle this for you automatically
(though you can hit edge cases in Java with this where it breaks)
So if I do a (declare …) at the top of my cljs file for all the things that I am going to need “out of order” then I’ll have no more issues?
you will still have issues, but hopefully not with that
(ie. It won’t cause an immediate impeachment)
Quite so @peterwestmacott
Unless the reason you're declaring is because of functions which call each other, and you don't break out when you should and blow your stack 😉
if you haven’t blown the stack you haven’t lived
stacks are for losers, real wo|men use continuations
Does anyone know how to include a UTF-8 symbol in the string being passed into a Hiccup structure in Reagent? I want to use this down arrow code: ⬇
Doing this:
[:td (str "⬇ " (:percentage-shortfall chain) "% " "on expected supply")]
I want to throw a line-break in there as well, after the “%” as well if at all possible - I already figured out that I can’t simply concatenate in “<br />“… 😞
@maleghast i think you can \u
embed a unicode character directly in a string without using an entity
Thanks @mccraigmccraig - I will see if I can do that in my terminal Emacs…
So out of interest sake, would anyone south of London consider going to a Clojure / FP meetup in Horsham? https://www.meetup.com/Horsham-Functional-Programming/
(if it happens to be meeting next time I'm in the UK to visit family, I'd attend! 🙂 )
Curious if @mccraigmccraig and his minions would venture this far north 😉
maybe @yogidevbear, although i'm really bad at going to the brighton fp meetups and they are closer
I wrote a command line tool and made a binary with lein-bin
. Recently it has become necessary to stop the program with Ctrl-c
- despite sending it's final output.
@mattford I can’t think of anything specific (although it does sound familiar), but you could look at the java stack between final output and exit to see what’s going on though.
the last thing I now do is call this https://github.com/clojure/clojure/blob/ef00c7cffad10e6104d333f7f71a29163b06cd0a/src/clj/clojure/java/browse.clj#L66
@broquaint cheers I'll do that