#clojure logs

2015-11-08

00:04mushttp://foxglovesecurity.com/2015/11/06/what-do-weblogic-websphere-jboss-jenkins-opennms-and-your-application-have-in-common-this-vulnerability/
00:07TEttingeryeah, that's crazy stuff mus
00:07TEttingerI linked that earlier
00:07TEttingerit seems to need a specific port to be open
00:07TEttinger(for most of the apps they tested)
00:10musI highly doubt its TCP port reliant. ;p
00:32TEttingermus: well some of them mention that specific apps need a debug port to be available to send the payload in the first place
00:34TEttinger"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."
00:34TEttingerso that's one blockade that sounds rather difficult for remote hackers
00:36TEttingerJBoss is totally vulnerable though, ouch
01:04jonathanjis there something like (comp) but only applies functions when the result is not nil?
01:04jonathanji guess i want some-> that isn't a macro
01:23TEttinger,(defn safe-comp [& fs] (fn [& args] (reduce #(let [r (%2 %1)] (if (nil? r) (reduced nil) r)) args fs)))
01:24clojurebot#'sandbox/safe-comp
01:24TEttinger,((safe-comp seq count) "hello")
01:24clojurebot1
01:24TEttinger,(seq "hello")
01:24clojurebot(\h \e \l \l \o)
01:25TEttingergot it...
01:25TEttinger,(defn safe-comp [& fs] (fn [& args] (reduce #(let [r (apply %2 %1)] (if (nil? r) (reduced nil) r)) args fs)))
01:25clojurebot#'sandbox/safe-comp
01:25TEttinger,((safe-comp seq count) "hello")
01:25clojurebot#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...
01:26TEttinger,(defn safe-comp [& fs] (fn [& args] (reduce #(let [r (apply %2 %1)] (if (nil? r) (reduced nil) [r])) args fs)))
01:26clojurebot#'sandbox/safe-comp
01:26TEttinger,((safe-comp seq count) "hello")
01:26clojurebot[5]
01:27douglarek,(source safe-comp)
01:27clojurebotSource not found\n
01:27TEttinger,(defn safe-comp [& fs] (fn [& args] (some-> (reduce #(let [r (apply %2 %1)] (if (nil? r) (reduced nil) [r])) args fs) first)))
01:27clojurebot#'sandbox/safe-comp
01:27TEttinger,((safe-comp seq count) "hello")
01:27clojurebot5
01:27TEttinger,((safe-comp seq count) nil)
01:27clojurebotnil
01:30jeayeAny specter users know how to handle https://github.com/nathanmarz/specter/issues/36 ?
04:13kwladykaI am a little confuse about Resources folder. What will happen after compile code to jar file. Still it will looks files in Resources folder?
04:15kwladykaAlso 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?
04:15kwladykai am not sure how exactly it works
04:53hibouI', new to clojure, how can a remove all the number 2 in this data structure: {1 '(2) 3 '(4 2 1)}
04:53hibou?
04:53hibouin a beautiful functional way
04:58kwladykaAs 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?
04:58kwladykahibou, you have many options for that
04:59kwladykahibou, try first with hints: this is map and you have to filter values of this map, all values are list
04:59kwladykahibou, use this site often http://clojure.org/cheatsheet
05:00kwladykahibou, you can use for example "filter" function to filter number 2
05:00kwladykahibou, but be creative, try solve the same problem in different ways
05:01hiboukwladyka, yes of course that's the best way to learn
05:01hibou;-)
05:01hiboumay be assoc will help
05:10TEttinger(doc remove)
05:10clojurebot"([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."
05:10TEttingerthis is a good one to know, it's the counterpart to filter
05:10TEttingersometimes the function name is the word you already used!
05:12TEttinger,(reduce (fn [m [k v]] (put m k (remove #{2} v))) {} {1 '(2) 3 '(4 2 1)})
05:12clojurebot#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...
05:12TEttinger,(reduce (fn [m [k v]] (assoc m k (remove #{2} v))) {} {1 '(2) 3 '(4 2 1)})
05:12clojurebot{1 (), 3 (4 1)}
05:12TEttingerthat uses a bunch of advanced clojure features, but it is what I'd consider a pretty short way to do it
05:15TEttingerthat 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
05:15TEttingerand remove will remove things that the fn you provide it returns true for
05:16TEttingerthere's also destructuring used, because you specified beautiful functional code and that definitely makes things more elegant :)
05:16kwladykaoh i see my problem is uberjar has all files, even resources inside...
05:19hibouThanks TEttinger
05:19TEttingerthere's definitely ways to make it better
05:21TEttingerI 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)
05:34hibouTEttinger, can you explain the syntax of (remove #{key} v) ?
05:34TEttingersure
05:34hibouI see that It removes the key in the sequence v
05:34TEttinger,#{1 2 3}
05:34clojurebot#{1 3 2}
05:34TEttingerthat's a set of 1, 2, and 3
05:34TEttingersets are unordered hence the weird print order
05:35TEttinger,(#{1 2 3} 1)
05:35clojurebot1
05:35hibouok
05:35TEttinger,(#{1 2 3} 100)
05:35clojurebotnil
05:35TEttingera set can be used as a function that returns a non-nil value if the argument you give it is present in the set
05:35TEttingerit returns nil if it isn't
05:35TEttingerso a set of one element can be used as an easy test for that element
05:36TEttinger,(reduce (fn [m [k v]] (assoc m k (remove #{2 4} v))) {} {1 '(2) 3 '(4 2 1)})
05:36clojurebot{1 (), 3 (1)}
05:36TEttingernote how that removes 2 and 4 both
05:36hiboubut the result of (remove #{key} v) is boolean then ?
05:37TEttingerthe function, which in this case is also a set, is called on each element of v
05:37TEttingerit returns a seq of the elements that were not removed
05:38TEttinger,(remove nil? '(1 2 3 nil 4 nil))
05:38clojurebot(1 2 3 4)
05:38TEttingerdoes that make it clearer?
05:38hibouyes it's all clear now
05:38hibouthanks TEttinger
05:38TEttingercool!
05:38TEttingerglad to help
05:39hibouwhat i'm not used to is that a datastructure can be seen as function
05:39TEttingerI 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
05:40hibouTEttinger, how long did you learn clojure or functional programming ?
05:40hiboudid you use in your job ?
05:41TEttingerit took me a long time because I was skipping around between languages at the time
05:41TEttingerwhen 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
05:42hibounice
05:43hibouTEttinger, the remove documentation does not talk about this particular way, can you point me to the link explain this ?
05:44hibouhttp://clojuredocs.org/clojure.core/remove
05:44TEttingerit's specifically the behavior of sets, which I don't know where a good resource is
05:44TEttingerI'll take a look
05:45hibouthe same behavior for filter
05:45hibou, (filter #{1} '(1 2 3))
05:45clojurebot(1)
05:46TEttingerheh, it's the very last thing on the page http://clojure.org/data_structures#Data Structures-Sets
05:46TEttingerso what it means by "Sets are functions of their members, using get:"
05:46hibouthanks TEttinger
05:46TEttingeris 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
05:46TEttinger(doc get)
05:46clojurebot"([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
05:47TEttingerinteresting 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
05:47TEttinger,(#{1 2 3} 1)
05:47clojurebot1
05:47TEttinger,(#{1 2 3} 100)
05:47clojurebotnil
05:48TEttinger,(#{1 2 3} 100 "it isn't there!")
05:48clojurebot#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 [...
05:48TEttingerhuh, I thought that would work
05:48TEttinger,(get #{1 2 3} 100 "it isn't there!")
05:48clojurebot"it isn't there!"
05:48TEttingerso I guess it isn't exactly get, and it always needs 1 arg
05:48TEttingerI learned something new then!
05:51hibou;-)
06:18sandbagsWhen 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"
06:19sandbagsis that expected? I wonder if I have some other problem at work
06:35douglareksandbags: not only lein, IMO, local will always override global
06:36sandbagsdouglarek: from the docs though it seems that it should be overriding in an additive sense
06:36sandbagsi.e. not simply the presence of a profiles.clj means "ignore everying under profiles in project.clj"
06:37sandbagsotherwise how do you, as it suggests, keep dependencies in project.clj and overrides you don't want committed to version control in profiles.clj
06:43Glenjaminafaik all profile info is "overridden" according to the rules in https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md#merging
06:52sandbagsGlenjamin: but the rules for collections (e.g. :dependencies) is combine not replace
06:53sandbagsoh wait, i had read the exception about :plugins and :dependencies but maybe it doesn't mean what i think
06:54sandbagsis that specifically stating that :dependencies will be treated as replaced, rather than combined?
06:54sandbagsof course, I don't actually have a :depenendencies section in my profiles.clj
06:55sandbagsso there's nothing there that should even be replacing what is in project.clj
07:52kwladyka_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?
07:56mustechnomancy is heavily involved in all things.
08:01noncom|3kwladyka: that depends
08:01kwladykanoncom|3, can you explain? :)
08:02noncom|3kwladyka: i usually do (slurp (str (System/getProperty "user.dir") "/my-file-name.edn"))
08:02kwladykaI just want give user config file where he can set SMTP authorisation etc.
08:02noncom|3kwladyka: ^^
08:02kwladykabut... hmm and how you read this file?
08:02kwladykais it possible to do that in sonian/carica?
08:03kwladykai am not sure how to use that
08:03noncom|3hmm
08:03kwladykai read that ok.. but i want use something what will make map from that file for me
08:03kwladykaor maybe slurp is enough?
08:03kwladykai am not sure how to do that in right way :)
08:04noncom|3then (read-string (slurp ...))
08:05noncom|3this will give you a clojure map
08:05noncom|3you could also use edn/read-string and other stuff
08:05noncom|3there's also *read-eval* flag that says if your code that is being read, will be executed (can be a security issue)
08:06kwladykaso in other words... i can't use carica library?
08:07noncom|3kwladyka: https://github.com/sonian/carica/blob/master/src/carica/core.clj#L33
08:08noncom|3this indicates that carica simply looks for resources using the classloader
08:08noncom|3so you must set a classpath for your uberjar
08:08noncom|3or add a classloader for (System/getProperty "user.dir")
08:08noncom|3but probobly there's a simpler way
08:09noncom|3sorry, i never use anything but read-string with slurp
08:09noncom|3it works just ok for me
08:11noncom|3kwladyka: btw: https://github.com/sonian/carica/blob/master/src/carica/core.clj#L33
08:11jeayeI'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
08:12noncom|3jeaye: what is your code?
08:12noncom|3jeaye: and what you mean by "compare lists"?
08:12noncom|3i think you can compare them on a per-element basis
08:13noncom|3idk of any other general notion of list comparison, except maybe for length, but that's a different story
08:13jeayenoncom|3: http://dpaste.com/27JZ0FZ
08:13jeayenoncom|3: Line 7
08:14noncom|3jeaye: so you compare types of elements?
08:15jeayeI'd like to compare per-element.
08:15jeayeThe lists are both, if I print them, (("string"))
08:15noncom|3so then why aren't you comparing them on a by-element basis?
08:16noncom|3with, say loop, reduce, for, or some other comprehension
08:17jeayeWell, I was expecting there to be a builtin function for per-element comparison.
08:17kwladykanoncom|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?
08:17jeayenoncom|3: (doc compare) doesn't say exactly what it does for collection comparison, just "compares numbers and collections in a type-independent manner"
08:18noncom|3jeaye: you can start investigation here: https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/core.clj#L796
08:18noncom|3jeaye: idk, sorry, never used it
08:19noncom|3jeaye: but i would just do a per-element comparison myself
08:19oddcullykwladyka: you might need io/resource instead of slurp there
08:19noncom|3kwladyka: 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
08:20noncom|3jeaye: so quite possible is that carica is a spin-off of such a project too
08:20kwladykaoddcully, mmm? I want it load config file from uberjar.
08:20noncom|3kwladyka: that was to you ^^
08:20noncom|3kwladyka: you don't pack your config in uberjar
08:20noncom|3kwladyka: if you pack it - what's the point?
08:21noncom|3kwladyka: also you can look at carica source and get a sense of what's it doing. it's rather small btw, just 3 namespaces
08:21kwladykanoncom|3, mmm? But uberjar pack config file into jar file. It is not to change. Or it is?
08:22noncom|3kwladyka: i usually have a "config" folder near my jar
08:22noncom|3so that users can go there and change the edn files
08:22noncom|3but that's again a preferencfe
08:22kwladykayes, i want do something similar. So slurp is the best solution?
08:22kwladykawith read-string
08:22noncom|3slurp or io/resource
08:23noncom|3well... best... hard to say
08:23noncom|3depends...
08:23noncom|3you should consider that someone may inject an executable code in your config
08:23noncom|3then you can rule it out with *read-eval*
08:23noncom|3and other stuff
08:23noncom|3just read some article on "reading edn files in clojure"
08:24kwladykaI didn't find anything what helped me. Can you recommend some article?
08:24kwladykanoncom|3, what is the difference between slurp and io/resources?
08:25kwladykanoncom|3, sorry if it is noob question but.. i am still learning :)
08:25noncom|3kwladyka: i'm not sure
08:25noncom|3i did not use io/resource much. probably there are some i,plications
08:26kwladykaoddcully, why io/resource instead of slurp? What is the difference?
08:41oddcullykwladyka: 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
08:42oddcullykwladyka: if you load it from filesystem, you are fine
08:47kwladykaoddcully, i want load it only from filesystem
08:48kwladykathx noncom|3 and oddcully :)
09:18phaseNiHello, 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.
09:20Glenjaminobjects are a reasonable way to model a connection, but the trick is that data from a connection can often be just data
09:20kwladykaphaseNi, hmmm watch Clojure Inside Out and do http://www.4clojure.com/
09:21kwladykaalso you can watch http://www.purelyfunctional.tv/
09:22kwladykaand 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 :)
09:23kwladykathat was my way
09:26phaseNiWould it be best to just have one atom that you update-in or have many atoms down the tree?
09:27imancis 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"]
09:27Glenjamini generally say start with one atom
09:28phaseNithanks for the links kwladyka, btw
09:28phaseNiimanc: you mean at compile time?
09:29imancphaseNi: 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
09:29phaseNiyou could just look at the resulting js
09:30dnolenimanc: there's a #clojurescript channel btw
09:30dnolenimanc: also if you have GC compatible lib you don't need externs
09:31imancdnolen: ahh, I'll just #clojurescript.
09:31dnolenimanc: as far as why you can't do that it's due to the fact that lein-cljsbuild would break if we touch that.
09:32dnolenno one as far as I know has fixed the issues in cljbuild, and then we could turn on externs validation
09:35phaseNiAre 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
09:36DeraenphaseNi: For managing application state, check https://github.com/stuartsierra/component
09:40phaseNiugh
09:40phaseNiso i have used component :0
09:40phaseNiits great for things that are actual components
09:41phaseNibut each long running connection cant be a component
09:43phaseNiAlso 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
09:45phaseNiSo I stopped using component, but I am still developing similarly to using component
09:45phaseNiand this is where everything seems to be ojecty for me
09:49dnolenphaseNi: why is debugging defrecord any different in ClojureScript than Clojure?
09:50phaseNidnolen: if something goes wrong in the methods, it doesn't give a stacktrace that points to where it happens
09:51dnolenphaseNi: you have to be more specific - what do you mean "it doesn't give a stacktrace"?
09:51dnolenClojureScript gives stacktraces to actual defrecord methods across many JS engines
09:51clojurebotGabh mo leithscéal?
09:51dnolenNode.js isn't special
09:53dnolendefrecord 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.
09:53dnolens/long/longer
09:54dnolenphaseNi: to answer your actual question - even in larger apps people manage state with an atom
09:55dnolenthat should definitely be sufficient for anything you might do with Node.js
10:04phaseNidnolen: it may not have been defrecord then, maybe the way component is implemented. i recall the issue is documented somewhere
10:54noncom|3does clojure already provide an inbuilt nrepl client?
10:54PMunchHmm, 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:54noncom|3i remember tehre were talks on that
10:55noncom|3PMunch: oh.. well..
10:57noncom|3PMunch: i guess you couple concepts of "clojure" and "functional programming"
10:57noncom|3PMunch: sure clojure favors functional programming, but also most power comes from that it is a lisp
10:58PMunchHmm, noncom|3 s/functional programming/lisp then
10:58noncom|3PMunch: so here are really two things with clojure: 1) advantages of a LISP 2) advantages of FP
10:59noncom|3ah ok, the main advantage of LISP is homoiconicity
10:59noncom|3it is its only feature in reality
11:01noncom|3* together with the lambda calculus, ofcourse
11:04noncom|3PMunch: so, once again, i can recommend this blog post about why lisp: http://www.defmacro.org/ramblings/lisp-ducati.html
11:04noncom|3PMunch: this is a nice technical outlook: https://www.dropbox.com/home/book/programming?preview=LispImpHandout.pdf
11:08PMunchI'll be sure to check those out, thanks
11:13noncom|3PMunch: feel free to ask more and rise discussions in this channel, you're welcome
11:14PMunchWill 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:14lodin_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:15noncom|3yeah, but homoiconicity is not only about macros
11:15PMunchlodin_, I haven't really done anything with macros yet
11:15noncom|3functional programming in lambda style is actually what it is
11:15lodin_PMunch: Nor will you need to, like, ever. ;-)
11:16noncom|3the need depends
11:21Bronsa`noncom|3: huh? homoiconicity is not only about macros?
11:21Bronsa`what do you mean?
11:22noncom|3yeah, i mean that a program can write itself in the process of executuion
11:22noncom|3macros are a part of this functionality i think
11:22noncom|3and operate on code as on data
11:22Bronsa`macros are exactly that functionality
11:23noncom|3yeah, but this functionality is accissible not only by macros
11:23Bronsa`by what else
11:23Bronsa`?
11:23noncom|3buy runtime code changes?
11:23noncom|3*by
11:23lodin_noncom|3: You often use eval in your program?
11:23Bronsa`I'm not following
11:23lodin_*programs
11:24noncom|3Bronsa`: well i mean a program can be constructed in runtime by the program, without actually writing a macro (without using defmacro)
11:25noncom|3maybe that's a too philosophical thought...
11:25lodin_noncom|3: It's perfectly fine, if you pass it to eval, but do you actually do that?
11:26noncom|3it happens but not often
11:26noncom|3although eval is considerfed a bad style
11:26lodin_noncom|3: When you do end up using it?
11:26noncom|3but for a ns loader, for example, it's fine
11:26noncom|3like if i am writing a custom ns-management
11:27noncom|3like the clojures inbuilt one is not always the most comfortable one
11:27dang`r`usoy
11:28lodin_noncom|3: Is that code on github or something?
11:29noncom|3lodin_: 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:29noncom|3in projects with over 100 namespaces, the default clojure ns system becomes a swamp
11:29lodin_Do you use this instead of the ns macro?
11:30noncom|3yes, instead of the ns macro
11:30noncom|3but not always
11:30noncom|3ns is allowed too
11:30noncom|3because it is natural
11:30noncom|3foreign libs are allowed to use ns
11:31lodin_noncom|3: What limitations of ns prompted this development?
11:31noncom|3lodin_: also eval is useful in repls, like nrepl, for example
11:32lodin_noncom|3: Of course eval is useful in r-EVAL-pls. :-)
11:32lodin_noncom|3: That's about tooling though, not the program you're actually writing. Unless your business is tooling.
11:33noncom|3lodin_: limitations of ns: no templating, no notion of requiring library groups, and some others
11:33lodin_(That is, lots of languages have repls, without being homoiconic.)
11:33noncom|3if you need to require 100 namespaces in 100 other namespaces, you gonna end up with a letters-wall hell
11:34Bronsa`you can write a more powerful `ns` without needing eval
11:34lodin_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:35noncom|3Bronsa`: hmmm... yeah, probably. clojure provides all that is required for that without the need to resort to eval..
11:36noncom|3lodin_: not only that.. but that too
11:36Bronsa`if your last resort is using eval you're either doing something incredibly complex or something that you shouldn't be doing
11:37lodin_noncom|3: What else?
11:38noncom|3Bronsa`: 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:38noncom|3if you have a string, then idk any other way to make it alive without reading and evaling it
11:38Bronsa`noncom|3: that might fall into the former category then :)
11:39lodin_noncom|3: You don't need homoiconicity for that though. You just need eval.
11:40noncom|3lodin_: yeah, but you were asking that exact question - where i used eval
11:41lodin_noncom|3: And it seems like you use it for precisely the purpose it exists. :-)
11:42noncom|3lodin_: as for homoiconicity - consider an AI that must build lisp forms in runtime, for example, based on a genetic approach, verifying some hypothesis..
11:42noncom|3it has to manage code as well as data
14:07skeuomorfIt's the damndest thing
14:08skeuomorfAt the REPL, whenever I try to use `(clojure.core.typed/cf 1)`, I get a `ClassNotFoundException clojure.core.cache.CacheProtocol`
14:09skeuomorfand 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:13justin_smithskeuomorf: missing clojure.core.cache dep, or a version that lacks that protocol?
14:19skeuomorfjustin_smith: I was under the impression that leiningen resolves deps automatically
14:19skeuomorfjustin_smith: And I am using the latest version according to the github repo
14:26justin_smithskeuomorf: 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:27justin_smithdeleting and reinstalling deps shouldn't do anything at all, but fixing your project to override some dep conflict decisions will likely fix it
14:27justin_smith'lein deps tree' will show any conflicts in your current project.clj
14:28justin_smithalso plugins can interfere too
14:30skeuomorfjustin_smith: `lein deps tree` doesn't output anything, so I am assuming there are no conflicts
14:30justin_smithsorry, it's lein deps :tree
14:32skeuomorfjustin_smith: ahh, https://dpaste.de/tSKk
14:38hibouHi, I really don't understand the question here https://www.4clojure.com/problem/10#prob-title
14:39justin_smithhibou: 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:39justin_smithit wants to know what you will get back if you make either of those calls
14:47hiboujustin_smith, thanks I've solved this problem
14:47favetelinguishave 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:35jonathanjhow do i convert a UUID from a string to a UUID instance?
16:35jonathanjthe reader macro obviously doesn't work and i don't see anything in clj-uuid
16:35jonathanjguess i have to use java.util.UUID/fromString?
16:36danlentzActually, there is also a wrapper in clj-uuid
16:37jonathanji couldn't find it
16:37jonathanjthere's str->uuid but it's not public
16:37jonathanjthe clj-uuid tests themselves use UUID/fromString
16:38danlentzas-uuid is a method of the UUIDable protocol
16:40danlentzhttps://github.com/danlentz/clj-uuid/blob/master/src/clj_uuid.clj#L702
16:40jonathanjah right, thanks
16:40jonathanjsorry, i find the clj-uuid documentation quite confusing to understand
16:40danlentzHappy to listen if you have any suggestions
16:41danlentzIs there anything in particular you're trying to do that you're having trouble with?
16:42jonathanjit's mostly just that it's not clear (without reading the code) what types are being extended with which protocols
16:43jonathanjso it's a little tricky to figure out what you can and can't call methods on
16:43danlentzThat's fair
16:46danlentzI 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:47jonathanjdanlentz: mostly i'm really happy with clj-uuid
16:48jonathanjdanlentz: so thanks for writing and maintaining it :)
16:48jonathanjapart from the issue i filed last week, which i see you've assigned
16:49danlentzIt's really rewarding that people find it useful
16:57danlentzjonathanj: 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:58danlentza new release in the near future once I return (sorry, all thumbs on iPad)
17:18Schrostfutz_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:29oddcullyapply and remove nil? as the blunt way
18:20MalnormaluloDoes anyone have any experience getting Eclipse to work with Leiningen via Counterclockwise?
18:22MalnormaluloIt doesn't seem to want to build correctly
19:46justin_smithMalnormalulo: cursive for idea is a lot more mature, and more actively developed
19:47MalnormaluloI'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:50CharlesNMalnormalulo cursive for idea will be a commercial product, with pricing to be released soon I don't know how soon.
19:51cflemingCharlesN: Today probably :)
19:52rhg135That's unfortunate, it's hard to justify it, unless employed and earning money
19:52cflemingShort answer: $199 for company licences, $99 for individual devs, free licence for non-commercial (OSS, personal hacking, students, ClojureBridge etc).
19:52cflemingrhg135: ^^
19:53rhg135That's actually quite cheap for me, nice
19:53CharlesNcfleming source code will be available ?
19:53rhg135I assumed it'd be a lot more
19:53cflemingrhg135: So it'll be free until you can justify it, at which point I hope everyone will.
19:55rhg135That's actually a very good scheme. If you need commercial use, you can hopefully pay it.
19:56cflemingCharlesN: No, or at least not initially, and probably never all of it.
19:57cflemingCharlesN: 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:57cflemingrhg135: That's what JetBrains used to charge for PyCharm before they switched to subscription pricing.
19:57rhg135I'm assuming you will not need confirmation for the OSS license?
19:59rhg135Because it'd be annoying to have to go through "paperwork" to use it for OSS
20:00rhg135I never did use PyCharm, although I did use python
20:04cflemingI'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:04cflemingrhg135: 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:04cflemingrhg135: 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:04cflemingBut renewing will just be go to the website and get a new one.
20:08TEttingeryay cfleming
20:08TEttingerhooray helping OSS
20:09TEttingerif I ever make commercial software in clojure I'll buy cursive in a flash
20:11cflemingTEttinger: :)
20:12cflemingTEttinger: I'll be rooting for you to get a Clojure job then
20:13TEttingergoing 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:14cflemingJust create a bot which updates a readme randomly each day, if you haven't submitted anything that day.
20:15justin_smithhaha
20:27rhg135cfleming: 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:27rhg135then I can coerce my employer :P
20:29rhg135I currently have to launch my browser anyway so renewing isn't bad
21:09cflemingHere's the gospel on the Cursive pricing and licencing: https://cursiveclojure.com/archive/1564.html
22:19wxlso 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:23justin_smithwxl: if you have pallet/alembic in your profiles.clj it's pretty easy to use that to try out other deps
22:32rvxihello
22:56AjaxCrixumis 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:57mungojellyAjaxCrixum: yeah SICP is awesome, there's good videos too
23:00sotojuani just started chapter 2 of it
23:00sotojuanawesome so far
23:00sotojuanlearning more than i did in college
23:00AjaxCrixumlike, what does it instill in you?
23:00owlbirdonly read first 3 chapters, fail to continue..
23:00AjaxCrixumcompsci knowledge in general? programming skills? knowledge of systems?
23:01justin_smithAjaxCrixum: it's an excellent book on programming, and systems design
23:01mungojellyit's very abstract, it teaches you what a programming language is made of
23:04sotojuanIt's essentially a book on computing: Abstractions with functions, Data Abstractions, handling state, etc
23:04sotojuanI would it pretty practical actaally
23:04justin_smithin conclusion, SICP is a book of contrasts
23:05AjaxCrixumit doesn't seem too pragmatic, but rather theoretical; is that good or bad?
23:06sotojuanIt'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:07sotojuanI'd recommend it after you have been programming or doing "pragmatic" things for some time :p
23:13owlbirdI prefer ACL, On Lisp, Land of lisp :-P