This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-14
Channels
- # admin-announcements (17)
- # announcements (4)
- # beginners (47)
- # boot (347)
- # braid-chat (55)
- # bristol-clojurians (5)
- # cider (5)
- # cljs-dev (1)
- # clojure (111)
- # clojure-chicago (1)
- # clojure-russia (73)
- # clojure-ukraine (2)
- # clojurescript (162)
- # code-reviews (1)
- # community-development (199)
- # core-matrix (2)
- # cursive (29)
- # datomic (40)
- # devcards (13)
- # dirac (37)
- # docs (12)
- # editors-rus (2)
- # emacs (11)
- # events (26)
- # hoplon (2)
- # jobs (8)
- # ldnclj (31)
- # lein-figwheel (2)
- # off-topic (7)
- # om (59)
- # other-lisps (1)
- # portland-or (1)
- # proton (50)
- # re-frame (5)
- # reagent (13)
- # ring-swagger (5)
- # spacemacs (3)
- # yada (3)
I'm trying to run my web application on Immutant with a context for example /context
but I'm not sure how to change my routes so that it will be reached at /context
instead of hitting my Not Found handler
Uncaught Error: Assert failed: Invalid Hiccup form: [nil] (in helper_module.core.current_page) (valid-tag? tag)
...I don't get this problem if I run at ROOT context -_-
OK, I guess it's not really a route problem.
maybe...
Seriously, how come it works in path: "/"
but if I change it to path: "/context"
it breaks
Hey all. Beginner here with a JS/frontend background. Getting my head around ClojureScript with Mike Walker's Koans, and will build something with FigWheel after. I'd appreciate any additional resources or suggestions.Thanks!
I've converted raw html into the hickory format and have three functions to extract data from it: select-title, select-link, select-description
Now I would like to do some kind of mega-map wherein (map [select-title select-link select-description] hickory-html)
welcome @iae. to what use do you intend to put the title, link and description data extracted from html?
Just console output, it's an exercise from rosetta code to display the first ten search results from yahoo
So ideally one entry would be a vector of ["New Tomorrow (IMDB)" "
I have a working solution to let
with three separate lists, one for titles, links, and so forth
sure- so it sounds like you have a collection of results, onto each of which you want to apply a collection of functions
yes- instead of open coding the repeated extraction of a specific piece of data from the list 3 times, you want to capture that operation in a functional way as well
so you'll want to have 2 layers- one that goes through each result, and for each result, runs each of a list of functions
could approach it like this- (defn extract-results [results extractors] ...) where extractors is [select-title select-link select-description]
and use 2 for loops
(for [r results] (for [e extractors] (e r))
can use map as well, though one of your collections is a collection of functions, so the semantics are the opposite of what you want- map applies a single function to each element in a collection, not multiple functions to a single piece of data.
Oh yeah, I forget that Clojure has for as well! My first thought was to map-map it sorta with (map #(into [] [(select-title %) (select-description %) (select-link %)])
Thanks for the tip! I think I was too focused on getting all the functions through in one layer
great! glad you posted
is anyone in here working on 4clojure problems? i figured out on by experimentation / guess check and don’t feel comfortable with my understanding of why the solution works
I could see how mapcat
could be useful, perhaps actually even elegant for that problem.
my original approach was to just iterate concat across the coll to create a lazy seq and just take n