#clojure logs

2015-05-01

00:00justin_smithTimMc: at least 4 victims
00:00brehaut'surprised' has got to be an understatement
00:00brehautFOUR
00:00brehautand one was with a screw driver
00:00brehautwhat on earth
00:01justin_smiththe stuff of nightmares, now I am sorry I shared it
00:02brehautnightmares is the truth
00:03brehautbrb looking at hilarious cat pictures to recover
00:07cflemingjustin_smith: Did anything ever come of your error message categorisation crusade?
00:09justin_smithcfleming: got hired full time, so my free time kind of disappeared
00:09cflemingjustin_smith: No worries, just wondering
00:09justin_smiththough as I settle into the new routine I may come back to that project, because it is definitely worthwhile
00:09justin_smithafter so long contracting from home, having a 9-5 is a big change
00:09cflemingAbsolutely
00:10cflemingYeah, I bet
00:12brehautjustin_smith: ive done similar recently. suddenly my veggie garden is an overgrown mess
00:14brehautits kind of amazing where the time goes
00:18TimMcalso there was that hobbit infestation
00:19brehautacutally more common than you'd think
00:21TimMcQuestion for people who use Java at work: Is it important to you that artifacts be in Maven Central, or are you pretty free to point to other repositories?
00:21TimMcbecause I am about done with trying to deploy there
00:22TimMc(this might be the wrong time of day to poll)
00:25cflemingTimMc: In my last job we didn't care where the jars came from, but be aware that if something isn't in Maven central it's effectively invisible.
00:26TimMccfleming: But can I reasonably tell Maven users "add the dependency this way" and tell them to point to clojars?
00:26TimMcI know it won't show up in regular searches.
00:27cflemingTimMc: Well, you could have told us that, but YMMV - I'm not sure how common that is
00:32TimMcI think a lot of folks use a nexus server that has to be specifically configured for different upstream repos, so that would be a problem.
00:39fowlslegsHow might I go from [ [ [0 1] [2 3] ] [ [3 4] [5 6] ] ] to [ [3 5] [7 9] ] with concurrency in mind?
00:41justin_smithvia which rule?
01:04TimMc(constantly [[3 5] [7 9]]) :-P
01:24arrdemconstant time, constant space, yep we're done here
04:01kritzcreekI want to learn Clojure but I'm coming from a functional background. Is there a book or tutorial that targets me as an audience?
04:21wasamasathat's a new one
04:21wasamasausually people come to clojure *because* they want to learn functional programming
04:23anti-freezeHi everyone. So, I'm a Clojure n00b and I'm trying to implement a generic uploader for some web software that allows, depending on some arguments uploading to public/uploads or anywhere. Currently, I'm using multimethods. Is there a better way to structure this? Here's the code: https://www.refheap.com/2c0b04a7c649610132ef7063a
04:23anti-freezeKeep in mind that I haven't tested it and I have no idea if it works
04:24anti-freezeIs there a way to group multimethods together or something?
04:25anti-freezeOr am I taking the wrong approach?
05:19anti-freezeguys?
05:54octewhenever i eval something that results in an error with cider connected to nrepl in emacs i get the regular cider-error buffer but also som kind of temporary buffer, form-initXXXXXXX.clj which i assume is what cider sends to nrepl
05:54octewhy do i get that buffer as a window?
06:43noncomin cursive how do i make the TAB to auto-ident instead of inserting tabs?
06:44noncomoh, this is described in the very getting started
06:49noncomwas happy to early - the recommended Emacs Tab only makes it so that it does not insert tabs mid-line, but it still inserts tabs at the beginning
07:21H4nsclojurescript + websockets recommendations anyone? i found sente, but maybe something else is better?
07:22bcn-florHas anyone worked with clojure.tools.analyzer ? Specifically, I'm interested if there is documentation for the returned AST structure, what fields are available for each :op .. ?
07:23Bronsabcn-flor: http://clojure.github.io/tools.analyzer.jvm/spec/quickref.html
07:23Bronsaor http://clojure.github.io/tools.analyzer/spec/quickref.html if for some reason you're usint t.a rather than t.a.jvm
07:24bcn-florBronsa: How could I miss that ? I've been reverse-engineering it for 2 days :) Maybe a good idea to have that link in the tools.analyzer repository .. or is it there already ?
07:25Bronsait's in the readme
07:27bcn-florBronsa: Yes, it's there allright, I've missed it somehow.. maybe because it's a link on a Heading. Anyway, thank you !
07:37cflemingnoncom: It shouldn't use tabs
07:38cflemingnoncom: Check Settings->Editor->Code Style->Default Indent Options
07:38noncomcfleming: heeey, glad i we finally meet :)
07:39noncomi have a somewhat very specific question on cursive, on classloaders. idk if the answer is easy...
07:40cflemingnoncom: Ok, shoot, but an email might be better, I don't have much time now
07:40noncomcfleming: ok, just briefly, look at this: https://github.com/bytedeco/javacv/issues/137
07:41noncomthe thing is: it works in eclipse, but when i open the project in intellij, it does not acquire the native libs
07:42noncomcfleming: if you do not have much time now, i would be grateful, if you could look into this later, when you have some..
08:01jlbhshluekg.
08:01jlbhshluekgdid usa intelligence supply isis with weapons like they did with al-qaeda to justify creating wars?
08:01jlbhshluekgdid usa excute the creative mess in the middle east like they said they will, does the creative mess include explosions with uncertain responsibles to create wars?
08:01jlbhshluekgplz, send my qs to help limiting usa & israel aggression against others& may then lessen number of people killed in the middle east.
08:01jlbhshluekg.did usa intelligence supply isis with weapons like they did with al-qaeda to justify creating wars?
08:11wasamasa...
08:11wasamasathat bot already appeared on #ruby
09:03TimMcThey make the rounds.
09:04justin_smithanti-freeze: protocols seem closer to what you want than multimethods
09:05justin_smitheach protocol can define as many methods as it likes
09:05anti-freezejustin_smith: I'm not really working on types though
09:05justin_smithanti-freeze: ::foo is as arbitrary as a custom defrecord is
09:05justin_smiththe idea is that you have something (whether a type or a weird keyword) that captures a range of behaviors
09:06justin_smithusually when I make a defrecord the purpose is to group together implementations of some protocol
09:07anti-freezejustin_smith: Would I be able to do something like, (upload-file! :uploads "somewhere/" file) with a protocol while having the more generic (upload-file!) default method?
09:07justin_smithit wouldn't be :uploads - you'd need some record that represents what :uploads means now
09:08anti-freezejustin_smith: I'm confused. Defining a record for example (defrecord Uploader) seems a little javaish. I'm defining a data type with behaviours?
09:08justin_smithbut it would mean the same thing - the keyword is used to identify a specific impl, the record would do the same
09:09anti-freezejustin_smith: Hmm. I defined a macro that works a little like this. (grouped-methods :foo (upload-file [path filename] (,,,))) Is that I bad solution?
09:10anti-freezeI can then define a whole load of grouped multimethods
09:10justin_smiththat seems like an ad-hoc way to get a protocol to me
09:10anti-freezejustin_smith: Yea, I thought it would be. So, I'm just confused about what type I would define it as. Any ideas?
09:11justin_smithanti-freeze: the type is just a marker for a group of protocol method impls
09:11anti-freezejustin_smith: Can you further explain? Is there any examples anywhere?
09:11justin_smithoften in a case like this it wont even have fields (but you can abstract over what would be multiple types with one by having fields (eg. a particular API key in your case)
09:12anti-freeze(defrecord Uploader [base-path]) Something like that?
09:12justin_smithright
09:12justin_smithif more than one uploader would be the same, except their base-paths differ
09:12anti-freezejustin_smith: Yes
09:13anti-freezejustin_smith: That's what I'm going for
09:13anti-freezejustin_smith: Same type, different base-path
09:13justin_smithI'm looking for a good example - I know I have one somewhere
09:14justin_smithbut I think you get what I am saying now
09:14anti-freezejustin_smith: I just feel like this is a bad example of functional programming. You know, defining actions as types
09:14justin_smithanti-freeze: the types are just groups of actions
09:15justin_smithparameterized, but not stateful
09:15justin_smiththat seems perfectly functional to me (very similar to functors in ml)
09:16anti-freezejustin_smith: I see. What if I just wanted to group the actions, without any data? Just (defrecord Something) ? I suppose they do work like functors, I just tend to see those (from my limited experience) as polymorphic functions based on type. Like type case statements
09:16justin_smithexactly
09:17anti-freezejustin_smith: My reservation was that I'm only operating on one type
09:17justin_smithand yeah, (defrecord Foo [] MyProtocol ...) is pretty much a functor
09:18anti-freezerather than a bunch of different types with one method. I'm working on a parameter of only one type
09:18anti-freezeNot even that, just on one type
09:19justin_smithsounds like that could be a function with two args
09:20anti-freezejustin_smith: This is a pain. The idea was that I wanted a generic version of upload-file that will upload anywhere and a upload-file that uploaded to the resources/public/uploads directory only
09:20anti-freezeBut also provided a method to delete from that directory too
09:20anti-freezeWith the same mechanic
09:21justin_smithYeah. I'd say a protocol with a single record implementing it, with a location field in the record to parameterize it
09:21justin_smithseems the simplest abstraction to encapsulate that
09:22anti-freezejustin_smith: So lets say I'm using the function now. What is it that I pass to it. (upload-file! (Uploader.)) ?
09:22justin_smith(def ^:private uploads-key (Uploader.))
09:23justin_smiththen use uploads-key the same way you did before
09:23anti-freezejustin_smith: Ah, I see. How would I define default behaviour?
09:23justin_smithhave a parameter to uploader that the behavior can switch on
09:24justin_smithor let the uploader arg be optional, and use a default instance if not provided
09:25justin_smithoh - it wouldn't be a private def any more I don't think
09:25justin_smithbecause a caller would provide a specific instance
09:26anti-freezejustin_smith: I could just set the default instance to nil and check for that right? Is this really a better solution than my ad-hoc multimethod grouping though? Seems to add more complexity
09:26anti-freezeOr is the complexity of the ad-hoc method just implicit
09:27justin_smiththe advantage is you have a properly reified grouping of methods, the cost is defining placeholder types that can own those method groups
09:27justin_smithI'd say that's a pretty low cost
09:27justin_smithyou could even use reify instead of defrecord actually
09:28justin_smithjust reify an impl of the protocol for each group you want to make
09:28anti-freezejustin_smith: How would I do that? Sorry for the noobiness, I haven't needed to do that before.
09:28justin_smithreify is simple https://clojuredocs.org/clojure.core/reify
09:29justin_smithit's simpler than defining a record
09:30anti-freezejustin_smith: How would it even work without defrecord?
09:30anti-freezejustin_smith: What am I refying?
09:30justin_smithreify reifies protocols
09:30anti-freezejustin_smith: So I would define a protocol to what exactly?
09:31justin_smith,(defprotocol Foo (upload [this]) (delete [this]))
09:31justin_smith,(reify Foo (upload [this] "I am now uploading") (delete [this] "I am now deleting"))
09:32justin_smithyou call (delete *1) to delete via its method
09:32justin_smith(upload *1) to upload, etc.
09:32justin_smithwhere *1 is the def I forgot to wrap the reify in :)
09:33anti-freezejustin_smith: I'm lost. This is a hopeless cause. Thanks for your help anyway
09:33justin_smithanti-freeze: wait, what in my example above was confusing?
09:33justin_smithFoo is the protocol for uploaders
09:34justin_smiththen the real version of the reify is (def uploader (reify Foo ...)) then you call (uploader uploader ...) (delete uploader ...)
09:34anti-freezejustin_smith: Ah, wait I think I got it. So, I would (defprotocol Foo (upload [])...) (def uploads (reify Foo (upload []...))) and then call (upload uploads ...)
09:34justin_smithexactly
09:34anti-freezejustin_smith: Justin, you are the man
09:34justin_smithreify creates an anonymous impl of a protocol
09:34justin_smithhaha
09:35anti-freezejustin_smith: Where can I buy you a beer?
09:35justin_smithnext clojure/conj likely, unless you end up in pdx
09:36anti-freezeProbably wont be happening. I live across the world
09:38anti-freezejustin_smith: Seriously, thanks for your help. You're becoming my goto guy on this IRC
09:45anti-freezeOne last thing, how would I implement default behaviour? Straight in the protocol?
09:47justin_smithanti-freeze: protocols don't contain any sort of implementation
09:48justin_smithanti-freeze: you could do a default via a wrapper function
09:48justin_smitheg use an uploader if provided, otherwise the default uploader
09:48anti-freezeAh, I see. Ok, cool, thanks
09:49justin_smithotherwise we get into the rabbit hole that is inheritance
09:49kwladykaI am doing http://www.4clojure.com/problem/156 and... i can find solution in The Internet, but... how to code solution myself - this is the question. I tried, but i failed... i found how people did this in The Internet, but still... i don't understand how they know to do that in that way... What exatly are you thinking in your head and how do you know what to use?
09:49anti-freezejustin_smith: And god knows I've been there before
09:50justin_smithkwladyka: do you know how to construct a hash-map?
09:50kwladykai don't know how to think about Clojure and problem to solve to solve this problem, it't more about guess, then really know what i am doing :)
09:51justin_smithkwladyka: I need to head out, but I'll be back later. I am sure there are other folks here that can help.
09:52kwladykajustin_smith, like there http://clojuredocs.org/clojure.core/hash-map:)
09:52kwladykajustin_smith, ok thx
09:52justin_smithif you had apply, plush hash-map, plus map, you could do it that way
09:53justin_smith,(apply + (map inc [1 2]))
09:53justin_smithsomething like that, but with your data
09:53justin_smith&(apply + (map inc [1 2]))
09:53lazybot⇒ 5
09:53kwladykahttp://clojure.org/cheatsheet - there is so many possibilites - how do you know which one you can use?
09:54kwladykai am not asking about solution directly, i am asking how should i think in Clojure to create solutions myself which wouldnt be guess like know. Now i am guessing how to solve problems.
09:54dnolenkwladyka: well most people that know Clojure pretty well know most of the useful functions off the top of their heads. So when confronted with a problem like this you think of the operations you'll need to get to the result.
09:55dnolenkwladyka: 1) you need to repeat a value 2) you need to create a map from two sequences
09:55kwladykadnolen, so its only matter about learn all this functions?
09:55dnolenso find a function that does 1), and find a function that does 2) - done
09:56dnolenkwladyka: well know the functions and learning to think in a functional way which takes some work, but it really is like learning words and how to make sentences
09:56dnolenso it's less about memorization and more about how to make sentences
09:56kwladykai am very confuse when to use zipper, seq, maps, sets, vectors, lists category of functions from http://clojure.org/cheatsheet
09:56kwladykahow to know which one from there match from problem?
09:57kwladyka*with problem
09:57dnolenkwladyka: just memorizing a list wouldn't help me. It's just easier to know what you want and to look for a function that does that
09:58kwladykadnolen, but i have often problems with types of data
09:58kwladykai want use something but i have to convert something and i know i have to convert because i get an error in console, not because i know
09:59dnolenkwladyka: well you can't expect to pick this stuff up quickly if you don't have a functional background it takes work and if it's a bit slow going, that probably meanas you're really trying.
10:00kwladykaso there is no thinking like: i have 2 data IN lists, i want have 1 data map OUT. So i have to use functions from lists and map. I should use function from everywhere?
10:00dnolenkwladyka: I already gave you hints with 1) and 2)
10:01dnolenkwladyka: you need 1) to repeat a value 2) take two sequences and produce a map from them
10:01dnolenfunctions exists for both 1) and 2), you just need to find them
10:01kwladykadnolen, so when you solving problem you dont thinking about "type" of function like it is from "zippers", "seq" or "map"?
10:02dnolenkwladyka: I do think about the types
10:03dnolen1) is something that looks like Any -> [Any], and 2) is something that looks like [Any] -> [Any] -> Map(Any,Any)
10:03kwladykadnolen, mmm soe for this example http://www.4clojure.com/problem/156 should i looking functions from vector and maps? Or zippers, seq? Or all this 4? or mayby somewhere else?
10:04dnolenkwladyka: vectors don't help you repeat a value. zippers aren't relevant. yes to maps. yes to functions that take seqs, especially one that takes 2 seqs into a map.
10:05dnolenkwladyka: good luck :)
10:05kwladykadnolen, heh so mayby should i read something about cateory of functions to know better which category match better with what i want achive?
10:07kwladykadnolen, because now i can find function like you descrbe but in chaots way, i dont really know where they can be, it is more brute force
10:07kwladyka*chaos way
10:08kwladykadnolen, thank your for your advices
10:41anti-freezejustin_smith: Ok, so I implemented it... Its a terrible solution
10:42anti-freezejustin_smith: https://www.refheap.com/28a2c38a1c2c53d13d2128007
11:05gfredericksTimMc: int or Object is common I guess, yeah; what I meant was int or Integer
11:09TimMcgfredericks: The result is the same though with Object.
11:17gfredericksTimMc: "result" meaning the behavior of the clojure compiler w.r.t. type-hints etc?
11:28gfredericksdoes `lein javac` require a jdk or does it work with a jre somehow?
11:30kaiyinit seems the `identity` arg never gets used in this watcher?
11:30kaiyinhttps://gist.github.com/kindlychung/804028ca4aa5509ab3d4
11:30TimMcgfredericks: "result" w.r.t. angry programmers
11:31matthaveneris it possible to use a go block in a cljs repl?
11:33dnolenmatthavener: only if the JS environment you're target supports some form of async dispatch. That said I have seen some minor issues that need looking into in cljs.core.async at the REPL.
11:34matthavenerhm, ok, I'm just using figwheel with chrome. it works OK if i'm calling a function that uses a go block, but if I try to create a go block from the repl itself its trying to resolve a Var.. maybe I need to tune my repl namespace
11:46edbond,(= 0M 0)
11:46edbond&(= 0M 0)
11:46lazybot⇒ false
11:47edbond&(== 0M 0)
11:47lazybot⇒ true
11:59kaiyinwhy do i get this error here? https://gist.github.com/kindlychung/c05aa1c9ba9ac2b481f0
12:05xonevkaiyin: you need to return true if the state is valid: (set-validator! sarah #(if (:age %) true (throw (IllegalStateException. ":age required"))))
12:05xonevyour function is always returning nil when it doesn't throw an exception
13:06darthdeusgiven a map of sets, such as {:foo #{1 2} :bar #{3 4}} where the values in the sets are unique, can I somehow easily find a key to which a given value in any of the sets belong? like to get :bar for 4
13:14hiredmanyou need to invert the index
13:15hiredman(apply merge-with into (for [[k v] m v v] {v #{k}}))
13:16hiredman,(apply merge-with into (for [[k v] {:foo #{1 2} :bar #{3 4}} v v] {v #{k}}))
13:16hiredmanoh
13:16TMA&(apply merge-with into (for [[k v] {:foo #{1 2} :bar #{3 4}} v v] {v #{k}}))
13:16lazybot⇒ {2 #{:foo}, 1 #{:foo}, 3 #{:bar}, 4 #{:bar}}
13:16Bronsarip clojurebot
13:17hiredman,(apply merge-with into (for [[k v] {:foo #{1 2} :bar #{3 4}} v v] {v #{k}}))
13:17sritchiehey all - weird issues with cljsbuild. looks like figwheel and cljsbuild aren’t respecting my reader conditionals
13:17clojurebot{1 #{:foo}, 2 #{:foo}, 4 #{:bar}, 3 #{:bar}}
13:17hiredman,(get (apply merge-with into (for [[k v] {:foo #{1 2} :bar #{3 4}} v v] {v #{k}})) 4)
13:17sritchiefighwheel’s throwing errors on clojure-only functions
13:17clojurebot#{:bar}
13:17sritchieis figwheel supposed to be ready for 1.7.0-beta2?
13:18TMA(doc =)
13:18clojurebot"([x] [x y] [x y & more]); Equality. Returns true if x equals y, false if not. Same as Java x.equals(y) except it also works for nil, and compares numbers and collections in a type-independent manner. Clojure's immutable data structures define equals() (and thus =) as a value, not an identity, comparison."
13:19TMA(doc ==)
13:19clojurebot"([x] [x y] [x y & more]); Returns non-nil if nums all have the equivalent value (type-independent), otherwise false"
13:39brainproxyis there a way to use a macro inside defn so that a var args form expands correctly? when I try it I'm getting an exception: "Parameter declaration ... should be a vector"
13:39brainproxywhich makes sense, i.e. the defn macro doesn't know about my macro
13:40Chousukeyou should write a macro that expands into the form of defn you want instead.
13:40brainproxyalright, I can do that, it just feels clumsy; i have to write the macro, then invoke it
13:40brainproxythat is, to get the top-level defn
13:41brainproxynevermind, i see it will work out fine since I need to do this in several places, so i can make it quite general purpose
13:41Chousukeit's less clumsy than the alternative, which probably involves eval :)
13:45noncomwhat is the best way to map through all permutations of elements of N collections like if i have (range 0 9) and (range 0 9) , i map over [0 0] [0 1] [0 2] [0 3].. [1 0] [1 1] [1 2].. .. [8 0] [8 1] [8 2] ... [9 9] ?
13:51bensunocom: that's a cartesian product, try with http://stackoverflow.com/questions/18246549/cartesian-product-in-clojure
13:51puredanger,(for [i (range 9) j (range 9)] [i j])
13:51clojurebot([0 0] [0 1] [0 2] [0 3] [0 4] ...)
13:51puredangerinsert whatever you like in the body of course
14:21brainproxyChousuke, this seems to fit the bill: (defmacro defn-expand [dname & varg-forms] `(defn ~dname ~@(map macroexpand-all varg-forms)))
14:37justin_smith~/
14:37clojurebotHuh?
14:37justin_smith~/
14:37clojurebotExcuse me?
14:38justin_smithsorry
14:46elvis4526Why when we map over a array of maps, each item isn't returned in the function as a map?
14:46elvis4526its returned as an array I think
14:47justin_smithdepends what function you are applying to those maps I guess
14:47justin_smith,(map seq [{:a 0 :b 1} {:Foo :bar}])
14:47clojurebot(([:a 0] [:b 1]) ([:Foo :bar]))
14:47elvis4526well in the function handler, the item appears to be
14:47elvis4526yes
14:47elvis4526exactly
14:47elvis4526Why it's not {:a 0 :b 1}, etc..
14:48justin_smith,(map (comp (partial into {}) seq) [{:a 0 :b 1} {:Foo :bar}])
14:48clojurebot({:a 0, :b 1} {:Foo :bar})
14:48justin_smithso you can change your function to do an into at the end (as one option)
15:10noncomhi! anyone interested in JME3 + JavaCV + Clojure, have a look at the example integration project: https://github.com/noncom/cursive-jme-jcv and please report issues
15:25tcrayford____PSA: java 7 is EOL today. y'all should upgrade to java 8
15:31wasamasaoh really?
15:32wasamasaI'm on 7.45-1 ._.
15:33wasamasatime to upgrade
15:37ahuegyua.
15:37ahuegyuadid usa intelligence supply isis with weapons like they did with al-qaeda to justify creating wars?
15:37ahuegyuadid usa excute the creative mess in the middle east like they said they will, does the creative mess include explosions with uncertain responsibles to create wars?
15:37ahuegyuaplz, send my qs to help limiting usa & israel aggression against others& may then lessen number of people killed in the middle east.
15:37ahuegyua.did usa intelligence supply isis with weapons like they did with al-qaeda to justify creating wars?
15:37wasamasa,ops
15:38clojurebot#error{:cause "Unable to resolve symbol: ops in this context", :via [{:type clojure.lang.Compiler$CompilerException, :message "java.lang.RuntimeException: Unable to resolve symbol: ops in this context, compiling:(NO_SOURCE_PATH:0:0)", :at [clojure.lang.Compiler analyze "Compiler.java" 6543]} {:type java.lang.RuntimeException, :message "Unable to resolve symbol: ops in this context", :at [clojure.l...
15:38wasamasa...
15:47justin_smitha
15:54@amalloyoops. kicked wrong person
15:55wasamasa;; no comment
15:57hiredman /win 18
16:44gfredericks`docker run --rm=true -it gfredericks/leiningen lein repl`
17:25xemdetiathis isn't the shell you are looking for
17:34arohnerwhat's the name for clojure's variable name style?
17:34arohneri.e. foo-bar-bbq, rather than fooBarBbq
17:35arohnerthe latter is camelCase, the former is ....?
17:35Bronsaarohner: kebab-case
17:35arohnerha
17:36Bronsahttp://c2.com/cgi/wiki?KebabCase
17:36andyfhttp://en.wikipedia.org/wiki/Letter_case#Special_case_styles
17:36andyfmultiple names, also spinal-case and Train-case
17:37andyfsorry, Train-Case is when every word is capitalized, which is definitely not typical Clojure style
17:37andyfWow, people love making names for things.
17:38TEttingerspinal-case (kebab-case), Train-Case
17:38TEttingerheh
17:38TEttingerhttps://en.wikipedia.org/wiki/Letter_case#Special_case_styles has an odd list
17:44scottja relevant clojure library https://github.com/qerub/camel-snake-kebab
17:45scottjit calls Train-Case HTTP-Header-Case though, not as cool :(
17:47gfredericksCamelbab case
17:47scottj(oh I misunderstood Train-Case)
17:55sritchiecemerick: is cljsbuild ready for 1.7.0-beta2?
17:55sritchiecemerick: thinking of the conditional reader stuff… was trying to port today and found that the cljs compiler was trying to read in clj only functions from a cljc namespace
18:00darthdeusre-posting here from #clojurescript since there doesn't seem to be many people there :\ if anyone has a sec, I'd really appreciate any tips http://stackoverflow.com/questions/29995440/how-can-i-mark-methods-created-with-reify-with-export-so-that-the-closure-c
18:02amalloydarthdeus: (doto (Object.) (aset "foo" (fn ...)) (aset "bar" (fn ...))) maybe? i don't really do any cljs
18:03darthdeusamalloy: hmm that sounds it could work, as long as the aset doesn't get optimized somehow :\
18:07sritchiedarthdeus: maybe just make an exported wrapper fn
18:07darthdeussritchie: how?
18:08darthdeusI'm trying to export this object to wrap my own API
18:08sritchieyour api is “foo”, “bar”, yeah?
18:08darthdeussritchie: yeah, my API generally is x = some_init(); and then x.foo(); x.bar();
18:09sritchieif you want the same names, make a new namespace like “myproj.exports” and add (defn foo [x] (myproj.core/foo x)), etc
18:09sritchie(defn ^:export foo [x] (myproj.core/foo x)) rather
18:09darthdeusbut that would export functions
18:09darthdeusI don't want functions like foo(x);, I need them on the object so they can be called like x.foo()
18:09sritchieah, sorry, got it.
18:10darthdeusfunny that I can't google anyone trying to do this :\
18:10sritchieI think amalloy’s approach is what you want
18:10sritchieom-tools does something like this for registering mixins
18:10sritchiehttps://github.com/Prismatic/om-tools/blob/00ccab13f2d536c4996cab7a2e85ef46f668a525/src/om_tools/core.cljx#L93
18:11darthdeushmm, interesting
18:43rksm_Heyho, is there a tool to automatically rewrite Java to clj code? I'm not looking for anything fancy, just something that does a syntactic transform of control structures?
18:45j-pbI don't think so.
18:45j-pbyou can wrap java code though and then gradualy rewrite it.
18:47amalloyrksm_: that is a hard problem
18:48j-pbamalloy: depends on how happy you are with the readability of that code
18:48amalloyj-pb: even if you're not concerned it's not easy
18:48rksm_amalloy: sure but I'm not looking for the hard solution, just something that makes rewriting java code a little bit less annoying
18:48j-pbamalloy: I'm pretty sure once we get advanced clojure tooling there might be some bytecode->clj debugger decompiler
18:49j-pbso you could just emit java bytecode, and then decompile it as clojure
18:49amalloyrksm_: there is no such thing. something that automatically attempted to do that rewrite would make it more annoying, not less, because you'd get complete garbage out
18:49j-pbI actually wonder what happens when you decompile clojure code as java :)
18:49j-pb(inc amalloy)
18:49lazybot⇒ 266
18:52j-pbrksm_: you could write something like that though, I'd be happy to help :)
18:52j-pbrksm_: I'd start out with a java parser in instaparse
18:53rksm_j-pb: if it gets too annoying I might dabble with java parser, it'll sure be an interesting project :) need to get other stuff done first though
18:53j-pbyeah
18:54j-pbgive me a call if you do though, :D, I'm currently writing a datalog compiler with a small nanopass framework, and so far I'm quite happy with how it works :D
18:54rksm_j-pb: will do :)
19:37lvhDoes aleph work with friend? Specifically friend relies fairly heavily on binding conveyance. I think it's fine, but I can't actually check. Also, netty does a bunch of threading stuff itself, so...
21:49whodevilhello all, I'm curious why people are using #_ for comment instead of ; now?
21:57whodevilsweet
21:58gfrederickswhodevil: also nice that you can use #_#_ to comment two forms
22:01whodevilneat
22:40ed-gis it possible to connect to Postgresql from clojure.java.jdbc using a unix domain socket?
22:51whodevilI've connected to postgres, but I was using the java interopt and a pooling library.
22:51whodevilso I guess that doens't really help
22:57crocketIs clojure a good language to use on android?
22:57crocketScala is known to be a good language to use on android.
23:03tomjackjava parser in instaparse? :) there are already battle-tested java parsers out there
23:06crockettomjack, Is that a response to my question?
23:06tomjackno
23:07tomjackfor that, I presume you've already read http://clojure-android.info/ ?
23:07crockettomjack, yes, I did
23:17crocketHell!!
23:42crocketIs clojure on android mature?
23:42crocketenough?
23:43TEttingercrocket: currently proguard can't be used with clojure
23:43TEttinger(at least as far as I know)
23:43TEttingerso the app size may be larger than desired
23:43crocketHow large?
23:44TEttingerproguard works with scala, that I can confirm. I know they're working on some tweaks to the clojure build process to allow proguard, no idea on ETA
23:45TEttingerit depends how much of a standard lib you would use
23:45TEttingerproguard just removes parts of jars that never get called, right? but clojure does compilation stuff at runtime so it currently can't tell what will be used