#clojure logs

2011-04-22

04:26alekx(let [v [1 2 3] (get v -2) (nth v -2)) ; get => nth in IndexOutOfBounds
04:26alekxIs that ok?
04:27alekxsorry, question is get using a negative index results in nil, while nth w/ negative index results in IndexOutOfBounds
04:28fliebelalekx: I still see no question, but that is expected. try (get v −2 :blah)
04:28alekxfliebel: I was wondering about the difference in behavior
04:29alekxboth nth and get support the "missing value"
04:29fliebel&(doc nth)
04:29sexpbot⟹ "([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences."
04:29alekx(nth [] -2 "missing"_
04:30alekxIs there a way to get the second to last element from a vector/sequence?
04:30fliebelalekx: vector or sequence?
04:30alekxsome langs support negative indexes for doing that; I'm wondering if a similar idiom exists in clojure
04:31alekxlet's start with vector
04:31alekx:D
04:31fliebelNot that I know, you could do (- length 2) though, or do (last (drop-last 2))
04:31fliebelor (nth 2 (rseq))
04:32fliebelor structure your data so that you don't need to do that, because it is inefficient.
04:32fliebelvectors can do disj though.
04:33fliebel(peek [1 2 3])
04:33alekx&(doc disj)
04:33sexpbot⟹ "([set] [set key] [set key & ks]); disj[oin]. Returns a new set of the same (hashed/sorted) type, that does not contain key(s)."
04:33fliebelor what… let mee see.
04:33fliebelno, you want peek and pop.
04:33fliebelfor a vector they work a the end, for a persistenqueue they work at the start.
04:34alekxthnks. I'll look into all these one by one :)
04:35fliebelSo since nth is actually just (first (rest (rest… you'd do (peek (pop (pop....
04:36fliebelBut vectors are counted and support numerical indexes really fast, so (- (lenth) 2) is probably faster.
04:37alekxit definitely needs to be index based
04:37alekxthat's the whole idea
04:38alekxso probably the length approach is the one to use
04:38fliebel&(source nth)
04:38sexpbotjava.lang.Exception: Unable to resolve symbol: source in this context
04:38alekxor someone could implement a new nth that behaves this way
05:33fliebelWhat would be the Clojure way of doing this? Killing threads does not really sound like a good idea. http://stackoverflow.com/questions/5378391/closing-a-blocking-queue
07:54raekfliebel: interrupting a thread is not the same as calling .stop on it
07:56raekan interrupt merely suggests the thread to stop what it's doing, but is not guaranteed to have any effect (it's up to the thread)
07:58raekalso, I would recommend reading the chapter "Cancellation and Shutdown" of Java Concurrency in Practice. it explains all this really well
07:59fliebelraek: OKay, thanks. I don't own the book though.
07:59raekyou might also find the "Shutdown with poison pill" example useful http://www.javaconcurrencyinpractice.com/listings/IndexingService.java
07:59raekI've borrowed it from the uni library... :)
08:00fliebelI'm not in uni either.
08:02fliebelraek: Do you know anything about pods? I thought they where going to be for this kind of Java stuff in Clojure.
08:02raeknope... :-)
08:02raekfliebel: I did something similar in clojure a while ago: https://github.com/raek/stream-seq
08:03raekhttps://github.com/raek/stream-seq/blob/master/src/se/raek/stream_seq.clj#L123
08:04fliebelokay, locking…
08:04raekthe project has an implementation of a "closable" blocking queue
08:04raekit uses locks and stuff, so it's not very pretty
08:05raekthe locks are mainly there to keep producers from putting stuff in the queue when it has been closed
08:06fliebelraek: Thanks for that code, it seems to contain a lot of stuff I might need.
08:08fliebelThe trouble with seque is that it must really support any BlockingQueue. Especially SunchronousQueue is problematic with locking.
08:12fliebelSo 1) I can't lock the actual queue, because for SynchronousQueue that means a deadlock. 2) I can't insert a plug, because for PriorityBlockingQueue that means NPE.
08:13fliebelI'm going to do some hamocking outside to cook something up.
08:32raekfliebel: can't you use an (Object.) as the "plug"/"poison pill"?
08:33fliebelraek: What is the priority of an object?
08:34raekoh, missed the Priority- there :)
08:35raekhamocking sounds like a good plan
08:35fliebel:)
09:09fliebelraek: interrupting *was* in fact a working solution :)
09:10ambrosebsis there any way to extract the type hint of an argument?
09:10ambrosebssay I want to know this symbol was hinted to be Integer
09:10ambrosebs(foo ^Integer 'a)
09:10fliebel(:tag (meta x)) I think.
09:11fliebel&(:tag (meta ^Integer []))
09:11sexpbot⟹ nil
09:11fliebeluuhm, what? In my repl that works.
09:11fliebel&(meta ^Integer [])
09:11sexpbot⟹ nil
09:11fliebel(dec sexpbot)
09:11sexpbot⟹ -1
09:11ambrosebsdoesn't seem to work for me either
09:12fliebel&(meta ^:blah [])
09:12sexpbot⟹ nil
09:16raekambrosebs: the type hints are on the data stucture that is sent to the evaluator
09:16raekambrosebs: so you need to look at those before they get evaluated, i.e. you need to do it in a macro
09:16ambrosebsah this makes sense
09:18ambrosebsIm not sure if I can use a macro in my situation
09:19raekI recall that the "defstrict" exercise of Labrepl uses the type hints to add runtime type checks
09:19ambrosebsyes i remember that too now
09:20ambrosebsI'm using pallet to generate Bash script .. I'm nested inside the "script" wrapper function, so I'm not exactly in clojureland
09:21ambrosebsI think i'll have to take a different strategy
09:37_ViHow to have a JComboBox that selects keywords from a set? Should I use a map from keyword to combobox's item index?
10:02fliebelWhat a beautiful error! java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.Exception:
10:03fliebelNow, how can I tell clojure.test that I don't care about the type of exception?
10:04stuartsierrafliebel: you mean test for any exception?
10:05fliebelstuartsierra: Well, what I mean is that the type of exception seems to depend on my implementation. So I guess that what I actually want is the original exception.
10:06stuartsierraThere's an example in the tests for clojure the language to get the root cause of an exception.
10:06stuartsierrabut you may just want `(thrown? Throwable ...)`
10:07fliebelstuartsierra: Well, I put Exception in there, but then it did not work when it was a RuntimeException. Is Trowable any different?
10:07stuartsierraYes. Throwable is the parent of all exception types.
10:08stuartsierraalthough Exception is also the parent of RuntimeException.
10:08fliebelstuartsierra: right, that is what I thought, but it seems to work anyway. :) thanks
10:08stuartsierra'welcome :)
10:10fliebel:( still locks itself up from time to time...
10:11stuartsierraIt's possible the exception is happening outside the scope of your `is` assertion or `deftest`, due to timing / concurrency issues.
10:11fliebelstuartsierra: Nah, the test is working now, btu I'm using interrupt to get out of the .take when I'm done, but it seems to miss that sometimes.
10:12stuartsierraThread.interrupt?
10:12fliebelyea
10:12stuartsierraWell, there's your problem. :)
10:12fliebelwhy?
10:12clojurebotwhy not?
10:12Kerrisahahah clojurebot
10:13Bronsalol
10:13stuartsierraThe behavior of Thread.interrupt is complex.
10:14stuartsierraIf you need to wait for something to complete, you're probably better off with something like a CountDownLatch.
10:15fliebelstuartsierra: Sounds like it's time based?
10:15stuartsierraCountDownLatch isn't time based. It's like a semaphore.
10:15stuartsierraClojure's promises use them.
10:16fliebelstuartsierra: Oh! I'll check that out. (it's for this one https://gist.github.com/934781 )
10:17dnoleninteresting, Java 7 book that covers using Scala/Clojure http://www.java7developer.com/
10:20fliebelstuartsierra: What is complex about interrupting?
10:20stuartsierraI don't understand it. Ergo, it must be complex.
10:20thorwilis there a straightforward approach or library for reversible text transformations? (specify transformation from format A to B, handle he other direction implicitly)?
10:21fliebelthorwil: Boomerang, or Logos, if you try really hard.
10:22fliebelhttp://www.seas.upenn.edu/~harmony/
10:23thorwilactually, i recall reading a bit about boomerang. but "straigtforward" in this context would start with available from/in clojure
10:23fliebelstuartsierra: This sounds interesting: http://www.ibm.com/developerworks/java/library/j-jtp05236/index.html
10:23stuartsierraYeah, Goetz is a smart guy.
10:24cemerickfliebel: it has a lot of the same characteristics of locks that make them hard to use properly as well
10:25fliebelcemerick: Well, while I'm already mutating stuff all the way though, it doesn't really matter, since it's complex anyway. It makes me respect Clojure all the more, though :)
11:15sritchiehey all, I was wondering if anyone had any advice on this function -- https://gist.github.com/936857
11:15sritchiethis is the structure of a cascalog aggregator -- tuples is a sequence of (index, val) pairs
11:16sritchieessentially, I'm filling in a sparse vector by associng values in place -- I sort of feel like this bashing in place isn't idiomatic
11:22Chousukesritchie: I'm having a hard time figuring out what that function even does :/
11:24sritchieChousuke: sorry! should have had an example. I start with a vector of 0s, of some length "width". This is fed into a function composed of a bunch of smaller "assoc" functions -- each of this does one of the replacements required by cascalog
11:25Chousukeare the tuples in index order?
11:25Chousukethen you could build a lazy sequence of items and call vec on that.
11:26Chousukeif not, it's a bit trickier.
11:26sritchieChousuke: yeah, some of the spots are going to be missing
11:26sritchiethey will be ordered, though
11:27sritchie,((fn [width tuples] [(vector ((apply comp (for [tup tuples] (fn [v] (apply assoc (vec v) tup)))) (repeat width 0)))]) 5 '((0 1) (4 2)))
11:27clojurebot[[[1 0 0 0 2]]]
11:27sritchie(cascalog needs all that extra nesting)
11:27sritchie,((fn [width tuples] [((apply comp (for [tup tuples] (fn [v] (apply assoc (vec v) tup)))) (repeat width 0))]) 5 '((0 1) (4 2)))
11:27clojurebot[[1 0 0 0 2]]
11:28Chousukewell then you can do something that goes through the tuples one by one, returning the value in it if the index is right, and returning a padding value instead if not (and incrementing an interal index counter)
11:28Chousukelazily
11:29Chousukeand then just call vec on the result of that, to get a vector of it
11:31sritchieChousuke: hmm, let me think about that one
11:32sritchiein this example, after looking at (0 1), the function would need to return three padding values -- I wonder if (partition 2 1 tuples) would help, so the function could look at consecutive pairs of tuples?
11:32ChousukeI don't think it has to be like that
11:33Chousukeit can just look at the first tuple, and if its index is not equal to the counter index, then return a padding value and recurse with an increased counter
11:33Chousukeif it is, then recurse with the rest of the tuples and an increased counter
11:33Chousukeuntil you run out of tuples
11:35sritchietrying that out
11:38thorwilI need to apply a function to the content of a text class. constructed as (def txt (ds/as-text "Foo")) prints as #<Text <Text: Foo>>
11:39thorwilsimply converting to a string includes the Text label and the content might e longer than 500 characters
11:44thorwilnm, looks like .getValue is the solution
11:52sritchieChousuke: https://gist.github.com/936857
11:52sritchiethere's a first try... it's a lot faster
11:55ilyakhi *
11:55ilyakIs is possible to somehow recur into current function and not into loop
11:56ilyakBecause otherwise you get three variables: initial-list, current-list and rest-list
11:56ilyakIt's easy to make a mistake
11:59Chousukesritchie: you could make it use a lazy seq too, though it's probably a bit more complicated than that.
11:59manutterilyak: what is the context of your question? Do you have any example code?
11:59Chousukesritchie: actually
11:59Chousukesritchie: never mind. calling vec on that thing is pointless, it's already a vector :D
12:00Chousukesritchie: if your sparse vectors are going to be large, try using a transient too
12:03sritchieChousuke: that's smoking fast
12:03sritchieChousuke: any comments on the way the function's written?
12:15ilyakmanutter: Yeah, I'll paste
12:16ilyakmanutter: http://pastebin.com/iphLptVW - this is haskell-style stateful iteration
12:16ilyakMaybe I should make cache transient and use for instead of loop?
12:18Chousuketransient? why.
12:18Chousukeand don't forget for is lazy
12:18ilyakHow would I write it without repeating downloads three times
12:19ilyakOh, I'd unlazy it after
12:19ilyakand, preferably, transferring cache implicitly not explicitly (too wordy)
12:19dnolenilyak: you can recur to the current fn.
12:19ilyakEven if it's defn-ed?
12:20ilyakMaybe I should try memoizing find-best-major
12:20dnolenilyak: yes, fns also support multiple arity, so you can make a second fn that takes the initial values.
12:21ilyakDoes clojure have some sort of memoize in core?
12:22dnolen,(doc memoize)
12:22clojurebot"([f]); Returns a memoized version of a referentially transparent function. The memoized version of the function keeps a cache of the mapping from arguments to results and, when calls with the same arguments are repeated often, has higher performance at the expense of higher memory use."
12:23ilyakcool
12:24TimMcilyak: Just be careful what you memoize, of course -- there's no clean way to clear the memoization cache.
12:25ilyakWell, it would be garbage collected won't it
12:25ilyakIs there a reasonable way to make with-open work with a map of something to closeable?
12:26ilyaki.e. close everything it finds there
12:26TimMcilyak: If you drop all references to the memoized function, yeah.
12:26ilyakTimMc: It won't escape that function
12:27dnolenilyak: which is the proper way to use memoize.
12:29dnolenhttp://lambda-the-ultimate.org/node/4260
12:30dnolen"Clojure (roughly an untyped version of Haskell using LISP notation)"
12:30hiredmanheh
12:31ilyakWow
12:31ilyakIt's even faster when I recur to defn
12:46thorwili have a problem with http://paste.pocoo.org/show/376416/ , where the effect if more isn't specified, it should be as if there was nothing at all @more. otherwise more will be a single function
12:49fliebelthorwil: What is in @more?
12:51thorwilfliebel: as things are, the @ marks my intention. it's meant to be an optional function
12:52amalloy*baffled*
12:52fliebelthorwil: So why do you write & more? then it's at least a seq of an optional function.
12:53fliebelthorwil: Write it as a multi-arg fn then, whre the [] version calls the other one with a default function, or identity.
12:54thorwilretrieve-article* is to be used like: (def retrieve-article (retrieve-article*)) or (def retrieve-article-for-editing (retrieve-article* de-paragraphify))
12:54fliebelhttp://paste.pocoo.org/show/376424/
12:54thorwilif this seems needlessly convulted ... i'm trying to raise my understanding of funcions that return functions as alternative to macros ;)
12:55fliebelthorwil: ^^
12:55ilyakFor some reason replacing loop/cache with memoize made it slower
12:56fliebelilyak: If the memoized fn is cheap, yes, it'll be slower, as it needs to look up the value every time.
12:57ilyakIt seems expensive to me
12:57thorwilfliebel: wow, your version gives me new insight, thanks!
12:57ilyakI'll try it without memoize at all
12:57fliebelilyak: Note that I have no idea what you're doing.
12:59fliebelthorwil: you're welcome :) I could use some insights as well though :( Still rewriting seque.
13:00ilyakfliebel: Sadly, my code without my data won't make any sense
13:00ilyakAnd data weight several gigs
13:00ilyakand are confidential
13:01fliebelilyak: I guess the minimal mockup to make it run is less than that, but as you wish.
13:11devnheya fliebel
13:11devnamalloy: im here!
13:11amalloydevn: haha
13:12amalloyi was actually just demonstrating how $seen works
13:12devnI feel so used :(
13:12amalloyaw, poor devn
13:12amalloydevn: want to join the 4clojure.com team?
13:13amalloysince you're lonely and you hang out in #sexpbot already
13:13devndo i have to do anything?
13:14devnamalloy: just saw the page. hell yes i want to join.
13:15amalloydevn: we're planning to release 0.1.0 today; finishing up the last feature planned for the release. have a look at the issues page and see if there's anything that interests you
13:15ilyakMy program in js/rhino runs 3,7 times faster than the same program in clojure
13:16ilyakI wonder if I would get the parity
13:17Raynesdrewr: Ping.
13:18Raynesdrewr: Nevermind. Found what I was looking for. ;)
13:20ilyakWithout memoization it's crippling slow.
13:24dnolenilyak: is the algorithm significantly different from the js/rhino version?
13:25peteriserinsto anyone from 4clojure: am I supposed to star the gists that I want to remember?
13:25ilyakdnolen: I guess not, except that obviously clojure version is more fp
13:25ilyakI can paste both if you bother
13:25ilyakThey're loke 200 line each
13:25ilyaklike*
13:27dnolenilyak: which function seems the slowest?
13:28ilyaknon-memoized version is four times slower than memoized one
13:28abedrastuartsierra, hey can you jump on skype?
13:28dnolenilyak: are you memoizing that fn in js?
13:28ilyaksure
13:30ilyakThe program does the following: reads four presorted file and calculates some things over records it read and writes to files
13:31dnolenilyak: how long exactly does the js program version take and the clojure version take?
13:31ilyakjs program does 270 ids per second (one master file line per multiple (0-100000) lines of other files
13:31ilyakclojure program does 70
13:32bultersgday all.
13:32ilyakIt's possible that I do some extra work in clojure version, e.g. parse some things eagerly
13:32edwGood afternoon. (GMT-5)
13:34dnolenilyak: paste the source, js and clojure, not saying I'll see anything, but I'm skeptical that the clojure version can't be made significantly faster than a rhino/js program.
13:34bultersit's one of the awkward things I always experience on irc.
13:35bultersI'd like to say hi (perhaps thats an option), but good evening is - in most cases - only applicable to a small subset of users.
13:35amalloyugt?
13:35clojurebotugt is Universal Greeting Time: http://www.total-knowledge.com/~ilya/mips/ugt.html
13:36bultersthanks
13:36amalloythat said, if everyone greeted everyone who joined the channel, there'd be no room for meaningful conversation
13:37amalloyso it's pretty common on irc to not waste breath on hellos
13:37bultersamalloy: could be, i don't expect a full "hi newbie, nice you're back; anymore questions?" from anyone...
13:38bultersbut for some reason i find joy in a short polite hi
13:38amalloybulters: well, feel free
13:38amalloyit's not offensive or anything
13:38bultersamalloy: as I just did ;-) and no offense is taken at all...
13:38amalloyheh
13:39bultersas soon as nobody gets hurt ;-)
13:39bulterslong**
13:39ilyakdnolen: clj version http://pastebin.com/E1KBiEKX
13:40ilyakdnolen: js version http://pastebin.com/5F1BMFqe
13:40dnolenilyak: already see the problem. You need type-hints. That code'll hit crazy amounts of reflection. You'll probably see a 10X speed boost just by adding them.
13:40ilyakit's really lame before it was written in hurry
13:41ilyakdnolen: What to read about that?
13:41aredington@ilyak: http://clojure.org/java_interop#Java%20Interop-Type%20Hints
13:41dnolenilyak: you can't just call Java methods like that and expect the code to be fast. the compiler doesn't know the types.
13:43ilyakSo I should only do that when I call Java?
13:44dnolenilyak: when performance matters yes, type-hinting is for dealing with Java (or primitive math in 1.2.0)
13:46aredingtonilyak: If you (def *warn-on-reflection* true) you'll be told every time that clojure's having to use reflection to correctly type things, those are good candidates for type hinting as an optimization
13:46ilyakaredington: Did that
13:46ilyakWow
13:46dnolenilyak: aredington: (set! *warn-on-reflection* true)
13:46ilyakIt switched gears obviously when I added three hints
13:47dnolenilyak: like I said, a clojure being slower than rhino/js sounded outrageous to me :)
13:47fliebelheya devn
13:48ilyakdnolen: Can you help me setting some non-obvious hints?
13:49ilyakdnolen: Basically I need to tell clj that (:stop right), (:start right) and date are LocalDates
13:49ilyakand (:major right) is String
13:49ilyakWhere do I put those?
13:50dnolenilyak: line 25, 28, 31 all those need hints. I don't have time at the moment to point out each one unfortunately.
13:51TimMcilyak: ^LocalDate foo tells the compiler that foo evaluates to a LocalDate.
13:52ilyakOne sec, I'll paste a fresh version
13:52edwIs there any way to dynamically add project dependencies without re-starting Clojure?
13:52amalloyTimMc: i think dnolen is right though, he wants to put hints in the function params
13:52amalloyedw: no
13:52edwThat is a downer.
13:52TimMcamalloy: Not having seen the code... probably.
13:52edwBut thank you.
13:52stuartsierraedw: Kind of a fact of JVM life, unfortunately.
13:53ilyakdnolen: http://pastebin.com/NR2KY3y3
13:53ilyakTimMc:
13:53edwI'd like to see (require '(lamina "0.4.0-SNAPSHOT")).
13:53ilyakHow do I do a type hint on return type?
13:54fliebelIs there anyone around who eats Java concurrency for lunch? I have some code that *should* to all my understanding work, but hangs 1/100 times. https://gist.github.com/934781 Related Java code: http://stackoverflow.com/questions/5378391/closing-a-blocking-queue
13:54dnolenilyak: (defn ^String foo [] ....)
13:54TimMcilyak: Line 39, you probably want [^String string] for the arguments.
13:55TimMcOr wait... Integer/parseInt might not need that since there's no ambiguity.
13:55ilyakTimMc: Nope, it figured it out (does not complain)
13:55TimMcOK, cool.
13:55dnolenilyak: rule of thumb, if your Clojure code isn't between 1X-4X of Java, something is wrong.
13:56TimMcdnolen: That reminds me, I need to do some performance analysis on my rasterizer.
13:56TimMcIt was super slow compared to Java. I blame the lack of primitive-passing.
13:56TimMc(Clearly, it can't be my own fault... :-P)
13:56amalloydnolen: well. if you *want* it to be close to java and it's not close, something is wrong. if you're putting together a program where elegance and/or ease of development is more important i wouldn't say something is wrong
13:57stuartsierraA thought: algorithms designed to be efficient with mutable data cannot be implemented efficiently with immutable data, and vice-versa. Discuss.
13:57dnolenstuartsierra: which is why I want Pods.
13:57chousers/cannot/cannot always/ and I'm good to go
13:58stuartsierras/cannot/can rarely/
13:58sexpbot<stuartsierra> A thought: algorithms designed to be efficient with mutable data can rarely be implemented efficiently with immutable data, and vice-versa. Discuss.
13:58ilyakdnolen: How do I help it with write-next?
13:58chouserthat'll do nicely. :-)
13:58ilyakehm .writeNext
13:58ilyakit's CSVWriter.writeNext(String[])
13:58TimMcilyak: Hint it in the let
13:59amalloy^"[String" i think
13:59amalloyor...there's an L in there somewhere
13:59amalloy&(class (into-array ["test"]))
13:59sexpbot⟹ [Ljava.lang.String;
14:00TimMcilyak: ^Hint lister (get ...) I think...
14:00ilyakTimMc: Okay
14:01ilyakIt's almost done
14:02ilyakNow it could not figure out reflection for .plusDays (lines 133-134)
14:03raekiirc, ^"[String" can be written as ^strings
14:03raekor maybe that is only for primitives
14:04ilyakIt still have some strange issues
14:04amalloyraek: i think it's primitives. string *might* be special cased, but i'd be surprised
14:04ilyakFor example, I need to do (defn ^DateTime read-date-time [^String string] (.parseDateTime date-time-formatter string))
14:05ilyakWhy can't it figure out the determined return type of read-date-time?
14:05amalloyilyak: you haven't told it what date-time-formatter is
14:05raekilyak: functions always return Objects (in 1.2)
14:06AndjaOk, people I have a assignment due tomorrow for clojure and I really really need someone to give my code a look and tell me is my code ok and give me some tips perhaps. https://code.google.com/p/binary-search-tree-implementation/source/browse/trunk/%20binary-search-tree-implementation/tree.clj
14:06Andjaplease pm me :)
14:06raekilyak: you cant put a typehint there, so you have to put it at all places where the function is called
14:07ilyakamalloy: It can infer that too
14:07TimMcilyak: THe compiler *might* need to be told the type of qux in (.foo bar qux), but it *always* needs to know what type bar is.
14:07fliebelAndja: Why pm?
14:07Andjafliebel: Because I am to embarrased to talk in public :)
14:07ChousukeAndja: It could use some more spaces :P
14:08Chousukeand perhaps destructuring
14:08fliebelAndja: Except for the formatting, it looks okay to me. Except that your doc strings are on the wrong side of the arguments.
14:08Andjafliebel: I dont even know how to run my code without copy pasting it in emacs
14:08Chousukeinstead of doing (:val tree) etc. all the time, destructure with {:keys [val L R]} instead
14:08Chousukethen you can just use val, L and R to refer to the values
14:09AndjaChousuke: Ok, thank you ill rewrite it
14:10ilyakTimMc: raek: http://pastebin.com/TfceKQ0n
14:10Chousukeeg. (defn makeseq [{:keys [val L R] :as tree}] (when tree (concat (makeseq L) [val] (makeseq R))))
14:10ilyakWhy does it complain that call to print can't be resolved?
14:10ilyakI mean, I did everything I could
14:10TimMcilyak: Looks reasonable to me, but I'm not an expert on the compiler.
14:11ChousukeAndja: otherwise, it seems ok. But yeah, fix the formatting :)
14:11fliebelWhoa, is it just me, or are there *a lot* of open issues for Clojure?
14:11ilyakamalloy: dnolen: any ideas on http://pastebin.com/TfceKQ0n vs "call to print can't be resolved"?
14:11raekilyak: this works (defn foo [] ...) (defn bar [] (let [^Foo f (foo)] ...)) but not this (defn ^Foo foo [] ...) (defn bar [] (let [f (foo)] ...))
14:12AndjaChousuke: What do you think I should add to my project cus it looks kinda dry just like that on it's own.
14:12raekilyak: basically, type hints are only considered inside functions. they are gone after the function is compiled
14:12amalloycandles and cupcakes
14:12ChousukeAndja: no idea :)
14:12AndjaChousuke: haha :) Thanx anyway m8 appriciate it!
14:13stuartsierrafliebel: There are a lot of JIRA tickets, with a lot of duplication.
14:13ilyakraek: So type hints inside (def are worthless?
14:13raekilyak: now I saw that date-time-formatter was not a function, but the same thing holds
14:13raekilyak: yes
14:13ilyakWhy aren't they an error?
14:14ilyakAnd what can I do? I can't use global-bound java objects?
14:14fliebelstuartsierra: I see… Is there anything mere mortals can do to improve that situation?
14:14raekI have no answer reagarding the reason, but the compiler ignores metadata where it doesn't look for it
14:15ilyakraek: In fact it seems to not be the case
14:15stuartsierrafliebel: Add comments with explanations & links where you find duplicates.
14:15ilyakIf I remove a type hint ^DateTime read-date-time, then .toLocalDate in read-local-date fail to resolve
14:16ilyakif I keep it, it resolves
14:17raekoh. hrm. maybe you're right
14:17stuartsierraType hint metadata can go on Vars, symbols, or list expressions.
14:17raekdidn't know that the compiler looked at the metadata of the var, in addition to the metadata on the code data structure
14:18fliebelstuartsierra: Okay. But… don't people use the search function themselves?
14:18ilyakoops
14:18ilyakI had a faulty type hint
14:18ilyakthat's why it failed
14:18stuartsierrafliebel: not always
14:19stuartsierrawe've had 3 different ticket trackers in 3 years, we're still recovering
14:19TimMcilyak: Misspelling?
14:19raekdoes the compiler treat the :tag metadata of a var containing a fn as the type hint for the return value then?
14:19fliebelstuartsierra: Ouch, that does not help I guess.
14:20aredingtonHopefully someone will wait till 2013 to write a ticket tracker in Clojure.
14:20stuartsierraraek: yes
14:20ilyakTimMc: Nope, I told it that date-time is String
14:20raekilyak: please ignore what I have said... :-)
14:20ilyakApparently it didn't believe
14:20ilyakThe only issue I have standing is:
14:20ilyak154 - reference to field toLocalDate can't be resolved
14:25fliebelstuartsierra: Ouch, this is harder than I thought. I found one duplicate so far. Can I ignore the ones by http://dev.clojure.org/jira/secure/ViewProfile.jspa?name=importer?
14:25stuartsierranot necessarily.
14:26stuartsierraYou can ignore all CONTRIB-* issues, however.
14:26fliebelAnd probably those by the core team as well.
14:26stuartsierraprobably
14:27cemerickProjects go into JIRA, and _they never come out_
14:27stuartsierrathe core team is working on this — we had a whole meeting this morning about pruning tickets for the next release.
14:27stuartsierraBut deleting duplicated or vaguely-defined tickets hasn't been as much of a priority.
14:28stuartsierraGot to go focus on my talk for #phillyete next week.
14:29aredingtonfliebel: if you use the advanced search feature you can scope things pretty precisely e.g. 'project = CLJ AND issuetype = Defect' will get you only the defects against the main clojure lang
14:29aredingtonI know embarrassingly too much about jira issue juggling so feel free to direct questions toward me :)
14:29ilyakwow
14:30ilyakIt's /really/ fast now
14:30ilyak2x the js version
14:30ilyakdnolen:
14:30ilyak3x
14:30hiredmansounds like we need (as far as I know unwritten) jira-jdbc
14:30hiredman(a jdbc driver for jira)
14:30fliebelaredington: I figured that out, but now I have only 17 tickets left, so I must have selected to… selectively.
14:32dnolenilyak: nice.
14:33fliebelMeh, I'd rather spend time fixing my own issue than browsing stuff by others. Only.. I'm really stuck.
14:34ilyakdnolen: last question for today
14:34ilyakhttp://pastebin.com/cFNx0SnG
14:34ilyakIs there a way to make it shorter?
14:34ilyakI mean, it's cool that it's fast, but 2x more lines is eww
14:34ilyak(one function)
14:35fliebel~logs
14:35clojurebotlogs is http://clojure-log.n01se.net/
14:35raekilyak: (map (fn [x] ...) coll) -> (for [x coll] ...)
14:36dnolenilyak: can't dig in but I saw a lot of things I would do differently in your code. Using records in this kind of code seems pretty unnecessary.
14:36raekyou can even do (for [x coll :let y (f x)] ...y...)
14:36ilyakcool tanks
14:36ilyakdnolen: I'm just dabbling
14:36ilyakI'll be back for advice one day :)
14:37aredingtonfliebel I get 42 back with 'project = CLJ AND issuetype = Defect and status=Open'
14:37raeks/:let y (f x)/:let [y (f x)]/
14:38fliebelaredington: Okay, I'll have another look later &&&& < to find it in my search history
14:38dnolenilyak: lines 51 59, would be shorter w/ destructuring.
14:38dnolenilyak: destructuring could be used in quite a few places.
14:40dnolenilyak: figure-out-best-major looks like it could be made way shorter.
14:40Raynesdrewr: postal doesn't support SSL, does it? :|
14:41drewrRaynes: not directly, but it's trivial through msmtp or some other proxy
15:01Raynesdrewr: I'll probably fork it and add it myself.
15:01RaynesWould you be opposed to direct SSL support?
15:02drewrnot at all
15:02drewrjust isn't a priority when other tools do it better
15:03Raynesdrewr: Right, but I'd rather not depend on something can't be grabbed by maven, and JavaMail supports it.
15:04Raynessomething that*
15:05drewryou need to expand your horizons :-)
15:05drewrhowever, if you do the work I'll certainly consider it
15:07chrissbxIs there a macro to split its arguments into right-associated binary calls?
15:08chrissbxe.g. (right-associate foo a b c) -> (foo a (foo b c))
15:08fliebelchrissbx: reduce?
15:09chrissbxwell that's a function, and it expects a list.
15:10chouserand will left-associate
15:10fliebeltrue
15:11fliebelhm, in Haskell there is foldl and foldr...
15:11amalloyfliebel: guess what is in amalloy-utils
15:11fliebelamalloy: Oh, I know this one! Let me think… lazy-reduce?
15:12fliebelno, lazy-recur!
15:13fliebelamalloy: How did you implement it? Let me see...
15:13chouserchrissbx: you're sure you want a macro?
15:13fliebelokay, I found unfold…
15:14chrissbxWell, it seemed like the natural thing: I want to turn a syntactical representation to another one
15:14chrissbxYes I could create a list and then fold, but..
15:14chrissbxthat needs the list, and also it needs list construction syntax syntactically.
15:14chrissbxSeems like a double looser.
15:15fliebeloh, lazy-loop even, but amalloy, I can't find it :(
15:15amalloyfliebel: it's in amalloy.utils
15:15amalloynot utils.whatever
15:15amalloyi guess i might not have pushed it?
15:15amalloyhaha apparently so
15:15amalloysorry to taunt you fliebel
15:16fliebelhaha sadface
15:16amalloyfliebel: i just implement it as (reduce (reverse-args-to f) (reverse coll))
15:16fliebelamalloy: Do you happen to have an implementation of seque laying around locally as well?
15:17amalloyfliebel: no, but i was interested by your tweet. finish it up, i want it
15:17fliebelamalloy: It works, except sometimes it does not :(
15:17amalloyouch
15:18fliebelEven though it's in java.util.concurrent, it's still not persistent, so it comes with all the classical java problems.
15:33nlogaxanyone using "static", the static site generator?
15:33nlogaxwondering why it crashes if i include a doctype in the default hiccup template
15:45edwIs there a clojure.string/split-like procedure where you specify what characters to collect, as opposed to which characters separate an element? E.g. (FOO "this is a test" #"[a-z]+")
15:46amalloyedw: re-seq?
15:46ataggart,(re-seq #"[a-z]+" "this is a test")
15:46clojurebot("this" "is" "a" "test")
15:46edwI think that'll do the trick. Thanks!
15:53pdk(doc reverse-args-to)
15:53clojurebotExcuse me?
15:53pdk,(reverse-args-to +)
15:53clojurebotjava.lang.Exception: Unable to resolve symbol: reverse-args-to in this context
15:54amalloypdk: not a built-in
15:54chouser#(+ %2 %1)
15:54pdkin contrib then?
15:55chousershorter, and no distracting alphabet chars!
15:55amalloypdk: https://github.com/amalloy/amalloy-utils/blob/master/src/amalloy/utils/reorder.clj
15:56arohneris there a fn to update the metadata, like assoc-meta, or do I have to do it by hand?
15:56amalloy&(doc vary-meta)
15:56sexpbot⟹ "([obj f & args]); Returns an object of the same type and value as obj, with (apply f (meta obj) args) as its metadata."
15:56arohneramalloy: thanks. I should have find-doc'd first
15:57dnolen,(let [flip (fn [f] (fn [& xs] (apply f (reverse xs))))] ((flip /) 2 4))
15:57clojurebot2
16:04bultersthis is odd; i added congomongo as a dependency in lein, tell it to use somnium.congomongo and I get a compile error
16:04bultersam I forgetting something?
16:04amalloylein deps?
16:05bultersthat's done
16:05amalloyand it successfully got into your lib directory?
16:05bultersyes, including dependencies
16:06bultersrestarted swank
16:08bultersok, got it... I tried out congomongo without somnium. before restarting swank
16:10ideamonkHi I'm very new to clojure, and am trying to nest a function inside another and call the nested function (mycount2) from outer function (mycount). But it seems everytime I try running it, I get a nil, am I calling the nested function the wrong way? is there a way to assign default values to arguments of a function in clojure? http://paste.pocoo.org/show/376541/ .. also I'm very new to functional programming itself. Looking for any
16:11pdkyou're using fn wrong
16:11ohpauleezideamonk: I'm looking at your paste now
16:12pdkex. (fn [x y] (+ x y)) would simply create and return an anonymous function that returns x + y, it won't give it a name or make it available to call by name
16:12ideamonkpdk: isn't fn like anonymous functions, that can be created in-place and called in-place ?
16:12pdkyes
16:12pdkif you want to give it a name
16:12pdkyou'd either use (defn function-name [arguments] body...) to give it a name that can be used at the toplevel
16:13pdkor store it within something such as in a let block to have it available in a local scope
16:13ideamonkpdk: Thx, im trying to rectify now.
16:13pdkex. (let [myfn (fn [x y] (+ x y))] body...) will define myfn as the function given and will make it accessible from within the body of the let statement by that name
16:14amalloyohpauleez: you okay with releasing a non-snapshot of clj-github? i'm using it for 4clojure.com and want to reduce our snapshot usage
16:14ohpauleezamalloy: Yeah, it's still matches the API right now and has tests where it matters most
16:15ohpauleezRaynes does the releases to clojars though
16:15amalloyohpauleez: i know. he didn't want to release without checking with you, since you've been doing more dev than him
16:15Raynesohpauleez: Cool, I'll release it later.
16:16amalloyi'm in a similar position with clojail
16:16Raynesamalloy: Remind me, please, because I know I'm going to forget.
16:16ohpauleezamalloy, Raynes: Cool, yeah, go for it
16:16pdktake a look at the reply to the paste
16:16pdkor rather here it is http://paste.pocoo.org/show/376547/
16:16pdker correction
16:16ideamonkpdk: thanks :)
16:17pdk(fn mycount [coll] should be (defn mycount [coll] if you want to be able to refer to mycount by name outside of that function def
16:17pdkthe way fn alone works is
16:17ideamonkpdk: im doing 4clojures :) they're like in place fill in the blanks
16:17pdk(fn fn-name [arguments] lets you refer back to the function you're writing by calling it with fn-name if it's defined recursively
16:17pdkbut that won't make fn-name refer to the function from outside
16:18ideamonkhmm
16:18pdkreplacing fn with defn in (fn mycount [coll] defines it by the name mycount and makes it accessible at the toplevel
16:19pdkbasically (defn myfn [args] ...) = (def myfn (fn [args] ...))
16:19pdkand def defines symbols that can be referred to by name at any scope
16:19ideamonkyes
16:22hiredmanpdk: no, def creates vars
16:22hiredmannot symbols
16:22hiredmanthe reader and the symbol function create symbols
16:25bultersamalloy: didn't know about 4clojure; very nice :D
16:26amalloybulters: it's only a few days old, so that's why you didn't know :P
16:28bultersamalloy: works really nice; working through the problems now :D
16:30pdkso do you register an acct for this 4clojure deal
16:31peteriserinsoh god, I wish I knew that fns can be named before doing the 4clojure problems by loop recur only
16:31amalloypdk: you don't have to, but you should: www.4clojure.com/register
16:32peteriserinsdidn't let me use def so I thought explict recursion is discouraged
16:32amalloypeteriserins: nope, just def is discouraged :)
16:33peteriserinsamalloy: btw what's the idiom for contributing problems? should one fork the dataset?
16:33bulterscan you recur in a lambda?
16:33amalloypeteriserins: yes, for now
16:33amalloyfork the repo, change data_set, push, send a pull request
16:33amalloywe have a feature request to add a nicer ui for that
16:33peteriserinsyeah that'd be very welcome
16:35bultersamalloy: rather than trying it out, i'll ask you (not to cheat): if you ask write a function, does it check if a function really is written?
16:35bultersor does (reverse (first list)) also work for problem 19? :P
16:35amalloy_lunchbulters: no. the test cases there get run, and that's about it
16:36bultersok, thanks. enjoy your lunch
16:36amalloy_lunchsomeone submitted "reduce conj ()" as a solution to one problem
16:36bultersha! :D
16:36peteriserinsamalloy_lunch: how do you view others' solutions?
16:47spewnFor all the ones in the form "(= ___ ...)", the most trivial "solution" seems to be "=);"
17:00krlcan you define protocol functions with variable amount of arguments?
17:01matthias_can i check which versions are avaiable of a dependency?
17:01cemerickkrl: no, you can't use varargs in protocols (yet, perhaps)
17:02krlhmm. no way to get around this/other ways of doing multidispatch?
17:02cemerickmatthias_: http://mavencentral.sonatype.com/ is there for central; You should be able to spelunk through clojars if that's where the dependency you're after is deployed.
17:02cemerickkrl: multimethods, if that suits you
17:02matthias_thanks
17:02amalloypeteriserins: there's a button to tweet your solution. i only see the ones that get tweetet
17:02cemerickprotocols do not offer multiple dispatch
17:02amalloybut check on twitter for #4clojure
17:04krlcemerick, ah true, had my concepts wrong. single dispatch is enough for me
17:04krllooking at multimethods, thx
17:14peteriserinsamalloy: cool, thanks
17:35devnhow to dispatch on type with multimethods
17:35devnerr when there's a protocol involved
17:36amalloy(defmulti foo (fn [a & _] (class a)))?
17:36raekdevn: why not use protocols and types directly?
17:37devnnah, it's like (defprotocol Foo (dothis [this] "foo bar") (dothat [this] "baz qux"))
17:38devn(reify Foo (dothis [this] (str "dothis")) (dothat [this] (str "dothat")))
17:39devnwhen you do this many times it seems like it's a bit redundant
17:40devnit feels like there should be a way to dispatch with a multimethod based on something being a Foo
17:40devndoes that make sense?
17:40ataggartWhy do you have those strings in your defprotocol?
17:40raekso what would the different dispatch values be?
17:40devndocstrings
17:41ataggartgood, so then what's the redundancy?
17:41devnI want to say, if the thing is a Foo, do this, but if it's a String, do that
17:43devni end up with (cond (satisfies? Foo ...) (dothis) (isa? (class ...) String) ...) :default (throw (RuntimeException. ...)))))
17:43ataggart(extend-protocol Foo String (dothis ...))
17:43devnhmm, trying that, give me a moment :)
17:43ataggartFoo is the prototype, not a type
17:44ataggartso this: "if the thing is a Foo, do this, but if it's a String, do that" is a possibly broken sentence
17:44ataggartshould Foo be a type or a protocol?
17:45stuartsierraIf you're dispatching on it, then it's a type.
17:45stuartsierraA protocol is that which does the dispatching.
17:45ataggarttrue, though inconsistent with his examples, hence the question
17:45raekdevn: to summarize: protocols give you dynamic dispatch on the type of the first argument - even with others' types
17:50TimMc'You tripped the alarm! eval is bad!"
17:50TimMc:-)
17:50Raynes>_>
17:50RaynesWas there some hidden context to that? :o
17:51TimMcNo, just noting that the same security (clojail?) is in place on 4clojure as in one of the bots.
17:51devnraek: stuartsierra: ataggart: thanks :)
17:51stuartsierra'welcome
17:52TimMcI guess I posted a bit late for the context to be obvious.
17:52RaynesTimMc: Aye, yes.
17:52RaynesTimMc: I work on 4clojure as well.
17:54TimMcThe Top Users page doesn't get recomputed right away, I see.
17:55TimMcRaynes: Grrr, I do not like problem 4.
17:56RaynesI didn't write that. ;)
17:56amalloyTimMc: yeah, a project Raynes and i are involved in, which needs sandboxing...not at all surprising that it uses clojail :P
17:56TimMcRaynes: Well, express my displeasure to whoever did. :-P
17:56RaynesWill do.
17:57TimMc(There's something fundamentally icky about telling users to put in a sequence of forms for a single form.)
18:03TimMcRaynes: I think I wouldn't find it problematic if there was a demo problem that showed multiple forms entered as a solution.
18:07ohpauleezTimMc: There's a getting started section that shows that, but I think it should be integrated into the problem set
18:26TimMcIt doesn't show multiple forms.
18:26TimMcIf I were coming straight from another Lisp, problem 4 would have confused me a lot more than it already did.
18:38schlechtvWhen using cake to execute a clojure "script": how can I pass commandline args? It doesn't seem to use ~main as an entry point ...
18:46Raynes_fogus_: Ping.
19:01chrissbxI'm missing the documentation of quasiquote
19:02chrissbxWhat's wrong with (defmacro ist [expr res] `(is (= ',res ,expr))) ?
19:03amalloychrissbx: ~, not ,
19:03amalloyer
19:03amalloythe single character to unquote is ~
19:03chrissbxOk, but it already complains about is, no such variable mynamespace/is
19:04amalloyyou need to define the macro in a namespace that knows about is
19:04amalloypresumably the one from clojure.test or some such
19:04amalloy&`walk
19:04sexpbot⟹ clojure.core/walk
19:04chrissbx(ns mynamespace (:require clojure.test))
19:04amalloythat's only a require, not a refer
19:05chrissbxaha
19:05amalloyif you wrote clojure.test/is, it would work
19:05chrissbxOk, thanks.
19:07chrissbxAh, comma seems to be a noop.
19:07amalloychrissbx: it's whitespace
19:07chrissbxyep
19:08amalloy&(+,1,2,3,,)
19:08sexpbot⟹ 6
19:11scottjI want to implement a foo where (foo "abc" "ac") => 2/3 and (foo "abc" "cba") => 1/3, any obvious/simple ways to do this?
19:12Kowboyhello
19:13amalloy&(map #(if (= %1 %2) 1 0) "abc "cba")
19:13sexpbotjava.lang.Exception: EOF while reading string
19:13amalloy&(map #(if (= %1 %2) 1 0) "abc" "cba")
19:13sexpbot⟹ (0 1 0)
19:13amalloyscottj: now just sum the list and divide by count
19:14scottj&(map #(if (= %1 %2) 1 0) "abc" "ac")
19:14sexpbot⟹ (1 0)
19:15scottjso doesn't work for both cases
19:15amalloyscottj: so far you haven't asked for any particular behavior when the strings aren't the same length
19:17amalloyoh, you have
19:17amalloyhaha
19:17amalloyit was sneakily word-wrapped on my client. anyway, if you could explain where you want that 2/3 number to actually come from...
19:18scottjnumber of characters in %2 in same order as %1
19:18amalloy$google longest common subsequence
19:18sexpbotFirst out of 16200 results is: Longest common subsequence problem - Wikipedia, the free encyclopedia
19:18sexpbothttp://en.wikipedia.org/wiki/Longest_common_subsequence_problem
19:24scottjyeah that's it, thanks for the pointer
19:25amalloyscottj: good, hope you find something useful there. the usual solution always had trouble fitting in my head
19:37chrissbxIs there some kind of an assert form that returns the value if it's ok? e.g. (first (assert* pair? (foo bar)))
19:38chrissbxHm, how do you actually check for a non-empty list?
19:38amalloyseq
19:39amalloychrissbx: (doto (foo bar) (->> (assert pair?))) would be one way to do it with existing tools
19:39chrissbxamalloy: re seq, hu? That returns a sequence, not a boolean.
19:40amalloy&(map seq [[] [1]])
19:40sexpbot⟹ (nil (1))
19:40amalloynil is like false, anything else is true. you don't need an actual boolean
19:40chrissbxaha, hu
19:41chrissbxWell, seq fails if its argument is not already a sequence or empty.
19:41chrissbxWhich doesn't concern me in my current chunk of code, but still.
19:41amalloy&(doc coll?)
19:41sexpbot⟹ "([x]); Returns true if x implements IPersistentCollection"
19:46chrissbxHow do I expand a piece of code completely, or n layers? Both macroexpand-1 and macroexpand only expand 1 layer.
19:47amalloy&(use 'clojure.walk)
19:47sexpbot⟹ nil
19:47amalloy&(doc macroexpand-all)
19:47sexpbot⟹ "([form]); Recursively performs all possible macroexpansions in form."
19:48chrissbxThanks
19:48amalloychrissbx: not strictly true, though. macroexpand expands N layers of macros - it just doesn't expand macros in the *arglist*
19:48amalloy&(macroexpand-1 '(doto x inc))
19:48sexpbot⟹ (clojure.core/let [G__29748 x] (inc G__29748) G__29748)
19:48amalloy&(macroexpand '(doto x inc))
19:48sexpbot⟹ (let* [G__29756 x] (inc G__29756) G__29756)
19:49chrissbxyes, no subforms (I've just read the docs)
19:50ideamonkhas anyone encountered any problem with the last z in https://www.4clojure.com/problem/36 ?
19:52amalloyideamonk: i wrote that problem. what do you mean, encountered problem?
19:53ideamonkamalloy: yup the solution which works locally isn't working there, weird , ending with java.lang.Exception: Unable to resolve symbol: z in this context (NO_SOURCE_FILE:0)
19:54amalloythen you're doing it wrong :P. can you paste into irc the solution you're putting in the 4clojure text box?
19:55ideamonkamalloy: http://pastebin.mozilla.org/1210219
19:56ideamonkworks locally, while on 4clojure page its a "java.lang.Exception: Unable to resolve symbol: z in this context"
19:57ideamonkamalloy: i hope im not doing something stupid :P
19:58amalloyideamonk: i have bad news for you, then
19:58amalloy:)
19:58ideamonkah
19:58amalloy&(let [x 7] [y 3] x)
19:58sexpbotjava.lang.Exception: Unable to resolve symbol: y in this context
19:59amalloylet only treats the first vector as a binding, is my point
20:00amalloy&(let [x 7, y 3] y)
20:00sexpbot⟹ 3
20:00ideamonkif we fill the last blank with "[z 1]" , it becomes
20:01ideamonk&(= 1 (let [z 1] z))
20:01sexpbot⟹ true
20:01amalloyideamonk: there's no "last blank"
20:01amalloyall three blanks are filled with the entire text you enter
20:01ideamonkamalloy: aha i've been assuming this all time !
20:01ideamonkgot it then !!
22:38ideamonkamalloy: have you done #44 on 4clj ? what could be wrong http://pastebin.mozilla.org/1210284 , seems to work perfect for testcases given, fails on unit tests
22:42amalloyideamonk: try it with a large negative rotation
22:43amalloyeg, a list of size 3, rotated by -9, should stay the same
22:43ideamonkAWW
22:43ideamonkah ah THX! :)
23:48joshua__$findfn [true true true] true
23:48sexpbot[clojure.core/== clojure.core/sequential? clojure.core/second clojure.core/last clojure.core/reversible? clojure.core/distinct? clojure.core/boolean clojure.core/vector? clojure.core/counted? clojure.core/associative? clojure.core/< clojure.core/peek clojure.core/fir... http://gist.github.com/938243