#clojure logs

2011-05-28

00:01scottjanyone know with swt do you have to make 6 versions of your app (win/mac/lin/32/64) or include all 6 of those in one jar?
05:11Vinzentis there something for dealing with zip archives?
05:12KneferilisHello!
05:13Kneferilisis clojure for .NET stable?
05:29bprwhy would (:use [ring.middleware.params :only [wrap-params]]) cause this compile error: error: java.lang.Exception: lib names inside prefix lists must not contain periods
05:42KneferilisI was wondering how Common Lisp compares to clojure, some input please?
05:45bprI am still quite new to clojure, but so far I've found clojure to be much better. This is mainly due to the massive number of libraries that are available, and how easy it is to make use of them via lieningen and sites like clojars.org
05:45bprI don't have hard numbers like performance difference for various algorithms etc.
05:46bpryou may want to take a look at: http://blip.tv/clojure/clojure-for-lisp-programmers-part-1-1319721
05:47bprand http://blip.tv/clojure/clojure-for-lisp-programmers-part-2-1319826
05:49VinzentKneferilis, clojure definitely has a better infrastructure than CL. Also, I think it's much more clear and consistent.
05:50bprthe immutable data structures and concurrency constructs are a *huge* win imo
05:50KneferilisVinzent: clojure for .net can use clojars?
05:51VinzentKneferilis, never tried .net, but anyway, i think jar files is specific for java
05:52KneferilisVinzent: you can convert them with IKVM to .NE Dlls
05:54KneferilisVinzent: ok, thanks for the information
07:14bprwhy might i be getting "Could not locate clj_facebook_graph/auth__init.class or clj_facebook_graph/auth.clj on classpath" when I try to compile my app?
07:14bprI do have clj-facebook-graph-0.2.0.jar in my lib directory
07:15bprand my project.clj has [clj-facebook-graph "0.2.0"] in the :dependencies
07:16bprthis is my ns: (ns mungo.core (use: [ring.util.response :only [redirect]]
07:16bpr [ring.middleware.stacktrace :only [wrap-stacktrace-web]]
07:16bpr [ring.middleware.params :only [wrap-params]]
07:16bpr [ring.middleware.session :only [wrap-session]]
07:16bpr [ring.middleware.session.memory :only [memory-store]]
07:16bpr [ring.handler.dump :only [handle-dump]]
07:16bpr
07:16bpr [clj-facebook-graph.auth :only [facebook-auth-url with-facebook-auth]])
07:16fliebelbpr: And the file auth.clj file is there?
07:16bprI'm done spamming now :-p
07:16bpryeah
07:16bpri unzipped the jar to be sure
07:17fliebelhm, that's weird.
07:17fliebelhave you tried turning it off an on again?
07:17bpryou mean the clojure instance? yes
07:17fliebelor, (System/getProperty "java.class.path")?
07:18bprinteresting, let me check that
07:18bpryeah the jar is listed in there
07:19bprlet me unzip it again and be sure there's nothing subtle that i missed
07:19fliebelhm, does importing another file work?
07:19fliebelSometimes it's just a silly type on the ns....
07:19bpr inflating: fbg/clj_facebook_graph/auth.clj (where fbg is the directory i unzipped it to)
07:20bprlet me try importing a diff file from the jar
07:20bprwow, that worked...
07:21bprfliebel: thanks for the tip
07:23bprhrm, it seems the with-facebook-auth symbol was the problem... i don't know what was wrong with it
09:44bprhow can i check if a namespace exists at runtime?
09:45bprI want to do this because I'm writing code that may be executed in Google App Engine and it does not have javax.net.ssl.HttpsURLConnection
09:46bprI'd like to be able to detect that case and use the code provided by Google to get an https connection
09:48opqdonutbpr: ns-resolve ?
09:49opqdonutor find-ns, rather
09:50bpri've tried find-ns, it doesn't seem to be it
09:51bprbecause even (find-ns 'java.lang) ==> nil
09:52bprso i think maybe the best way is to try to do (require 'javax.net.ssl.HttpsURLConnection) and catch the exception if it's thrown
09:56opqdonutah, so you're not looking for a clojure namespace but a java package/class
09:57bpryeah
09:57bprsorry for the mangled terminology there
09:57opqdonutyou could maybe ask the ClassLoader
09:58opqdonutbut, of course, all the nice methods are protected...
09:58bprinterresting
09:59opqdonutthe only public one that's of interest seems to be loadClass, which then throws a ClassNotFoundException if it doesn't find the class
09:59opqdonutso that's not any better than using import from clojure
09:59bprthat could work
10:00opqdonutimport + catch is probably good enough
10:00bprok
10:00bpri'll give that a shot
10:12fliebelMy father got 2 robotic arms from a school. They have LPT ports. Does nyone have any idea how to control these?
10:37raek,(resolve 'java.lang.Integer)
10:37clojurebotjava.lang.Integer
10:37raek,(resolve 'java.lang.DoesNotExist)
10:37clojurebotjava.lang.ClassNotFoundException: java.lang.DoesNotExist
10:38raekbpr: you could also try java.lang.Class/forName and catch ClassNotFoundException http://download.oracle.com/javase/6/docs/api/java/lang/Class.html#forName(java.lang.String)
10:40gfrlogClojure doesn't have a *var* I can set for a (Math/random) instance to use with (rand-nth), does it?
10:40gfrlogI have some randomized code that I would like to be able to test deterministically
10:41gfrlogwithout mucking up the non-test code
10:41gfrlogI guess I could rebind (rand-nth) in the tests, if nothing else :-/
10:42bprraek: thanks
12:14mrBlissOh yeah, I'm no. 1 on 4clojure.com!
12:25robonoboIs there any documentation on how to include and use resources in a leiningen uberjar?
12:48raekrobonobo: well, everything in the resources/ directory is inlcuded in the jar. you can use (def r (clojure.java.io/resource "foo/bar.txt")) to get a special URL to the file, which you can then use to open it, like this (clojure.java.io/reader r) or this (slurp r)
12:53robonoboraek: that works, thanks.
12:53raekunfortunately, I'm not aware of any pages that explains this scenario, but the concepts involved are basically putting things on the classpath, getting a url to the thing on the classpath, and opening a stream from a url
12:53robonoboit's kinda confusing
12:53robonobothe leiningen documentation doesn't say anything about resources other than how to set the path
12:53robonobobut anyway
12:53robonobothanks
12:54raekit basically just another src/
13:17KneferilisHello.
13:18Kneferilisanyone with exprerience with clojure on .NET?
13:25Kneferiliscan someone explain to me, why use clojure instead of common lisp?
13:27Kneferilisanyone?
13:27clojurebotPlease do not ask if anyone uses, knows, is good with, can help you with <some program or library>. Instead, ask your real question and someone will answer if they can help.
13:28fliebelKneferilis: I inly know it doesn;t work on mono.
13:28raekKneferilis: well-defined concurrency semantics for things that can mutate, persistent data structures, and interop with the jvm are some arguments
13:28fliebel... what raek said
13:29Kneferilisraek: but why someone use clojure instead of common lisp or the opposite?
13:29Kneferilissorry, I just noticed I asked that
13:29raekif your app will (eventually) need both states and multiple threads, then Clojure rules
13:29raek*changing state
13:29Kneferilisand where is common lisp better than closure?
13:32rlbKneferilis: I imagine that some common lisp's may be faster, and they may provide better built-in support for lower-level operations on a particular platform. Though the jvm has gotten better in that respect (i.e. symlinks).
13:32raekKneferilis: ... oh, and to the clojure over cl arguments, add The Sequence Abstraction
13:33raekthe fact that CL has a standard could be an argument fo CL too
13:33KneferilisI see.
13:34rlbKneferilis: also for better and worse, common lisp has a giant library, though for many modern (especially web-oriented) bits, when you include the jvm, I'd imagine clojure has the upper hand.
13:35rlbThough it's been quite a while since I worked in common lisp heavily, so I'm not up on the current state of the world.
13:36raekI guess the condition system and debugging is more simpler in CL, but it's getting better in Clojure
13:36raekprobably a lot simpler
13:37Kneferilishow does clojure compare to F#?
13:37rlbI imagine the decision would often be clear, given the particular project, and the particular target platform.
13:37rlbi.e. if you need to deploy somewhere the jvm doesn't exist, but one of the common lisps does...
13:37rlbetc.
13:38rlbDon't know anything about F#.
13:39Kneferilisok
13:42churibwhich version of swank should i use with the current version of clojure-slime?
13:43churibswank <--> slime
13:45amalloybpr: http://download.oracle.com/javase/1.3/docs/api/java/lang/Package.html#getPackage(java.lang.String)
13:49amalloychurib: it's hard to nail down versions, because apparently the slime devs think releases are lame
13:50raekchurib: if you follow this approach, you get a slime version that works for the swank version you are using: http://technomancy.us/149
13:50carllercheDoes anybody know of a resumable json parser for clojure? As far as I can tell, the one in contrib blocks for input.
13:51churibraek: thanks - i will try that one
13:52amalloycarllerche: huh? how could it not block?
13:52raekcarllerche: could you explain how you would like to use such a parser?
13:52carllercheamalloy: returns a state
13:52amalloyoh, resumable
13:52carllercheor tracks state somehow
13:52amalloyi read that as reasonable
13:52carllerchehehe :)
13:53raekone hackish way to use the contrib one could be to pass data to a PipedInputStream that the parser can read from
13:55carllercheyeah... but it seems to be a reasonable thing to have. I'm not sure if it would be better to try to write a resumable parser for clojure or try to use a java one since the java ones would parse to some java structure and then it would have to be converted to clojure data structures
13:55carllerchei should see if aleph has anything
13:55amalloyi'm still not really clear how it would be useful to you. you want to get out the partial results and work with them somehow?
13:56raekcarllerche: so you want to feed it data that might not make a complete json object, and get back as many object as could be parsed?
13:57carllercheI'm dealing w/ large json objects & netty. It seems better to stream the chunks into the parser as opposed to buffer all the chunks then parse all at once
13:57carllerchebut, it could probably go either way
13:57raekcarllerche: fn-parse is a functional parsing library that has a json parser as an example. it will return its state.
13:58carllercheraek: huh, looks interesting. I'll look into it. Either way, worst case is buffer all the chunks before parsing which isn't _terrible_ in this case
14:09amalloyhaha congrats mrBliss
14:20mrBlissamalloy: How can I see the code golf histograms without resubmitting my solutions?
14:20amalloymrBliss: fork the github repo and add the feature :P
14:21amalloynot strictly true, i guess
14:22amalloyhttps://4clojure.com/leagues/golf/2 will show you all the scores but with no marker for where you stand
14:23mrBlissamalloy: nice. Are the solutions stored or just the scores?
14:23amalloymrBliss: we started storing solutions after we started storing scores
14:23amalloyand we don't actually store your *best* scoring solution, but rather the one you entered most recently
14:24mrBlissamalloy: it'd be nice to compare solutions like on projecteuler :-)
14:25amalloymrBliss: well you seem to be better at clojure than dbyrne or me, so make it happen!
14:26mrBlissamalloy: I should be studying for my exams though ;-) When I find some time, I'll see what I can do.
14:55dnolenfliebel: did you sae my comment about your core.logic patch?
14:55dnolens/sae/see
14:55sexpbot<dnolen> fliebel: did you see my comment about your core.logic patch?
15:26fliebeldnolen: no?
15:26dnolenfliebel: check it out, you should bring the args bit back, I explain in the comment on your patch.
15:26fliebelI'm looking at it now.
15:27fliebelSo they should just be no-ops now? sure... I'll have another patch in a few secs.
15:27dnolensimple type inference for the simply typed lambda calc in core.logic, port of stack overflow Prolog solution, https://gist.github.com/997140
15:27dnolenfliebel: thx.
15:28fliebeldnolen: stu said that for a patch to core clojure, I had to use a different format, should I do this for you as well?
15:29dnolenfliebel: yeah, to get attribution info.
15:29fliebelok
15:29fliebeldnolen: How do I run the tests?
15:29dnolenfliebel: mvn test
15:33fliebeldnolen: Still some failures...
15:33dnolenfliebel: related to what?
15:34fliebeldnolen: It's because the new fact takes a vector and now & args I think.
15:34fliebel*bot
15:34fliebel*not
15:35hugodmy first logic code https://gist.github.com/996901 - any critique appreciated
15:35dnolenfliebel: I don't see an immediate advantage in taking a vector, we have apply.
15:35fliebeldnolen: It's just that protocols dont support varargs
15:36dnolenfliebel: protocol fact -> fact*, then define fact which calls it.
15:37fliebeldnolen: hm, could do that... not all to hapy with it, but I guess it's better that way.
15:38dnolenhugod: interesting! what advantage do you see for using core.logic here ? :)
15:39hugoddnolen: it is a simplified at the moment - I want to be able to match multiple rules to build the final map
15:40hugodand ideally spec2 would be built from a plain data structure, that can be built from data in config files
15:41dnolenhugod: for complex rules, core.logic is useful. One thing I don't like is that core.logic is closed, I wonder if a robust pattern matching would work better for your usage ?
15:42dnolenhugod: so you're planning on introduction conditionals of some sort that make multimethods a poor fit?
15:42dnolenintroduction -> introducing
15:43dnolenfliebel: yeah, I don't really see any other way, and it's not so bad IMO.
15:44fliebeldnolen: What about invoke? I can't go around implementing all 16 versions of it, I hope?
15:45dnolenfliebel: ? fact* takes a seq, fact will create that seq via rest arg.
15:45fliebeldnolen: I mean, rel implements ifn. If I want that to work with varargs, I need to implement all 20 versions.
15:46fliebel(likes x y)
15:47fliebelBut possibly also (likes t u v w x y z)
15:48hugoddnolen: multimethods won't work - need to be able to specify default os-family for a provider, default image-id for a specific os-family for a provider, and :image-id's for :os-family :os-version combinations, image-id's for :os-family :os-version :hardware-id combinations, translations from :cpu-count and :min-ram to hardware size, network topology, etc
15:49dnolenhugod: I see, this is cool. Love to hear feedback as this evolves.
15:50hugoddnolen: sure - I'm also thinking about using it for exception filtering in swank-clj
15:50fliebelIs there any way to implement IFn with varargs without implementing all 20?
15:51dnolenfliebel: hmm ... yeah I agree lets avoid the invoke limits. Can you fix the tests as well in your patch?
15:51dnolen(fact name [a b c]) is OK w/ me.
15:51fliebeldnolen: Okay, so I just fix the tests rather than my code?
15:51dnolenfliebel: yes.
15:53fliebeldnolen: So should I make it (defrel man ['p]) as well?
15:54dnolenfliebel: actually I think we should think about this some more ...
15:54dnolenfliebel: it would be useful to describe relations that dispatch on arity ...
15:55fliebeldnolen: I can't think anymore now. Timezones, you know. I'll just upload this patch and think about it later, or in my sleep probably.
15:55dnolenfliebel: np, I'll ponder it as well.
15:57fliebel??? git made me 2 patch files.
16:00amalloyfliebel: one per commit, no?
16:00fliebelamalloy: Yea, but why would it do that? Not very useful...
16:00amalloyuh. that seems a lot more useful than the alternative
16:01amalloyif you want just one patch file, rebase it down to one commit
16:01fliebel$google git rebase
16:01sexpbotFirst out of 7420 results is: git-rebase(1)
16:01sexpbothttp://www.kernel.org/pub/software/scm/git/docs/git-rebase.html
16:03arohneranyone have a clever way to stick an 'if' test into a ->> expression?
16:04arohnerlike (->> foo (bar) (if x (baz) (bogus)), but have it do what I mean?
16:05arohnerI already have apply-if, I supposed I could make an arrow version
16:05amalloyfliebel: $ git rebase -i dnolen/master (or whatever you call his branch)
16:06amalloythen in the editor that appears, replace "pick" with "squash" in any commits you want to fold into earlier commits
16:07fliebelamalloy: I did that, but at first I failed :( Now I did it I think.
16:07amalloyfliebel: yeah, i can never find the right args to supply to a rebase :P
16:08fliebeldnolen: http://dev.clojure.org/jira/browse/LOGIC-2
16:08imadezipmap is kinda evil ,(vals (zipmap (range 1 6) [1 2 3 4 5]))
16:09imadewait, how do I invoke the clojure evaluator here?
16:09fliebeldnolen: What do you mean with dispatch based on arity?
16:09imade,(vals (zipmap (range 1 6) [1 2 3 4 5]))
16:09clojurebot(5 4 3 2 1)
16:09imadeah there we go
16:09imadeit returns in reverse order
16:09fliebelimade: ampersand, comma, or double hash.
16:10fliebelwhere ##(+1 1) cal also be used in the middle of a sentence. comma is for clojurebot, and ampersand is for sexpbot.
16:10sexpbotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn
16:13gfrlogimade: a map doesn't have a defined order, so you shouldn't expect any particular behavior from (vals)
16:13fliebeldnolen: You mean you want to be able to do ((rel [[2 2] [1 2 3]]) [q 2 3]) -> (1)
16:13fliebel*questionmark*
16:16imadeso is there another way to zip together indexes and values without loosing order? [[1 :a] [2 :b] [3 :c]]
16:17imadeI guess I could use map-indexed
16:17imade,(map-indexed #(vector %1 %2) [1 2 3 4 5])
16:17clojurebot([0 1] [1 2] [2 3] [3 4] [4 5])
16:17gfrlogimade: I believe a sorted map would accomplish that. Personally I've never had to use one, so I'm curious what you're doing.
16:18fliebel$findfn [[1 :a] [2 :b] [3 :c]] {1 :a 2 :b 3 :c}
16:18sexpbot[]
16:18imadeI am solving the 99 prolog problems, nr 16 in particular
16:18gfrlogoh. I'm not familiar with them.
16:18fliebel$findfn {} [[1 :a] [2 :b] [3 :c]] {1 :a 2 :b 3 :c}
16:18sexpbot[clojure.core/into]
16:19gfrlogI guess if you're doing exercizes then you probably wouldn't want too much high-level advice anyhow.
16:19imade:)
16:19amalloyimade: yeah, just map vector
16:19imadeI think I had a lightbulb just now above my head
16:19amalloy&(map vector [1 2 3] [:a :b :c])
16:19sexpbot⟹ ([1 :a] [2 :b] [3 :c])
16:19gfrlogimade: that's kind of awkward lighting
16:20imade:D
16:20amalloyimade: shameless plug here: have you tried www.4clojure.com? interactive tutorials, some of them pulled from 99 lisp problems
16:20gfrlogimade: I guess the summary is that there are a handful of ways to represent pairs, depending on what you need to do with them
16:21gfrlogamalloy: have you no shame?
16:21imadeI looked that no-one has solved the 99 prolog problems in clojure all the way to 99, so I try to accomplish that
16:21fliebelimade: How far are you?
16:22imade16
16:23imadeI think it would be good if newcomers like me have as many resources as possible to practice
16:23imadecurrently it's a private repo, but if anyone is interested to help along then I could make it public
16:27imadeI noticed that there have been other attempts, but no one has finished it all the way to 99, so I am commited to do that
16:28dnolenfliebel: Prolog supports the notion of like/1, like/2, like/3 etc. It would be nice to be able to do the same in core.logic. The more I think about it, the more I think that's the direction to go.
16:28imadeI made it public https://github.com/imade/clojure-99
16:29imadeso if anyone wants to contribute let me know, I can give commit rights, besides it would be really helpful if I get feedback also, I am a lisp newbie
16:29fliebeldnolen: What would that do in Prolog? I've only encountered it while importing stuff in Erlang.
16:30imadehaskell, scala prolog and CL have been solved all the way to 99, so Clojure deserves it too, cause it's a fun and awesome language
16:30dnolenfliebel: it just means that the like relation supports multiple arity is all. right now defrel doesn't, even though goals support it because of multiple arity support.
16:31dnolenfliebel: I'm heading out, will ruminate on this and get back to you.
16:59imadecan anyone review my solution to problem 16 or maybe come up with more concise solution? here's the link https://github.com/imade/clojure-99/blob/master/src/clojure_99/problem16.clj and test https://github.com/imade/clojure-99/blob/master/test/clojure_99/test/problem16.clj
17:07amalloyimade: sent a pull request just now
17:07imadek I check it out
17:09imadewhoa, nice concise solution! I will run it through the unit test too just in case
17:09amalloyit won't behave the same way as yours when n=1
17:09amalloybut that's because yours is imo wrong :P
17:11amalloyoh, yes it will. i read your zero-check as a one-check, sorry
17:12imadeI get an exception with (drop-nth4 [1 2 3 4 5 6 7 8 9 10] 3)
17:13amalloyoh, i wrote it as n coll, not coll n
17:13amalloy&(doc drop-nth)
17:13sexpbotjava.lang.Exception: Unable to resolve var: drop-nth in this context
17:13amalloy&(doc take-nth)
17:13sexpbot⟹ "([n coll]); Returns a lazy seq of every nth item in coll."
17:13amalloysince that's the way clojure arguments are ordered usually :P
17:15imadeyep I need to read some coding conventions then I will do a code review for myself
17:17imade(drop-nth4 [1 2 3] 0) creates neverending loop
17:17amalloymhm. as you can see i didn't do a zero check. feel free if you want
17:17imadeyep
17:18amalloybut "drop every zeroth element" doesn't really have a clear meaning
17:18imadeyou're right, it's a fine line how error resilient these solutions should be, maybe I should ease it up a bit, like expect valid input
17:53imadeamalloy: I'm studying your solution, you're using recursion, but in this form it will consume stack as it goes deeper, right?
17:54amalloyno, because i wrapped it with lazy-seq
17:55amalloypiling concat on top of concat can be problematic sometimes though, so you might try it out for, say, 10k elements
17:58imadeseems to be very fast with 10k elements
18:00imadeI'm trying to wrap my head around how come this solution doesn't consume stack, lazy-seq source doesn't use recur or smth like that
18:03raekwhen (lazy-seq ...) is evaluated, the inner code is not evaluated, but put into a LazySeq object, which is returned
18:03raekso one level of the stack is popped right there
18:04raekwhen you call seq on the LazySeq object, it will return (cons some-element (lazy-seq ...)) and the process is repeated
18:04imadeah ok, so it's solved in deep level, in bear guts
18:04raekyou could say that 'seq' and 'lazy-seq' works as a trampoline
18:06imadeI am looking clojure.lang.LazySeq source now, it's all java :)
18:11imadeI guess I need more experience to know when certain algorithm is consuming stack or not, so far I thought the only way to to recursion is with recur, but as it turns out amalloy's solution also uses recursive definition but without consuming stack
18:12raekyes, lazy-seqs have this property too
19:22KneferilisHello!
19:22KneferilisIs there anything wrong with this code: (ns user) (defn foo [a b] (str a \" \" b)) ?
19:22amalloyKneferilis: looks fine to me
19:23KneferilisI see.
19:24amalloy&(let [foo (fn [a b] (str a \" \" b))] (foo 1 2))
19:24sexpbot⟹ "1\"\"2"
19:24amalloyassuming that's the output you want
19:27Kneferilisanything wrong with this?
19:27Kneferilishttp://pastebin.com/BtP11JWy
19:31amalloyyes
19:32Kneferiliswhat is wrong?
19:32amalloyit doesn't do the same thing as your clojure example because the escaping of the "s isn't the same
19:33amalloyi don't really write clj/java interop from the java side, but doesn't RT.var want symbols, not strings?
19:33amalloyno, i guess it wants strings
19:34Kneferilisok
19:35amalloybut you'd probably get more useful help if you said "here's some code that i think should do X but isn't; it's doing Y instead"
19:36amalloyrather than asking someone to guess whether it "works"
19:39gfrloghere's some code that I think should throw an out-of-memory error, but isn't; it's serving a complex and lucrative web application instead.
19:45KneferilisI have a file foo.cjlit only has the text: (ns user) (defn foo [a b] (str a \" \" b)) in it, is it correct?
19:45KneferilisI have a file foo.cjl it only has the text: (ns user) (defn foo [a b] (str a \" \" b)) in it, is it correct?
19:49Kneferilisdoes clojure has eval?
19:49imade,(doc eval)
19:50clojurebotDENIED
19:50imadehmm
19:50imadehttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/eval
19:50Kneferiliswell, can it use eval if it is called from java?
19:53Kneferilisthanks for the information
19:53KneferilisI tried to install clojure on .net, by converting the jar file to dll
19:53Kneferiliswith ikvm
19:54Kneferilisbut it didn't work
19:54Kneferilisit seems that clojure compiles everything instead of interpreting
19:54Kneferilisso, it compiles its script to java bytecodes and that crashes my app, that expects il
19:56imadeI wish I could help you more, did you look at https://github.com/richhickey/clojure-clr/wiki? it seems to have info how to get clojure running on clr
19:58imade,(-> 2 (+ 2))
19:58clojurebot4
19:58imade,(-> [1 2 3] (split-at 2))
19:58clojurebotjava.lang.ClassCastException: clojure.lang.PersistentVector cannot be cast to java.lang.Number
19:59gfrlog,(->> [1 2 3] (split-at 2))
19:59clojurebot[(1 2) (3)]
20:00imadeaah, cause with -> it would be like (split-at [...] 2)
20:00gfrlogexactly
20:15Kneferilisimade: thanks for the information
20:28Kneferilisgoodnight
20:51imadeI am searching for a function thrown?, what's the best way to find which namespace it belongs to?
20:51gfrlogmaybe clojuredocs.org
20:51gfrlogI bet there is something better though, which I am too lazy to ever figure out exists
20:52amalloyimade: it's not a real function
20:52amalloyit's something that clojure.test treats specially in macroexpansions
20:52imadek, so I can use thrown when I use clojure.test
20:53amalloyyes
20:53gfrlogman that's like one step eviler than a macro
20:53amalloysrsly
20:53gfrlogcouldn't it have been done with a (defmacro thrown? ...)?
20:53amalloygfrlog: thrown? probably needs access to information that the outer macro has
20:54gfrlogI can't think of why...wouldn't it just need to create a try-catch and a couple (is)es?
20:54amalloyi'm not in favor of the choice that was made, but i don't know the background of how clojure.test is implemented so i can't really judge
20:56gfrlogI only make judgments prior to reviewing the code
21:05imadek, it's 4 a.m here, enough of coding for today, good night
21:07offby1wuss
21:07amalloy*chuckle*
21:07amalloy#clojure is not for the weak!
21:09gfrloghe didn't say for the week, he said for today
21:09gfrlog....I'm so sorry
21:13gfrlog,(doc keep)
21:13clojurebot"([f coll]); Returns a lazy sequence of the non-nil results of (f item). Note, this means false return values will be included. f must be free of side-effects."
21:13gfrlogI think that last sentence is strange.
21:26amalloyagreed, i suppose
21:29gfrlogI didn't see anything in the source that looked suspicious, unless I don't understand how chunked seqs work
23:12offby1presumably clojure reserves the right to call f more or fewer times than you might expect
23:14amalloyoffby1: yes. but that's true for a lot of things (eg map) and they don't all mention it; it's sorta implied that if you have side-effectful functions you deserve what you get
23:15offby1hmph
23:15amalloy(futher, neither keep nor map *actually* call it more than you expect)