This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-28
Channels
- # aatree (3)
- # alda (8)
- # avi (21)
- # beginners (37)
- # boot (193)
- # cbus (1)
- # cider (29)
- # cljs-dev (8)
- # cljsjs (3)
- # cljsrn (20)
- # clojure (76)
- # clojure-dev (13)
- # clojure-miami (20)
- # clojure-portugal (2)
- # clojure-russia (220)
- # clojure-sg (2)
- # clojurebridge (5)
- # clojurescript (94)
- # community-development (14)
- # conf-proposals (110)
- # core-async (12)
- # cursive (12)
- # datascript (6)
- # datomic (14)
- # dirac (72)
- # emacs (49)
- # hoplon (86)
- # jobs (33)
- # jobs-discuss (1)
- # ldnclj (6)
- # lein-figwheel (1)
- # off-topic (56)
- # om (139)
- # onyx (29)
- # pedestal (17)
- # proton (23)
- # re-frame (45)
- # reagent (35)
- # ring-swagger (4)
- # test-check (1)
- # testing (8)
- # yada (11)
stop lurking, @christianromney
@sstawecki: I found this resource helpful: https://yobriefca.se/blog/2014/05/19/the-weird-and-wonderful-characters-of-clojure/
Reducer implementations are primarily functional - no iterators Can someone help me explaining how functional is different from iterators in this context ? Is it still iterator in the end after all ?
Hi guys, a nube question: getting CompilerException java.lang.NullPointerException, compiling:(form-init6123271814648428847.clj:1:10) That happens even when I have a try - catch - the catch does not … catch it. Any ideas?
@mpisanko: looking at the trace that you got the problem happens compiling, not running the program
so you might have something that its overriding a clojure core function or a similar problem
Is there a Clojure (or Java) function to check if a number is a valid char
?
I'm parsing some binary input and i get java.lang.IllegalArgumentException: Value out of range for char: -126
I'd like to first check (every? valid-char? input)
, but I need a valid-char?
function.
Looks like I'm going to have to use something like that, yeah. Thanks @dm3
Hi. Where I can find info on foo#
forms, used in macros?
@andrewboltachev: those are auto gensyms - see http://clojure.org/reference/reader#__a_id_syntax_quote_a_syntax_quote_note_the_backquote_character_unquote_and_unquote_splicing
they will generate a new unique symbol that can be used throughout a ` form
@alexmiller: Thanks, did found already. Weren't easiest to google about
hi people, calling: (= 0 (.indexOf "hello world" "h"))
we are calling the indexOf from the Java class String, but how does clojure know the method from String instead of any other class?
anyone know of some collapse & expand edn editor thing that's online?
@jethroksy: thanks. Ok but at least in java you need to specify the class: String.indexOf(....)
in clojure, calling only .indexOf(...)
how does it knows I want to call .indexOf from the String class
@jethroksy: Java could have any other class with an indexOf method.
@jethroksy: when do you say instance, do you mean instance of the args passed to the indexOf?
in the case of (.indexOf "hello world" "h")
, "hello world"
is your instance and "h"
is your args
"technically "hello world" and "h" are both args" ... yes i thought it
awesome
@jethroksy: thank you very much. It is clear now
@jethroksy: I'm a "advanced beginner", but you was really helpful. For sure I'm going to read that documentation. Thank you so much
@renan.reis - it's either reflection or - if the argument is sufficiently type-hinted - cast + method call, IIRC.
So (.indexOf haystack "needle")
will be called through reflection and (.indexOf ^String haystack "needle")
will be called through cast + method call.
@jaen: tnaks
thanks*
http://blog.cognitect.com/blog/2016/1/28/state-of-clojure-2015-survey-results
now that is a big logo
I think my favourite part of the entire survey is how few people thought we had an "Unpleasant Community" - really nice to see how generally positive the answers were. Great job on writing up the survey.
Yeah, there's about one thing that I feel is specifically unpleasant about the community; on the whole it's really cool.
in the general case this would use java reflexion to determine that “hello” is a string
but in this instance, it’s a String litteral
I think “hello”.indexOf()
would work in Java too
huh, looks like I’m lagging
I have a library which specifies clojure dependency as [org.clojure/clojure "1.8.0" :scope "provided”] (via lein’s project.clj)
Also I have specified :main dirac.agent-cli
because it included a command-line client.
When doing lein deploy clojars
(or lein jar
) the generated jar was AOTed and included all dependencies, except clojure (I assume because of the :scope “provided”).
A consumer of my library included it into a project with [org.clojure/clojure “1.7.0”] dependency and ended up with really puzzling errors complaining java.lang.NoClassDefFoundError: clojure/lang/Tuple
in files in some dependencies of my library.
I was able to fix it by removing :main and producing source-only jar. I assume this mess was caused by AOTing sources of my library (along with all its non-scope-provided dependencies against clojure 1.8.0). When those AOT-compiled files get linked against Clojure 1.7.0 it breaks in unexpected ways.
Is this theory correct? What could I do in case I really needed/wanted to AOT files to provide better user experience for consumers of my library? A warning or user-friendly error would help a lot in this case. I have almost zero java experience, so please forgive if this is a trivial java-knowledge. Thanks.
@darwin: it's a little hard to tell exactly what you're running into. in general a library should only be producing a jar that contains the library itself (and not dependencies), which is a recipe for version conflicts in almost every case.
Unfortunately with AOT being transitive it is all too easy to build a library jar with AOT'ed dependency files - this is often a source of tricky problems.
I have dealt with this in a variety of ways - usually some kind of post-filtering on the jar
CLJ-322 is the issue tracking this problem and it's something I would really like to make progress on this year. there are a bunch of approaches that have been proposed but they all have tradeoffs. those really need to be better analyzed, especially in the context of current tooling scenarios. Many of them will also require some amount of tool cooperation, since it's usually external tools like lein or boot that are coordinating the compilation and packaging.
(defn ssh-worker [in] (go-loop [] ( let [[name ip] (<! in) {out :out err :err} (ssh/ssh ip command )] (println name out err) ) (recur) ))
sure does, by default https://clojure.github.io/core.async/index.html#clojure.core.async/onto-chan
@alexmiller: thanks for the explanation, I will keep an eye on jar size should this happen again
@goodfornothing - it was at runtime. however the problem was the null pointer - in a totally different place… with this weird message. will know for next time
If anyone has used clj-thrust ( https://github.com/solicode/clj-thrust ), if I occasionally want to open an extra window, must is share the same process or can the new window start its own process?