#clojure logs

2013-04-17

00:00capcrunchanyone has used scriptjure ? i want to use jquery using this
00:21muhoocapcrunch: clojurescript seems to be the usual client side thing. jayq is a wrapper around jquery
00:21capcrunchyep , but i don't want to use clojurescript
00:22capcrunchmuhoo jayq i'll take a look
00:24muhoocapcrunch: oh, well jayq may require cljs. check itd project.clj
02:07kritztopfHey guys, I read a tutorial on Clojure and now I have one question: is it possible to write my own classes in Clojure?
02:08SegFaultAXkritztopf: Of course!
02:08kritztopfI can't find a thing on this topic
02:08kritztopfor I'm too stupid to find it
02:08SegFaultAXkritztopf: What are you trying to do?
02:10kritztopflet's say I have classes for geometrical objects, like Square and Circle. Do I just (def Circle....) or how do I do this in Clojure?
02:10kritztopf*I want to have classes
02:11SegFaultAXkritztopf: Sure, you can do that. But /why/ do you want classes?
02:12kritztopfbecause that's my naive approach to Clojure ^^. but with a functional paradigm classes may not be that necessary as in Java
02:13SegFaultAXkritztopf: There are lots of great resources available to get started with Clojure.
02:13SegFaultAXI personally suggest this: http://www.clojurebook.com/
02:13kritztopfI'm reading through http://java.ociweb.com/mark/clojure/article.html atm
02:13kritztopfokay, will have a look at that
02:14noidikritztopf, you should only use classes for interop with Java
02:14SegFaultAXkritztopf: I don't know if I agree with that approach. You should learn Clojure the "Clojure Way". Not Java by example in Clojure.
02:14SegFaultAXnoidi: That's not the only reason to introduce a class, but it's definitely a good one.
02:14kritztopfokay
02:43james1Does anyone know of a good tutorial about setting up emacs as an ide for clojure? I have GNU Emacs 24.2.1 (x86_64-suse-linux-gnu, GTK+ Version 3.4.4)
02:43james1 of 2012-10-10 on build20. And nothing seems to work! Tried nrepl but when i try to "jack-in" I get the error message inferior-lisp-proc: No Lisp subprocess; see variable `inferior-lisp-buffer' and I see no repl. Any help would be great! thanks.
02:46ebaxtjames1: I used https://github.com/technomancy/emacs-starter-kit to get started quickly. If you just want to get something up and running it's a good start, eventually you probably want to modify stuff. Another "out of the box" solution is http://overtone.github.io/emacs-live/.
02:49james1thanks ebaxt. Does the emacs started kit include clojure?
02:52ebaxtyes. Btw, I think the problem you are experiencing might have something with an invalid project root, since the nrepl-jack-in tries to launch an nrepl server
02:56james1the funny thing is that it says I am "connected"...
03:01james1the other thing is I am currently under opensuse. I do the same command in ubuntu and it works! Something must be missing....
03:05james1the emacs-live worked!
03:05james1thanks!
03:05ebaxtnp
03:56asalehquestion: is there a way to add type anotations to a record?
03:58amalloyasaleh: for what purpose?
03:59asalehamalloy, want to get better errors in my system
04:05asalehamalloy, Ibut I think I have found somethin that lookslike what I need https://gist.github.com/richhickey/377213
04:10clgvasaleh: you want to type record fields?
04:10asalehclgv, yes, that is what I want :)
04:10clgvasaleh: you cant do that the way you (probably) imagine
04:12clgvyou can type hint (1) primitive types int, long, double and such, and (2) general classes - for the two cases there are different effects
04:12clgvfor (1) the field of the generated class will have the primitive type you hinted
04:13asalehclgv, and 2?
04:13ucbare there any libraries for load testing you guys would recommend?
04:13clgvfor (2) reflection will be avoided when calling java methods on the values of those fields - that means a cast is inserted at the java method call
04:13ucbI'm wanting to test a multi-threaded graphite client which is claiming to be overloaded.
04:13clgv(2): but only in the inline method implementations of that defrecord
04:16clgvasaleh: there is typed clojure (core.typed) from ambrose though - which may contain type checks for records (I am not sure since I did not check out its feature set yet)
04:25asalehclgv, so there is not a easy way how to force my code to fail as soon as I create record with some field with wrong type? Because I don't want to create my own macro for checking ...
04:45clgvasaleh: you can implement a cunstructor function that type checks all arguments
04:45clgv*constructor
04:46asalehclgv, yes, that is what I am trying to do now :)
04:48clgvasaleh: you need a constructor function anyway, when you want to create records from a different namespace. (clojure 1.4+ generates the function ->MyRecord for you which you should not use when you want to implement your type checks.)
05:03dbushenkohi all!
05:03dbushenkohow to start a clojurescript repl in emacs?
05:13xeqidbushenko: https://github.com/cemerick/piggieback
05:13dbushenkoxeqi, thanks!
05:28naegis there something like drop-while which returns everything from start up to the first logical false instead of from first logical false to end? or do I have to (reverse coll)?
05:34jack_rabbitI've set up a proxy interface that's suddenly not working. Here's the code: http://pastebin.com/4uaqAs0k
05:35jack_rabbitI'd appreciate any help. It's a good chunk of code, but I think most of it isn't relevant.
05:35ucbnaeg: you can try take-while
05:36naegucb: thanks, didn't think of that one
05:48jack_rabbitIn general, why might a proxy fail? The java code appears to be finding the proxy, and running the proper method, but the code in the proxy isn't executing.
05:51ivanjack_rabbit: I think the method in your proxy is returning a function
05:52ivantry without the #
05:52jack_rabbitOOF! Duh.
05:53jack_rabbitThat hurts.
05:53jack_rabbitThanks, guys.
05:54jack_rabbitSure enough...
05:54naegcan I somehow create a lazy seq of function calls like this: (f (f (f 1 2) 3) 4)
05:55naegso I can do a take-while on them
05:55ucb,(doc repeatedly)
05:55clojurebot"([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it"
05:55ucbhum, not that one
05:58naegI actually want to produce this in clojure: http://pastebin.com/UwydC1WG
05:58ucboh, blah, that's reduce
05:58ucb,(doc reductions)
05:58clojurebot"([f coll] [f init coll]); Returns a lazy seq of the intermediate values of the reduction (as per reduce) of coll by f, starting with init."
05:58naegmy thought was to(last (take-while cond2 (f (f (f 1 2) 3) 4)))
05:59ucbnaeg: (reductions f [1 2 3 4 5]) would produce something like ((f 1 2) (f (f 1 2) 3) (f (f (1 2) 3) 4) ...)
05:59ucb,(reductions + [1 2 3 4])
05:59clojurebot(1 3 6 10)
06:08clgv+1 for reductions
06:11naegdoes the clojure code below do the same as the pseudocode above? http://pastebin.com/JPvvS4zm
06:12naegit does not work as it should right now, but could be a fault somewhere else too
06:12hyPiRionnaeg: yes, I think so, but it's better to utilize reduced instead I think
06:13naegbeside, cond2 is inverted in the clojure code
06:14hyPiRion,(reduce (fn [acc n] (let [v (+ acc n)] (if (= n 8) (reduced v) v))) 0 (range))
06:14clojurebot36
06:16naegdoesn't really seem simpler to me?
06:17naegalso, last paste was wrong: http://pastebin.com/zvCZLT9U
06:19hyPiRionnaeg: true, not if your condition only depends on the result, and not the input
06:19hyPiRionor a combination, for that matter
06:22naeghyPiRion: put cond in some context: http://pastebin.com/u1QR3bzX
06:23hyPiRionyeah, then reductions is fine
06:25naegthanks
06:25hyPiRion,(->> (range) (reductions max 0) (drop-while (partial <= 5)) first)
06:25clojurebot0
06:26hyPiRion,(->> (range) (reductions max 0) (take-while (partial <= 5)) first) ;*
06:26clojurebotnil
06:26hyPiRionoh what. Well, you get the idea
06:31naegI'll first try to make it work without ->>, it's confusing enough to me already ;)
06:33hyPiRionoh, alrighty
06:59clgvnaeg: you can use `reduce` with a lambda function and `reduced`
07:00thalassios_xelonhello everyone :), https://www.refheap.com/paste/13704 simple question about concurency
07:02clgvthalassios_xelon: an agent excutes all its task sequentially.
07:03clgvthalassios_xelon: in principle it is a worker thread with state and an associated job-queue where it retrieves jobs executes them, updates its states with the job result and then retrieves the next job
07:04thalassios_xelonclgv, i got confused them about agents ok thanks i will read more
07:05clgvthalassios_xelon: you can do parallel computations via futures or clojure.core.reducers
07:06thalassios_xelonfold is only for very big collections?
07:07thalassios_xelonreduces any tutorial?
07:07clgvyou can say it like that. the general principle is that you need enough work for a thread so that the overhead is not bigger than the computation time needed.
07:07thalassios_xelonhttp://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html i found only this
07:09clgvthalassios_xelon: the basic idea is to use the functions (map, reduce, filter ...) of clojure.core.reducers as drop-in replacements for the ones in clojure.core
07:10thalassios_xelonok thanks clgv :)
07:16katratxohi all, how can i hint the compiler on this call to FileUtils ? https://www.refheap.com/paste/13706
07:20clgvkatratxo: do you need to? what are the java signatures for that method? to me it looks as if all types are inferable
07:21katratxoclgv: the return type is Collection<File> .. the signature is File, String[], boolean
07:22clgvkatratxo: oh, ok the `into-array` has not :tag and is not inlne
07:24katratxoclgv: the :tag?
07:24clgvkatratxo: you have to hint the string array. ^"[Ljava.lang.String;"
07:25katratxoha! thanks, will try it
07:27katratxoclgv: thank you! that was it :)
07:43Deleteyrselfshut up and listen some http://anonpt.caster.fm/
07:45bosiehow would i create a thread-safe function that is cached
07:46bosiememoizing
08:24capcrunchanyone uses scriptjure ?
08:56clgvbosie: check whether memoize is built correctly with atoms then it is thread-safe. I thought it was
08:56bosieclgv: hm, ok
08:57clgvbosie: did you encounter any error that makes you believe otherwise?
08:57bosieclgv: no, but i am not sure how to test it either
08:58clgvyeah should be threadsafe. although it might calculate value more than once in worst case scenarios
08:59clgvbosie: for more advanced memoization there is core.memoize
09:00bosieclgv: even core.memoize doesn't mention thread-safety
09:00bosieclgv: but i will look into it
09:01clgvbosie: maybe the authors think it's self-evident that it must be thread.-safe to be of any use...
09:02bosieclgv: yes, and tests are used as documentation ;)
09:02clgvbosie: the readme could improve its documentation amount right.
09:03clgvbosie: though there is not much document for just using core.memoize since you just do (memo-lu f) or similar ^^
09:04clgvbosie: the kinds of caches could be explained for people that dont know the names
09:04bosieindeed
09:04bosiebut the documentation could be improved almost everywhere. at times it reads like a math book ;)
09:05bosienot so brainy ppl like me take a bit longer to grasp it
09:05gdevsalutations fellow clojurists
09:06clgvhmm the docstrings of core.memoized are quite verbose though
09:06bosieclgv: "Positional factory function for class clojure.core.memoize.PluggableMemoization."
09:07bosieok to be fair that was bad luck i found this as the first docstring it seems
09:13naegsomeone having experience with minimax and alpha-beta pruning?
09:14naegwrote both in clojure and alpha-beta (more exactly negamax) is only 1 second faster than minimax on a 6x7 connect four board calculating 4 steps
09:14naegis that unusual?
09:14naegminimax takes 2.5sec and alpha-beta 1.6 sec
09:17hyPiRionnaeg: what is the branch factor?
09:18hyPiRion,(Math/pow 7 4)
09:18naegI guess it's 7? if you mean how many possible moves one has his turn
09:19hyPiRion,(* 7 7 7 7)
09:19hyPiRion&(* 7 7 7 7)
09:19lazybot⇒ 2401
09:19hyPiRionwell, that should be done in an instant
09:19hyPiRionnot sure you're running 8 plies?
09:20hyPiRionThat is, four moves for you and 3-4 moves for the opponent
09:20naegnope, 4 moves in total. 2 times me 2 times opponent
09:20clojurebot2401
09:20clojurebot2401.0
09:20hyPiRionWell, that seems absurdly slow
09:21naegclojurebot: you're slow
09:21clojurebotexcusez-moi
09:21naegthe minimax too?
09:21naeg2.5 sec
09:21clgv&(println "I am the faster one...")
09:21lazybot⇒ I am the faster one... nil
09:21hyPiRionyeah
09:22hyPiRionlet me think here
09:23naegheuristic function takes about 0.2-0.15msec
09:23hyPiRion,(* 16 15 14)
09:23clojurebot3360
09:24hyPiRion,(* 16 15 14 13)
09:24clojurebot43680
09:24hyPiRionI manage to calculate that many different moves in 1 second sequentially in Quarto with alpha beta
09:25hyPiRionhttps://github.com/hyPiRion/snigilbot/blob/master/src/snigil/players/minimax.clj#L71-93
09:26hyPiRionnaeg: it may be that you're not creating the children lazily. That hit my performance at first attempty
09:29naeghyPiRion: I'll take a closer look at your code, thanks. here is mine: http://pastebin.com/PszQWsnY
09:29naegseems all lazy to me...I guess
09:29ucbthis test has me a bit puzzled: https://gist.github.com/ulises/5404292
09:30naegoh, the docstrings are wrong partly
09:31hyPiRionnaeg: negamax is the alpha-beta one?
09:31naeghyPiRion: yes
09:31naeginspired by this one: http://chessprogramming.wikispaces.com/Alpha-Beta#Implementation-Negamax%20Framework
09:32hyPiRionah, okay. Hm.
09:33naegusing that (last (take-while cond (reductions ....) we talked about before
09:33hyPiRionyeah
09:34hyPiRion,(range 100 1000 100)
09:34clojurebot(100 200 300 400 500 ...)
09:36hyPiRion,(->> (range 100 1000 100) (map #(do (Thread/sleep 100) %)) (reductions max) last time)
09:36hyPiRion(Then wait half an hour)
09:38naeghyPiRion: I can't follow you here?
09:39clojurebot"Elapsed time: 901.240846 msecs"\n900
09:42hyPiRionnaeg: the only thing I attempted was to figure out whether reductions would perform a calculation multiple times
09:42hyPiRionit doesn't
09:42naegwhat about the (last) actually? does tha realize the seq?
09:43hyPiRionnaeg: no, it would only pick the last element in the seq you get from take
09:43hyPiRion,(->> (range 100 1000 100) (map #(do (Thread/sleep 100) %)) (reductions max) (take-while #(< % 400)) last time)
09:43clojurebot"Elapsed time: 905.020026 msecs"\n300
09:44naegbut the values returned by negamax are realized already, right? since take-while checks them with the pred
09:44hyPiRiongurr
09:44naegat last up to first logical false
09:44hyPiRion,(->> (range 100 1000 100) (map #(do (Thread/sleep 100) %)) (reductions max) (take-while #(< % 400)) time)
09:44clojurebot"Elapsed time: 0.868794 msecs"\n(100 200 300)
09:44hyPiRion,(->> (range 100 1000 100) (map #(do (Thread/sleep 100) %)) (reductions max) (take-while #(< % 400)) last time)
09:44clojurebot"Elapsed time: 901.426042 msecs"\n300
09:45hyPiRionnaeg: oh dangit, I know the root cause
09:45hyPiRionmap is chunked lazy, so it evaluates 32 elements at a time
09:46naegwhat could I use instead of map then?
09:46hyPiRion,(first (map #(do (pr '.) %) (range)))
09:46clojurebot................................0
09:47hyPiRionnaeg: fogus had a solution for this, let me look it up
09:47hyPiRionnaeg: http://blog.fogus.me/2010/01/22/de-chunkifying-sequences-in-clojure/
09:47hyPiRionIt's not pretty, but it works
09:48naegjust wanted to say, seems cumbersome
09:48hyPiRionyeah.
09:48naegyou're using loop for that in sniglibot?
09:52hyPiRionno, I didn't know about that issue at that time
09:53hyPiRion,(first (for [a (range)] (do (pr '.) a)))
09:53clojurebot................................0
09:56naeghyPiRion: using seq1 doesn't change anything :/
10:00hyPiRionnaeg: bleh, then I'm not sure
10:02naeghyPiRion: I'll try to find out by using sniglibot as a reference, thanks
10:02hyPiRionnp
10:03ambrosebsasaleh: If you want runtime checking of record constructors see defconstrainedrecord in core.contracts. If you want static type checking, there's some support for records in the latest core.typed release.
10:04clgvambrosebs: it seemed as if type check on construction was all he needed.
10:05ambrosebscore.contracts also gives type checking on map ops like assoc, update-in, if that's useful.
10:07ambrosebsFWIW core.typed has assoc checking too.
10:08asalehambrosebs, thanks, will look into it :) ... I have already updated my constructor to do basic typechecks, but if there is something better, than my 4 line macro, I will use it :)
10:09ambrosebsasaleh: You basically leave all your code as you would, but have (defconstrainedrecord MyRecord [a b] "Doc" [(my-contract1 a) (precondition2) b)]) instead of the defrecord
10:09ambrosebsIt rocks.
10:10ambrosebs(with core.contracts)
10:12ambrosebsIIRC it even checks the bare java constructor.
10:16asalehjweiss, this looks good https://github.com/fogus/trammel
10:18asalehambrosebs, I liked Trammels readme better :) ... has nice defconstrainedrecord example
10:19ppppaulhow would i invalidate a memoized function?
10:19ambrosebsasaleh: fair enough :)
10:20jweisscan anyone tell me the general state of core.typed? seems like the examples i have read have a lot of forms that are not checked because of lack of support for various things
10:20jweissis there a list of yet-to-be-implemented functionality i can watch
10:21ambrosebsjweiss: There's been some good progress lately.
10:21ambrosebsjweiss: Follow on the mailing list or Jira http://dev.clojure.org/jira/browse/CTYP
10:22ambrosebsjweiss: https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed
10:23ambrosebsjweiss: Latest features: multiple error messages per run, support for records, lazy loading of internals, wrapper macros for `for` and `doseq`.
10:24jweissambrosebs: i'll try it out, seems like it can't hurt :)
10:25rektidejasonjckn: thanks for the storm & kafka jars on clojars!!
10:25ambrosebsjweiss: Also optional and mandatory keyword args are supported :)
10:25rektideyou don't happen to be a Developer in denver? i knew a jason jackson out there
10:26ambrosebsjweiss: Use this version, I can't make releases yet because the contrib infrastructure is broken. https://groups.google.com/forum/?fromgroups=#!topic/clojure-core-typed/LJLSl3GyMEY
10:26ambrosebsjweiss: Use this in your project.clj: :repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/&quot;}
10:28ambrosebsjweiss: aaaand start here if you didn't find it before :) http://clojure-doc.org/articles/ecosystem/core_typed/home.html
10:28jweissambrosebs: yep i had seen that last one :)
10:33learner_Hello guys, anyone using pallet with linode?
10:42learner_Hello guys, anyone using pallet with linode?
10:48clgvlearner_: maybe you have better success chances in the #pallet channel
10:49nDufflearner_: given as someone went through the trouble to write the jclouds support for linode, I'd certainly expect so.
10:50learner_clgv: thanks, I couldn't get any response in pallet channel. Since our clojure channel has more members, thought one of you Gurus will answer.
10:51learner_nDuff: Looked around but found nothing. Hope there is a solution available. Thanks for your response.
10:51clgvlearner_: Hugo Duncan was often in the #pallet channel when I needed help around this time of the day...
10:52nDufflearner_: How long did you wait? Smaller IRC channels often have multi-hour lag before you get a response.
10:52learner_clgv: I see him there. Will ping him. Thanks
10:53learner_nDuff: May be you are right. my session is on for about 5 hours. Will keep it on. Thanks
10:54nDufflearner_: ...it also helps to ask a detailed question, rather than "does anyone [...]"
10:55learner_nDuff: Excuse me for my short question. I will soon post a detail question. Thanks for your time
11:16cmajor7how do you guys deal with hiccup templates (partials) and compojure routes? e.g. "(GET "/some-route" [] (body(how-to-partial)))". Here "body" is a function with a header and footer with all the CSS/JS includes. And "how-to-partial" is a hiccup function that just returns a "how to" portion. what would a better way be?
11:17astevewhat is a "\"how to\" portion"?
11:22TimMcalexbaranosky: y u no tag? :-(
11:28danneucmajor7: then you'd have really repetitive routes. body(this).. body(that).
11:29danneucmajor7: instead why not map routes to the fns that represent that page. then that page fn can do whatever it wants. nest a thousand partials, be composed of 30 other fns, whatever.
11:29danneui may've misunderstood
11:32ucbwhen writing tests (whether midje or otherwise) how do you guys go about checking that a fn doesn't throw? do you wrap in a try/catch and fail the test in the catch clause?
11:32ucb(I suppose that exceptions make the test fail anyway and stop execution anyway)
11:32cmajor7danneu: no you understood correctly. that is how I approached it at the first pass. however that means that there should be a unique function for each route that combines header/partial(s)/footer. while it is ok, it creates an unnecessary two liners e.g. (defn route-x [] (body(single-partial-x))) … (defn route-y [] (body(single-partial-y)))
11:33noidiucb, isn't not throwing the default? :)
11:33ucbnoidi: sure, but alternatively you could check the opposite. I'm wondering about exception handling during tests
11:34noidiI think all test frameworks report thrown, unexpected exceptions as errors
11:34noidijust check that the return value / side effects and you're done
11:35cmajor7danneu: I am in a noir rebound, where the magical noir powers that are "no longer" solved that. I can't recall how exactly. so I am thinking what is the preferred/idiomatic way to do it with compojure
11:36ucbnoidi: yeah, I think my problem stems from the fact that these exceptions are being thrown in other threads, and caught and reported elsewhere :/
11:36ucbnoidi: thanks anyway :)
11:44TimMcalexbaranosky: More seriously, I added tags to https://github.com/timmc/clj-schema -- you can pull them if you'd like.
11:46TimMcI did not verify that they match the Clojars artifacts, though.
11:52aebertshi all :-) could someone help me with a newbie clojure question please?
11:53ucbaeberts: don't ask to ask?
11:53aebertsCan anyone tell me why this is throwing an error on line 7? http://pastebin.com/yE4WyqDh
11:54aebertserror: ClassCastException java.lang.Long cannot be cast to clojure.lang.IPersistentCollection
11:54aeberts clojure.core/conj (core.clj:83)
11:54aeberts alpen.core/fiber (core.clj:198)
11:54aeberts alpen.core/eval1596 (NO_SOURCE_FILE:1)
11:56joegalloaeberts: your loop expects a list for result
11:57joegalloyour recur at line 8 is passing it a number
11:57noidiaeberts, on line 8 your recur is setting result to (dec n)
11:57noididamn, joegallo beat me to it :)
11:57joegalloi'm fast
11:57aebertsthanks joegallo - does that mean that the args to loop act like function args?
11:58joegalloehhhhhhhhh
11:58joegallosortof
11:58joegalloyes
11:58aebertsi.e. args to recur have to be the same as the arg list in loop?
11:58joegalloyes
11:58aebertsok, thanks for the help!
11:59joegallo(loop [x 3 y []] ... (recur 4 [4 5])) ;; in the iniial loop statement, it's a bit like a let. in the later recur, though, it's like a function call.
11:59joegalloso on the next run through the loop, x will be 4 and y will be [4 5]
11:59TimMcThe loop bindings are *very* similar to fn bindings, yes.
11:59noidiaeberts, recur jumps back to the nearest recursion point, which is either a loop statement or a function declaration
11:59aebertsI see - I have to pass the "index" and the seq
12:01noidiin your case the nearest recursion point is the loop, so you have to give recur the next values for the names initialized in the loop statement
12:01aebertsnoidi - thanks for the help.
12:03rasmustotpope: ok, thanks for the response. Sometimes I like to pull up a version of a function from a few commits back and slam it into the repl to see what happens.
12:23ppppaulhey guys. i have a really weird problem. i brought down a lib (camel-snake-kebab) and got it working in my repl... i then brought in a new lib (timbre) and got it working, however now i'm getting an exception saying that camel_snake_kebab.clj isn't found
12:23ppppauli looked in .m2 and it's there
12:23ppppaullein classpath | tr : \n | grep snake works too
12:24nDuffppppaul: Could you provide enough detail to reproduce?
12:24nDuffppppaul: something we can ''git clone'' to see the problem ourselves would be ideal.
12:24ppppaulok... i'll set up a public repo
12:25l1xaeberts: have you considered something like this? https://github.com/l1x/euler/blob/master/src/euler/core.clj#L55
12:28aebertsl1x - yes, that was my first thought but I wanted to exercise my understanding of loop and recursion in clojure and I'm glad I did because I learned something in the process… the implementation you showed is a better approach. Thanks!
12:29ppppaulhmm... i just moved my files to somewhere else and now the lib is loading properly again...
12:29ppppaulgah
12:29ppppaulmy head...
12:29l1xaeberts: i see. this implementation is form the joy of clojure if i remember correctly, i guess loop+recursion is important to understand anyways
12:31aebertsI prefer the implementation you referenced - it's more clojuresque.
12:31ppppaulnDuff killing emacs seems to have solved my problem
12:31ppppaulug
12:31ppppaultime for candy
12:58thalassios_xelonif i have 4 agents(with work to do) in a 4 thread system,are they work in parallel?
13:00nDuffthalassios_xelon: in general, yes. In Clojure 1.5, you can get detailed control of the thread pool if you want it.
13:00thalassios_xelonok thanks
13:00nDuffthalassios_xelon: It doesn't matter for only 4 agents, but are you invoking with send or send-off?
13:00clojurebotExcuse me?
13:01thalassios_xelonwith send
13:01nDuffthalassios_xelon: ...then at most (number_of_processes + 2) threads will be running at once, unless you replace the pool yourself.
13:08thalassios_xeloni am doing something like https://www.refheap.com/paste/13716
13:08thalassios_xelonto use agents in parallel
13:10thalassios_xelonsorry that -> https://www.refheap.com/paste/13718
13:14technomancyyogthos: hey, we're checking up on the possible clojars intrusion; do you recall whether you deployed over an existing deployment of lib-noir and luminus/lein-template last week?
13:14nDuffthalassios_xelon: Eww.
13:15thalassios_xeloneww means?
13:16nDuffthalassios_xelon: Not very functional code. Lots and lots of recur.
13:18thalassios_xelonok but the way i try to get it parallel its ok?
13:19naeghyPiRion: tried it with reduce/reduced now and still same execution time. any idea what's a good place to ask what's going on there? stackoverflow?
13:26yogthostechnomancy: hey I'd have to check
13:28yogthostechnomancy: I think I did a deploy of lib-noir 6 days ago
13:28technomancyyogthos: sure; I mean a re-deploy over an existing version specifically
13:29yogthostechnomancy: it's likely but I'm not 100% sure
13:29yogthostechnomancy: I think I released version 0.5 and didn't promote it right away
13:29technomancyno problem; I plan on reviewing diffs manually anyway
13:30yogthostechnomancy: ok cool, but I would say it's most likely that it was me
13:44TimMcreiddraper: We should totally have a keysigning event at the next Boston Clojure Meetup, along with a demonstration of jarsigning.
13:45TimMcreiddraper: I don't know if I can volunteer to arrange the whole thing, but I've deployed some signed jars on clojars.
13:55jweissanyone know how in core.typed, i would annotate the map constructor that is generated automatically?
13:56jweissseems like it would be redundant to annotate the record itself and the constructor, it's the same info
13:57technomancyfor anyone following along re: the possible clojars break-in, we've confirmed all but 45 jars
13:57reiddraperTimMc: that'd be awesome
13:58technomancyif your dependency tree doesn't include anything from http://p.hagelb.org/clojars-redeployed.html you should be safe
13:58technomancywell, as safe as you were before the break-in; you're still probably depending on unsigned jars
13:59technomancyif you do use any of those libs and you have a copy older than april, let me know
14:04thalassios_xelonhttps://www.refheap.com/paste/13718 is this a normal way to achieve parallezation?
14:09tyler_woohoo my copy of process and reality came today
14:10amalloythalassios_xelon: no, that is bonkers
14:10technomancyamalloy: hey, do you recall whether you may have redeployed flatland/phonograph in the past few weeks?
14:10amalloyuse futures, or pmap, or anything but this
14:10amalloytechnomancy: i'm sure i have
14:11technomancyamalloy: specifically redeploying over an existing version
14:11stuartsierra1technomancy: Thanks for preparing the list.
14:11amalloyright, i understood
14:11technomancyamalloy: ok cool; thanks
14:11amalloytechnomancy: i can redeploy again, if you can tell me which versions are questionable
14:11technomancyamalloy: just interested in confirming that it happened at this point; thanks
14:12amalloyk
14:12technomancythough if you have it still in your m2 and could paste a sha1sum that might help actually
14:12amalloytechnomancy: sure. what version?
14:12technomancyof 0.1.4
14:13amalloy$ cat phonograph-0.1.4.jar.sha1 ## 1d8838b7bf8762b92a0d2881c260aa5c1f9eae63
14:13technomancyyogthos: if you could do the same for lib-noir 0.5.0 and luminus 0.5.3 and 0.5.5 that'd be tops
14:13technomancyamalloy: thanks
14:13technomancystuartsierra1: yeah, just glad things appear to be clean. it's a good wake-up call.
14:14technomancyin case the rubygems break-in wasn't enough of one =)
14:14yogthostechnomancy: yeah I can deploy the latest when I get home tonight
14:14technomancyyogthos: just the checksum would be fine
14:14technomancy(if you have it from the machine on which it was deployed from)
14:14technomancyif not no big deal; I will probably be able to get it from another source once he comes online =)
14:18tyler_im thinking about using var- to prefix my symbols that are bound to vars
14:18tyler_you think thats stupid?
14:18tyler_my reasoning is so i don't accidently rebind symbols bound to functions
14:19amalloytyler_: yes, that is silly
14:19technomancytyler_: every symbol that's not a local is bound to a var
14:19tyler_ah <---- newb
14:19technomancy(not technically true, but enough to make it a bad idea)
14:19amalloytechnomancy: that's not really true at all, right?
14:20technomancyheh
14:20TimMctyler_: If you're worried about shadowing vars with locals, there might be a lein plugin that can warn you about those.
14:36tomojhuh, ##([1] 0 0)
14:36lazybotclojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector
14:46yogthostechnomancy: ok sure thing
14:47TimMctomoj: Yeah, vectors don't have an optional not-found arg.
14:47TimMcIt would have made some Swearjure programs easier.
14:56stuartsierra1,(get [:a :b :c] 4 :not-found)
14:56clojurebot:not-found
14:58SegFaultAXNot sure why, but using vectors in function position looks really ugly to me.
14:58SegFaultAXI'm fine with sets and maps, but vectors? Just use get.
14:58Chousukegenerally you wouldn't usea literal vector
14:59SegFaultAX,([:a :b] 10)
14:59clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
14:59SegFaultAX,({} :a)
14:59clojurebotnil
15:00SegFaultAXThat discrepancy annoys me.
15:00TimMc,(apply trampoline #{2 ["a" "b" "c"]})
15:00clojurebot"c"
15:00amalloySegFaultAX: that calling two different functions behaves differently? use 'get if you want something that acts like 'get
15:00TimMcAllow me to recalibrate your sense of "ugly".
15:01SegFaultAXamalloy: Didn't I just say that?
15:01hiredman,(get [:a :b] 10)
15:01clojurebotnil
15:01amalloyno, you said that the discrepancy annoys you
15:01hiredman,(get [:a :b] 0)
15:01clojurebot:a
15:01SegFaultAXRead ^
15:02SegFaultAX11:58 < SegFaultAX> I'm fine with sets and maps, but vectors? Just use get.
15:26ssideris_hello
15:27ssideris_is anyone getting "error in process sentinel: nrepl-sentinel: Wrong type argument: stringp, nil" with nrepl.el in windows?
15:27ssideris_right after connecting
15:28ssideris_nrepl 0.1.7, clojure 1.5.1, leiningen 2.1.3
16:37arrdemtechnomancy: is there an nrepl port of slamhound?
16:38arrdem-__- yours supports nrepl. I'll rtfm next time.
17:08rlb`lb
17:16TimMcls
17:16lazybotbin data dev home lib media mnt root selinux src srv sys tmp var
17:40callenRaynes: don't say I didn't warn you.
17:41Raynescallen: Can you sing like Kris Allen?
17:41callenRaynes: ...no. I warned you CLJS wasn't the province of those that give a damn.
17:41callenRaynes: incidentally, Prismatic used to do backend CLJS, but they switched.
17:41callenBecause they're smart.
17:41callenand because node is awful.
17:42Raynescallen: http://dl.dropbox.com/u/23745600/Screenshots/BjcV.png What I take from this: people agree with me, but like Stuart Sierra too much to want to be upset with him. :P
17:43RaynesI'm not really a fan of node, but it is likely the best option we'll have for a while for a Clojure-like language with reasonably speedy startup speeds.
17:43RaynesNobody gives any shits about the other Clojure implementations, which is unfortunate.
17:43callenRaynes: sigh...I know... :(
17:43RaynesThere was plenty of interesting ones.
17:43Raynesclojure-py is my favorite, but even it has slow startup speed.
17:43callenRaynes: I could really use the better startup speed, but I've been having an okay time with Clojure Control in spite of it.
17:44technomancyRaynes: you've got a tweet favourited by HipsterHacker; congratulations, you win at twitter, etc
17:44SegFaultAXRaynes: Do you include normal Clojure in "other implementations"?
17:44callenSegFaultAX: normal Clojure is a diesel truck engine.
17:44SegFaultAXcallen: Does that mean no one gives any shits about it?
17:44RaynesSegFaultAX: No. I'm specifically referring to ones with fast startup.
17:44callenSegFaultAX: lern2read
17:45Raynescallen: There is the off chance that he doesn't understand diesel engines and thus doesn't have the foggiest idea what you mean.
17:45callenRaynes: I always forget yuppies exist.
17:46Bronsa>lern2read
17:46BronsaI see what you did there.
17:47Raynestechnomancy: Hipster Hacker is a big deal?
17:47Raynes"Erlang is better than yer lang."
17:47RaynesYep, he's a big deal.
17:49SegFaultAXcallen: Oh I missed the part where he was talking about Clojure-like languages.
17:51kmicu> (([1]))
17:57arrdemokay so slamhound is cool, but are there any good tools for moving vars around between namespaces?
18:14technomancyarrdem: there's a clojure-refactoring tool that has been vehemently disowned by its author =)
18:15trptcolintcrayford vehemently disowns a lot of stuff
18:15arrdemtechnomancy: haha is that joodie/clojure-refactoring?
18:15technomancytrptcolin: good point
18:15arrdemah that's why joodie took it over
18:15arrdemwhat was the reason for writing it off?
18:16trptcolinplease tell me it's written in "rubby"
18:16trptcolinrats
18:16technomancyarrdem: seemed mostly because it was written as an exercise to learn Clojure
18:19arrdemthat's unfortunate... seems like something along those lines could be a valuable tool
18:19arrdemand the joodie mirror hasn't been ported to nrepl yet.. push that to the heap
18:19danielglauserdoh! My slacking has been called out
18:58lynaghkIs nREPL any smarter than Slime/Swank in that ALL communication about source code goes through its pipe?
18:58lynaghki.e., it should be possible for me to launch an nrepl server on a remote machine but use my local editior commands ("load this buffer") to source all code
19:00amalloylynaghk: M-x nrepl-eval-buffer or similar probably exists
19:00amalloyjust as it does for swank
19:00arrdemlynaghk: yes you can run a remote nrepl server and send arbitrary code to it
19:00lynaghkamalloy: yeah, I'm just wondering if it's any smarter than swank's implementation. I'm still using slime/swank, but if I do a command like "eval buffer" then the backend whines about not being able to find that file
19:01amalloylynaghk: no, that's what happens if you do a command like "load file"
19:01lynaghksince, of course, it doesn't exist on the remote machine.
19:01amalloyif you actually do eval-buffer, it evals the buffer
19:01lynaghkamalloy: ah, noted. maybe I should just change my swank keybindings.
19:02amalloy(this probably has unwanted side effects, since load-file does some smart things like resetting your *ns* back to where it was after loading)
19:02amalloybut in general it's possible
19:13technomancyeval-region if the file doesn't exist remotely
19:14tieTYT2i don't know anything about ring. Will it be hard for me to use compojure?
19:14patchworkinsufficient information
19:15patchworktieTYT2: only one way to find out: try it!
19:16tieTYT2well, I already have a war and I'm creating a new war in a big ear that needs to reuse a lot of code. We're building a rest web service in this second war. I barely know what ring is, but I looked at compojure and it looks easier to use than java's jersey
19:16tieTYT2so I'd like to use compojure
19:16patchworkring's driving design principle is simplicity
19:16tieTYT2i don't think that's javaee's driving principle. Can they work together?
19:17patchworkcompojure is a tool for defining routes on top of basic request/response cycle
19:17patchworkJava is extremely easy to use from inside clojure
19:17ivanyou go to war with the wars you have, not the wars you wish you had
19:18tieTYT2yeah and it looks like an easy way to build a rest api with compojure. But I'm not sure if it's possible to take a war and use compojure inside of it
19:18brehauttheres a lein thing for doing ring wars
19:19patchworkYou mean a war that already exists?
19:19brehautring is server agnostic; just use the appropriate adapter
19:19tieTYT2patchwork: exactly
19:19brehautoh the other way
19:19patchworkYeah, that may be tricky
19:19patchworkstill doable though, but you have to call clojure from inside java
19:19tieTYT2or it could be a war from scratch, but it's gotta reuse a lot of code from an ear
19:20brehautyou'd need to synthesis a request object in a handler
19:20brehaut(or write an adapter that includes the original request in the ring map i guess)
19:22tieTYT2hrm, sounds like a high learning curve
19:22clojurebotlearning a new runtime is much harder than learning a new language.
19:22tieTYT2if I were building the war from scratch, does that make things much easier?
19:23patchworkYou can take a compojure project and generate a war from that
19:23patchworkno java needed
19:23tieTYT2interesting, but my web.xml has <ejb-local-ref> entries that it depends on
19:23tieTYT2will that be a problem?
19:24brehautMadness → ring: easy; ring → madness: hard
19:24tieTYT2i definitely need to do more research, I just don't know how to prioritize what I research :P
19:43patchworkSo if my lib uses a ref for something, all libs that reference that lib can only have one value for that ref between them right?
19:44patchworkWhat if they each want to use the lib in a different way?
19:44patchworkWhat if (more likely) they don't even know other libs are using that lib and they don't realize they are crossing wires, so to speak
19:44brehautpatchwork: do you mean you have a namespace global var holding a ref?
19:44patchworkbrehaut: Yeah
19:45brehautpatchwork: well dont do that ;)
19:45patchworkIs there a better way to do that?
19:45brehautstuart sierra has a blogpost about that somewhere
19:45patchworkAh, that would be helpful
19:45brehautyeah, pass it as an argument
19:45pppaulis there some sort of clojure/lisp semantic merge tool?
19:45brehauthe's been doing a talk on it
19:45pppaulasking because of this http://www.infoq.com/news/2013/04/Semantic-Merge
19:46brehautpatchwork: http://stuartsierra.com/2013/03/29/perils-of-dynamic-scope is kind of on topic
19:46patchworkbrehaut: So namespace global var holding a ref is a problem…. How do you get access to a ref that is not bound to a var somewhere?
19:47brehautyou pass it as an argument
19:47patchworkSo you pass in the ref… but then it wouldn't need to be a ref
19:47patchworkThen it would just be functional
19:47patchworkI will read your link
19:48brehautpatchwork: well then, its an even bigger win
19:49brehautpatchwork: your other alternative is to close over ref and pass that function (or functions or reified type) around
19:50patchworkbrehaut: Define the ref in a let, return a closure that modifies the ref?
19:50brehautyes
19:50patchworkOkay, that sounds good
20:10amalloyi wonder if i can get stackoverflow to send me an email whenever an answer to a question tagged [clojure] contains the word "flatten"
20:16the_walking_deadhl
20:18RaynesPlease don't eat me.
20:19rasmustoamalloy: haha, I scrubbed all instances of 'flatten' from my code the other day
20:20Raynesamalloy: It isn't *always* wrong.
20:21RaynesJust usually.
20:21jgermanflatten is usually wrong
20:21jgerman?
20:21RaynesYes.
20:21amalloy~flatten
20:21clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
20:21RaynesIt's usually a bandaid on a gushing wound.
20:22jgermanglad I decided to lurk
20:22RaynesYou learn all sorts of things here.
20:22Raynes$know the meaning to life, the universe, everything
20:22RaynesThat's very rude, lazybot.
20:35weavejesterDoes anyone happen to know why Clojure uses a thread pool of 2 + the number of processors for agents
20:35weavejesterAnd not just a pool equal to the number of processors.
20:36amalloyweavejester: i think because at any given time some number of threads are likely to be blocking on IO or something
20:36nightfly__So that it something finishes there will always be something in the ready list?
20:36weavejesteramalloy: Ah, okay, so it's like a fudge factor
20:36amalloyweavejester: mostly my own speculation, though
20:39weavejesterHm… so the question is now, do I cargo-cult the clojure 2+available-processors, or do I just go with a pool of available-processors
20:40weavejesterIt probably doesn't matter, so I'll go with Clojure's scheme for now, and then test it later
20:43chessguy'evening, ya'all
20:47technomancyweavejester: if possible please support the bring-your-own-thread-pool model
20:47technomancyit bugs me that clojure didn't support that for a long time
20:47weavejestertechnomancy: Yeah, me too
20:48weavejestertechnomancy: But in this case it's a specialized, CPU-bound case
20:49weavejesterActually, come to think of it… I could probably just use agents…
20:49weavejesterI've gotten into the habit of using executors directly because they didn't have configurable thread pools
20:51weavejesterThat said, I don't need the output stored, either.
20:53ambrosebsjweiss: the map->* constructors should be typed automatically if the record is annotated with ann-record.
20:54ambrosebsjweiss: currently they might be a little restrictive, you must provide each record field as a key of the input map.
21:22chessguyso i'm assuming that lein has some local stash of jars from clojars? how do i find it
21:22callenchessguy: take a wild guess
21:23amalloychessguy: `lein classpath` will tell you some interesting and useful things, unlike callen
21:23chessguyah. i looked in ~/.lein, but it wasn't useful. thank you, amalloy
21:24chessguyhmm. those paths all seem to be in the project repository
21:24amalloyi rather doubt that
21:25amalloyat least the dependency on org.clojure/clojure should live elsewhere
21:25chessguyi can gist it for you, if you like...
21:26chessguyfairly certain i'm sane tonight, though...
21:26weavejesterThe lein jar cache is the same as the maven one; it's in ~/.m2
21:27chessguyaha. and how do i update it, weavejester?
21:27weavejesterUpdate it?
21:27chessguyweavejester: get a newer version of one of the clojars in it
21:28weavejesterYou include it as a dependency...
21:28weavejesterUnless you're talking about a snapshot version?
21:28chessguyweavejester: what if it's only used as a source of a lein template?
21:28amalloyi'd actually like to see that gist, chessguy, since i don't really believe you have a project with no external dependencies
21:29weavejesterLein templates should always use the latest version
21:30chessguyamalloy: as you wish: https://gist.github.com/arwagner/5409221
21:31amalloyugh, pedestal
21:31chessguywhat's wrong with pedestal?
21:31amalloyokay, you win. use a project that refuses to use maven for dependency management, and it won't refer to any of your maven cached jars
21:32weavejesterDoes pedestal not have a project.clj file?
21:32chessguyweavejester: it does
21:32amalloyweavejester: it uses a lein plugin to override the regular dependency-fetching for its sub-projects
21:32weavejesterSo… what's in the project.clj file?
21:32amalloyor something like that
21:32xeqichessguy: pedestal is setup with lein-sub projects
21:32chessguyweavejester: but no dependencies
21:33weavejesterOhh
21:33weavejesterWell, that's not so bad, probably
21:34weavejesterPresumably the sub-projects all have normal dependencies
21:34weavejesterOh yeah, I see
21:34chessguypresumably
21:35weavejesterSo… what's the issue again? :)
21:35chessguyi'm not sure i remember :)
21:35chessguyoh, yes
21:35chessguyso i want to use pedestal to generate a new application, but i want to make sure i'm generating it with the latest version of all the files
21:36chessguyi suspect that the version in the cache is stale
21:36weavejesterIt's possible, if it's a snapshot
21:36weavejesterI think by default Lein updates snapshots daily?
21:37chessguyi suppose i could just nuke it
21:37weavejesterOh, except it looks like the lein template system doesn't do snapshots, which makes sense
21:38weavejesterWhen I do "lein new pedestal-app foo" it grabs up to version 0.1.5
21:38weavejesterAnd in github it's 0.1.6-SNAPSHOT
21:38weavejesterSo if you're looking at the github code expecting something to be there...
21:38weavejesteryou might be disappointed
21:38chessguyweavejester: ah, so they just haven't put it in clojars yet
21:39chessguyor whatever the heck that site is called
21:39weavejesterRight
21:39chessguygotcha
21:39chessguycan i tell lein to use a template from disk?
21:39weavejesterchessguy: What specifically were you looking for?
21:40chessguyweavejester: there was a typo i noticed the other day, and i saw that it was fixed on github. not a big deal, but it would be fun to be on the bleeding edge
21:40weavejesterIt looks like 0.1.5 is pretty recent...
21:41chessguyplus, i'm trying to learn about the ecosystem, so i'm a little eager to ask questions
21:41weavejesterchessguy: Do you mean the #49 pull request typo?
21:41weavejesterchessguy: You should have a version later than that
21:42weavejesterBut that's not in the template code so… I'm not sure why you'd care
21:43chessguyweavejester: no, there was another one
21:43chessguyweavejester: you're right, though, it seems like what i have should be pretty darn new
21:43chessguyi don't know, let me play with it and see
21:44weavejesterI gotta head to bed anyway :)
21:44chessguyok, thanks for your help
21:56namespaceSo, I've been scouring the docs, and can't figure out a good way to check if the first character of a string is upper case.
21:59amalloy$javadoc Character
21:59lazybothttp://docs.oracle.com/javase/6/docs/api/java/lang/Character.html
22:01namespaceThank you.
22:15tieTYTis there a more idiomatic way to do this? (if (= (config destination-button :text) "<Unset>") nil (config destination-button :text))
22:19azkanetieTYT: i'd use `when` rather than return nil explicitly
22:20tieTYTazkane: actually, this is in a let, can I do that? Can you show me how?
22:20tieTYTin the binding part of a let I mean
22:21azkaneso youre binding the return value of that in a let?
22:22azkanei think it still holds as (when (not= (config dest...)) (config ...))
22:22tieTYTyes
22:22tieTYTah that's a little better, but I was hoping there's a way to get rid of the DRY violation of that config twice
22:25jasonjckntieTYT2: when-let
22:25jasonjckntieTYT: you can always create your own syntax, that's the beauty of lisp
22:26azkanetheres a built-in when-let? damn thats why love clojure :)
22:26jasonjckni thought there was
22:26jasonjcknmaybe not
22:26jasonjcknin that case if-let
22:26azkanethere is, reading the docs of it atm
22:27xeqiI don't think it will do quite what you want
22:40gfredericks&(partition-all 2 1 "okay")
22:40lazybot⇒ ((\o \k) (\k \a) (\a \y) (\y))
22:40gfrederickshuh.
22:52n_bIs data.xml deprecated in favour of the xml functionality in core?
22:53tieTYTthanks
22:53amalloyn_b: neither is deprecated, but if anything it's the other way around. xml in core is something rhickey threw together in like a day, five years ago
22:53amalloydata.xml is something that several smart people have spent actual time on, making conforming and performant
22:54TimMcgfredericks: What's up?
22:55TimMcgfredericks: Here's the real head-scratcher: ##(partition 2 1 [] "okay")
22:55lazybot⇒ ((\o \k) (\k \a) (\a \y) (\y))
22:55n_bamalloy: I think I'll go with with data.xml then; thanks for the timely, informative answer, as always
22:56amalloytieTYT: there are some ways to remove that duplication; i'd recommend the pedestrian (let [the-config (config ...)] (when (not= "<Unset>" the-config) the-config))
22:56amalloybut you could do something silly like (first (remove #{"<Unset>"} [(config ...)])) if you want the people who come after you to be confused
22:57tieTYTamalloy: hah ok
23:21patchworkBest lib for config?
23:21patchworkcarica?
23:21patchworkanything else?
23:36xeqienviron is another possiblity
23:36namespaceWhat's the best guide to understanding the Java interop? I'm confused.
23:40SegFaultAXnamespace: Anything in particular?
23:41namespaceActually, I think I may have finally figured it out.
23:43patchworkAnyone using luminus?
23:43Raynes~anyone
23:43clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
23:46gdevdoes anyone know how I'm more likely to get some help?
23:46gdev~anyone ?
23:46clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
23:46patchworkI was more looking for firsthand accounts I guess
23:46gdevthanks clojurebot =D
23:47patchworkwanted stories of personal encounters
23:47patchworkimpressions, joys, sorrows, dreams
23:47namespaceNope, guess I didn't get it. I'm trying to use the Java method that somebody linked to, but because I haven't really ever used clojure before, I don't know the Java interop. So I read the doc and it says the second operand needs to correspond to a class name when calling a method.
23:47patchworkI guess it is not a concrete question
23:47namespaceI figured the code would look like:
23:47namespace(.isUpperCase Character "H")
23:49gdevpatchwork, I'm setting up a project now with luminus, i'll let you know tomorrow how i like it
23:49xeqi&(Character/isUpperCase "H")
23:49lazybotjava.lang.IllegalArgumentException: No matching method found: isUpperCase
23:50xeqiah, right
23:50namespaceThe Java docs claim it is indeed a method.
23:50xeqi&(Character/isUpperCase \H)
23:50lazybot⇒ true
23:50xeqistring vs character
23:50namespace-_- Really?
23:50namespaceThank you.
23:51gdev&(class \H)
23:51lazybot⇒ java.lang.Character
23:51gdev&(class "H")
23:51lazybot⇒ java.lang.String
23:51xeqipatchwork: I don't use luminus, but I've used many of the libraries it brings in
23:52gdevirc is data, data is irc
23:52patchworkxeqi: Yeah it looks like a semi-official confederation of libraries really
23:53patchworkI guess, what are people really talking about when they say "batteries included"?
23:53patchworkWhat else is a framework supposed to have?
23:55taliosbatteries included on a web framework would imply a full solution for database access, views/templates, caching, email, scheduling things etc. etc. etc. a raw framework that provides routing/http connectivity - and leaves the rest up to you
23:55taliosIMHO
23:56gdevI prefer frameworks to have as little as possible. Do one job well and let me add other libraries that do their jobs well rather than a monolithic thing with half maintained functionality
23:58gdevbut that could just be the node.js koolaid talking
23:59patchworkI think of it this way: How much effort is duplicated every time a new project is begun?
23:59patchworkDo I have to craft everything from scratch every time?