#clojure log - Nov 08 2015

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:04 mus: http://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/

0:07 TEttinger: yeah, that's crazy stuff mus

0:07 I linked that earlier

0:07 it seems to need a specific port to be open

0:07 (for most of the apps they tested)

0:10 mus: I highly doubt its TCP port reliant. ;p

0:32 TEttinger: mus: well some of them mention that specific apps need a debug port to be available to send the payload in the first place

0:34 "The entry point is on TCP port 8880. This is a management port and unlikely to be exposed to the Internet, but if you can get on the same network as a WebSphere box, it’s game over."

0:34 so that's one blockade that sounds rather difficult for remote hackers

0:36 JBoss is totally vulnerable though, ouch

1:04 jonathanj: is there something like (comp) but only applies functions when the result is not nil?

1:04 i guess i want some-> that isn't a macro

1:23 TEttinger: ,(defn safe-comp [& fs] (fn [& args] (reduce #(let [r (%2 %1)] (if (nil? r) (reduced nil) r)) args fs)))

1:24 clojurebot: #'sandbox/safe-comp

1:24 TEttinger: ,((safe-comp seq count) "hello")

1:24 clojurebot: 1

1:24 TEttinger: ,(seq "hello")

1:24 clojurebot: (\h \e \l \l \o)

1:25 TEttinger: got it...

1:25 ,(defn safe-comp [& fs] (fn [& args] (reduce #(let [r (apply %2 %1)] (if (nil? r) (reduced nil) r)) args fs)))

1:25 clojurebot: #'sandbox/safe-comp

1:25 TEttinger: ,((safe-comp seq count) "hello")

1:25 clojurebot: #error {\n :cause "Wrong number of args (5) passed to: core/count"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (5) passed to: core/count"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 48]\n [clojure.lang.AFn applyToHelper "AFn.java" 171]\n [clojure.lang.AFn...

1:26 TEttinger: ,(defn safe-comp [& fs] (fn [& args] (reduce #(let [r (apply %2 %1)] (if (nil? r) (reduced nil) [r])) args fs)))

1:26 clojurebot: #'sandbox/safe-comp

1:26 TEttinger: ,((safe-comp seq count) "hello")

1:26 clojurebot: [5]

1:27 douglarek: ,(source safe-comp)

1:27 clojurebot: Source not found\n

1:27 TEttinger: ,(defn safe-comp [& fs] (fn [& args] (some-> (reduce #(let [r (apply %2 %1)] (if (nil? r) (reduced nil) [r])) args fs) first)))

1:27 clojurebot: #'sandbox/safe-comp

1:27 TEttinger: ,((safe-comp seq count) "hello")

1:27 clojurebot: 5

1:27 TEttinger: ,((safe-comp seq count) nil)

1:27 clojurebot: nil

1:30 jeaye: Any specter users know how to handle https://github.com/nathanmarz/specter/issues/36 ?

4:13 kwladyka: I am a little confuse about Resources folder. What will happen after compile code to jar file. Still it will looks files in Resources folder?

4:15 Also i need configuration file. https://github.com/sonian/carica looks good, but can i read data from there and use in jar file or only during compilation?

4:15 i am not sure how exactly it works

4:53 hibou: I', new to clojure, how can a remove all the number 2 in this data structure: {1 '(2) 3 '(4 2 1)}

4:53 ?

4:53 in a beautiful functional way

4:58 kwladyka: As i see reading conf file gives me value which i had during compilation. Not which i have now. How to use confid end file with ubarjar?

4:58 hibou, you have many options for that

4:59 hibou, try first with hints: this is map and you have to filter values of this map, all values are list

4:59 hibou, use this site often http://clojure.org/cheatsheet

5:00 hibou, you can use for example "filter" function to filter number 2

5:00 hibou, but be creative, try solve the same problem in different ways

5:01 hibou: kwladyka, yes of course that's the best way to learn

5:01 ;-)

5:01 may be assoc will help

5:10 TEttinger: (doc remove)

5:10 clojurebot: "([pred] [pred coll]); Returns a lazy sequence of the items in coll for which (pred item) returns false. pred must be free of side-effects. Returns a transducer when no collection is provided."

5:10 TEttinger: this is a good one to know, it's the counterpart to filter

5:10 sometimes the function name is the word you already used!

5:12 ,(reduce (fn [m [k v]] (put m k (remove #{2} v))) {} {1 '(2) 3 '(4 2 1)})

5:12 clojurebot: #error {\n :cause "Unable to resolve symbol: put in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: put in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: put in this conte...

5:12 TEttinger: ,(reduce (fn [m [k v]] (assoc m k (remove #{2} v))) {} {1 '(2) 3 '(4 2 1)})

5:12 clojurebot: {1 (), 3 (4 1)}

5:12 TEttinger: that uses a bunch of advanced clojure features, but it is what I'd consider a pretty short way to do it

5:15 that uses reduce, and reduce treats maps (with the {} braces) as seqs. so we're already using two key clojure data structures, and the quoted lists inside the map are for all intents and purposes identical to seqs. later we use a set, #{}, with 2 as its only element. sets can be used as functions that return true if given an argument in the set

5:15 and remove will remove things that the fn you provide it returns true for

5:16 there's also destructuring used, because you specified beautiful functional code and that definitely makes things more elegant :)

5:16 kwladyka: oh i see my problem is uberjar has all files, even resources inside...

5:19 hibou: Thanks TEttinger

5:19 TEttinger: there's definitely ways to make it better

5:21 I wanted to avoid using (into {} (map some-fn-or-something some-coll)) because even though it's usually faster but feels kinda like a hack to run map on a hash-map and get back something you need to convert (that's the best thing to do when not advertising clojure I guess)

5:34 hibou: TEttinger, can you explain the syntax of (remove #{key} v) ?

5:34 TEttinger: sure

5:34 hibou: I see that It removes the key in the sequence v

5:34 TEttinger: ,#{1 2 3}

5:34 clojurebot: #{1 3 2}

5:34 TEttinger: that's a set of 1, 2, and 3

5:34 sets are unordered hence the weird print order

5:35 ,(#{1 2 3} 1)

5:35 clojurebot: 1

5:35 hibou: ok

5:35 TEttinger: ,(#{1 2 3} 100)

5:35 clojurebot: nil

5:35 TEttinger: a set can be used as a function that returns a non-nil value if the argument you give it is present in the set

5:35 it returns nil if it isn't

5:35 so a set of one element can be used as an easy test for that element

5:36 ,(reduce (fn [m [k v]] (assoc m k (remove #{2 4} v))) {} {1 '(2) 3 '(4 2 1)})

5:36 clojurebot: {1 (), 3 (1)}

5:36 TEttinger: note how that removes 2 and 4 both

5:36 hibou: but the result of (remove #{key} v) is boolean then ?

5:37 TEttinger: the function, which in this case is also a set, is called on each element of v

5:37 it returns a seq of the elements that were not removed

5:38 ,(remove nil? '(1 2 3 nil 4 nil))

5:38 clojurebot: (1 2 3 4)

5:38 TEttinger: does that make it clearer?

5:38 hibou: yes it's all clear now

5:38 thanks TEttinger

5:38 TEttinger: cool!

5:38 glad to help

5:39 hibou: what i'm not used to is that a datastructure can be seen as function

5:39 TEttinger: I find it's interesting how with so many better resources available, people these days seem to be learning clojure faster than I did when I started

5:40 hibou: TEttinger, how long did you learn clojure or functional programming ?

5:40 did you use in your job ?

5:41 TEttinger: it took me a long time because I was skipping around between languages at the time

5:41 when I started using clojure on a "real" project (maintaining and adding features to an IRC bot written in clojure), I quickly started picking up stuff

5:42 hibou: nice

5:43 TEttinger, the remove documentation does not talk about this particular way, can you point me to the link explain this ?

5:44 http://clojuredocs.org/clojure.core/remove

5:44 TEttinger: it's specifically the behavior of sets, which I don't know where a good resource is

5:44 I'll take a look

5:45 hibou: the same behavior for filter

5:45 , (filter #{1} '(1 2 3))

5:45 clojurebot: (1)

5:46 TEttinger: heh, it's the very last thing on the page http://clojure.org/data_structures#Data Structures-Sets

5:46 so what it means by "Sets are functions of their members, using get:"

5:46 hibou: thanks TEttinger

5:46 TEttinger: is that if you use a set as a fn, it acts like you're calling the fn called get with that set as an argument

5:46 (doc get)

5:46 clojurebot: "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."

5:47 TEttinger: interesting behavior here, sometimes very useful: get can take a collection and a key to search for, but it can also take an additional arg that it returns if nothing is found

5:47 ,(#{1 2 3} 1)

5:47 clojurebot: 1

5:47 TEttinger: ,(#{1 2 3} 100)

5:47 clojurebot: nil

5:48 TEttinger: ,(#{1 2 3} 100 "it isn't there!")

5:48 clojurebot: #error {\n :cause "Wrong number of args (2) passed to: PersistentHashSet"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (2) passed to: PersistentHashSet"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 36]\n [sandbox$eval119 invokeStatic "NO_SOURCE_FILE" 0]\n [...

5:48 TEttinger: huh, I thought that would work

5:48 ,(get #{1 2 3} 100 "it isn't there!")

5:48 clojurebot: "it isn't there!"

5:48 TEttinger: so I guess it isn't exactly get, and it always needs 1 arg

5:48 I learned something new then!

5:51 hibou: ;-)

6:18 sandbags: When the leiningen docs say "Profiles specified in profiles.clj will override profiles in project.clj" I hadn't taken it to mean quite so literally as "a :profiles section in project.clj will be ignored"

6:19 is that expected? I wonder if I have some other problem at work

6:35 douglarek: sandbags: not only lein, IMO, local will always override global

6:36 sandbags: douglarek: from the docs though it seems that it should be overriding in an additive sense

6:36 i.e. not simply the presence of a profiles.clj means "ignore everying under profiles in project.clj"

6:37 otherwise how do you, as it suggests, keep dependencies in project.clj and overrides you don't want committed to version control in profiles.clj

6:43 Glenjamin: afaik all profile info is "overridden" according to the rules in https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#merging

6:52 sandbags: Glenjamin: but the rules for collections (e.g. :dependencies) is combine not replace

6:53 oh wait, i had read the exception about :plugins and :dependencies but maybe it doesn't mean what i think

6:54 is that specifically stating that :dependencies will be treated as replaced, rather than combined?

6:54 of course, I don't actually have a :depenendencies section in my profiles.clj

6:55 so there's nothing there that should even be replacing what is in project.clj

7:52 kwladyka_: How to read config file as uberjar? I am using sonian/carica but i don't see any possibility. It is matter of library what i use or i have to do something what i don't know?

7:56 mus: technomancy is heavily involved in all things.

8:01 noncom|3: kwladyka: that depends

8:01 kwladyka: noncom|3, can you explain? :)

8:02 noncom|3: kwladyka: i usually do (slurp (str (System/getProperty "user.dir") "/my-file-name.edn"))

8:02 kwladyka: I just want give user config file where he can set SMTP authorisation etc.

8:02 noncom|3: kwladyka: ^^

8:02 kwladyka: but... hmm and how you read this file?

8:02 is it possible to do that in sonian/carica?

8:03 i am not sure how to use that

8:03 noncom|3: hmm

8:03 kwladyka: i read that ok.. but i want use something what will make map from that file for me

8:03 or maybe slurp is enough?

8:03 i am not sure how to do that in right way :)

8:04 noncom|3: then (read-string (slurp ...))

8:05 this will give you a clojure map

8:05 you could also use edn/read-string and other stuff

8:05 there's also *read-eval* flag that says if your code that is being read, will be executed (can be a security issue)

8:06 kwladyka: so in other words... i can't use carica library?

8:07 noncom|3: kwladyka: https://github.com/sonian/carica/blob/master/src/carica/core.clj#L33

8:08 this indicates that carica simply looks for resources using the classloader

8:08 so you must set a classpath for your uberjar

8:08 or add a classloader for (System/getProperty "user.dir")

8:08 but probobly there's a simpler way

8:09 sorry, i never use anything but read-string with slurp

8:09 it works just ok for me

8:11 kwladyka: btw: https://github.com/sonian/carica/blob/master/src/carica/core.clj#L33

8:11 jeaye: I'm trying to compare two lists, though one of them is the lazy result of a map. I tried applying it to list, to realize it, but I get clojure.lang.PersistentList cannot be cast to java.lang.Comparable

8:12 noncom|3: jeaye: what is your code?

8:12 jeaye: and what you mean by "compare lists"?

8:12 i think you can compare them on a per-element basis

8:13 idk of any other general notion of list comparison, except maybe for length, but that's a different story

8:13 jeaye: noncom|3: http://dpaste.com/27JZ0FZ

8:13 noncom|3: Line 7

8:14 noncom|3: jeaye: so you compare types of elements?

8:15 jeaye: I'd like to compare per-element.

8:15 The lists are both, if I print them, (("string"))

8:15 noncom|3: so then why aren't you comparing them on a by-element basis?

8:16 with, say loop, reduce, for, or some other comprehension

8:17 jeaye: Well, I was expecting there to be a builtin function for per-element comparison.

8:17 kwladyka: noncom|3, hmm... come on... (read-string (slurp "./resources/config.edn")) is to easy and works... where is the catch? If it is so easy why carica exist?

8:17 jeaye: noncom|3: (doc compare) doesn't say exactly what it does for collection comparison, just "compares numbers and collections in a type-independent manner"

8:18 noncom|3: jeaye: you can start investigation here: https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L796

8:18 jeaye: idk, sorry, never used it

8:19 jeaye: but i would just do a per-element comparison myself

8:19 oddcully: kwladyka: you might need io/resource instead of slurp there

8:19 noncom|3: kwladyka: idk, well, there's the db interface and stuff. i once designed something similar to corica when i had a big project with various configs

8:20 jeaye: so quite possible is that carica is a spin-off of such a project too

8:20 kwladyka: oddcully, mmm? I want it load config file from uberjar.

8:20 noncom|3: kwladyka: that was to you ^^

8:20 kwladyka: you don't pack your config in uberjar

8:20 kwladyka: if you pack it - what's the point?

8:21 kwladyka: also you can look at carica source and get a sense of what's it doing. it's rather small btw, just 3 namespaces

8:21 kwladyka: noncom|3, mmm? But uberjar pack config file into jar file. It is not to change. Or it is?

8:22 noncom|3: kwladyka: i usually have a "config" folder near my jar

8:22 so that users can go there and change the edn files

8:22 but that's again a preferencfe

8:22 kwladyka: yes, i want do something similar. So slurp is the best solution?

8:22 with read-string

8:22 noncom|3: slurp or io/resource

8:23 well... best... hard to say

8:23 depends...

8:23 you should consider that someone may inject an executable code in your config

8:23 then you can rule it out with *read-eval*

8:23 and other stuff

8:23 just read some article on "reading edn files in clojure"

8:24 kwladyka: I didn't find anything what helped me. Can you recommend some article?

8:24 noncom|3, what is the difference between slurp and io/resources?

8:25 noncom|3, sorry if it is noob question but.. i am still learning :)

8:25 noncom|3: kwladyka: i'm not sure

8:25 i did not use io/resource much. probably there are some i,plications

8:26 kwladyka: oddcully, why io/resource instead of slurp? What is the difference?

8:41 oddcully: kwladyka: sorry i don't meant "instead", but you have to use both. this is for the case, your file there you are loading is part of your jar file

8:42 kwladyka: if you load it from filesystem, you are fine

8:47 kwladyka: oddcully, i want load it only from filesystem

8:48 thx noncom|3 and oddcully :)

9:18 phaseNi: Hello, how the hell can I unlearn OOP and learn to enjoy clojure? I am writing a daemon that connects to many sources of data with long running connections. There is tons of state that I need to keep track of. Everything I am writing turns out to look like objects somehow.

9:20 Glenjamin: objects are a reasonable way to model a connection, but the trick is that data from a connection can often be just data

9:20 kwladyka: phaseNi, hmmm watch Clojure Inside Out and do http://www.4clojure.com/

9:21 also you can watch http://www.purelyfunctional.tv/

9:22 and on the end do something really hard :) I did https://github.com/kwladyka/chess-challenge and it gives me extreme amount of change in my mind :)

9:23 that was my way

9:26 phaseNi: Would it be best to just have one atom that you update-in or have many atoms down the tree?

9:27 imanc: is there any way of getting closurescript to report if a file is missing, e.g. if this doesn't exist: :externs ["libs/box2d/box2d.ext.js"]

9:27 Glenjamin: i generally say start with one atom

9:28 phaseNi: thanks for the links kwladyka, btw

9:28 imanc: you mean at compile time?

9:29 imanc: phaseNi: Yeh, I'm having an absolute 'mare trying to get a google closure compatible js lib to work wtih clojurescript and it'd be nice if I could easily rule of if cljs has even managed to use the file

9:29 phaseNi: you could just look at the resulting js

9:30 dnolen: imanc: there's a #clojurescript channel btw

9:30 imanc: also if you have GC compatible lib you don't need externs

9:31 imanc: dnolen: ahh, I'll just #clojurescript.

9:31 dnolen: imanc: as far as why you can't do that it's due to the fact that lein-cljsbuild would break if we touch that.

9:32 no one as far as I know has fixed the issues in cljbuild, and then we could turn on externs validation

9:35 phaseNi: Are there any medium to large applications on github that would be a good example of how to properly track state? All I can find are webapps, which clearly have different needs

9:36 Deraen: phaseNi: For managing application state, check https://github.com/stuartsierra/component

9:40 phaseNi: ugh

9:40 so i have used component :0

9:40 its great for things that are actual components

9:41 but each long running connection cant be a component

9:43 Also at this point I should point out I am actually using cljs on node, and that debugging anything using defrecord there is a nightmare :P

9:45 So I stopped using component, but I am still developing similarly to using component

9:45 and this is where everything seems to be ojecty for me

9:49 dnolen: phaseNi: why is debugging defrecord any different in ClojureScript than Clojure?

9:50 phaseNi: dnolen: if something goes wrong in the methods, it doesn't give a stacktrace that points to where it happens

9:51 dnolen: phaseNi: you have to be more specific - what do you mean "it doesn't give a stacktrace"?

9:51 ClojureScript gives stacktraces to actual defrecord methods across many JS engines

9:51 clojurebot: Gabh mo leithscéal?

9:51 dnolen: Node.js isn't special

9:53 defrecord is just sugar over deftype ... if we couldn't get stacktraces ClojureScript developement would have taken a much long time. All the data structures are written with deftype.

9:53 s/long/longer

9:54 phaseNi: to answer your actual question - even in larger apps people manage state with an atom

9:55 that should definitely be sufficient for anything you might do with Node.js

10:04 phaseNi: dnolen: it may not have been defrecord then, maybe the way component is implemented. i recall the issue is documented somewhere

10:54 noncom|3: does clojure already provide an inbuilt nrepl client?

10:54 PMunch: Hmm, can anyone recommend a good read on functional programming? I've started learning Clojure and while I see some of it's strengths I'm sure there are a lot more that I'm missing. And what I feel are limits are probably strengths in a way.

10:54 noncom|3: i remember tehre were talks on that

10:55 PMunch: oh.. well..

10:57 PMunch: i guess you couple concepts of "clojure" and "functional programming"

10:57 PMunch: sure clojure favors functional programming, but also most power comes from that it is a lisp

10:58 PMunch: Hmm, noncom|3 s/functional programming/lisp then

10:58 noncom|3: PMunch: so here are really two things with clojure: 1) advantages of a LISP 2) advantages of FP

10:59 ah ok, the main advantage of LISP is homoiconicity

10:59 it is its only feature in reality

11:01 * together with the lambda calculus, ofcourse

11:04 PMunch: so, once again, i can recommend this blog post about why lisp: http://www.defmacro.org/ramblings/lisp-ducati.html

11:04 PMunch: this is a nice technical outlook: https://www.dropbox.com/home/book/programming?preview=LispImpHandout.pdf

11:08 PMunch: I'll be sure to check those out, thanks

11:13 noncom|3: PMunch: feel free to ask more and rise discussions in this channel, you're welcome

11:14 PMunch: Will do. Currently I'm working on an assignment but I'm very interested in Clojure so I'll probably be back when I actually have time

11:14 lodin_: noncom|3, PMunch: For me the functional part of Clojure is more important than having macros. That's not to say that having macros isn't important, but functional programming is that lowers complexity for me, not macros.

11:15 noncom|3: yeah, but homoiconicity is not only about macros

11:15 PMunch: lodin_, I haven't really done anything with macros yet

11:15 noncom|3: functional programming in lambda style is actually what it is

11:15 lodin_: PMunch: Nor will you need to, like, ever. ;-)

11:16 noncom|3: the need depends

11:21 Bronsa`: noncom|3: huh? homoiconicity is not only about macros?

11:21 what do you mean?

11:22 noncom|3: yeah, i mean that a program can write itself in the process of executuion

11:22 macros are a part of this functionality i think

11:22 and operate on code as on data

11:22 Bronsa`: macros are exactly that functionality

11:23 noncom|3: yeah, but this functionality is accissible not only by macros

11:23 Bronsa`: by what else

11:23 ?

11:23 noncom|3: buy runtime code changes?

11:23 *by

11:23 lodin_: noncom|3: You often use eval in your program?

11:23 Bronsa`: I'm not following

11:23 lodin_: *programs

11:24 noncom|3: Bronsa`: well i mean a program can be constructed in runtime by the program, without actually writing a macro (without using defmacro)

11:25 maybe that's a too philosophical thought...

11:25 lodin_: noncom|3: It's perfectly fine, if you pass it to eval, but do you actually do that?

11:26 noncom|3: it happens but not often

11:26 although eval is considerfed a bad style

11:26 lodin_: noncom|3: When you do end up using it?

11:26 noncom|3: but for a ns loader, for example, it's fine

11:26 like if i am writing a custom ns-management

11:27 like the clojures inbuilt one is not always the most comfortable one

11:27 dang`r`us: oy

11:28 lodin_: noncom|3: Is that code on github or something?

11:29 noncom|3: lodin_: sorry, no, it belongs to my employeers. there's nothing too interesting, just a namespace-specification system that has, for example, more robust and versatile DSL for requiring namespaces and stuff

11:29 in projects with over 100 namespaces, the default clojure ns system becomes a swamp

11:29 lodin_: Do you use this instead of the ns macro?

11:30 noncom|3: yes, instead of the ns macro

11:30 but not always

11:30 ns is allowed too

11:30 because it is natural

11:30 foreign libs are allowed to use ns

11:31 lodin_: noncom|3: What limitations of ns prompted this development?

11:31 noncom|3: lodin_: also eval is useful in repls, like nrepl, for example

11:32 lodin_: noncom|3: Of course eval is useful in r-EVAL-pls. :-)

11:32 noncom|3: That's about tooling though, not the program you're actually writing. Unless your business is tooling.

11:33 noncom|3: lodin_: limitations of ns: no templating, no notion of requiring library groups, and some others

11:33 lodin_: (That is, lots of languages have repls, without being homoiconic.)

11:33 noncom|3: if you need to require 100 namespaces in 100 other namespaces, you gonna end up with a letters-wall hell

11:34 Bronsa`: you can write a more powerful `ns` without needing eval

11:34 lodin_: noncom|3: You mean that if you have foo.x, foo.y, foo.z you want to be able to say something like 'foo.*' so that you now can do foo.x/whatever in your code.

11:35 noncom|3: Bronsa`: hmmm... yeah, probably. clojure provides all that is required for that without the need to resort to eval..

11:36 lodin_: not only that.. but that too

11:36 Bronsa`: if your last resort is using eval you're either doing something incredibly complex or something that you shouldn't be doing

11:37 lodin_: noncom|3: What else?

11:38 noncom|3: Bronsa`: yeah, well, that improved ns allowed to require namespaces that were out of the filesystem, like resolved through some protocol like HTTP or TCP where they come as a string

11:38 if you have a string, then idk any other way to make it alive without reading and evaling it

11:38 Bronsa`: noncom|3: that might fall into the former category then :)

11:39 lodin_: noncom|3: You don't need homoiconicity for that though. You just need eval.

11:40 noncom|3: lodin_: yeah, but you were asking that exact question - where i used eval

11:41 lodin_: noncom|3: And it seems like you use it for precisely the purpose it exists. :-)

11:42 noncom|3: lodin_: as for homoiconicity - consider an AI that must build lisp forms in runtime, for example, based on a genetic approach, verifying some hypothesis..

11:42 it has to manage code as well as data

14:07 skeuomorf: It's the damndest thing

14:08 At the REPL, whenever I try to use `(clojure.core.typed/cf 1)`, I get a `ClassNotFoundException clojure.core.cache.CacheProtocol`

14:09 and any subsequent calls to functions from the `clojure.core.typed` namespace fail saying "Exception There was previously an unrecoverable internal error while loading core.typed. Please restart your process"

14:13 justin_smith: skeuomorf: missing clojure.core.cache dep, or a version that lacks that protocol?

14:19 skeuomorf: justin_smith: I was under the impression that leiningen resolves deps automatically

14:19 justin_smith: And I am using the latest version according to the github repo

14:22 * skeuomorf will delete his deps and reinstall and see what's up

14:26 justin_smith: skeuomorf: leiningen managed declared deps. But sometimes a version conflict between two libs means you get a version that lacks a feature one of them needs. Or a badly written library fails to declare a dep (not having seen an error because apps are getting it from elsewhere)

14:27 deleting and reinstalling deps shouldn't do anything at all, but fixing your project to override some dep conflict decisions will likely fix it

14:27 'lein deps tree' will show any conflicts in your current project.clj

14:28 also plugins can interfere too

14:30 skeuomorf: justin_smith: `lein deps tree` doesn't output anything, so I am assuming there are no conflicts

14:30 justin_smith: sorry, it's lein deps :tree

14:32 skeuomorf: justin_smith: ahh, https://dpaste.de/tSKk

14:38 hibou: Hi, I really don't understand the question here https://www.4clojure.com/problem/10#prob-title

14:39 justin_smith: hibou: a hash-map can be a function, with the key as an argument, and a key can be a function, with a hash-map as the argument

14:39 it wants to know what you will get back if you make either of those calls

14:47 hibou: justin_smith, thanks I've solved this problem

14:47 favetelinguis: have i understand it right that i need a buffered channel in core async in order to use a transducer on that channel? is so why?

16:35 jonathanj: how do i convert a UUID from a string to a UUID instance?

16:35 the reader macro obviously doesn't work and i don't see anything in clj-uuid

16:35 guess i have to use java.util.UUID/fromString?

16:36 danlentz: Actually, there is also a wrapper in clj-uuid

16:37 jonathanj: i couldn't find it

16:37 there's str->uuid but it's not public

16:37 the clj-uuid tests themselves use UUID/fromString

16:38 danlentz: as-uuid is a method of the UUIDable protocol

16:40 https://github.com/danlentz/clj-uuid/blob/master/src/clj_uuid.clj#L702

16:40 jonathanj: ah right, thanks

16:40 sorry, i find the clj-uuid documentation quite confusing to understand

16:40 danlentz: Happy to listen if you have any suggestions

16:41 Is there anything in particular you're trying to do that you're having trouble with?

16:42 jonathanj: it's mostly just that it's not clear (without reading the code) what types are being extended with which protocols

16:43 so it's a little tricky to figure out what you can and can't call methods on

16:43 danlentz: That's fair

16:46 I will give that some thought, thanks for the feedback. It's always helpful. Feel free to open an issue on the github repo if there are any other stumbling blocks you run into.

16:47 jonathanj: danlentz: mostly i'm really happy with clj-uuid

16:48 danlentz: so thanks for writing and maintaining it :)

16:48 apart from the issue i filed last week, which i see you've assigned

16:49 danlentz: It's really rewarding that people find it useful

16:57 jonathanj: good catch regarding that missing protocol method. I'm traveling/onsite this week, but will try to roll that into a new release once in the near future

16:58 a new release in the near future once I return (sorry, all thumbs on iPad)

17:18 Schrostfutz_: Is there a nice way to get a statement like this: (< x y z) nil-proofed? So that if one of the numbers in nil it just is ignored?

17:29 oddcully: apply and remove nil? as the blunt way

18:20 Malnormalulo: Does anyone have any experience getting Eclipse to work with Leiningen via Counterclockwise?

18:22 It doesn't seem to want to build correctly

19:46 justin_smith: Malnormalulo: cursive for idea is a lot more mature, and more actively developed

19:47 Malnormalulo: I'm unfortunately locked in to Eclipse for now for reasons of company culture. But I've found a nice tutorial on using Maven instead, which will be easier to work into our existing practices anyway.

19:50 CharlesN: Malnormalulo cursive for idea will be a commercial product, with pricing to be released soon I don't know how soon.

19:51 cfleming: CharlesN: Today probably :)

19:52 rhg135: That's unfortunate, it's hard to justify it, unless employed and earning money

19:52 cfleming: Short answer: $199 for company licences, $99 for individual devs, free licence for non-commercial (OSS, personal hacking, students, ClojureBridge etc).

19:52 rhg135: ^^

19:53 rhg135: That's actually quite cheap for me, nice

19:53 CharlesN: cfleming source code will be available ?

19:53 rhg135: I assumed it'd be a lot more

19:53 cfleming: rhg135: So it'll be free until you can justify it, at which point I hope everyone will.

19:55 rhg135: That's actually a very good scheme. If you need commercial use, you can hopefully pay it.

19:56 cfleming: CharlesN: No, or at least not initially, and probably never all of it.

19:57 CharlesN: There will be an extension API, which Cursive uses internally right now, and the current implementations of the API will be open sourced as examples of how to use it. So that's perhaps half the code in Cursive at the moment (totally made up figure, I haven't actually checked)

19:57 rhg135: That's what JetBrains used to charge for PyCharm before they switched to subscription pricing.

19:57 rhg135: I'm assuming you will not need confirmation for the OSS license?

19:59 Because it'd be annoying to have to go through "paperwork" to use it for OSS

20:00 I never did use PyCharm, although I did use python

20:04 cfleming: I'd like to charge more because I'm not sure this price will be sustainable, but I'll have to see how it goes. Hopefully the fact that it's relatively cheap will mean that people don't mind paying for it.

20:04 rhg135: No, the free licence will just be a trust model. I guess some people will take advantage of it, but I hope not too many.

20:04 rhg135: The only thing will be that the free licence will probably expire after 6 months, so you'll just have to renew it then. That will hopefully prompt people to pay if they've started using it for commercial work in the meantime.

20:04 But renewing will just be go to the website and get a new one.

20:08 TEttinger: yay cfleming

20:08 hooray helping OSS

20:09 if I ever make commercial software in clojure I'll buy cursive in a flash

20:11 cfleming: TEttinger: :)

20:12 TEttinger: I'll be rooting for you to get a Clojure job then

20:13 TEttinger: going for day 513 of my github commit streak. what would happen to my open source commit streak if I get a job though? haha

20:14 cfleming: Just create a bot which updates a readme randomly each day, if you haven't submitted anything that day.

20:15 justin_smith: haha

20:27 rhg135: cfleming: that sounds great, I have no interest in being someone's slave, but not all jobs are that, so I'm glad that till then I can keep using it

20:27 then I can coerce my employer :P

20:29 I currently have to launch my browser anyway so renewing isn't bad

21:09 cfleming: Here's the gospel on the Cursive pricing and licencing: https://cursiveclojure.com/archive/1564.html

22:19 wxl: so let's say i wanted to use clj-time to quickly do some date/time calculations on the REPL. is there an easy way to add the lib without making a lein project?

22:23 justin_smith: wxl: if you have pallet/alembic in your profiles.clj it's pretty easy to use that to try out other deps

22:32 rvxi: hello

22:56 AjaxCrixum: is SICP a good book? i here that it teaches programming (not scheme; just uses that)? have any of you clojure programmers read this seemingly programming-enhancing book to see if it's legit or just hype?

22:57 mungojelly: AjaxCrixum: yeah SICP is awesome, there's good videos too

23:00 sotojuan: i just started chapter 2 of it

23:00 awesome so far

23:00 learning more than i did in college

23:00 AjaxCrixum: like, what does it instill in you?

23:00 owlbird: only read first 3 chapters, fail to continue..

23:00 AjaxCrixum: compsci knowledge in general? programming skills? knowledge of systems?

23:01 justin_smith: AjaxCrixum: it's an excellent book on programming, and systems design

23:01 mungojelly: it's very abstract, it teaches you what a programming language is made of

23:04 sotojuan: It's essentially a book on computing: Abstractions with functions, Data Abstractions, handling state, etc

23:04 I would it pretty practical actaally

23:04 justin_smith: in conclusion, SICP is a book of contrasts

23:05 AjaxCrixum: it doesn't seem too pragmatic, but rather theoretical; is that good or bad?

23:06 sotojuan: It's not pragmatic in the sense of "learn to program in X days!!!" but what it teaches you'll find useful, especially in Clj since its a Lisp like Scheme

23:07 I'd recommend it after you have been programming or doing "pragmatic" things for some time :p

23:13 owlbird: I prefer ACL, On Lisp, Land of lisp :-P

Logging service provided by n01se.net