This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-11-16
Channels
- # admin-announcements (9)
- # beginners (112)
- # boot (223)
- # cbus (10)
- # cider (19)
- # clara (2)
- # cljs-dev (81)
- # cljsjs (3)
- # cljsrn (45)
- # clojure (239)
- # clojure-conj (12)
- # clojure-poland (2)
- # clojure-russia (56)
- # clojure-taiwan (1)
- # clojurescript (57)
- # cursive (28)
- # datomic (5)
- # events (14)
- # immutant (1)
- # jobs (1)
- # ldnclj (8)
- # off-topic (28)
- # om (80)
- # onyx (121)
- # re-frame (10)
- # sneer-br (1)
- # spacemacs (40)
- # yada (44)
Heyo, I’ve been doing some Clojure work for awhile now…but I finally care to put some cljs into the loop here for the project…I’m a little curious if anyone has a resource (book, blog article, course, w/e) that goes into the routing flow for cljs/clj integration? Not sure I need core.async, but it may come up. Really I just need the ability to pass some datastructures to the client side code for display
I’ve done a bit of om in a course, and some react native even, I just need the “here is the routing, here is how you get data across” part, nothing else.
Hi @mj_langford ! CLJS stack is evolving fast. If you just start and know a bit of Om already, you might be interested in looking at Om Next https://github.com/omcljs/om/wiki/Quick-Start-(om.next)
It is well suited for React Native apparently
It looks like that’s not explicitly routing on the server side, but just manually mapping generated cljs to hand written html
Is this the normal strategy?
Am I just expecting a piece to be there that isn’t?
the om course I did was entirely client side, hence the disconnect about this connecting up portion
I think @dnolen doesn't want om next to handle or provide routing directly. But I guess there are already examples out there.
This could be asked in the #C06DT2YSY channel
Otherwise secretary or bidi might be interesting to look at for routing
I’m not asking about om, sorry if that was confusing, just expressing my experience level. I’m asking about routing to clojurescript. I’m using compojure to route to server side html right now
thank you, I will check into those, of course this is implemented in a random library ;D
bidi has a pretty table that also appears to list silk
as a clj/cljs router
@roelof: Hey, over here man
EOF is typically encountered in programming languages when you have reached the End Of File
this almost always happens when you have “unbalanced delimiters"
aka, more ( than )
or more [ than ]
so the computer keeps reading and reading and reading and reading waiting for the closing parenthesis
the way to prevent yourself from making this error is using something called “rainbow parenthesis” in whatever editor you are using
then the color shows when you messed up
so you see different colored parentheses when you type (((())))
they only thing I change it this piece (defn parse "Convert a CSV into rows of columns" [string] (map #(clojure.string/split % #",") (clojure.string/split string #"\r\n")))
can you pastebin it again so I can see it in my ide
just the code part, not the data
you can also add a snippet here if that’s easier
either one is fine ;D
(ns core-functions.core (:gen-class)) (def filename "suspects.csv") (slurp filename) (def vamp-keys [:name :glitter-index]) (defn str->int [str] (Integer. str)) (def conversions {:name identity :glitter-index str->int}) (defn convert [vamp-key value] ((get conversions vamp-key) value)) (defn parse "Convert a CSV into rows of columns" [string] (map #(clojure.string/split % #",") (clojure.string/split string #"\r\n"))) (defn mapify "Return a seq of maps like {:name \"Edward Cullen\" :glitter-index 10}" [rows] (map (fn [unmapped-row] (reduce (fn [row-map [vamp-key value]] (assoc row-map vamp-key (convert vamp-key value))) {} (map vector vamp-keys unmapped-row))) rows))
I think control enter on windows makes the snippet dialog come up
wait, do you have that data in the bottom of the file?
Or does the file end after line 38?
rows)) is line 38
is the file 38 lines long or 39?
generally speaking, you want one final blank line at the end of files fed to programming tools
this is because programming tools are often quite bad
it’s not user error, its crap tools
ooh, I undestand now
you had another thing there
@swizzard I don’t think Cftbat uses -> and ->>
Clojure for the Brave and True
@swizzard: have you see swiss arrows?
the diamond wand is my new favorite ;D
my list of “probably just include these by default” is pretty much limited to instaparse and clj-http, tbh
wait @roelof it’s not working?
thought you found the bug
okay, hit cmd enter, paste in everything you’re doing
everything that you need in the clj file
like @mj_langford said, programming tools are often dumb as hell
I seen it before that a old error message stays visible even after the culprit is found. I think I will have to find a better IDE then LT
There aren’t really IDEs as such for clojure
there are a lot of text editors with clojure support
cursive clojure is sorta here?
but it’s a whole lotta ide for sure ;D
the difference between ide and text editors is a wierd distinction, but this is the sort of thing that happens in editors, and not in IDEs
(as often)
I use vim and a repl in the command line
It is fine
You don’t have to build in LightTable, you can truly use it for editing, and compile at the command line
if you’re getting error messages that are confusing
Does anyone know if nightcode is still working?
It’s supposed to be a one stop shop targeted at beginners
Yeah, @roelof, this might be less headache inducing https://sekao.net/nightcode/
but sorry on the behalf of programmers, our tools have edges like razorblades
@binduwavell: can you share your docker file one more time. I do not get it to work properly. Still errors
(load-file “src/module/core.clj”)
I assumed he was doing it in the repl?
swizzard: just for clarity, I am sure you meant (require '[module.core])
- (:require '[module.core])
silently does nothing.
also, don't forget the optional :reload
argument
Hey guys i’m new using http-kit and compojure , i’m not sure how to get body from a POST request (not sure if this is the right channel)
saiberz: there is a ring middleware that will parse the post request body and give you a hash map, wrap-params