This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-14
Channels
- # adventofcode (20)
- # arachne (11)
- # beginners (53)
- # boot (342)
- # cider (54)
- # cljs-dev (39)
- # cljsrn (4)
- # clojure (78)
- # clojure-brasil (2)
- # clojure-italy (5)
- # clojure-nl (4)
- # clojure-quebec (1)
- # clojure-russia (90)
- # clojure-sanfrancisco (4)
- # clojure-spec (55)
- # clojure-uk (27)
- # clojurescript (170)
- # core-async (1)
- # core-logic (1)
- # css (1)
- # cursive (8)
- # datomic (83)
- # dirac (5)
- # hoplon (24)
- # lambdaisland (1)
- # lein-figwheel (23)
- # midje (2)
- # off-topic (1)
- # om (4)
- # om-next (7)
- # onyx (74)
- # proton (1)
- # protorepl (22)
- # rdf (2)
- # re-frame (105)
- # reagent (15)
- # ring-swagger (3)
- # rum (4)
- # slack-help (17)
- # spacemacs (14)
- # untangled (62)
- # vim (4)
- # yada (18)
@roelofw another way of keeping the solutions and their test cases would be to have a (lein) project of them with the solutions in the src
namespaces and the tests in the test
namespaces written as clojure.test assertions. i.e. (deftest check-solution1 (is (= .....)) ...)
@agile_geek I did it already with a let . See https://github.com/rwobben/4clojure
@ashnur sounds like you need http://clojure.org/reference/namespaces
@pawel.kapala thanks, i got help in #clojurescript since then š
hello im scheduling a task using schejulure, however as it returns a future , my application returns the future and quits how can i get my application to wait indefinitely?
@gregnwosu A normal future
will wait until the tasks are finished. The lib you use doesn't use them. I looks like you can't use that library for that kind of behaviour
it must work somehow , theres no point in a scheduling library that returns a future and exits
@gregnwosu @(promise)
blocks the current thread forever.
That library operates independently of the lifetime of the main thread. It doesn't concern itself with the complex daemon/non-daemon split. There is defining behaviour for this somewhere in the JVM
can you say that again , perhaps in simpler language for less intelligent people such as myself
The JVM is a bit confusing in how it does threads. The search term you need is about daemon threads
vs non-daemon threads
, stack overflow probably has a good discussion on the two
@val_waeselynck thank you. iāll have a look soon
Hello all, I have to confess, I'm reduce addicted. I left map, doseq or other thing to process map, array or something else. What is the impact using reduce instead of map or doseq?
reduce
is eager, while map
is lazy
reduce
returns a result, while doseq
is for side effects only
When Iām not sure the right seq traversing form to use, Iāll reach for reduce
or reduce-kv
first
ĀÆ\(ć)/ĀÆ
Depends on if you want laziness or not
The reduce
forms are a good first stop, though nowadays applying a transducer might be better. Reducers might be a good next step if your fold doesnāt care about order.
For a Ring app, I had the following ns declaration: `(ns ring-app.core (:require [ring.adapter.jetty :as jetty] [ring.util.http-response :as response] [ring.middleware.reload :refer [wrap-reload]] [ring.middleware.format :refer [wrap-restful-format]]))`
Nevermind, I needed to restart the application with lein run
to get it working properly.
@gdeer81 , thanks š The Web Dev with Clojure book adds dependencies to many projects incrementally to teach different web dev techniques, so I'll probably be using lein run
and cider-restart
a few more times...
@mlev yeah my issue was kind of weird because I added ring mock to my dependencies so I could write my tests and when I refreshed my browser it was complaining it couldn't find ring mock. I was like "okay my main app doesn't use mocks but I'll go ahead and restart my server and see if that fixes it" and of course it did
@gdeer81 I guess you know if you're using leiningen you can just add your test dependencies to the :dev
profile and therefore not have them on the main app's classpath?
@agile_geek I swear that's what I did. :profiles {:dev {:dependencies [[ring/ring-mock "0.3.0"]]}}
Also if you are using CIDER and clj-refactor (which I think comes bundled with latest versions of CIDER) you can hot reload dependencies into a running server
the good thing about my dicey workflow is that it breaks around the time I need to step away from the computer anyway.
Design opinion request: Jack and Jill have a collection of maps and they want to give them to you. You want to remember the source so do you give Jack and Jill a key in your map or store their maps in a list with the keywords changed to name/keyword?
Does it have to do with the fact that the CIDER repl is not defaulting to the APPNAME.core>
prompt, so perhaps its in the wrong namespace?
Curiously, though, it does produce "Hello, World" when I put (selmer.parser/render "Hello, {{name}}" {:name "World"})
in the repl...
In case anyone is interested, it turns out it was a namespace issue: With @dpsutton 's help, I ran the following from within the APPNAME.core.clj file: C-u C-c M-z
and it autoloaded the correct namespace into the repl. Then running (selmer/render "Hello, {{name}}" {:name "World"})
from the repl worked perfectly.