#clojure logs

2013-05-03

00:00axle_512Raynes: Cool, I like it. I'll dig a little more into it and see if it's something I can use with my little scheduler
00:00holo(inc Raynes)
00:00lazybot⇒ 28
00:05djwonk(dec djwonk)
00:05lazybotYou can't adjust your own karma.
00:05djwonk(inc danielglauser)
00:05lazybot⇒ 1
00:05holothanks to Raynes, and numerous contributors for tryclj.com, my girlfriend could try programming without setting her hair on fire. she actually enjoyed it
00:06djwonk(inc clojurebot)
00:06lazybot⇒ 21
00:06djwonk(inc technomancy)
00:06lazybot⇒ 53
00:06djwonk(inc lazybot)
00:06lazybot⇒ 18
00:07Raynesholo: It's all a cunning plot to steal your girlfriend.
00:09holoshe was sad there weren't more levels to solve though.. just imagine how many more girls are out there.. trying clojure
00:09RaynesOh dear. I'll get right on it.
00:10holo:>
00:11amalloyholo: 4clojure.com?
00:12holoamalloy, she gave up on that one. not because of difficulty i think (some problems are indeed really easy), but because it was enough for the day
00:14axle_512Raynes and amalloy: Read the code for chronicle. That is slick — I love the lazy seq of times that match the spec.
00:15amalloyit's good that you love it, because that is literally the only thing in chronicle
00:15axle_512haha
00:15axle_512simplicity is good
00:15amalloyyeah, i wrote it in an hour. now Raynes will market it for me
00:24callenClojure: programming without the burning hair.
00:26holoClojure: the fresh maker
00:29arrdemClojure: macros for the JVM
01:00technomancyholo: let's film a series of advertisements
02:38tomojshould ring provide names for comp and #(comp %2 %1)?
02:42tomojhmm, not #(comp %2 %1)
02:45tomojoh, yeah. https://www.refheap.com/paste/163cd2a1090c780ac4b2b8ba2
02:46tomojI guess I can just keep writing those functions in many namespaces since it's just two lines..
02:52augustlpjstadig: ah, the good old source :)
02:52augustlI guess clojure.core/addMethod could be considered a public and supported API
02:54tomojhmm https://www.refheap.com/paste/765fc76fe098a715d6edd1239
02:56tomojoh that's just (def in-response ((in-args reverse) (partial partial comp)))
03:55Glenjamintomoj: i don't quote follow the example at the bottom, where abouts in a ring app would you need this?
03:57mindbender1what is cljs version of js/Array?
03:57mindbender1this issue has been bugging me
04:00tomojmindbender1: (array) ?
04:00tomojwhat do you mean
04:00tomojGlenjamin: anytime you want a middleware which just applies a function to the request or the response
04:01Glenjamindoesn't ring have separate request/response maps? or am i just blinkered by compojure here?
04:01tomojyes
04:01Glenjaminah, i see
04:01tomojthe example is not ring-conformant
04:01mindbender1I mean something that allows me to insert anywhere and have the index re-ordered
04:02tomojand also I was actually thinking of clj-http middleware.. is it the same for ring?
04:02Glenjaminring has request map in, and response map out
04:03tomojoh yeah, it's the same-ish
04:03Glenjamin(def app (fn [req] {:status 200, :body "Hello World", :headers {}}))
04:04tomojmindbender1: hmm.. port clojure.core.rrb-vector ?
04:04mindbender1let me see..
04:04Glenjaminso middleware can either operate on req and pass it along, or call the wrapped function, operate on the returned response and pass it back
04:04tomojthen you'd have slice conj slice splice for an insert-at
04:05tomojor maybe finger trees?
04:05tomojno cljs version of that yet afaik either
04:07tomojGlenjamin: yeah -- (fn [app] (fn [req] (app (f req)))) is comp, and (fn [app] (fn [req] (f (app req)))) is #(comp %2 %1)
04:07tomoj..well, with the f param somewhere in there
04:16ddellacostawhat's the best way to short-circuit an iteration? I mean, what kind of looping construct to use? filter is close, but I want something more like Ruby's detect: http://ruby-doc.org/core-1.9.3/Enumerable.html#method-i-detect
04:16ddellacostaI feel like I must be missing something obvious.
04:16Glenjaminddellacosta: you probably want some
04:17ddellacostaGlenjamin: THAT'S what I've been looking for…thanks!
04:17Glenjamin,(doc some)
04:17clojurebot"([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)"
04:17ddellacostayes, perfect.
04:17ddellacostaI always forget about "some."
06:37augustlI end up writing this function quite often: (defn assoc-if [m key value] (if value (assoc m key value) m))
06:38augustlonly assoc if the value is truthy. I use this for threading macro goodness, such as (-> base-data (assoc-if :some-key some-value))
06:38augustlsince assoc-if is not in core, and I find it insanely useful, I guess I'm "doing it wrong" :) Anyone got some favorite ways of doing hashmap building based on conditions?
06:39tomojwell there is (cond-> m value (assoc key value)) :/
06:41jballanc,(let [value true] (and value (assoc {} :test value)))
06:41clojurebot{:test true}
06:41jballancI find 'and' and 'or' are underutilized...but that may just be me
06:43tomojhere they are not very helpful
06:44jballancah, I see...the hash should still be returned if value is false
06:44jballanchmm...
06:45jballanc,(let [value false m {:first "thing"}] (and (or value m) (assoc m :test value)))
06:45clojurebot{:test false, :first "thing"}
06:45jballancoh, whoops
06:45jballanchmmm...
06:46jballanc,(let [value false m {:first "thing"}] (or (and value (assoc m :test value) m))
06:46clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
06:46jballancd'oh
06:46jballanc,(let [value false m {:first "thing"}] (or (and value (assoc m :test value)) m))
06:46clojurebot{:first "thing"}
06:46tomojseems like a strange way to write (if value (assoc m :test value) m) :)
06:46jballancthere we go
06:46jballancheh
06:47tomoj&(clojure.walk/macroexpand-all '(or (and value (assoc m :test value))))
06:47lazybot⇒ (let* [and__3822__auto__ value] (if and__3822__auto__ (assoc m :test value) and__3822__auto__))
06:47clgvaugustl: go for `cond->` as proposed
06:48tomojoops
06:48tomoj&(clojure.walk/macroexpand-all '(or (and value (assoc m :test value)) m))
06:48lazybot⇒ (let* [or__3824__auto__ (let* [and__3822__auto__ value] (if and__3822__auto__ (assoc m :test value) and__3822__auto__))] (if or__3824__auto__ or__3824__auto__ m))
06:49jballanchaha
06:49jballancyeah, I keep forgetting that and/or are macros and if is the special form
06:49tomojsemantically equivalent in this case?
06:50jballancI swear that's backward from one of the schemes I've used...
06:50tomojI always think it's the other way too
06:53augustlthanks folks :)
06:54augustlwhy u not 1.5, http://clojure.org/cheatsheet !
06:55tomoj(filter (comp #{"1.5"} :added meta) (vals (ns-publics (find-ns 'clojure.core)))) :)
06:56tomojI just realized that that's fucking sweet
06:58augustltomoj: ah, nice one :)
07:12augustlis zipmap "the best" way to map the values of a hashmap?
07:12augustlseems wasteful to create so many temporary collections
07:13VelrokHi, quick question:
07:14VelrokI have some problems resolving a java class
07:14Velrokcern.colt.matrix.io.MatrixInfo.MatrixField
07:14VelrokCompilerException java.lang.ClassNotFoundException: cern.colt.matrix.io.MatrixInfo.MatrixField, compiling:(NO_SOURCE_PATH:1)
07:14Velrok(import (cern.colt.matrix.tint.impl SparseIntMatrix2D)
07:14Velrok (cern.colt.matrix.tdouble.impl SparseDoubleMatrix2D)
07:14Velrok (cern.colt.list.tint IntArrayList)
07:14Velrok (cern.colt.matrix.io MatrixVectorWriter
07:14Velrok MatrixVectorReader
07:14Velrok MatrixInfo
07:14Velrok MatrixSize)
07:15Velrokuser=> cern.colt.matrix.io.MatrixInfo
07:15Velrokcern.colt.matrix.io.MatrixInfo
07:15Velrokworks
07:15brainproxyVelrok: please use gist or refheap
07:15noidiaugustl, (into {} (for [[k v] m] [k (f v)]))
07:16noidiwhere m is your map and f is the function to map over the values
07:16augustlnoidi: ah, cool
07:17noidithat iterates over the entires in the map, destructuring them into a key and a value, and creating a vector that is close enough to a MapEntry that it can be stuffed into a new map
07:17Velrokas suggested here the code as gist: https://gist.github.com/Velrok/5508551
07:19VelrokDo I have to change my import call? I can't access inner classes of MatrixInfo
07:21noidiVelrok, try MatrixInfo$MatrixField
07:21noidiAFAIK that's the real name of the inner class
07:21noidiMatrixInfo.MatrixField is syntactic sugar provided by Java (again AFAIK)
07:21VelrokIndeed
07:22VelrokThanks @noidi
07:24Velrokcern.colt.matrix.io.MatrixInfo$MatrixField works but
07:24VelrokMatrixInfo$MatrixField fails
07:25Velrokdo I have to giv it the complete name space ?
07:27VelrokAh ok
07:28VelrokI also need to import MatrixInfo$MatrixField
07:28Velrok(cern.colt.matrix.io MatrixVectorWriter
07:28Velrok MatrixVectorReader
07:28Velrok MatrixInfo
07:28Velrok MatrixInfo$MatrixField
07:28Velrok MatrixSize)
08:04luxbockhas anyone here tried writing a Firefox extension using ClojureScript?
08:34TimMcVelrok: Please don't paste more than 1 or 2 lines to the channel -- use a pastebin such as http://refheap.com or http://gist.github.com instead.
08:35Velrok@TimMc ok Thanks
08:41dnolenluxbock: someone mentioned doing a Chrome Ext at one point I think
10:01jcromartieso here's something I wish Clojure had: lazy maps
10:02jcromartiei.e. in OOP languages I can make a class with a variety of lazy property getters
10:02jcromartiebut in Clojure if I want some sort of associative structure it usually has to be all-or-nothing
10:02jcromartielike, for parsing content from a URL
10:03jcromartieIf the map values are functions that use futures or delays, then that is one option
10:04jcromartieI guess @(:title foo) is not too bad
10:04nDuffjcromartie: you can certainly implement clojure.lang.Associative yourself.
10:04tomojor just ILookup
10:06tomojbut what happens when you print the "lazy map"?
10:06tomojI was thinking about something somewhat related earlier, I'm putting lazy IO seqs in ring responses, so if you print the response that causes IO...
10:07tomojwell that's probably just nuts
10:08jcromartieyeah I suppose there's nothing stopping a lib from implementing this
10:09tomojsay, datomic
10:09tomojwith lazy EntityMaps
10:13juhu_chapakjkl
10:22beakyhello
10:33beakywhere can I read more about design patterns related to functional programming?
10:39stuartsierraclojurescript 0.0-1798 is out the door and on its way.
10:39poi519beaky: if you find anything, let me know please. I do not think there are many design patterns already, though.
10:41beakyah
10:43stuartsierrabeaky - I did a talk at Strange Loop last year called "Functional Design Patterns." The video is on InfoQ. Pretty basic stuff, but maybe useful.
10:46beakyah thanks
10:46poi519stuartsierra: thanks, watching
10:47ambrosebsIt would be nice if *out* had a Writer type hint.
11:58gdev,(= *)
11:58clojurebottrue
11:59gfredericks,(= * + -)
11:59clojurebotfalse
12:00kmicu, (= comp comp comp complement true)
12:00clojurebotfalse
12:01poi519,(if nil true false)
12:01clojurebotfalse
12:03justin_smith,(= (/ 0.0 0.0))
12:03clojurebottrue
12:03justin_smithNaN should not equal NaN, I would call that a bug
12:05justin_smith,(== (/ 0.0 0.0) (/ 0.0 0.0))
12:05clojurebotfalse
12:05justin_smith,(== (/ 0.0 0.0))
12:05clojurebottrue
12:05justin_smithbugs
12:06IamDrowsy,(= (/ 0.0 0.0) (/ 0.0 0.0))
12:06clojurebotfalse
12:06IamDrowsyNaN isn't equal to NaN...
12:06justin_smithright
12:07justin_smithbut (== (/ 0.0 0.0)) implies it is
12:07IamDrowsythe equality of a single element is true because it makes not alot of sense to check the equality of a single thing
12:07justin_smithuntil things are not supposed to be equal to themselves
12:08edoloughlin,(doc ==)
12:08clojurebot"([x] [x y] [x y & more]); Returns non-nil if nums all have the equivalent value (type-independent), otherwise false"
12:08edoloughlinNot 'equal', but 'equivalent'???
12:08lazybotedoloughlin: How could that be wrong?
12:17IamDrowsywell i dont think you can get it right... because you can always argue in different directions.. so its more a decision then a bug
12:18TimMcNaN is a bug. :-/
12:18justin_smithyeah, but it is a bug in a standard
12:19TimMcI actually don't see what's wrong with (= Double/NaN) => true
12:19TimMcYou're not aksing whether NaN = NaN, you're saying that there are no argument pairs where = yields false.
12:19TimMcAnd there are no argument pairs, period.
12:20IamDrowsyso the bug is that (= Double/NaN Double/NaN) is false?
12:20justin_smithno
12:20justin_smiththat is correct behaviour
12:20TimMcThat's "broken as designed".
12:25manutter"NaN is not equal to anything, including itself."
12:26clgvmanutter: what's the philosophical or technical idea behind that?
12:26bbloomclgv: i believe there are multiple ways to represent NaN
12:27axle_512manutter: I think that is correct. Instead of comparing NANs, use isNaN()
12:27bbloomso it would be weird to have SOME nans be equal
12:27bbloomyeah, see http://stackoverflow.com/questions/640109/what-is-the-internal-representation-of-inf-and-nan
12:27manutterIf I understand correctly, NaN represents what something *isn't*, so it's not really a thing in-and-of itself
12:27clgv,-0
12:27clojurebot0
12:27clgv,-0.0
12:27clojurebot-0.0
12:28clgv,(= -0,0 0,0)
12:28clojurebottrue
12:28bbloomweeee floating point
12:28clgv^^
12:28axle_512bbloom is right, for doubles and floats, there is more than one way a NAN can be represented bitwise
12:29bbloomfloats are a PITA ##(= (/ 1.0 3.0) 0.33333333333333334)
12:29lazybot⇒ true
12:29clgvbbloom: you should learn that in programming courses ;)
12:30avishaihi
12:30avishaii'm a total clojure noob
12:30avishaidoing a ring toturial
12:30axle_512avishai: hi
12:30avishaihi
12:30bbloomclgv: don't they teach twos complement and IEEE representation in early CS courses? i'm pretty sure we covered that...
12:30avishaii got not locate ring/middleware/reload__init.class or ring/middleware/reload.clj on classpath
12:31avishainot sure why
12:31clgvyeah they do. that was what I meant ^^
12:31weavejesteravishai: Have you included the ring/ring-devel dependency?
12:31avishaias dev-dependency
12:32bbloomthe real bitch of floating point math is that it actively thwarts analysis
12:32clgvbbloom: I have some thousands of floating point numbers that probably need to be added in a divide-and-conquer manner... :/
12:32bbloomyou want to do common expression elimination? constant folding? NOPE
12:33justin_smithhell, they aren't even transative, yay
12:33weavejesteravishai: Using :dev-dependencies, or :profiles {:dev {:dependencies …}} ?
12:33technomancyat least they're fast =\
12:33bbloomclgv: communicative? associative? transitive? NOPE
12:33avishai:dev-dependencies
12:33avishaihaven't yet mastered the secrets of lein profiles
12:34weavejesteravishai: That's been deprecated in Leiningen for a while. I don't think the latest Leiningens support it… do they, technomancy?
12:34technomancyyeah, :dev-dependencies is for lein1
12:34bbloomtechnomancy: agreed, but totally the wrong default (holy hell i freak out when i see people tracking money in floats) and absolutely the wrong ONLY POSSIBLE SOLUTION (argh javascript)
12:34weavejesteravishai: Profiles are pretty easy. They're just maps that are merged into your main project map.
12:34technomancybbloom: are there any languages where decimal literals read as non-floats?
12:35justin_smithtechnomancy: sql?
12:35justin_smithnot that sql decimals are a good thing mind you
12:35bbloomtechnomancy: common lisp?
12:35avishaiwhich means?
12:35technomancyjustin_smith: heh; I was just wondering whether it would be a cautionary tale of woe =)
12:35avishaihow do i choose which profile to work with?
12:36technomancybbloom: huh; I had no idea
12:36bbloomgnu clisp doesn't even support IEEE floats
12:36technomancyhaha
12:36bbloomIEEE is an extension that most impls have
12:37technomancyI am surprised CLers don't lord that over other languages more.
12:37weavejesteravishai: Well, lets say you have {:dependencies [foo "1.0"]} in your project
12:37avishaiyes
12:37bbloomtechnomancy: they are too busy arguing about things that don't matter
12:37weavejesteravishai: And you also have: {:profiles {:dev {:dependencies [bar "1.0"]}}}
12:37avishaiso far
12:37bbloomtechnomancy: the most important thing that Clojure did for lisp was to change the subject
12:38weavejesteravishai: Then when the dev profile is active, the content of the dev profile is merged into your main project.
12:38avishaithat i got
12:38weavejesteravishai: So with the dev profile, you have deps foo and bar
12:38avishaibut how do i choose which profile is active?
12:38technomancybbloom: heh
12:38weavejesteravishai: By default the following profiles are active: user, dev and … um, some other one whose name escapes me
12:39weavejesteravishai: You can choose profiles explicitly with "lein with-profile <profile> <command>"
12:39avishaiah
12:39weavejesteravishai: So I usually have a profile for testing different clojure versions
12:39avishaiand the default is dev?
12:39weavejesteravishai: So I can run: lein with-profile 1.3 test
12:39weavejesteravishai: To test against Clojure 1.3
12:39avishaiah
12:40avishainow i have a ton of other questions....
12:40weavejesteravishai: And in my project file: {:profiles {:1.3 {:dependencies [org.clojure/clojure "1.3.0"]}}}
12:40weavejesteravishai: You can have multiple profiles active at once, so the default is user + dev + something-else
12:40avishaifound the profiles docs
12:41avishaii'll look there and not waste your time
12:41weavejesterOh, :provided
12:41weavejester:user, :dev and :provided are active by default
12:41bbloomtechnomancy: like on the latest HN post RE: Light Table…. some dude was clojure bashing b/c clearly all good ideas were had by mccarthy
12:41avishai10x
12:41avishaiand dev-dependencies == {:profiles {:dev {:dependencies ?
12:42technomancybbloom: or the one about how we shouldn't have reader syntax for hash tables because the reader doesn't know what performance characteristics we're going to want
12:42bbloomtechnomancy: the most common argument is "reader macros can do that"
12:42bbloomwhich is the stupidest thing i've ever heard
12:42bbloomturing machines can do it too!
12:43bbloomdefaults fucking matter people.
12:43gdevtail calls can do it from behind
12:51avishaiok, it works with :dependencies
12:51avishaiso i guess :dev-dependencies was just wrong
12:51avishai10x
12:51nDuff...
12:51technomancyavishai: if you can report a bug or whatever with the docs you found that would be decent
12:52jcromartieI really appreciate the fact that deploying the average Clojure system requires only Java as a dependency...
13:07ppppauli find it a bit strange that dissoc and select-keys have different protocols
13:08justin_smithsomeone probably has a function that returns two maps, the first a select-keys and the second a dissoc - I could imagine that being very useful
13:08avishaiquestion
13:08avishairegarding ring performance
13:08ppppauli just made one
13:08weavejesteravishai: Go ahead
13:08avishaii take it the dev setup isn't optimized
13:09avishaiby after testing a "hello world" handler, it's .... slow
13:09avishaicompared to go or ever cherrypy
13:09avishaicompared to go or even cherrypy
13:09avishaion my laptop i get around 6k rps
13:10weavejesteravishai: To be honest I haven't checked the development setup
13:10avishaiah
13:10ppppaul(def split (juxt select-keys (partial apply dissoc)))
13:10avishaiso i'll rephrase
13:10justin_smithppppaul: nice
13:10avishaiis clojure ring performance much worse the say java + jetty?
13:10avishai^the^then
13:10ppppauli just find it a bit weird that these functions have such different protocols
13:11nDuffavishai: There was a recent benchmark with a huge number of languages/tools that got published around a bit.
13:11weavejesteravishai: http://www.techempower.com/benchmarks/ indicate it's around twice as slow, at least when deployed as a servlet.
13:11nDuffAhh, that's the one.
13:12avishaii can live with twice as slow
13:12weavejesterI suspect that using dedicated adapter would push up the speed considerably.
13:12avishaiinstead of the jetty adapter?
13:13weavejesterYes, because the Jetty adapter sits on top of the servlet interface.
13:13weavejesterI've been meaning to run that benchmark suite against something like https://github.com/RallySoftware/netty-ring-adapter
13:14weavejesterIt should be a fair bit quicker. Enough to push Compojure into the top 10 at least.
13:14nDuffavishai: Notably, those benchmarks put compojure and (especially) http-kit well ahead of _any_ Python-based framework.
13:14avishaiwell, since in real life performance degrades mostly due to logic and implementation
13:15nDuff*nod*.
13:15avishaii prefer a language which is clear but a little slower
13:15avishaithen tons of horsepower with many quirks
13:15mefistoor more to the point, tons of horespower but you have to supply your own wheels :D
13:16avishaiif only my wheels weren't so edgy
13:19gdevi think of it more as mpg
13:19gdevyou get more milage per gallon of effort
13:21justin_smithwhich reminds me, I need to top off my effort tank
13:28avishaianother question
13:28avishaiis there an encoding middleware?
13:29avishaie.g. to serialize be accept header?
13:47justin_smithavishai: yes, there are middlewares for headers and encoding, for example I am looking at ring.middleware.content-type in my code at the moment
14:03mabeswhenever I use nrepl-macroexapnd it simply puts the name of the macro I'm trying to expand in the buffer.. so, I must be doing something wrong. I've tried highlighting the form in question but that didn't work.. any tips?
14:04justin_smith,(macro-expand '(#(+ % %) 1))
14:04clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: macro-expand in this context, compiling:(NO_SOURCE_PATH:0:0)>
14:05justin_smith,(macroexpand '(#(+ % %) 1))
14:05clojurebot((fn* [p1__69#] (+ p1__69# p1__69#)) 1)
14:05mabesyeah, I've resorted to doing the expansion in the repl... I was just curious if I was making a common mistake in using nrepl.el
14:07silasdaviswith sqlkorma, where are you meant to place your defentity declarations?
14:07gdevsilasdavis:) since it uses the last defdb as its default, if you place it after that you won't have to specify the db
14:09silasdavisgdev, so do I just have to ensure that file get's loaded before I run queries in another file?
14:09silasdavisgets*
14:10gdevsilasdavis:) yeah definitely
14:11gdevotherwise you'll get a symbol not found exception
14:11amalloymabes: if it's anything like slime, point has to be on the open-paren at the start of the macro invocation
14:11mabesamalloy: ah, that was it. thanks!
14:13gdevsilasdavis:) is your project on github?
14:13mabesI need a macro to reference a var that lives in the same namespace as the macro.. right now I'm manually referencing the fully qualified var in the macro... Is there a better way to do this so that the fully qualified var gets expanded for me?
14:15mabesi.e. I have something like: (ns foo-bar) (def foo 23) (defmacro my-macro [& body] `(something foo-bar/foo ~@body)) ... can I replace the foo-bar/foo with something that gets expanded to that?
14:17silasdavisgdev, not publically I'm afraid
14:17clojurebotGabh mo leithscéal?
14:18gdevsilasdavis:) that's fine, I just realized mine wasn't either, so I'm putting it up there now
14:20gdevnow i'm trying to figure out how I can set the db connection information from a settings file that gets gitignored instead of putting user names and passwords hardcoded on the internet
14:21klrris there any clojure implementation that compiles to machine code?
14:25amalloymabes: yes, just foo will do that, when inside a syntax-quote
14:26amalloy&`(inc 10), for example
14:26lazybot⇒ (clojure.core/inc 10)
14:26mabesamalloy: nice.. I thought I had tried that.. thanks!
14:28mikerodIs there a "term" to describe a macro that incorrectly generates code if the arguments given are "complex" forms instead of forms that evaluate to themselves.
14:28mikerod Since this doesn't make sense much as I explain, an example is: (defmacro mc [x] `(let [y ~(resolve x)]))
14:28nightfly__broken
14:28mikerodWhere (mc MySymbol) is ok, but (mc (symbol (str "MySymbol"))) is not.
14:29mikerodnightfly__: Hah, yes broken indeed.
14:29amalloyaw, nightfly__ got to my joke before i'd even finished reading the question
14:30amalloyalthough, mikerod, that particular example is so poorly written that it generates incorrect code no matter what arguments are passed to it
14:30mikerodI was just wondering if there is a good way to describe that situation. Where the macro doesn't work depending on how the structure of the argument passed to it.
14:31mikerodamalloy: I know that was a poor example. I'm just looking for a way to describe the macro mistake of assuming the argument takes a certain form before evaluation
14:31amalloymikerod: i mean, a reasonable point of view is that *every* macro and function must assume its arguments take a certain form. the problem you're describing is making the wrong assumption
14:31amalloyso it's really just "bad code"
14:37gdevso in leiningen I was trying to create a new project inside an existing directory with the same name that lein new would've generated, --to-dir for the win
14:39gdev(inc technomancy)
14:39lazybot⇒ 54
14:39nightfly__(incf lazybot)
14:40technomancyI didn't do that
14:41gdevkarma for good documentation?
14:42gdevi didn't have to submit a feature request to see it already existed, just command line help files
14:47gdev_{^_^}_:) Y U NO pick one name and stick with it?
14:49_{^_^}_gdev: cause im indecisive, im seeking help
14:52nDuff_{^_^}_: I'd suggest something you'd be willing to live with indefinitely. On which point, cute has a limited shelf life.
14:53hfaafb_{^_^}_ clearly has issues picking names
14:55[tab][tab][tab]*cough*
15:05gdevwhats the opposite of currying?
15:05beakyuncurrying
15:06beaky:t uncurry
15:06beaky(a -> b -> c) -> (a, b) -> c
15:07bbloombeaky: eehhh not really
15:08beaky:(
15:08gdevI thought it was yogurting
15:08bbloombeaky: yes, you are correct that that is the type of uncurry in haskell
15:08bbloomhowever, it's not really the inverse of "curry"
15:08beakyah right
15:09bbloomwell sorta
15:09technomancya reversible partial application would have to store the original fn somewhere
15:09bbloomit IS the inverse of haskell's curry function
15:09bbloomlol
15:09bbloombut haskell functions DO CURRYING
15:09gdevi asked for the opposite, not the inverse
15:09bbloomand the uncurry function makes them NOT do currying
15:09rasmustois it lunchtime?
15:09beakyhaskell automagically currys for you
15:09bbloommmm curry.
15:10beakyimo curry would be a cool name for a functional programming language
15:10bbloombeaky: it was one of the candidate names for haskell, if i recall correctly heh
15:10bbloomcurry :: ((a, b) -> c) -> a -> b -> c
15:10bbloomcurry converts an uncurried function to a curried function.
15:10bbloomuncurry :: (a -> b -> c) -> (a, b) -> c
15:10bbloomuncurry converts a curried function to a function on pairs.
15:11bbloomthat's with the doc strings ^^
15:11gdevstuartsierra:) wtf is yogurting?
15:13raekbeaky: there is a logic programming language called curry..
15:14beakyah
15:14beakywhere did the name 'clojure' come from?
15:14gdevclosure + java
15:15pppaulcloja
15:15beakyah
15:15gdevcoca-cloja
15:15beakywhat's a closure?
15:15gdeva resolution to a conflict
15:15pppaulsounds like an anxiety attack
15:16raekbeaky: a function with its lexical environment
15:16gdevlisp and the jvm had a huge fight, went out for beers and realized they needed clojure
15:17beakya closure is a poor man's objects
15:17beakyor was it the other way around?
15:17raekhehe :)
15:18gdevJoel Moses credits Landin with introducing the term closure to refer to a lambda expression whose open bindings (free variables) have been closed by (or bound in) the lexical environment, resulting in a closed expression, or closure
15:19beakyah
15:19gdevadopted by Sussman and Steele in Scheme in 75 which is where it became widespread
15:19beakyso it's like a function escaping and forming its own universe?
15:20gdevit's often mistakenly used to mean an anonymous function
15:20beakyah
15:21beakyyeah closures are a bit more than lambadas
15:21gdevlambadas?
15:21mikerod_amalloy: I had a meeting and couldn't follow up earlier (I asked about a a term for a macro that depends on the structure of the unevaluated form).
15:21beakylambads*
15:21gdevlambads?
15:21beakylambdas*
15:23gdevalso to make things even more confusing, http://shop.oreilly.com/product/0636920001416.do
15:23mikerod_The concept I was getting at is would you consider a macro to be poorly written, if the caller of the macro had to know to treat it differently than calling a function?
15:23bbloombeaky: i think that objects are one way to implement closures :-)
15:24mikerod_If a macro specifies that it is to take a symbol as an argument, but then it doesn't accept forms that evaluate to a symbol.
15:24bbloombeaky: and, given an alternative implementation of closures, then closures are one way to implement objects ;-)
15:24beakyah thats a nice way to think about that; that's what I use c++ classefor
15:24beakyclases*
15:28gdevClosures were left out of Java initially more because of time pressures than anything else. In the early days of Java the lack of closures was pretty painful, and so inner classes were born: an uncomfortable compromise that attempted to avoid a number of hard issues. But as is normal in so many design issues, the simplifications didn't really solve any problems, they just moved them.
15:28gdevquote from James Gosling
15:29bbloomwell yeah, "final" variables plus inner classes ARE closures
15:29bbloomthey just aren't also lambdas
15:29bbloom:-P
15:29beakyah
15:29beakywhat's an inner class?
15:30bblooman inner class (in java anyway) is when you define a class within a class
15:30bbloomor even within a method
15:30beakyah
15:30bbloomthe compiler will rewrite that class to have a name like TheParentClass$TheChildClass
15:30gdevjava can only have one public class for every class file, but it can have as many non-public ones it wants
15:30bbloomand then rewrite the constructor and calls to 'new TheChildClass(foo)' to be 'new TheChildClass(TheParentClass.this)'
15:31bbloomrather 'new TheChildClass(TheParentClass.this, foo)'
15:31bbloomeffectively closing over "this"
15:31beakyso in java every file may only export a single class? :(
15:31bblooma single top level class, yes
15:31beakyah
15:31bbloomhowever, if you make a final variable and then use it inside an inner class, the constructor will be rewritten there too to take a copy of that variable
15:31bbloomthat's why it needs to be final
15:31bbloomit's not a true closure
15:32bbloomti's a manually hacky closure via rewriting constructors to patch up the closure
15:32gdevon the file system you'll have Foo$InnerFoo.class and Foo$1.class for inner classes and anonymous inner classes
15:32llasramExcept for may be "static inner classes", which AFAICT are the same damn thing as regular classes modulo the funky `$` in their name
15:32llasramPlus the convenience of being able to have more than one per file
15:33gdevanonymous innerclasses are also a way to add listeners
15:33bbloomwell, the static modifier on a class just says "dont add TheParentClass.this" to the constructor :-)
15:35gdevif you've had to deal with listeners, factory patterns, IOC, decorators, or iterators in java you appreciate Clojure a lot more
15:36beakyah I never programming in java
15:36beakyI've never coded in java*
15:37gdevgive it a try =D
15:37llasramJust other parts of Indonesia?
15:37beaky:D
15:37beakyI heard that java was a nice programming language
15:38gdevdepends on your definition of "nice"
15:38axle_5121a lot of people pick on java today, but it was one of the first to really reach that holy grail of platform independent executables
15:38bbloomaxle_5121: people pick on the language more than the virtual machine
15:39beakythe virtual machine is genius
15:39bbloomaxle_5121: the JVM and core libraries was/is/are a fine piece of work
15:39axle_5121bbloom: agreed
15:39bbloomthe language was (obviously) very successful in this respect:
15:40bbloom "We were not out to win over the Lisp programmers; we were after the C++ programmers. We managed to drag a lot of them about halfway to Lisp."
15:40bbloom- Guy Steele, Java spec co-author
15:40axle_5121Yes, it definitely was a more palattable version of C++
15:40TimMccemerick: Did you end up creating a ticket for automatic namespace loading for defrecords? https://groups.google.com/forum/#!msg/clojure-dev/4CtSVWcD15A/shpMuyjMpxsJ I can't find one.
15:40axle_5121palatable even.
15:42mikerod_I'm a bit of an IRC n00b. What causes/caused my "nick" (user name?) to get an underscore after it suddenly?
15:42devnwhat's the pattern for developing a new lein plugin? I have a new clojure project and created src/leiningen/foo.clj which contains a single function: (defn foo "Foo" [] (println "hi"))
15:42devnBased on a couple of the other lein plugins I've looked at this should let me run the task inside my lein-foo plugin, is that wrong?
15:43TimMcmikerod_: You probably disconnected and then reconnected, and your old nick stuck around just long enough to be unavailable to your new session.
15:43TimMc(aka a ghost)
15:43devnI keep getting "Task: 'foo' not found"
15:44devnlol nevermind...
15:47mikerod_TimMc: That makes sense. Thanks!
15:47mikerod_I'm a ghost now. Yikes.
15:51gdevmikerod:) welcome back to the land of the living
15:51jcromartiethis Clojure quiz on Smarterer is driving me insane
15:51jcromartieQ: "What are the 3 phases clojure code is processed in?" A: "Read-time, compile-time, run-time"
15:51gdev,(= *)
15:51clojurebottrue
15:52gdevyou got it right, why is it driving you insane?
15:52jcromartiebecause every question is weird
15:52gdevwhat about that question is weird?
15:53mikerodgdev: Thank you. It feels good to be back.
15:53jcromartiebecause as a user of the language you don't care about a compile phase
15:53jcromartiethere's a reader, but you don't necessarily need to use it to create Clojure code
15:53jcromartieand the code is evaluated, period, from a user standpoint
15:54jcromartiethe bytecode compilation has no bearing on someone programming clojure
15:54jcromartieunless they are doing something tricky with AOT
15:54TimMcmikerod: It's actually the old nick that is the ghost. If you register your nick with NickServ, you can kill the ghost and recover your nick.
15:54gdevjcromartie:) and if you're using macros
15:54TimMcNot all servers have that service, though.
15:55TimMcs/servers/networks/
15:55gdevjcromartie:) macros are a way to get the code to program in clojure for you
15:55jcromartieyeah
15:55devnjcromartie: from a "user" standpoint you don't care at all about the code, you just care that it works.
15:55jcromartieI'm not talking about a user of an application, I'm talking about a user of the Clojure language.
15:56jcromartieA programmer writing Clojure.
15:56gdevjcromartie:) those are called developers
15:56jcromartiesure
15:56ToxicFrog...and as a programmer writing Clojure, you are in fact interested in the distinction between the read, compile, and run phases, because macros are tasty
15:56devn^
15:56devnThat was what I driving at
15:57devnMainly trying to demonstrate that "user" is ambiguous. Some programmers might not need to care about read, compile, and run, but some care.
15:58gdevThere's a Rich Hickey video where he talks about why homoiconicity is so important and goes into comparing languages that compile from text into byte code with lisp
16:00gfredericksclojure supports annotations?
16:00jcromartieI feel like this test was created to troll Clojure developers
16:00jcromartie"True or False? A symbol in Clojure can contain symbols that most imperative language variables can't handle. (Example. You can't define a variable with the name of +1-.)"
16:01gdevjcromartie:) I took the Sun Certified Java Programmer exam, that one is a huge troll to a clojure programmer
16:01jcromartieQ: "True or False? The Clojure language is a data manipulation language written in data." A: True
16:01gfredericksany language that wants infix notation tends to disallow -
16:01Pupnikgdev, got a link to that talk?
16:02Chousuke:P
16:02gdevPupnik:) I'm googling for it as we speak =D
16:02jcromartietechnomancy: you may also be surprised to learn that Clojure is NOT an imperative language :)
16:02Pupnikrich hickeys talks are always very interesting and i havent heard this one
16:02jcromartietechnomancy: if you just ignore `do' and atoms and all that
16:05muhoodoes this really not exist anywhere in the clojure standard libraries? https://www.refheap.com/paste/14188
16:06jcromartiemuhoo: it really does not… that's specialized enough and not hard to write
16:07mikerodTimMc: Thanks, I will look at this. I use the freenode webchat client right now. I think my network blocks me from connecting through the IRC client I usually use.
16:09muhoojcromartie: it wasn't hard to write, but it sure ain't specialized. many languages have a "capitalize words" function
16:09devnIs there an easy way to build a leiningen plugin to add a key/val to the user's project.clj?
16:10Pupnikmuhoo, does java have one?
16:10jcromartiemuhoo: right… just not Ruby or Java or JavaScript or ...
16:10jcromartiePython does
16:11gdevPupnik:) I think this is the one, or at least he's talking about the same thing at about 24 minutes into it http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Rich-Hickey-and-Brian-Beckman-Inside-Clojure
16:12Pupnikgdev, im always interested to here bits about homoiconicity and macros, I still don't particularly know under what circumstances they are useful
16:13jcromartieC# has the ever-so-intuitive System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase("exAmpLe sTrinG")
16:13gdevPupnik:) at about 48 minutes in he gives a better explanation with better visuals http://www.youtube.com/watch?v=P76Vbsk_3J0
16:14brainproxydnolen: in your opinion, is mori still a viable approach to provide persistent data structures to JavaScript? I tried building after cloning and updating to latest cljsbuild, but the more.node.js it outputs is throwing errors realated to goog.string
16:14brainproxyrather than spend a bunch of time hunting that down, i figured i would ask if you still think mori is worthwhile, or if things have happened with cljs that make it unviable
16:14gdevactually, the "Clojure for Java Programmers" videos were the most entertaining because of the old guy that kept interupting
16:14muhoojcromartie: python, perl, php, from memory. hmm, if java string library has one, i should just use that.
16:16brainproxyjimduey: you might like https://github.com/michaelsbradleyjr/jonas/blob/master/index.js
16:17brainproxyi took what I learned from protocol-monads and used technique to build a State monad abstraction for JavaScript that layers on top of JS promises
16:17Pupnikcheers gdev
16:17muhoojcromartie: CurrentCulture???!! what are they doing, growing yogurt?
16:17gdevPupnik & jcromartie actually at 58 minutes in to "Clojure for Java Programmers" video he has all three phases that clojure is processed in
16:19Chousukebrainproxy: that's funny, promises form a sort of monad by themselves :P
16:19muhooah, commons has one http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/text/WordUtils.html
16:20brainproxyChousuke: they do, yes
16:20jimdueybrainproxy: nice
16:20jimdueyChousuke: I've got to look at it more, but I think promises are more like comonads.
16:20brainproxyChousuke: but my thought is that the State monad idiom of [state, value] and the standard "helpers" is pretty useful
16:21brainproxyespecially if you have a "do" like thing
16:21jimdueybut they're also easy to think about as monads.
16:21brainproxythat gives you a lexical environment for chaining operations wherein you can refer back to results of previous steps
16:21brainproxywhich I'll be working on soon
16:21Chousukethere's a yo dawg joke here somewhere. but I bet you could get a monad out of DAWGs too and then it would get ridiculous
16:21jimdueyChousuke: lol
16:21brainproxy:)
16:23gdevPupnik:) macros are useful when you want something to be in the language that isn't. most people take it for granted. Macros are way better than JSRs
16:23brainproxythe downside in JavaScript is that mutable state can bite you in the butt if you're not careful regarding how you work with the the state and values you're passing through a program
16:23Pupnikgdev, JSRs?
16:23gdevPupnik:) Java Specifications Requests
16:23brainproxypromises and I think my State abstraction help, but don't completely eliminate the problem
16:23Pupnikah, I don't know java
16:23muhooPupnik: consider yourself lucky.
16:23PupnikI only know actionscript 3, lua and a little bit of C/C++ and Clojure
16:23Chousukepromises are a great tool in JS though
16:24brainproxyChousuke: they are, but I now suddenly have a renewed interest in dnolen's mori
16:24Chousukehandling all that async code control flow explicitly is a huge pain in the butt
16:24gdevPupnik:) okay, well in java if you want something in the language you have to go through a huge ceremony
16:24brainproxyas mori's persistent data structures are the perfect kind of things to use for state/values
16:25gdevI can't tell you how many goats were sacrificed just to get the foreach keyword
16:25jcromartiegdev, Pupnik: JSRs are one thing… not to mention the huge ceremony of actually implementing it!
16:25brainproxyChousuke: yep, except you can still end up with a bunch of boilerplate depending on how you are chaining promises
16:26brainproxythe other night I was doing some complex chains that drove me toward a helpful pattern, which when I stood back and looked at it, I said "hey, that's more or less the state monad"
16:26Chousukebrainproxy: sure, but it's probably way less than all the nested anonymous functions. :)
16:26gdevbeing a java developer around clojure developers who've never used java, I feel like one of those old vietnam vets who always says "i've seen some things, and some stuff...i wouldn't recommend it"
16:26brainproxyChousuke: exatcly, but I think w/ an abstraction layered on top of promises, we can make it even better
16:27brainproxyiow, callbacks < promises < State
16:27brainproxyin terms of efficiency of abstraction
16:28Chousukeas far as I understand state should be orthogonal to promises. Combining them can of course be useful (composition is great, after all)
16:29technomancy"I've seen things you people wouldn't believe. Build servers on fire off the shoulder of Orion. I watched maven artifacts glitter in the dark near the Tannhäuser Gate. All those... moments... will be lost in time, like tears in the rain."
16:30jcromartie(inc technomancy)
16:30lazybot⇒ 55
16:30clojurebotthat will show you what jars (including the clojure jar) leiningen is using
16:30jimdueybrainproxy: perhaps of interest http://www.cs.umd.edu/~jfoster/papers/cs-tr-4923.pdf
16:31brainproxyChousuke: you may be right
16:31technomancy"We couldn't find any repositories matching 'tannhauser'" <- github, I'm disappointed.
16:31gdevtechnomancy:) everytime you quote something I assume its from bladerunner
16:32jimdueybrainproxy: or this might be a better link http://www.cs.umd.edu/projects/PL/arrowlets/
16:32brainproxyjimduey: very cool
16:32brainproxyI spent a loooong time working with Flapjax a couple of years ago
16:33brainproxywhich is related
16:33devn(inc technomancy)
16:33lazybot⇒ 56
16:33technomancyhuh; Tannhauser is a Wagner reference. nicely played, Rutger Hauer.
16:34brainproxyjimduey: i mean related conceptually
16:34Chousukebrainproxy: It's always interesting to me to see how people are implementing more and more Haskell idioms in other languages
16:34devnparsec all the languages!
16:34tieTYT2why doesn't clojure have (all)?
16:35devntieTYT2: like, (all even? [2 4 6]) or?
16:35tieTYT2the first
16:35tieTYT2it has an every?
16:35tieTYT2ok i'll use that
16:35devnyes
16:36tieTYT2ugh but it doesn't takes multiple args
16:36jimdueyChousuke: I see them more as category theory abstractions than Haskell idioms
16:36jimdueyand it's my mission in life to implement all of them in Clojure. :)
16:36Chousukejimduey: same thing. it's funny how category theory translates into practical programming
16:36tieTYT2i'll just wrap my args in a vector
16:36brainproxyjimduey: have you seen bilby.js
16:37Chousukethough I still have no idea what the hell profunctors are supposed to be about
16:37tieTYT2i feel (every? nil? [e1 e2]) is more readable than (nil? (or e1 e2)) Is there an even clearer way?
16:38brainproxyjimduey: https://github.com/pufuwozu/bilby.js <-- the author is doing some pretty serious work with functional programming for javascript
16:38Chousukefunctors I can see, they're really useful all the time, but I don't even understand the definition of a profunctor, much less why it would ever be useful.
16:39Chousukejimduey: it's just one of those things I've encountered reading random things about haskell that I haven't yet been able to make sense of
16:40Pupnikman i could listen to rich hickey all day
16:40jimdueybrainproxy: bilby looks ambitious. I think most of the libraries I've done so far that are based on protocols will be portable to clojurescript
16:40pjstadigtieTYT2: if you're using it as a conditional, then just use (and e1 e2)
16:40pjstadigor whatever
16:40jimdueybrainproxy: protocol-monads already has been
16:40brainproxyjimduey: yeah, saw that
16:40Chousukejimduey: but apparently the lens library uses profunctors so it must have some practical use
16:40tieTYT2pjstadig: ha, I feel dumb
16:41tieTYT2pjstadig: well actually I'm doing the opposite of and
16:41jimdueyChousuke: lenses are also on my list. BTW, it's a really long list.
16:41tieTYT2i'm checking that they're both null
16:41tieTYT2not that they both exist
16:41amalloymikerod: https://www.refheap.com/paste/776ba83c0bcd45f07eb024dae
16:41Chousukejimduey: as far as I can tell lenses are the ultimate code golfing tool
16:42pjstadigtieTYT2: yeah so you could do (not (or e1 e2)) or (and (nil? e1) (nil? e2))
16:43tieTYT2pjstadig: you think that's easier to read than (every? nil? [e1 e2]) ?
16:44tomojbilby lenses aren't van laarhoven, right?
16:44tieTYT2IMO the latter expresses its intent better
16:44pjstadigtieTYT2: it may depend on the context, but i think i'd favor something with ands or ors to using every? and making a vector out of the expressions
16:46gdev"Quite an experience to live in fear, isn't it? That's what it is to be a java dev doing concurrency"
16:47tomojI just got this passing https://www.refheap.com/paste/242b5b8583854d7411312acf1 but what's the point, I want van laarhoven :(
16:47technomancyheh nice
16:48justin_smithtieTYT2: (empty? (remove nil? [e1 e2]))
16:48rodnaph_using enlive, is it possible to do a selector using element attributes? like jquery would be: input[name=foo] ?
16:48brainproxygdev: http://image.slidesharecdn.com/concurrencygotchas-100408105435-phpapp01/95/slide-7-728.jpg?1270742095
16:49nkozahow you can see the tcp port used by nrepl to listen for connections from inside the nrepl session?
16:51rodnaph_to answer my own question, yes, using (attr= :href "foo")
16:52tieTYT2rodnaph_: you want to check that the name = foo?
16:52tieTYT2yes
16:52tieTYT2i hate enlive btw
16:52rodnaph_whaaa? i am currently loving enlive. what don't you get on with?
16:52gdevbrainproxy:) i thought that was going to be a link to some slideshow, i almost fell out of my chair laughing
16:52tieTYT2I don't like the double nested vectors
16:52gfredericksTimMc: I like your inclusion of hiredman as a debugging requirement
16:53tieTYT2and their significance, it's confusing to me
16:53tieTYT2and i wish the selectors were better documented
16:53gdev(inc brainproxy)
16:53lazybot⇒ 1
16:53rodnaph_i haven't gone too deep into the selector syntax tbh (as u can tell from my q)
16:53brainproxygdev: :) that came from one of Alex Miller's slideshows
16:53tieTYT2i've only used the selector part
16:54rodnaph_i use it for html templating, works really nicely.
16:56tieTYT2can someone explain to me why I should have to use a dorun when I use map in a precondition?
16:57ChousuketieTYT2: map is lazy
16:57tieTYT2yeah but why isn't pre trying to get the results?
16:59mikerodamalloy: Thanks. I think I can see your point on that with functions and macros having some assumptions on argument forms.
16:59Raynesgfredericks: Wtf, I wasn't following you on twitter? No wonder my life is so empty.
17:00gfredericksI have finally made it!
17:00gfredericksno more striving for me
17:01RaynesI have a haircut.
17:01gfredericksso no more striving for you either
17:01gfredericks"v1.9" == birthday?
17:02Raynesgfredericks: Nope.
17:02technomancyjust minor bugfixes
17:02technomancyor a complete VM rewrite, if you're ruby
17:03Raynes$google list of burn centers
17:03lazybot[List of burn centers in the United States - Wikipedia, the free ...] http://en.wikipedia.org/wiki/List_of_burn_centers_in_the_United_States
17:05gdevgfredericks:) after i starting following you it suggested i also follow the parody account for charles manson
17:07gfredericksgdev: good?
17:08gdevgfredericks:) depends, I'm just assuming its a parody account, but I'm too scared to google search if charles manson is still alive while at work
17:09AimHereI believe he's still alive, yes
17:12gdevis there a safer way to do this? (read-string (slurp "some.properties"))
17:12justin_smithclojure.data.edn/read-string
17:12justin_smithfor 1.5+
17:13justin_smiththere is also a thing before 1.5 where you can turn some magic evaluation reader macros off
17:16justin_smithoh, yes - it is good to bind *read-eval* to false - but there are still gotchas
17:17gdevjustin_smith:) thanks
17:18gdevjustin_smith:) am I being too paranoid if the file I'm reading from is a properties file i wrote?
17:18justin_smithheh, maybe, but we have had the exact same conversation at my workplace :)
17:19justin_smithbut clojure.data.edn/read-string, in 1.5+, is the thing that is designed to be safe to read without weird unintended security issues
17:20tieTYT2I have a bunch of date Intervals and I need to do certain things with them. EG: If one contains the other, keep the container. If one is after the other, keep both. At first I thought a (reduce) would be a good fit. But I'm having second thoughts because if I return both, the reduce function now has to check if the input is a Interval or a vector of two Intervals.
17:20gdevjustin_smith:) if I just use an edn file instead of a properties file couldn't I just validate the data its reading
17:20tieTYT2oh i left out a detail: I've got a list of the details, and I'm trying to decide which ones to keep and which to throw away
17:21gfrederickswhat do you folk use instead of capistrano?
17:21justin_smithgdev: the issue is that just in being parsed, it can make other things happen, even before you use the data
17:21justin_smithunless you are using c.d.edn
17:21justin_smithhttp://clojuredocs.org/clojure_core/clojure.core/read toward the end of that page it is explained in more detail
17:22gdevjustin_smith:) yeah that's what i meant, I'll use an edn file with the edn reader and I'll sleep safe at night
17:22gdevmkay I'll check out that link
17:34TimMcgfredericks: That was ha-ha-only-serious -- I'm really not sure I would have gotten to the bottom of that without the help of someone well-versed in JVM.
17:36gdevso now I've painted myself into an awkward corner; (def configs (read-string (slurp "super-secret.config"))) (def oracle-db {:user (:user configs) ...})
17:37gdevi elipsed out the rest of the def, but you get the idea, i have to deref with the same key as the key i'm trying to set a value for
17:37gdevcould i simply say (def oracle-db configs) ?
17:37justin_smithwhy not make the oracle db a submap of the config? {:db {:user ...}} then (def orcle-db (:db config))
17:38gdevthe file has the exact map that the def needs
17:38TimMcgdev: select-keys
17:38justin_smithif that will always be the case and any other configs will be in another file, why not (def orcale-db configs)
17:39gdevjustin_smith:) yeah, that's what i'm going for, just trying to keep company server, username, passwords etc off the interwebs
17:39justin_smithmakes sense, yeah
17:40gdevit's tricky posting database examples since to connect you have to have username and passwords stored
17:40TimMc&(select-keys {:user {:blah "blah"} :un "related"} [:user])
17:40lazybot⇒ {:user {:blah "blah"}}
17:41justin_smithTimMc: my problem with doing configs that way is you end up with unrelated configs interleaved, when nesting would clearly indicate the separation. And then some configs should use the same key with different values...
17:41avishaiq
17:41avishairequire vs use
17:41avishaiu probably get that a lot
17:42gdevavishai:) I have to look it up every time
17:42TimMcavishai: Are you asking whether to use :require or :use? Definitely :require, almost always.
17:42avishaireally?
17:42TimMcAnd only use :use with :only.
17:42avishaiwhy?
17:42clojurebothttp://clojure.org/rationale
17:42TimMcNamespace pollution.
17:43avishaiwhy require and not use
17:43justin_smithyeah, use makes reorganizing code a pain in the ass, or even reading it
17:43gdevavishai:) you can use :as with require
17:43akhudekuse :require and :refer rather than :use
17:43TimMcavishai: It's really hard to read code that heavily refers vars.
17:43akhudekif you really want to use everything, you can do (:require [library :refer :all])
17:44avishaiso (ns blah (:require [some-ns :as n])) ?
17:44TimMcYep.
17:44avishaiso other then style use and require do the same thing?
17:45akhudekavishai: require with refer is the same as use with only, but is now the preferred style as I understand
17:45TimMcavishai: (:use foo) == (:require foo :refer :all) -- but you really don't want that anyway.
17:45akhudekand as TimMc, it is better to require :as if most cases
17:46justin_smithavishai: they both make libraries accessible - but if your json lib and your xml lib both have a parse function, then require is your only option, use just won't work
17:46TimMcPeople will hate reading your code.
17:46avishaican i import with the full name/
17:46avishai?
17:46justin_smithrequire lets you use the full name
17:46avishaiah
17:46justin_smithbut also lets you use :as
17:46avishaiso i want just (:require some-ns)
17:47justin_smithif you want to spell it all the way out, yeah
17:47avishaigreat
17:47avishai10x
17:47gdevalthough the only pain point for me in using ":as" is when i have (kd/this (kc/that (ps/i-like-turtles (ps/wat 42) all the slashes, slashes everywhere =(
17:47justin_smithbut (:require [foo.bar :as bar]) ... (foo.bar/x ...) still works
17:48justin_smith(let [foo bar/foo] ...) is helpful sometimes
17:48justin_smithstill more readable than a :use
17:49avishaii find long names more readable
17:49avishaiand if you work with autocompletion writing is easy
17:50nkozahow you can get the tcp port used by nrepl to listen for connections from inside the nrepl session?
17:51gdevso i would say (let [this kd/this that kc/that i-l-t ps/i-like-turtles wat ps/wat] (this (that (i-l-t (wat 42)))) ?
17:52gdevwho is working on the strunk and white for clojure?
17:53justin_smithwell, it doesn't help much for that example, but if you were using string/join over and over in one block but not in the rest of your ns, (let [join clojure.string/join] ...) totally makes sense
17:53akhudekbbatsov
17:53akhudekhttps://github.com/bbatsov/clojure-style-guide
17:53justin_smithbut yeah, pretty much
17:58tomojyou lose typehints in that case right, or is clojure smart enough?
17:59gdevi'm totally forking that repo, not in a pycon way either, like literally
17:59pppaulclojure brains
17:59tomojnope, not smart enough
17:59hiredmanclojure-style-guide is silly
18:00gdevhiredman:) yes, once you've used the language for a while, but when first starting out it seems helpful
18:01hiredmanI submitted a pr to make it less so, but it was rejected https://github.com/hiredman/clojure-style-guide/commit/0e904f2b41866fcccddc924a3e5faf5660b2cb4a
18:01gdevhiredman:) oh i thought you were talking about the idea of a style guide, i didn't know you meant that specific one
18:02justin_smithgdev: read his rq, you were right
18:03gdevjustin_smith:) his rq?
18:03justin_smiththe pull request he linked
18:03justin_smithyou were right the first time
18:03hiredmanthe style guide is basically "let's write down how emacs formats lisp", which even as an emacs user I think is silly
18:04justin_smiththe reason emacs formats it that way is because reasonable people wanted that as a default
18:04gfredericksif macros could include metadata to suggest formatting, would that be cool or stupid?
18:04technomancygfredericks: CL indents differently depending on whether slime is connected or not
18:04technomancydo not want
18:04clojurebotNo entiendo
18:04gdevlol i just read the pull request very clever hiredman, very clever
18:04hiredmanthat is almost how the emacs indenting system works
18:04hiredmanyou add indenting info to the plist of symbols
18:04technomancybut emacs is always "live"
18:04technomancyelisp
18:05gfrederickshiredman: that's symbol based instead of var based though, right?
18:05technomancygfredericks: symobls in elisp are kind of like vars
18:05technomancythey are storage locations
18:05hiredmantechnomancy: works for non-elisp lisps too
18:05justin_smithyeah, every symbol has a plist, like in cl
18:06hiredmantechnomancy: I have a little mode for the lisp I am writing that does it
18:06gfrederickstechnomancy: are you still bullish on racket?
18:06technomancyhiredman: right, but the whole "language describing its own indentation" thing only works for slime and elisp
18:06technomancygfredericks: there are a couple things about it I hate. but there's a lot to like.
18:06hiredmantechnomancy: sure, or a pretty printer
18:07technomancygfredericks: it seems like a good fit for this project I'm doing on the raspberry pi.
18:08hiredmanI'm telling you, the jvm will run great on that
18:08technomancymy fallback plan is elisp =P
18:12technomancywait is bullish good or bad?
18:13hiredmanhttps://en.wikipedia.org/wiki/Market_trend
18:13TimMcGood, I think.
18:13technomancyhuh. I assumed with such a low edit distance from "bullshit"...
18:14hiredmanyo, it's the animal spirits
18:15hiredmanhttp://en.wikipedia.org/wiki/Animal_spirits_%28Keynes%29
18:18mthvedtwell a lot of bullish opinions are reflective of that edit distance
18:18learnerHello Clojure Gurus, I have been learning clojure. Trying to understand apply function more clearly. I executed "(apply vector [:a :b] [:c :d])" expecting result [:a :b :c :d] -- one single vector --> instead I got [[:a :b] :c :d]. If any of you explain me how exactly apply works, it's great. Thanks for your time.
18:18TimMchiredman: Not to be confused with spirit animals.
18:19trptcolinlearner: apply unrolls only the last arg given; the rest of the args are passed directly (in front of the last arg)
18:19trptcolin,(apply vector :a :b [:c :d])
18:19clojurebot[:a :b :c :d]
18:19gfrederickswhich is useful a lot of the time
18:21learnertrptcolin: Thanks. Excuse me for my lack of knowledge and little brain, would it be possible to explain me in simple words. what do you mean by "apply unrolls only the last arg given"
18:23trptcolinlearner: here's an easier-to-understand example: you can think of (apply + 1 2 [3 4]) as more or less the same as (+ 1 2 3 4)
18:23trptcolinthe last argument [3 4] needs to be a sequence-like thing, and it gets "unrolled" when it's passed to the function (the first argument to `apply`)
18:25TimMchttp://dev.clojure.org/jira/browse/CLJ-1208 "Namespace is not loaded on defrecord class init"
18:25learnertrptcolin: Exactly that example confused me. I was expecting (apply vector [:a :b] [:c :d]) to behave (apply vector [:a :b :c :d]).. but it's not
18:26trptcolin(apply vector [:a :b] [:c :d]) is like (vector [:a :b] :c :d)
18:26TimMc(apply vector [:a :b] [:c :d]) => (vector [:a :b] :c :d)
18:26TimMcsniped
18:26trptcolinhehe
18:27tomojdo you really want to be using records directly from java anyway?
18:27TimMcYep.
18:30learnertrptcolin: Based on your explanation, I tried couple of examples on REPL. I am clear now. Cheers mate. BTW, quoting-without-confusion -> is my one of my favourite bookmark.
18:31learnerTimMc: Thanks for clarifying apply vector question
18:34mikerodWhat is "quoting-without-confusion"?
18:35learnermikerod: it's Colin's article. trptcolin: http://blog.8thlight.com/colin-jones/2012/05/22/quoting-without-confusion.html
18:37mikerodlearner: Ah, I didn't realize that. I have read this before and agree that it is useful.
18:42learnerAnother question Gurus. To practice & improve my clojure skills, I am planning to write a simple password cracker (brute force). I would like to control number of threads I initiate, and if password found I update an atom(found) value to TRUE. Loop terminates if TRUE found. I am using https://github.com/clojure/math.combinatorics to get various combinations. But I am not sure on how to control threads and stuff. Any pointers are rea
18:47SegFaultAXlearner: That's a really inefficient way to crack passwords. Dictionary attack is much better.
18:48AimHerePhishing scam is better still!
18:48SegFaultAXlearner: http://www.openwall.com/john/
18:48SegFaultAXNot that I'm endorsing that sort of thing for malicious purposes, you see.
18:48SegFaultAXI'm just sayin...
18:49learnerSegFaultAX: Thanks for your reply. I don't mean to crack passwords really. But to learn concurrent programming and experiment on threads. If I were to crack password, Yes I target to get Hash!
18:52SegFaultAXlearner: This sounds like an awesome opportunity to learn about reducers and Fork/Join!
18:53learnerSegFaultAX: True. I am not sure where to start though. I am wondering if the community can point me to couple of examples.
18:54SegFaultAXlearner: Probably do it in phases. Start with a single threaded synchronous version, then a second version built on futures, etc.
18:55SegFaultAXBut get a working conceptual model first before you try and add paralellism.
19:01learnerI think understanding clojure way of solving sleeping barber's problem gives me a good start on concurrency. Just in case if any of you also looking for examples. Thanks for all your support.
19:06amalloySegFaultAX: this sounds like a terrible opportunity to use fork/join, right?
19:07amalloyor, at any rate, a bad time to use reducers
19:07amalloysince r/fold has no provisions for stopping early
19:07amalloyor in fact coordinating at all with the other threads working on the task
19:08amalloyreally he wants like...a queue of "passwords to try", and a threadpool of workers taking jobs from there; he just stops putting stuff on the queue, or shuts down the threadpool, when an answer is found
19:10tieTYT2is a reducer different from the reduce function?
19:14amalloy$google clojure reducers
19:14lazybot[Clojure - reducers] http://clojure.org/reducers
19:14tomoj"reducers are composable", huh
19:15apocwhats (fn*)? I get it from something like '#(+ % 1) but I've trouble finding out what the * does
19:15tomojreducer combinators are composable, but they're just functions, so what does that even mean?
19:16SegFaultAXamalloy: I didn't know that about reducers, I just lumped that into Fork/Join. Probably misspoke. But FJ is still reasonable here.
19:16tomojI guess maybe it means that there are functions in the reducers library :)
19:16tomojwhich is better than lots of collection libraries at least
19:18amalloytomoj: composable is just a word rhickey likes. saying it soothes him
19:18SegFaultAXtomoj: Not all functions are composable.
19:19tieTYT2thanks
19:20tomojI mean reasonable functions :)
19:20SegFaultAXtomoj: "Reasonable" isn't a word I understand in this context.
19:20tomoj"composable"
19:20justin_smith apoc: fn* is a function, that the fn macro calls
19:20justin_smithsimilar let* / let
19:20tomojor, say, "pure"
19:20justin_smithmaybe special form? anyway it doesn't do data decomposition and stuff
19:21SegFaultAXtomoj: Pureness is not what makes functions composable.
19:21apocthe * makes it really difficult to search for, looks like most search engines ignore it ;)
19:21apocmaybe have a doc link for me?
19:21SegFaultAXtomoj: For two functions f and g to be properly composable with each other (f . g) the co-domain of g must be a subset of the domain of f
19:22tomojok, so "composable" then. my point is just that reducers themselves seem very uncomposable. if I've got two reducers, well, shit
19:22SegFaultAXIt may or may not be a proper subset (eg the co-domain of g may match the domain of f exactly, but that's not a requirement)
19:23tomojbut I guess maybe that enables the kind of composition that is there
19:25justin_smithapoc: you can expand the source tab on this page to see how fn calls fn* http://clojuredocs.org/clojure_core/clojure.core/fn
19:26justin_smithfn* isn't meant to be called by normal code, it is just a less useful primitive that fn is made of
19:41tieTYT2I'm reading this fogus article: http://www.drdobbs.com/architecture-and-design/the-clojure-philosophy/240150710
19:41tieTYT2he uses this code as an example: x = [5]; process(x); x[0] = x[0] + 1
19:42tieTYT2you can't tell what x will become because you don't know if process mutates
19:42tieTYT2and clojure is better because locals are immutable
19:42tieTYT2BUT, if x is a java object, aren't you just as unsure as any other language?
19:43technomancytieTYT2: yes
19:43technomancyit's just that it's easy to avoid that in clojure and nearly impossible in most languages
19:43tieTYT2i must be writing clojure wrong if it's easy to avoid that
19:44tieTYT2also some of my clojure is embedded in a java app
19:44SegFaultAXtieTYT2: Are you using lots of POJOs in your Clojure code?
19:44tieTYT2SegFaultAX: not lots, but usually a main one
19:44tieTYT2i've used seesaw, clj-http and things like that
19:44tieTYT2they're all using java objects under the hood
19:45SegFaultAXtieTYT2: Yea, there really isn't anything you can do about that.
19:45SegFaultAXClojure isn't a pure language and Java sure as hell isn't a pure runtime.
19:45tieTYT2right, so in that case I don't understand the clarity argument
19:46tieTYT2if I don't use any java libraries directly or indirectly things are easy to understand, but otherwise you never know, right?
19:46technomancyyou can get a seq over a mutable java object
19:46technomancyand it's guaranteed to be stable
19:47tieTYT2what do you mean? Like (let [x [java-object] ...) ?
19:47technomancy(seq java-list-thingy) ; <- not gonna change
19:47tieTYT2but the objects inside could
19:48tieTYT2when I pass that seq into any function, right?
19:48technomancywell, you have to apply the seq at the right level
19:48technomancyif it's a list of strings or numbers, you're fine
19:48tieTYT2right
19:48technomancyotherwise maybe you (map bean list-of-pojos) instead
19:49tieTYT2yeah I suppose that's better
19:50technomancyclojure encourages you to keep the yucky mutable bits as small as possible
19:50tieTYT2pure clojure does, yes
19:51technomancyso you do your interop in one namespace, and as long as you don't let the objects escape, your namespaces implementing the rest of the logic are clean
19:51tieTYT2maybe the unusual thing with my experience is I've always been using java somewhere
19:51SegFaultAXtieTYT2: Well, all Clojure encourages you to keep the lucky bits isolated.
19:51SegFaultAXtieTYT2: Even when you're working in Java interop, it's still encouraged.
19:52SegFaultAXs/lucky/yucky/
19:52tieTYT2SegFaultAX: maybe as a philosophy. But I can take a seesaw label and call (.setText l "foo") on it any time I want.
19:53SegFaultAXWhy is the null check in RT.seqFrom second?
19:53technomancymore importantly, someone else could do that
19:53tieTYT2technomancy: you mean a library that requires label's?
19:53SegFaultAXtieTYT2: Clojure is not a pure language. It doesn't claim to be.
19:53technomancyI guess? I don't know swing
19:53technomancyor java
19:54SegFaultAXThere is absolutely nothing to stop you from doing that.
19:54technomancyit's just more insidious when mutation comes from places you don't control
19:54SegFaultAXBut if that's the way you choose to do it, why use Clojure at all?
19:54SegFaultAXhttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/RT.java#L489
19:57hiredmanSegFaultAX: because you might call seq on nil?
19:59SegFaultAXhiredman: But why is the null check second?
20:01hiredmanSegFaultAX: *shrug*, as as it is before the method calls
20:15tomoj"values of type X are composable" =?= "the X library provides at least one non-identity function of type X -> X (in spirit)"
20:37axle_512anyone recommend a good continuous build setup for lein? Is jenkins an option or is there something better?
20:38justin_smithwe use jenkins with hooks on git
20:38justin_smithI am not the one that set it up, but it works fine
20:38axle_512justin_smith: thanks. Does it require a jenkins plugin?
20:38justin_smithand we all get to ritually humiliate the one who checked in the bad commit
20:39justin_smiththe guy who set it up is out of office (late on a friday), I only know it oworks, sorry
20:39axle_512cool. thanks, will look into it
20:39justin_smithjenkins even has an irc bot - think of the possibilities
20:40axle_512I've used jenkins with jabber to get IM notifications, that was pretty cool
20:40amalloytravis seems popular for clojure folks
20:41axle_512will take a look at travis as well. thanks
20:52lpetitaxle_512: Travis also has handful of options for post build notifications (email, irc, etc.): http://about.travis-ci.org/docs/user/notifications/
20:52axle_512lpetit: thanks, I just signed up on travis-ci.org.. digging deeper
20:54lpetitaxle_512: it's very straightforward, read about it a little bit, then tried to push my maven + tycho (for Eclipse plugins) tonight. First successful build in less than an hour
21:13Apage43when I kill an nrepl evaluation (ctrl-c) is there a way to see the stack trace as of when I killed it?
21:14Apage43Trying to debug a deadlock
21:15gdevApage43: trace log?
21:19nkozaI want to test if something can be converted to a seq with (seq x) ... there is some predicate to know if that is possible? (seq? x) doesn't work, for example (seq? [1 2]) evaluates to false
21:22nkozaI see in clojure 1.2 there was a clojure.contrib.core/seqable? function, where is now?
21:22axle_512lpetit: saw you over on #travis as well. travis ci is quite nice, I'm already up and running with a little help from henrikhodne.
21:23Apage43nkoza: you can grab it from the old repo. https://github.com/clojure/clojure-contrib/blob/b8d2743d3a89e13fc9deb2844ca2167b34aaa9b6/src/main/clojure/clojure/contrib/core.clj#L78
21:23nkozathere is no modern way?
21:24Apage43don't know what you mean.
21:24gdev,(instance? clojure.lang.Seqable [1 2 3])
21:24clojurebottrue
21:25Apage43,(instance? clojure.lang.Seqable "i'm a string")
21:25clojurebotfalse
21:25Apage43,(seq "I'm a string")
21:25clojurebot(\I \' \m \space \a ...)
21:26Apage43so no. If you want to check if seq will succeed you have to check all the things it works on
21:26nkozaI mean, seems to be some very basic, I'm surprised there is no official predicate to check for that
21:26nkozabut thanks for the link, I will use it
21:27gdevthats not that many checks in an or statement
21:27tomojpresumably it was removed for a reason :)
21:28gdevdon't be presumptuous
21:28amalloyApage43: "all the things it works on" is an open-ended set
21:28Apage43mm, it could increase in the future
21:29amalloyApage43: it can increase right now. [B, [[B, [[[B...
21:29amalloythere are already an infinite number of seqable classes
21:29Apage43amalloy: right, but that's checkable
21:29amalloysure, using reflection
21:30amalloyif you can find it, dnolen has a blog post about memoizing that reflection check for seqable? by dynamically extending protocols at runtime
21:30gdev,(seq \x)
21:30clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Character>
21:30gdev,(seq 42)
21:30clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
21:31gdev,(seq 'seq)
21:31clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol>
21:32tomojhttp://web.archive.org/web/20120726061808/http://dosync.posterous.com/51626638
21:33tomojI figured extending protocols at runtime was evil
21:34amalloywell, basically yes. but the goal is evil too, so it evens out
21:34tomojI guess it's only evil if I use it to implement implementation inheritance?
21:34tomojah :)
21:34dnolentomoj: extend-type is inately a runtime thing
21:35tomojdunno how to say what I mean but I figure you know?
21:35tomojI guess I mean extending in a default impl
21:35dnolentomoj: it's your protocol, what's the problem?
21:35Apage43okay, I broke emacs enough times today, time to head home
21:36tomojI think the problem is that my goal is evil
21:36dnolentomoj: oh I probably missed that
21:37tomojI want protocol<->protocol extension
21:37dnolentomoj: terrible idea
21:37dnolenwell IMO, I know other people have done it and like it.
21:37tomojso I'm left thinking that there is something wrong with reducers, because it has an ugly workaround for that
21:38dnolentomoj: that said, extending protocols to interfaces is less of a hassle in CLJ
21:38tomojoh, yeah, but that's cheating :)
21:38dnolenin CLJS you gotta do that work in default implementations
21:38amalloytomoj: what workaround?
21:39tomojhttps://github.com/clojure/clojure/blob/master/src/clj/clojure/core/protocols.clj#L39
21:40dnolentomoj: that's just the default implementation
21:41tomojthe 'ugly workaround' is to use the default impl to extend a protocol to a closed set of other protocols
21:42nkozamaybe is simpler to do (defn seqable? [x] (try (seq x) true (catch Exception e false)))
21:42Apage43nkoza: well, that'll also eat any exception realizing the first element of a lazy seq
21:43amalloyit also doesn't work for empty collections, but that's an easy fix
21:44nkozatrue, maybe there is a way to check if the exception was made before or after realizing that element... maybe inspecting the stack or something
21:44amalloythe original implementation wasn't evil enough for you, nkoza?
21:44tomojI hadn't noticed that cljs has the IReduce impls directly on all the concrete seq types
21:44tomojthat is nice
21:44nkozalearning is to explore all the evil corners :)
21:45nkozacan you call (seq col) without realizing the seq first element?
21:46tomojif that's what clj wants to do, then I retract my complaint - I'll just have to implement IReduce directly on all my concrete types
21:46tomojotoh if clj really wants to abuse the default impl, it seems unfair :)
21:46dnolentomoj: it's the right way if more tedious.
21:47tomojhmm
21:48dnolentomoj: it does make a compelling argument for some language level type union.
21:49dnolensolves the tedium - tho not the closed problem
21:49tomojso should (into [] (reify clojure.lang.ISeq (seq [this] this) (first [_] :foo) (next [_]))) fail?
21:50tomojer, (r/reduce conj [] (reify ...)) say
21:50tomoj(oh, same thing-ish)
21:51tomojnot sure what you mean about the union, but I'm guessing it would allow that to succeed, and then like you say the problem is just that it won't work for (reify com.example.MyISeq ...) ?
21:53dnolentomoj: sorry I'm talking about a problem for CLJS which does get to ride on interface inheritance to avoid tedium.
21:53dnolendoesn't
21:54tomojyeah, like clojure.data.diff? and the reify thing fails there iirc
21:55tomojah well, moot if I'm right that IReduce is wrong
21:56dnolentomoj: I'm missing some context here, why is IReduce wrong?
21:57nkozabtw, I found two posts by Rich about the "seqable?" issue: https://groups.google.com/d/msg/clojure/sqok3RqGEC8/m63Kv_qYUDgJ https://groups.google.com/d/msg/clojure/CPFPkyTYXGc/jfuaHOjWPPwJ
22:00dnolennkoza: those are old posts, CLJS has ISeqable and seqable?
22:00dnolenin fact strings and arrays were extended to ISeqable until recently
22:00tomojdnolen: reducers need to be broken up more, I think. CollReduce specifies synchronous single-threaded execution and CollFold (sort of) specifies ForkJoin
22:01dnolenthey no longer are, but I pretty much agree on the minor utlity of seqable?
22:01tomojI'd rather those concerns be separate
22:02nkozadnolen: "grep -r ISeqable *" gives nothing on clojure 1.5.1 source
22:02dnolentomoj: reading the code I don't really agree.
22:02dnolennkoza: ClojureScript
22:03dnolensorry I abbreviated it as CLJS
22:03nkozawhy ISeqable exists on CLJS and not in CLJ? CLJS is more based on protocols, like a CLJ cleanup? (I'm new to CLJS)
22:04tomojsay I have some other way to execute a binary tree of tasks besides FJ -- I have to copy+paste foldvec, replace the FJ bits, and then wrap my vectors in a special CollFold wrapper that uses my execution mechanism?
22:06tomoj"wrong" was probably too strong - I quite like reducers, I just want more (really, less?)
22:06dnolentomoj: it might be usefult to break out the strategy, but then why not make a more flexible protocol for your own use?
22:07clojurebotforget chouser: it's tougher with guards (arbitrary tests), where grouping is less clear. I need to work that out still.
22:07dnolennkoza: CLJS is newer is all
22:07tomojdnolen: yeah, that's what I hope to be able to do
22:08nkozadnolen: ok, thanks
22:09amalloydnolen: that seems like a weird answer to nkoza's question. you couldn't define ISeqable usefully in clj-jvm. you have to either make it an interface, in which case it can't be extended to existing jvm types; or a protocol, in which case it's very hard to bootstrap the compiler up to the level where protocols exist
22:11dnolenamalloy: I didn't mean to imply that CLJ JVM could solve this issue easily - I just meant that CLJS is newer and designed w/ protocols in mind from the beginning.
22:12nightfly__is cljs self hosting yet?
22:12dnolennightfly__: nope
22:13nightfly__That's too bad. I really like the idea of it but am really attached to macro expansion happening in the same dialect/implementation as the runtime.
22:15dnolennightfly__: I've written some fancy macros and never needed access to the runtime so it doesn't bother me. But it's useful for the very fanciest of fancy macros.
22:16dnolennightfly__: CLJS will likely bootstrap at some point but there's a quite a bit of work to do. There is a fork of CLJS that bootstraps - http://github.com/kanaka/clojurescript
22:17nightfly__I'll definitely check that out, thanks.