#clojure logs

2015-02-23

02:31ewemoaget an error with fresh check out of mies-node: https://pastee.org/pfbe9 -- does this work for anyone else?
05:23robindunbarrHi all, I cannot grasp the difference behind comp, compare, and comparator.
05:24H4nsis it idiomatic to use multimethods to tie together multiple implementations of a similar thing? i'm tempted to use a multimethod to implement various file transfer protocols, using the scheme/protocol from the url as dispatch value.
05:25H4nsi.e. (defmulti ls (fn [url] (.getScheme (URI. url)))) and then, in ftp.clj, (defmethod protocols/ls "ftp" [url] ...)
05:26H4nsyay or nay?
05:27ordnungswidrigh4ns: interesting question. I would suggest to think about error conditions. do all protocols handle that the same?
05:27ordnungswidrige.g. 404 vs. exception
05:27i-blisrobindubarr: comp is function composition ((comp first rest) [1 2 3]) <-> (first (rest [1 2 3])), very handy when you map, filter etc
05:27H4nsordnungswidrig: for my purposes, all protocols would signal exceptions when there was an error
05:28H4nsordnungswidrig: i subscribe to the fail fast philosophy, so most errors will be treated as fatal anyway
05:28robindunbarri-blis: Right, so there’s no relation to compare and comparator.
05:28ordnungswidrigh4ns: I think this could. th eonly other options is to register url handlers to some dispatcher.
05:28robindunbarri-blis: However, I still do not understand how compare works.
05:28ordnungswidrigh4ns: which is what a multimethods does.
05:29H4nsordnungswidrig: right. the thing is that unless i'm building an uberjar, clojure does not implicitly load the protocol implementations, so at some point, i need to iterate them all.
05:29ordnungswidrigh4ns: not sure what you men
05:30ordnungswidrig...mean
05:30H4nsordnungswidrig: but i think i can live with that. i just wondered if that'd be considered abusive.
05:30i-blisrobindunbarr: take a look at the examples on grimoire: http://conj.io/store/v0/org.clojure/clojure/1.7.0-alpha4/clj/clojure.core/compare/
05:30robindunbarri-blis, thanks I will check it out.
05:30robindunbarrclojure-docs isn’t that helpful, though.
05:31H4nsordnungswidrig: i mean that just by defining a few methods, i do not force the protocol implementation to be actually loaded. i need to make sure that it is loaded by some other means (i.e. by requiring all protocols explicitly into a top-level namespace)
05:31i-blisrobindunbarr: basically it returns positive if the first arg is greater than the second
05:31robindunbarri-blis it as in compare?
05:31ordnungswidrigI see.
05:31H4nsordnungswidrig: anyway, i think i'm good, thanks for your comment
05:33ordnungswidrigH4ns: on point againt multis is that you cannot change the implementation for a protocol at runtime.
05:34H4nsordnungswidrig: that is not a requirement, but what do you mean? i cannot recompile a method?
05:35ordnungswidrigh4ns: I don't think it's good style to redefine a defmethod
05:35H4nsordnungswidrig: you mean at run time, because it may break optimizations?
05:37ordnungswidrigh4ns: yes at runtime. say a user of the lib wants to use a different ftp implementation. you can redfine a defmethod, (not sure). However, in the case another code path also uses your lib that might lead to unexpected effects.
05:38H4nsordnungswidrig: ah, ok - well, this is out of scope for what i'm doing right now. i just need to support ftp and sftp for file transfers and would like to use a unified interface for the two.
05:39ordnungswidrigh4ns: then use a defmulti and change it if it sould give you problems at any time
05:39H4nsordnungswidrig: aye
05:42ordnungswidrig:-)
06:38zoti can't easily tell, since it's a java impl underneath: is doing (seq foo) always equivalent to (when-not (empty? foo) foo) ?
06:40zotah, yes. i see my own answer now.
06:47owl-v-is openjdk free to use in commercial products?
06:55alexyakushevHey everyone, I'm getting this error "Can't change/establish root binding of: *warn-on-reflection* with set" when I do (set! *warn-on-reflection* true) inside my namespace. Apparently the thread-binding of *warn-on-reflection* does not happen. My question is: where it is suppose to happen in the first place?
06:55alexyakushevI can find two bindings of WARN_ON_REFLECTION in RT.java, one when loading user.clj, and one when loading precompiled classes. But that's only when loading them, not when evaluating them
06:56Glenjamini tend to set it via leiningen
06:57alexyakushevYeah, I know, but I need to handle this case too
07:31dejanrhi, could anyone suggest me a good starting read for Clojure and ClojureScript, i have 10 years of web development experience, but never did Java or Clojure before
07:32dejanri would like to feel the full benefit of clojure envirionment, and do a small side project
07:32agarmanhttp://www.braveclojure.com
07:33agarmansome folks dislike that it steers users toward emacs
07:33dejanri am vim user for 5 years, but i have been looking to learn emacs too
07:34agarmanthat's another blog series that's useful for beginners
07:34dejanrthanks, looking into it
07:35omis it safe to assume that only a var with a :arglists entry in its metadata points to a fn, and that if in addition to that it has no :macro entry, then it is a normal (non-macro) fn (to be evaled at runtime)? https://www.refheap.com/97677
07:40dejanragarman: what do you think about datomic, and how far profesional project could go with free or first tier of pricing. Or do you prefer usual path by using open source dbs, and whats available
07:42agarmandejanr: it depends
07:43alexyakushevom: For macro part it is true
07:43alexyakushevom: For functions I'm not so sure
07:43agarmandejanr: there is good support for SQL, cassandra, mongo etc in Clojure. pick whatever is best for your app
07:43alexyakushevom: Do you only have the access to var metadata, but can't resolve them?
07:44dejanragarman: do you think you are more competent building distributive apps, and micro services, with clojure and actor model of concurency?
07:45omalexyakushev: right, I could resolve them; thanks!
07:45agarmandejanr: been using Erlang for distributed parts of my apps of late
07:45agarmandejanr: Clojure is great for concurrency
07:46alexyakushevom: Although be careful to correctly determine if something is a function
07:46alexyakushevFor example
07:46alexyakushev(instance? clojure.lang.IFn {}) => true
07:47dejanragorman: i see thanks, is that common? or people use successfully clojure for distributed parts too?
07:47omalexyakushev: yeap, I thought about such cases where IFn is implemented (so it's functionnaly speaking a function!)
07:48omalexyakushev: I am gathering stats on some of my growing namespaces
07:48alexyakushevom: Maybe your :arglists approach is more reliable
07:49alexyakushevFurthermore, it seems you are doing something tooling-related, so an error here or there wouldn't be much of an issue, right?
07:49agarmandejanr: you can do distributed programming in Clojure or whatever language. Erlang just has most of what you need to build already built.
07:49omright
07:50omstill, I had a function to check the instance, so I can cross check if I need to (may be it will reveal some strange edge cases)
07:50dejanragorman: so you used erlang for supervisoring and distributed part, and clojure for doing real work, right?
07:50oms/I had/I'll add/
07:53omalexyakushev: спасибо! :)
07:53alexyakushevom: You're welcome;)
08:03agarmandejanr: mostly handling truly distributed aspects with erlang ... next version of app may be mostly erlang
08:11dejanragorman: would you suggest me to start with Erlang or Clojure. I am looking to find better way of building apps, and solving better scaling problems current web technologies offer
08:12dejanragorman: and invest in something that would pay off over greater period of time
08:14mnngfltg(object-array [1 2 3]) => #<Object[] [Ljava.lang.Object;@31163991> <-- any info how to read this REPl output?
08:14mnngfltgThat is, what does [L...;@n] stand for?
08:16Bronsamnngfltg: it's the internal jvm representation of the "object array" class
08:17agarmandejanr: Clojure is a great language; learn it. It's worthwhile, especially if you're doing webdev.
08:17Bronsamnngfltg: "[" means it's an array, L<class name>; tells you the class. primitive types have single letter representations e.g. long is J, int is I etc
08:18mnngfltgBronsa, I see
08:18Bronsamnngfltg: so "[[I" will mean a int[][], "[[[Ljava.lang.String;" a String[][][] etc
08:20JavaDogCould anyone enlighten me as to why this throws "java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long"? http://pastebin.com/hK67eRP4
08:20mnngfltgand @31163991 is the hash code in hex
08:21mnngfltgwhich I suppose is some variant of the underlying pointer right?
08:21JavaDogIt's gotta be something to do with lazy sequences but I don't know how to solve it because I started with clojure 2 days ago :o
08:21BronsaJavaDog: take-nth takes n and coll, not coll and n
08:21JavaDogoh, shit
08:22mnngfltgJavaDog, I always get the arg order wrong
08:22omJavaDog: (take-nth n coll)
08:22Bronsamnngfltg: it's some sort of hash code yeah, no idea exactly what it corresponts to
08:22mnngfltgit's the most frequent mistake I make in clojure
08:22timvisheranyone have an irc channel they like for web development?
08:22JavaDogIt's confusing because some of the nth-related functions want (coll, i) and some want (i, coll)
08:23mnngfltgJavaDog, it helps if your editor shows the signature of the function at point automatically
08:23omJavaDog: it is idiomatic clojure to have coll as last argument
08:24mnngfltgBronsa, do you know what the hash means when you're talking about an array? the first element? or are arrays contained in objects?
08:24Bronsamnngfltg: usually sequence operations take the coll as the last arg while coll operations take it as first parameter
08:24Bronsamnngfltg: no it's an instance hash
08:24mnngfltgom, except for, e.g., `conj`
08:24Bronsa,(object-array [])
08:24clojurebot#<Object[] [Ljava.lang.Object;@49032abc>
08:24Bronsa,(object-array [])
08:24clojurebot#<Object[] [Ljava.lang.Object;@60a9c6d0>
08:25JavaDogIt's the same thing you get if you try to print the value of an object in java and haven't overridden toString()
08:25mnngfltgBronsa, interesting distnction, between seq operations and coll operations
08:25Bronsamnngfltg: yeah arrays are objects
08:27mnngfltgBronsa, Java's object model is certainly a bit confusing but it probably makes sense
08:28mnngfltgsequence functions: map, filter, reduce <--- take coll as final arg, require ->>
08:29mnngfltgcoll function: assoc, dissoc, conj <-- take coll as first arg, require ->
08:29mnngfltgI'm looking for a mnemonic :)
08:29JavaDogtake-nth appears to grab the first item in the list, and the continue to get the nth item after that. I don't want that, how can I make it just start from the beginning of the list and get me the first n items?
08:29JavaDoger
08:30ommnngfltg: yeap
08:30JavaDogeach nth item
08:30omJavaDog: (take n coll)
08:31JavaDogIf I processed this list with n=3, then I would want (7 15 25) returned: '(1 3 7 9 13 15 19 21 25)
08:31omah
08:33JavaDogmaybe (take-nth (next (dec n)) coll)?
08:34JavaDoger
08:34JavaDognext being first, rather
08:35JavaDogthis is my first foray into functional programming (i'm a java/android/web guy) and let me tell you, it's pretty damn difficult :p
08:35Glenjamin(doc take)
08:35clojurebot"([n] [n coll]); Returns a lazy sequence of the first n items in coll, or all items if there are fewer than n. Returns a stateful transducer when no collection is provided."
08:35omJavaDog: or, (map last (partition-all n coll))
08:35mbacJavaDog: yeah, it's kind of like learning to program for the first time since it's both a new language and a new paradigm
08:35mbacbut only kind of
08:36mnngfltgJavaDog, to take every nth you'll need to generate a lazy-seq yourself
08:37JavaDogHow would I do that?
08:38maaclHow can I upgrade to nrepl 0.2.7 ? CIDER 0.9.0 is complaining that only 0.2.6 is available and lein (upgraded to latest) also pulls down 0.2.6?
08:40omJavaDog: partition does generate a lazy-seq for you, with sequences of count n
08:41om,(map last (partition 3 [1 3 7 9 13 15 19 21 25]))
08:41clojurebot(7 15 25)
08:42mnngfltggood call, om
08:43ommnngfltg: thanks! (but probably not very efficient on very long colls) (because of last)
08:46JavaDogom: Aha, thanks.
08:53omJavaDog: you're welcome
08:54JavaDogI'm trying to understand the use of map though. Why couldn't I just run (last (partition ...))?
08:55omJavaDog: because you want the last of each (sub-sequence of length n)
08:55JavaDogoh, okay. I was misunderstanding partition
08:58omJavaDog: you may want to play a little with 4clojure, it is a nice way to discover the core functions
08:59JavaDogI have used it. Unfortunately the core functions lessons are so easy that they didn't really sink in :(
08:59JavaDogI do plan to continue with some more difficult ones though
09:10neoartifexHi, i've got an issue while using :group-by option in scatter-plot function in Incanter 1.9
09:11patrkrishi folks. do anyone here know if its possible to have github.com/miner/herbert report *which* validations fail? as far as I can tell, I only get a true or false value
09:30JavaDogAm I doing something wrong here? This line is throwing classcastexception: (if (= iterator (inc (* n n)))
09:30justin_smithJavaDog: what are "iterator" and "n"
09:31justin_smithsounds like n may not be a number
09:31JavaDog(defn myFunc [n] (loop [iterator 1 collection (initializing code)]))
09:32JavaDogand the function is called with (myFunc 5)
09:32justin_smithwhat does your recur look like?
09:32JavaDog(recur (definitely a collection here) (inc iterator))
09:33JavaDogOH
09:33justin_smithwell the order is wrong
09:33justin_smithhaha
09:33JavaDogfucking changed that. right.
09:33mbacshouldn't you... yeah
09:33JavaDogoh man...
09:33justin_smiththat's why I'm hear asking the tough questions
09:34JavaDogI need to buy a rubber duck
09:34SagiCZjustin_smith is a free rubber duck
09:35JavaDog$60/mo internet access + $??? custom PC = not free
09:35mbacwait, didn't you get the application for your #clojure monthly rebate?
09:35JavaDogokay cool. Now I just have an infinite loop
09:36JavaDogwell, not infinite. but not finishing anytime soon.
09:36mbacyou should've been msged that when you joined
09:36JavaDogdamn
09:36SagiCZmbac: wait i thought the premium account has to be earned?
09:37mbacsssh! that's separate!
09:37SagiCZmbac: darn!.. sorry
09:38JavaDogthis was probably not the best problem to choose 2 days into learning clojure: http://codegolf.stackexchange.com/q/45785/38108
09:38mbacit's okay, we'll roll that out for free and introduce a pro tier
09:38JavaDogsee I was like "Oh it's just a bunch of lists, clojure will be perfect"
09:38JavaDogoh yeah except for how I don't know anything
09:39hyPiRionThe first rule of #clojure monthly rebate: Do not speak about #clojure monthly rebate.
09:39SagiCZJavaDog: we are very patient with people who have 'java' in their nick, dont worry
09:40JavaDoghahah
09:40FunctionalDogthere you go
09:41FunctionalDogI feel like I'm so close and yet it's taking all my willpower not to give up. http://pastebin.com/j6ZSS8J6
09:41justin_smithFunctionalDog: 4clojure has some simpler problems, and some harder ones - all are rated for difficulty
09:41FunctionalDogbut I don't get internet points on 4clojure
09:42justin_smithFunctionalDog: I am suspicious of that .contains call
09:42FunctionalDogoh, that works for sure
09:42FunctionalDogmy only problem right now is that the loop runs forever
09:42FunctionalDogafter that is fixed, I'm sure I'll have 4000 other bugs to work on
09:42SagiCZFunctionalDog: that means that the if condition is never true
09:43SagiCZis n changing?
09:43FunctionalDognope. n is hardcoded when passed
09:43FunctionalDog(to 5)
09:43SagiCZoh i see.. but iterator is increasing
09:44FunctionalDogyeah
09:44SagiCZadd some prints to see whats happening to iterator
09:44justin_smithloop/recur is eager
09:44justin_smithand you clearly have no stop condition
09:44justin_smithyou need a lazy version, and to take only N results from the lazy version
09:44FunctionalDogyeah, I was going to sort that out later because I didn't know if I had to do it now
09:44justin_smithoh never mind, you do have a stop condition
09:45FunctionalDogbecause I can run (range) and get an infinite list just fine, so...
09:45SagiCZthere is a stop condition but its not lazy
09:45FunctionalDoghow do I make it lazy?
09:45SagiCZand making it lazy later wont work very much.. you would have to rewrite it
09:45SagiCZFunctionalDog: by using lazy-seq or higher order constructs
09:45FunctionalDogthat's fine too. I just want to be done with this so I can finally go eat
09:45justin_smithwell, concat and take and remove are already lazy
09:46justin_smithit would be a question of changing the loop / recur to a cons / lazy-seq / self-call
09:46justin_smithwith a version of your function with some extra args
09:46FunctionalDogthis is for code golf though. so even if not efficient, I want the shortest source I can
09:47justin_smithloop/recur is never the most concise answer in clojure
09:47SagiCZalthough it may be the most readable one in some cases
09:47mgaarewhen first learning Clojure, it's generally better to use recursion rather than loop/recur because you're more likely to write idiomatic code that way. Bring in loop/recur later
09:48justin_smithI'm going back to "4clojure has easier problems", I don't think code golfing something like this is a good first intro to clojure really
09:48FunctionalDogoh, it's not, and I'm quite aware. this is day 2.
09:48FunctionalDoghowever, I am learning it a lot faster than I would be if I were just going through problems one by one
09:49FunctionalDogso I can have recur jump back to a cons statement?
09:49SagiCZrecur can jump only to loop or to function
09:49FunctionalDogoh, a function would work I guess
09:52FunctionalDogthe main problem with this code golf is that I chose a mathy one. I suck at math
09:52FunctionalDogespecially when it starts getting several levels deep.
09:52FunctionalDogfuck this noise. I'm gonna write a goddamn sailboat.
09:53FunctionalDogoh wait, I can't. this isn't oop
09:53FunctionalDogo__o
09:54FunctionalDogexcept I probably can with some arcane combination of java library calls
09:54piranhacan somebody recommend me a database migrations library? I want to have them in simple '*.sql' files.
09:54justin_smithFunctionalDog: to do a lazy sequence, you do something generally like this: (fn x [arg] (if (foo? arg) nil (lazy-seq (cons (frob arg) (x (quux arg))))))
09:57justin_smithFunctionalDog: everything doable in java can be done in clojure if you don't mind a bit of interop, in practice everything but concrete inheritence and annotations tends to be reasonable, and those two are iffy.
09:57FunctionalDogannotations are for lazy library slaves
09:57FunctionalDog(and testers, I guess)
09:57FunctionalDog(and overrides too)
09:58justin_smithand we only need concrete inheritence when badly written libraries demand it as well
09:58justin_smithbecause a good library would use an interface
09:58Glenjamini do sometimes want sideways code re-use
09:59Glenjaminlike when implementing a simple custom collection it'd be nice to implement seq, and make other functions use seq internally
09:59FunctionalDogI'm just waiting until we start to see libraries that let you annotate stuff like @MakeFlappyBirdClone, @RequirePurchaseForProgression, @EntirelyLuckBased
10:00FunctionalDogI thought about writing the ultimate messenger service. It would let you sign in to all your other platforms (twitter, yim, kik, whatever)
10:00FunctionalDogand then every time you send a message, it just sends it to every service!
10:01justin_smithhaha
10:01justin_smithlike bitlbee in reverse
10:01FunctionalDog"But what if I want to respond to a particular person or conversation, FunctionalDog?"
10:01justin_smith@@@@
10:01FunctionalDogI will take your intended recipient and put that information directly where it belongs. In the garbage collector.
10:02FunctionalDogIf the people who made "Yo" were so successful, why couldn't I be?
10:03FunctionalDogIn case you don't know... https://play.google.com/store/apps/details?id=com.justyo&amp;hl=en
10:05FunctionalDogYeah I'm going to have to throw in the towel on this codegolf. Maybe I could do it in a language I actually know.
10:06FunctionalDogThanks everyone for your help, regardless. I did learn a lot :p
10:06SagiCZFunctionalDog: dont give up :)
10:06ddellacostaFunctionalDog: don't give up!
10:07justin_smithFunctionalDog: I'll mention 4clojure again - clojure code golf where you can see other people's answers after you solve it, with a pretty wide range of difficulty
10:07ddellacosta(not even sure what you shouldn't be giving up, but if it is related to learning clojure, then it fits...)
10:08ddellacosta4clojure is great
10:12SagiCZalso maybe clojure koans? but it might be too late for that
10:15FunctionalDogI was just giving up because I hate this problem
10:15FunctionalDogMath stuff starts to really grind on me after a while and it was getting to that point
10:16FunctionalDogIt's largely working except the loop, which I don't know how to construct properly
10:18justin_smithFunctionalDog: so the remove / .contains is removing every nth item, but I wonder if .contains is lazy enough
10:18justin_smithoh, never mind, it is
10:19FunctionalDogthis works: (let [coll '(1 3 7 9 13 15 19 21 25), i 4] (remove #(.contains (map last (partition i coll)) %) coll))
10:19FunctionalDoghow do you know that it's lazy?
10:20justin_smithFunctionalDog: my concern was that contains would act weirdly with a boundless lazy first arg
10:20justin_smithbut it is fine
10:20justin_smith,(.contains (range) 100)
10:20clojurebottrue
10:20justin_smiththat would not return if it realized (range) fully
10:22justin_smithFunctionalDog: so I added a print, it gets to 26 and hangs...
10:22justin_smithI think it's all the stacked up concat / remove
10:24FunctionalDoghm, yeah
10:24FunctionalDogis there a better way to do that? It was just the first thing I came across that worked, ie (concat '(1 2 3) '(4 5 6))
10:25justin_smithit could be that once you are removing all multiples of N where n is 2..26 it just takes a damned long time to get to the next non-removed items
10:25justin_smithFunctionalDog: using lazy-seq construction instead of eagerly building it up out of stacked concats actually helps
10:26FunctionalDoggoogle: "clojure lazy sex"
10:26FunctionalDogmhm.
10:26FunctionalDogI mean, I just typed that into google
10:26FunctionalDognot that you should search for it
10:27justin_smith$grim clojure.core/lazy-seq
10:27lazybothttp://grimoire.arrdem.com/1.6.0/clojure.core/lazy-seq
10:27justin_smithsee above link for docs and examples
10:27justin_smithyou are very close to solving this, it's just a concat bomb right now is all I think
10:28justin_smithFunctionalDog: you'll notice that same pattern I mentioned before in the examples on that page
10:28justin_smith(fn x [arg] (if (foo? arg) nil (lazy-seq (cons (frob arg) (x (quux arg))))))
10:31justin_smithFunctionalDog: I'm also concerned with the fact that you aren't dropping from the collection in the second half of the concat
10:32FunctionalDogOh, I had a drop there before. must have forgotten to re-add it when I changed everything
10:33FunctionalDogadded it again but that hasn't fixed anything noticeable yet
10:34justin_smithFunctionalDog: yeah, I put a print inside your remove condition that isn't printing at all
10:34justin_smithwhich makes me hella suspicious
10:34FunctionalDoghm. why would that happen?
10:34justin_smithnested concats can be a stack bomb
10:34justin_smithbecause concat is lazy
10:35justin_smithso you end up with a massive pile of ops to do to generate the next item
10:35FunctionalDogI thought I wanted to keep it lazy until the very end
10:35FunctionalDog(of the function)
10:36justin_smithyeah, recursive calls to concat are not a good way to do that in clojure, it's a weird thing
10:36FunctionalDogI guess I want to effectively model the formula, and then just extrapolate based on the input
10:36FunctionalDognot be doing anything with big lists ever until the program is about to exit. right?
10:37FunctionalDogand you're saying everything I have is lazy, like I want, except the concats
10:37justin_smithconcat is lazy
10:38FunctionalDogThen I am 100% confused
10:38justin_smithit's just that it is also pathological when nested deeply
10:39FunctionalDogI guess what I'm stuck on with converting to a cons call or something is, how can I join a list to another without concat?
10:39FunctionalDogBecause I need to be able to do (1 2 3) + (4 5 6) to get (1 2 3 4 5 6). IIRC cons only adds a single element
10:39justin_smithif you are using cons, why would you need to join two lists for this problem?
10:40opqdonutand why do you want to do it without concat? it's the right tool for the job
10:40FunctionalDogI'm looking at the examples you linked
10:41justin_smithopqdonut: his code stalls after the iterator reaches the goal value. I was suspecting the nested concats, but it could be some other issue http://pastebin.com/j6ZSS8J6
10:41FunctionalDogis any one of them particularly relevant? I have a hard time reading/understanding these very fast
10:41opqdonutjustin_smith: link's broken
10:41FunctionalDogoh, sieve is relevant
10:42opqdonutok nevermind I see tehre's a huge backlog, carry on :P
10:42justin_smithopqdonut: OK, FunctionalDog can repaste if he wants
10:42FunctionalDoghttp://pastebin.com/nNrG7YmQ
10:42FunctionalDogI must have hit 10 mins or something
10:42FunctionalDoglol
10:42m4farrelwhat's a quick way to convert a 1D seq to a 2D seq in clojure? Like take a seq and group parts of the seq of size 'width' together?
10:43m4farrellike (1d->2d 2 [1 2 3 4]) => [[1 2] [3 4]]
10:43opqdonut,(partition 2 [1 2 3 4])
10:43FunctionalDogpartition!
10:43clojurebot((1 2) (3 4))
10:43FunctionalDogoh, yeah ^
10:43FunctionalDogsee, learning
10:43m4farrelsweet, thanks
10:45opqdonutFunctionalDog: it seems to me you're calling (.contains x y) where x is an infinite list
10:45opqdonutFunctionalDog: do you see why this can never return false?
10:46FunctionalDogindeed
10:46opqdonut,(.contains (range) -1)
10:46clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
10:46opqdonutyou need to write your own monotonic-sequence-contains function
10:46opqdonutif I understand what you're trying to accomplish
10:46FunctionalDogwell, it's for code golf, so I want to inline and reduce as much as possible
10:47FunctionalDogthat said, I probably couldn't get it right even if it weren't for codeolf
10:47opqdonutwhat's the spec?
10:47FunctionalDoghttp://codegolf.stackexchange.com/q/45785/38108
10:47FunctionalDoglucky number generator
10:48FunctionalDogI know I need to restructure my loop. the finish condition isn't quite right
10:48FunctionalDogI need to be checking how many lucky numbers I've got
10:48justin_smithFunctionalDog: opqdonut has a good point (.contains (infinite-generator) x) is fine for the true case, but it's just an infinite loop for the false case
10:49FunctionalDogand I do know that to calculate n lucky numbers, you need to start with the range 1 -> n^2+1
10:49opqdonutFunctionalDog: it should be pretty easy to make a solution of the form (take n (generate-all-lucky-numbers))
10:49opqdonuta la the haskell solution behind your link
10:49FunctionalDogI've tried to read that haskell several times and it just... yeah
10:49FunctionalDogI'm a java guy.
10:49opqdonutand it'll be a good exercise in laziness
10:50justin_smithopqdonut: that's why I was trying to get him to look at lazy-seq (and also trying to get him to try simpler stuff first)
10:50FunctionalDogwell I tried to give up but you guys kept encouraging me :p
10:51justin_smithheh
10:51FunctionalDogyeah, I think that is the ideal solution though
10:51FunctionalDogone function which can generate all lucky numbers lazily, and then just a call to it with the user input n
10:52FunctionalDogand that's what I'm going for. but not attaining.
10:52justin_smithFunctionalDog: yeah, opqdonut hit the nail on the head - the problem was not the concat (it was a small nest of them after all), it's what the .contains call does when the infinite input does not contain the thing you are looking for
10:52FunctionalDogis there an alternative I should use, or some way I can limit its loopiness?
10:52justin_smithFunctionalDog: so your current code will work if you change the .contains to something that scans for a match, or a larger number, returning true for the former, false for the latter
10:53TimMc,(.contains (range) -1)
10:53clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
10:53justin_smithbecause it's an ordered collection, no match will be found after a larger number
10:53justin_smithso just short circuit it there
10:53TimMcSilly bot, why can't you just look at it?
10:53justin_smithhaha
10:54FunctionalDogokay, let's see if I can come up with something
10:54justin_smithbased on your other code, I am confident you can write that function (brb, coffee)
11:00justin_smiths/will work/will be close to working/ - you'll still need a drop call in there I think
11:01TimMc,(unchecked-inc Long/MAX_VALUE)
11:01clojurebot-9223372036854775808
11:01TimMc,(unchecked-inc (identity Long/MAX_VALUE))
11:01clojurebot#<ArithmeticException java.lang.ArithmeticException: integer overflow>
11:03FunctionalDogI added a drop
11:03FunctionalDogit's in that last paste
11:05omif I want a function to resolve the *ns* of the calling namespace, I have to wrap it in a macro, right?
11:06alejandrozfhi people, I'm wondering why clojure works only compiling to JVM, it's not possible create a Clojure->.java compiler_
11:07FunctionalDogthat would be called a translator, not a compiler
11:07FunctionalDog(or something like that)
11:07FunctionalDog(but still not a compiler)
11:08alejandrozfFunctionalDog: a compiler is , in principle, a translator
11:08FunctionalDogSure, but usually to some "more executable" piece of code
11:08FunctionalDogI feel like java source doesn't qualify as a compilation target
11:09FunctionalDogthat's why when you write in some language that gets translated to another language before it's compiled, it's called an interpreted language
11:10FunctionalDogwait, maybe that's not what that means. I don't know.
11:10FunctionalDogDon't listen to me. I don't even know clojure very well lol
11:11alejandrozfwell, but I think .java source files would be more "clean" of unpleaseant
11:11alejandrozf...JVM issues
11:13alejandrozfbesides, one could write a program in clojure and present it as a .java program for let say, Java employers,
11:13alejandrozfif such transalator exists
11:14alejandrozfsorry for my poor english
11:14daniel`alejandrozf: don't think anyone really wants it
11:14FunctionalDoghave you ever seen the HTML output from tools like dreamweaver? I can only imagine a similar unreadable mess
11:14daniel`i don't see why it wouldn't be possible
11:14Glenjaminafaik early version of clojure did compile to java source
11:15alejandrozfFunctionalDog: would be a cost, but if well designed minimize that problem
11:16FunctionalDogjustin_smith: I'm a little confused. I get the logic of the problem I'm trying to solve, but I have no idea how to implement it in clojure
11:16alejandrozfGlenjamin: yes? and why not on recent versions_
11:16FunctionalDogif(set contains larger number) return false; else if(set contains this number) return true;
11:16alejandrozf?
11:16FunctionalDoger, 'list', rather than set
11:16Glenjaminpresumably it was decided that bytecode was better
11:16FunctionalDogcollection, perhaps
11:17daniel`compiling to .java would basically mean compiling it twice rather than once
11:17alejandrozfGlenjamin: :(, both should coexist
11:17daniel`and i dont think many people would prefer to read java over clojure
11:17Glenjaminpresumably someone knows why, but i don't
11:17FunctionalDog(at least until I know clojure better, it's damn difficult to read)
11:18alejandrozfdaniel`: but integrate better with "java code"
11:18favetelinguisdu i need to compile my java class to be able to import it in my clojure namspace?
11:19justin_smithFunctionalDog: not really, because the set is infinite - you need to scan individual items until larger than the item (when you know you hit false)
11:19daniel`alejandrozf: i think as FunctionalDog said, the java output would be a mess
11:20daniel`clojure integrates pretty well with java when needed, as it is
11:20FunctionalDogjustin_smith: so in my original code, I guess there's an internal loop happening with that "remove" call, and clojure is trying to loop through the infinite list and it hangs, right?
11:20TimMcFunctionalDog: Clojure-as-Java would be harder to read.
11:21justin_smithFunctionalDog: exactly, what you want instead is a loop where you test each item in the coll - if it equals the thing you return true, if it's larger than the thing return false, otherwise recur and test the next item
11:21alejandrozfpeople, i'm far far to Clojure expertise but thinking if clojure would look like Hy, like more to more Lisp-people
11:22FunctionalDogjustin_smith: Now I have to decide how to build that loop, though. Would I do it with loop-recur, or is there a better way for this instance?
11:23TimMcFunctionalDog: (+ 2 2) becomes clojure.java.api.Clojure.var("clojure.core", "+").invoke(2, 2);
11:24FunctionalDogTimMc: eh?
11:24justin_smithFunctionalDog: you can use (recur) to recur a function without loop
11:24justin_smithFunctionalDog: in the repl, design a function with that logic, it should be pretty straightforward
11:24FunctionalDogjustin_smith: aha, that's the sort of thing I was looking for
11:24FunctionalDogyeah that's what I'm doing. I can compact it for golf later
11:25justin_smithpremature optimization and all that
11:25justin_smithmake it work, then, make it short afterward
11:25FunctionalDogI tend to be okay at optimizing and such. I wrote a pretty efficient MD5 hash collision finder in java for the lols
11:26FunctionalDogooh, I should make that a codegolf if it doesn't already exist
11:26justin_smithI was speaking in the general sense - code compactness (golfing) is a kind of optimization
11:26FunctionalDogyeah
11:27TimMcFunctionalDog: You said you'd like to see Clojure translated into Java. That's what it would look like.
11:28FunctionalDogNot me. I think you meant alejandrozf :p
11:28FunctionalDogI just mentioned that it would be ugly, like the html output from dreamweaver
11:29FunctionalDogoh, I guess I did
11:29FunctionalDogBut it was a joke. that would be horrible
11:29FunctionalDoga really clear, hand-made translation could be useful in learning though
11:30FunctionalDoglike, "these programs do the same thing", not "these programs are literally the same"
11:30TimMcAh, misread "raises hand".
11:34Glenjaminthe original discussion was why the clojure compiler emits java byte code instead of java source code
11:38SegFaultAXWhat would you call a function like (defn name-me [& args] (fn [f] (apply f args))?
11:38SegFaultAXIt's kind of like partial application, except you're making the entire argument list a value that you can apply to arbitrary functions.
11:39mdrogalisSegFaultAX: A closure?
11:39justin_smithSegFaultAX: on-args maybe
11:39SegFaultAXmdrogalis: :) I mean what would you call name-me?
11:39mdrogalisSegFaultAX: Derp. Sorry, heh.
11:40justin_smith(def to-twos (on-args 2 2)) (to-twos +)
11:40mbacSegFaultAX: apply-factory :P
11:40SegFaultAXIt's weird, right? It's vaguely related to partial, apply, and maybe similar to juxt in a way.
11:40SegFaultAXI guess it's like the dual of juxt.
11:41justin_smithmaybe apply-to
11:41justin_smith((apply-to 2 2) +)
11:41justin_smiththat is kind of readable
11:41SegFaultAXapply-with maybe?
11:41mbaccan you work combinator into there somewhere?
11:42SegFaultAXmbac: Pff, definitely.
11:44FunctionalDogjustin_smith: Well, I wrote a function, but I don't know why it doesn't work
11:44FunctionalDoghttp://pastebin.com/4BQ4q3bq
11:45FunctionalDog(line number is accurate on pastebin also)
11:45FunctionalDogas for why line 12 has an anonymous function, I couldn't tell you
11:45justin_smithFunctionalDog: well, to work where you call it, it would need to return a function
11:45justin_smithFunctionalDog: and you definitely don't want contains
11:45justin_smiththat's the same problem as before
11:46justin_smithyou want to do an = check with the first element of the collection
11:46FunctionalDogoh, I see what you mean
11:46justin_smithdo you know about let yet?
11:46justin_smithlet would be helpful there
11:47FunctionalDogwhy would I want to return a function, though?
11:47FunctionalDogremove just removes based on a boolean predicate
11:47justin_smithFunctionalDog: because teh first arg to remove must be a function
11:47FunctionalDogoh, it has to be?
11:47justin_smithyes, has to be
11:47justin_smithI mean, how else would findMatches know what to compare to?
11:47justin_smithit needs to have an arg
11:48justin_smithso you need a function that returns a comparator function when given a coll and an element
11:48justin_smitherr - not quite that, sorry
11:49justin_smithone way to do it would be to make findMatches take a coll and return a function to test an element
11:49justin_smithanother way would be to make an anonymous function (like you had before) that constructs the function you need each loop iteration
11:49FunctionalDogI'll keep it separated for now, for clarity
11:52justin_smith(defn match-finder [coll] (fn [ele] (loop [[x & xs] coll] (cond (> x ele) false (= x ele) true (recur xs)))) something like this I think
11:52FunctionalDogbut that's using loop
11:52justin_smithsure, it has a loop, it could be rewritten not to
11:54justin_smith(defn find-match [[x & xs] ele] (cond (> x ele) false (= x ele) true (recur xs ele)) then you would pass (partial find-matches coll) in the remove
11:54FunctionalDogwhat's this business? [[x & xs] ele]
11:54justin_smith,((fn [[x & xs]] x) [:a :b :c])
11:55clojurebot:a
11:55justin_smith,((fn [[x & xs]] xs) [:a :b :c])
11:55clojurebot(:b :c)
11:55justin_smithit's argument destructuring, a crucial code-golf technique in clojure
11:55justin_smithit replaces usage of first / rest in this case
11:55FunctionalDogah okay, I saw that on 4clojure earlier but forgot about it
11:56justin_smithI use it in one liners here out of habit
11:58FunctionalDogso it's just grabbing first and calling it x, and rest is xs
12:03justin_smithright
12:04justin_smithin a concise way
12:04justin_smiththe names are of course arbitrary
12:04justin_smith,(let [[tree & trees] (range)] tree)
12:04clojurebot0
12:06FunctionalDogwould this work? http://pastebin.com/wd2C8j7a
12:07FunctionalDogI guess I don't actually do anything in it yet
12:09justin_smithFunctionalDog: well, that mixes up two different approaches
12:09FunctionalDogI realized I never used the coll in the inner function
12:09FunctionalDogso I'm rethinking
12:09justin_smitheither you want to use partial, in which case you don't have nested functions any more, or you need a loop inside the fn and it doesn't take the collection arg
12:10justin_smithbut it's a couple small changes from being either of those things that would work :)
12:10FunctionalDogI haven't quite wrapped my head around everything the program is supposed to do here
12:11justin_smithbig picture, what both versions do is walk the collection, returning false if any element is larger than e, or returning true if any element is equal to e
12:12FunctionalDogin terms of golfing, using a loop is probably faster than writing partial twice
12:12justin_smithno, partial would only be there once
12:12justin_smithpartial would be at the call site, in the arg to remove
12:12FunctionalDogoh, I thought your example had 2. maybe I misread
12:13justin_smith(defn find-match [[x & xs] ele] (cond (> x ele) false (= x ele) true (recur xs ele)) then you would pass (partial find-matches coll) in the remove ;; <- quoting me - of course I left the :else out of that cond
12:14justin_smithbut for code golf I would use 1 instead of :lse
12:14justin_smithdoes the same thing
12:14FunctionalDoguse 1?
12:14justin_smith,(cond nil :a false :b 1 :OK)
12:14clojurebot:OK
12:15justin_smith:else is just a convention
12:15justin_smithand 1 is shorter
12:17justin_smithto put it another way: a single digit number is the smallest truthy thing I can think of to replace :else with
12:18FunctionalDogohh, okay. you just mean, anything to fill in the conditional spot
12:18justin_smithright
12:18justin_smithbut whatever, feel free to use :else first, golfing can come later
12:21FunctionalDogI have this now, but it still seems to be hanging on iterator=26 http://pastebin.com/AMvTHQG7
12:21FunctionalDogoh wait, I still have concat going on
12:21FunctionalDogI forgot what I was even doing
12:22justin_smithI don't think the concat is an issue here
12:22justin_smithone thing - define findMatches before lucky
12:23justin_smithbecause on the first pass through the file the compiler will fail otherwise
12:23FunctionalDogi'm using light table's instarepl
12:23justin_smithOK, I'm talking about what will happen if this code is in a namespace
12:25FunctionalDoghttp://i.imgur.com/GlWzBaM.png
12:25justin_smithyeah, findMatches still isn't getting called
12:26FunctionalDoghow are you sure?
12:26justin_smithI added a print statement to it
12:26FunctionalDogah
12:28justin_smithso I think it is time for our lazy version!
12:28FunctionalDogyeah, same result. so we need to do something differently
12:29FunctionalDogdoes that mean that .contains wasn't the issue after all?
12:29FunctionalDogif so, it was much more compact so I should use it
12:29justin_smithno, contains would definitely have had that problem
12:29FunctionalDogah okay
12:29justin_smithbut we can double check later if you really want to see that for yourself
12:29justin_smithlet's get a version that works first
12:30FunctionalDogwhat do you think is the problem, then?
12:30FunctionalDogor... the second problem
12:32justin_smithchecking that out now, doing a translation to a lazy version - if nothing else that might expose the issue
12:33FunctionalDogalright. thanks for your help so far, also
12:33FunctionalDogI would have given up permanently if not for you :p
12:40FunctionalDogbrb, laundry
12:47FunctionalDogback
12:48justin_smithFunctionalDog: my sloppy lazy version https://www.refheap.com/97681 - find-matches runs now
12:48justin_smithit is running on values it shouldn't be!
12:48justin_smithbut it is running
12:49justin_smithFunctionalDog: the trick was the doall on the take
12:49justin_smiththat reduces the stack accumulation
12:49justin_smith(when the whole nest of laziness is finally forced)
12:49justin_smiththere are folks here that are better with lazy-seqs than I am who may be able to point out what I am still doing wrong there
12:50FunctionalDoghm, alright
12:50Glenjaminyou probably need lazy-seq in there somewhere to avoid blowing the stack?
12:50justin_smithFunctionalDog: the one tricky thing is that I put println calls inside the concat
12:50justin_smithGlenjamin: concat is lazy
12:50justin_smiththe issue is the stack usage once the laziness is forced
12:51justin_smithconcat-bomb I guess
12:51Glenjaminoh, i see
12:51justin_smithor would lazy-seq help fix that?
12:51Glenjamini think so?
12:51Glenjaminnot really sure
12:51justin_smithor maybe lazy-cat
12:51justin_smith(doc lazy-cat)
12:51clojurebot"([& colls]); Expands to code which yields a lazy sequence of the concatenation of the supplied colls. Each coll expr is not evaluated until it is needed. (lazy-cat xs ys zs) === (concat (lazy-seq xs) (lazy-seq ys) (lazy-seq zs))"
12:52Glenjaminsounds like the right sort of thing
12:52justin_smithI should really write a hyper-dog function
12:52justin_smithfor balance and all
12:53FunctionalDogdefinitely don't search google for 'hyper dog'
12:53justin_smithhaha
12:53justin_smithwhy, the results are too amusing?
12:53FunctionalDogoh okay, I was expecting worse. furry stuff.
12:53FunctionalDogpretty tame actually
12:54justin_smithok, same issue with lazy-cat
12:54justin_smithI don't get why find-matches is getting called with such large arguments
12:55Glenjaminyou're calling lucky inside lucky
12:55justin_smithsure, but it's inside a lazy-cat
12:55Glenjaminoh right, i'm still looking at the old one
12:55justin_smithso the thunk keeps it from being eager I would think
12:55justin_smiththe new version is just s/concat/lazy-cat
12:56justin_smithhrm...
12:57FunctionalDogIt's okay if it's too much of a headache. I don't need to be able to do this for any actually good reason :p
12:57justin_smithnow it's more like "I thought I knew clojure better than this, why the hell is this not working..."
12:57justin_smithso it's as much for my own edification as yours :)
12:57FunctionalDogtherein lies the challenge of the golf prompt, I guess :p
12:58justin_smithit'
12:58justin_smiths not even golf yet
12:58justin_smithI'd settle for correct
12:58FunctionalDogof course it's impossible to even win codegolf anymore unless you know those stupidly compact languages made specifically for it
12:58FunctionalDoglike Pyth
12:59FunctionalDognot that winning is the main reason anyone plays. that would be silly.
12:59FunctionalDogif you want a REAL challenge, I think this program could be written in Chef
13:00justin_smithI'd settle for a working clojure version
13:00ystaelFunctionalDog: http://www.jsoftware.com/help/dictionary/vocabul.htm except these people are serious
13:00justin_smithystael: there's also golfscript
13:01FunctionalDogI wrote a chef program once. never again. https://github.com/culmor30/chef-moon-pie/blob/master/moon-pie-commented.chef
13:01justin_smithhttp://www.golfscript.com/golfscript/
13:02ystaelFunctionalDog: ha, i thought you meant chef the infrastructure management tool
13:03FunctionalDogheh, no. The chef I meant is the opposite of usable or efficient. You can't even do float math
13:04dahhmm, sounds like the infra tool except the float math part
13:04ystaelone could also argue that the chef i was thinking of is the opposite of usable or efficient :p ... but that's off topic and perhaps my experiences have just been bad
13:04dahhaha
13:08justin_smithFunctionalDog: so looking at the output of find-matches, it's doing a lot of comparisons it really shouldn't need to do
13:08FunctionalDogYeah, I let it run for a while and it started getting pretty crazy
13:09FunctionalDogespecially since there are only 2 lucky numbers when n=5... 1 and 3
13:09alexyakushevDoes anyone know how can one "unmerge" some dependency in Leiningen in a certain profile?
13:09justin_smithin that case, the whole (take i ...) thing is way wrong
13:09justin_smithit's more like (take-while (< i x))
13:10FunctionalDogwhy's that?
13:10justin_smithFunctionalDog: because (take n coll) returns n elements
13:10justin_smithand i is monotonically increasing
13:11FunctionalDogoh yeah...
13:12FunctionalDogbut what's x?
13:13justin_smith(take-while #(< i %) coll)
13:13justin_smithor something like that
13:13justin_smithand the drop should similarly be a drop-while...
13:13justin_smithif I am thinking about this clearly
13:13FunctionalDogThis stuff is way over my head for having no experience :p
13:14justin_smithyeah
13:14FunctionalDogMaybe I could write it in java. but not this.
13:15FunctionalDogmay be time for me to give up on this challenge. but I wish you the best in conquering it, haha
13:15FunctionalDogthe best of luck, rather
13:16justin_smithFunctionalDog: I just had an aha momemt - since we want results less than n, we can replace (next (range)) with (range 1 n)
13:16justin_smiththat eliminates the silly looping, now working on correct output...
13:16FunctionalDogyou can't though
13:16justin_smithwhy not?
13:16FunctionalDogyou need to start with all real numbers 1 through (n*n)+1
13:17justin_smithahh
13:17justin_smithso it isn't up to n
13:17justin_smithit is up to limit
13:17justin_smitheasy enough!
13:17FunctionalDogthe goal is to produce n lucky numbers, but that requires going further than n in real numbers
13:17FunctionalDog*the first n lucky numbers
13:22justin_smithFunctionalDog: another potential problem: in the first iteration, it appears we are eliminating all multiples of 1
13:22justin_smithFunctionalDog: this means it won't find anything
13:22AimHereSomeone doing Eratosthenes with 1 as a prime?
13:22justin_smithAimHere: not quite, it's a very similar algo though
13:23justin_smithAimHere: there's still no excuse that I didn't catch that immediately...
13:24justin_smithFunctionalDog: basically that (remove ...) returns an empty list because every input is a multiple of 1
13:25FunctionalDogah, there's another thing I used to have logic for, but deleted in a refactoring frenzy at 4am
13:25justin_smithhaha
13:25justin_smithI'm going to have to step away from this, I must pay rent and have paying work to do :P
13:25justin_smithbut I'll check in later
13:25FunctionalDogI think I'll work my way through 4clojure stuff instead. That's at least realistic.
13:25FunctionalDogalright, well it was fun at least.
13:26FunctionalDogHopefully I'll also have paying work soon, haha
13:26FunctionalDog(graduated not too long ago)
13:28FunctionalDogI'm sure I'll be back with questions from 4clojure later. Gonna slack off for a while though.
13:34TimMcHas anyone used as-> with nontrivial binding forms? And not just to demonstrate that it's weird, but actually for practical purposes.
13:34TimMc,(as-> "hi" [x] (list \a x) (list \b x) (list \c x))
13:34clojurebot[\c]
13:35justin_smithOK, that is weird
13:40pppppaulwhat do you guys think of wish?
13:41pppppaulhttps://github.com/Gozala/wisp
13:41pppppaulwisp, sorry
13:44SegFaultAXpppppaul: I don't understand the reason for it to exist, even after reading the intro paragraph.
13:48dahwow gorilla is really nice
13:49pppppaulwisp has no clojure runtime needed for compiling, right?
13:50pppppaulif this is true, then one can compile to JS on a web browser...
13:50justin_smithpppppaul: do you mean it is a self hosting compiler that targets js?
13:50pppppauli think so
13:51justin_smithpppppaul: a big difference is that cljs has clojure semantics, and it seems this only offers clojure syntax
13:51pppppaulseems like a reimplementation of CLJS
13:52justin_smithnot really, because it lacks persistent data structures
13:52noonianright
13:52noonianits more like coffeescript imo but as a lisp so you get lispy benefits
13:52dnolenWisp is really nowhere even close to being a reimplementation of CLJS. Give it 3 more years ... maybe.
13:54pppppaulafter reading through the github page i did feel that is was reminding me of coffee script as well
13:54pppppauljust trying to have the same syntax as clojure, but not use the data structures of clojure
13:55noncomhi!
13:55vas_Ello noncom
13:55noncomi am running "lein clean" in my project, and get this error: https://www.refheap.com/97682
13:55noncomdoes anyone have any idea?
13:55noncomwhat that means
13:55dahweird. wisp sounds like pyrex or coffeescript or something
13:57nooniannoncom: hard to tell from that stacktrace but if I had to guess your project might have non-standard directory structure (like file paths not corresponding to namespaces) since its dying in leiningen sanity_check and protected_paths functions.
13:58noncomnoonian: what's strange is that it worked a day ago.. and i did not change anything except for reimporting all my projects into eclipse luna from eclipse kepler.. and reinterlinking them (having 3 linked projects)
13:59SegFaultAXpppppaul: That seems like going in the opposite direction of where you'd want to be.
13:59SegFaultAXIf anything, I'd give up Lisp syntax but maintain immutable data structures.
13:59noncomthis error comes up even in the bottom line project that is not linked to the other 2. (the other two are linked to it)..
13:59nooniannoncom: what do you mean inter-linking? I wouldn't be suprised if eclipse stuck some files somewhere for bookkeeping and that is what is tripping lein up
14:00noonianSegFaultAX: well, when you start with JS you don't have the data structures or the syntax and if you need something self hosted or that compiles to readable JS then cljs is currently out
14:00noncomnoonian: yeah, probably.. eclipse (and ofcourse, ccw) have a notion of "dependant projects" - while you can make other projects internals visible from another project... like a source dependancy
14:01noncomok, will look into more what happens there with eclipse and stuff, i guess...
14:02nooniandoes lein work well with symlinks? not much experience with that myself
14:02SegFaultAXnoonian: I'm saying I care about CLJ[S] semantics a whole hell of a lot more than I care about the syntax.
14:03SegFaultAXAnd adding mori.js or similar to the mix at least gives me a part of that.
14:03noncomnoonian: yeah, having symlinks in the checkout dir too - you know, that leiningens method of depending on another project - putting a symlink for it in the "checkouts" directory..
14:03noonianSegFaultAX: Yeah I agree the data structures are one of my favorite aspects of Clojure
14:03SegFaultAXnoonian: So I don't really get the point of wisp if it only has the syntax part.
14:04SegFaultAXIf it was syntax + mori, that might be cool.
14:04noncomyeah, i am fond of clojure datastructs too. miss them so much when have to work with other languages..
14:04noncomwhat is wisp anyway?
14:04noonianI'm sure you could use it with mori but from the readme the literal map syntax compiles to java objects
14:05SegFaultAXnoonian: Right.
14:05noncomdound it: https://github.com/Gozala/wisp
14:05noncom*found
14:05noonianbut if you're going to use it with mori might as well use cljs :P
14:12pppppaulmaybe it's easy to add mori to wisp
14:12pppppauli haven't looked into it
14:21SegFaultAXpppppaul: I mean it should be as simple as including another library, right?
14:22pppppaulsyntax may be a problem
14:23pppppaulwould need to have the compiler know about mori, i guess
14:23pppppaulthe collection functions depend on seqs, i don't know what wisp wants, and mori doesn't make seqs
14:33TimMcIs there a tool for discovering unused :import, :use, and :require forms?
14:38BronsaTimMc: eastwood has an unused-namespaces linter
14:39BronsaTimMc: also I believe cursive can do that but I'll let cfleming confirm that
14:41sveriTimMc: cursive supports this now too for most forms
14:41TimMcBronsa: Hmm, I don't remember that being on the eastwood feature list.
14:44TimMcAha, it is disabled by default.
14:46RazzeeyyHi all, is there a way to trap a value returned by a function so it won't be displayed back in a REPL?
14:46Razzeeyydoing (time BIG_ARRAY) and getting annoyed by automatic printing of that array by REPL :(
14:47TimMc(do ... nil)
14:47amalloyalthough if the thing you're timing the printing of is a lazy seq, TimMc's fix may create some other exciting issues
14:47TimMcalthough remember that if your return valueis a lazy seq and you want it to get realized, you'll need to throw a dorun inside the time expr.
14:48RazzeeyyTimMc: thanks!
14:49RazzeeyyTimMc: yeah I'm fine with lazies, just looking at whether sorting it first and then taking max will bring me a speed boost vs just taking max right away
14:49TimMc,(time (do (range) nil)) ;; wow!
14:49clojurebot"Elapsed time: 0.047078 msecs"\n
14:49TimMcRazzeeyy: You'll want to use criterium, by the way.
14:50Razzeeyydunno why I bother with that tho, solving projecteuler in clojure
14:50TimMcclojure.core/time isn't great for perf tests
14:50Razzeeyybut speed freak is living inside of me xD
14:50RazzeeyyTimMc: criterium is some profiling lib I guess?
14:50TimMc~benchmark
14:50clojurebotcriterium or gtfo
14:50TimMchaha
14:50TimMcCorrect, but not helpful.
14:50TimMc~benchmark
14:50clojurebotcriterium or gtfo
14:51TEttingerheh
14:51TEttinger$google clojure criterium benchmark
14:51lazybot[hugoduncan/criterium · GitHub] https://github.com/hugoduncan/criterium
14:51TimMcclojurebot, forget benchmark |is| criterium or gtfo
14:51clojurebotI forgot that benchmark is criterium or gtfo
14:52TimMcclojurebot, benchmark is <reply>criterium or gtfo https://github.com/hugoduncan/criterium
14:52clojurebotYou don't have to tell me twice.
14:52Razzeeyyhm is (max) a lazy function? :o
14:52TimMcclojurebot, forget benchmark |is| <reply>criterium or gtfo
14:52clojurebotI forgot that benchmark is <reply>criterium or gtfo
14:52amalloyRazzeeyy: kinda
14:52amalloywell actually no
14:52TimMcmy eyebrows went up
14:53TimMcRazzeeyy: max can't compute lazily, since there could always be a higher value it hasn't seen yet
14:54TimMcAnd since it returns a plain number, not a seq, it can't defer part of the computation.
14:54amalloyTimMc: i mean, it consumes its arglist lazily, which is what i was thinking of. like, (apply max (range)) doesn't use up all memory. but that's a pretty silly definition of lazy, since it never returns either
14:54TimMc(I am at least 25% sure I did not just repeat myself.)
14:55TimMcdorun isn't lazy either :-P
15:02Razzeeyylet me try it :D
15:02Razzeeyy,(do (time (sort (for [a (range 100 1000) b (range 100 1000)] (* a b)))) nil)
15:02clojureboteval service is offline
15:02Razzeeyyhope the bot won't shot me for long run time
15:02Razzeeyyerr
15:03Razzeeyy,(do (time (sort (for [a (range 100) b (range 100)] (* a b)))) nil)
15:03clojurebot"Elapsed time: 297.143697 msecs"\n
15:03AeroNotix,123
15:03clojurebot123
15:04hiredman~clojurebot
15:04Razzeeyy,(do (time (max (for [a (range 100) b (range 100)] (* a b)))) nil)
15:04clojurebot"Elapsed time: 0.2984 msecs"\n
15:04clojurebotclojurebot will become skynet
15:04hiredman~clojurebot
15:04clojurebotclojurebot exploits differences in network latency to appear to violate causality
15:04hiredman~clojurebot
15:04clojurebotclojurebot is everyone else
15:04RazzeeyyTimMc: the max isn't run in the example above, right?
15:05amalloyhiredman: is clojurebot not a benchmarking platform?
15:05hiredmanamalloy: I think so
15:06amalloyfrom context Razzeeyy isn't actually trying to time this specific thing, but experimenting with the idea of (do (time (f)) nil) to get timing info without printing the resulting expression
15:12Razzeeyyamalloy: I'm experimenting with (sort) and (max)
15:12Razzeeyylooks like that (max) won't evaluate untill value is requested or something so makes it lazy or something
15:12Razzeeyyor....
15:12Razzeeyysort takes to many operations in comparison to just (max)
15:12hiredman,(doc max)
15:12clojurebot"([x] [x y] [x y & more]); Returns the greatest of the nums."
15:13hiredman,(max 1)
15:13clojurebot1
15:13SegFaultAXThe variadic form just reduces over the collection
15:13hiredman,(max [1 2])
15:13clojurebot[1 2]
15:13hiredman,(apply max [1 2])
15:13clojurebot2
15:14SegFaultAXRazzeeyy: Reduce is strict.
15:17Razzeeyyhiredman: yeah figured it out it just returns the seq itself :c
15:17Razzeeyyand thx
15:17Razzeeyy,(do (time (apply max (for [a (range 100) b (range 100)] (* a b)))) nil)
15:17clojurebot"Elapsed time: 199.517518 msecs"\n
15:18Razzeeyy,(do (time (sort (for [a (range 100) b (range 100)] (* a b)))) nil)
15:18clojurebot"Elapsed time: 193.319982 msecs"\n
15:18Razzeeyyhm
15:18Razzeeyysorting seems faster :o
15:18Razzeeyyand what if I sort then max...
15:18Razzeeyy,(do (time (apply max (sort (for [a (range 100) b (range 100)] (* a b))))) nil)
15:18clojurebot"Elapsed time: 104.481787 msecs"\n
15:18RazzeeyyWHAT
15:18Razzeeyyhow come it being so faster :o
15:19amalloyRazzeeyy: clojurebot is not a benchmarking platform, and neither is (time)
15:19amalloythey are both very rough estimates
15:19SegFaultAX,(let [n (dorun (for [a (range 100) b (range 100)] (* a b)))] (time (max n)))
15:19clojurebot"Elapsed time: 0.013101 msecs"\n
15:20SegFaultAX,(let [n (dorun (for [a (range 100) b (range 100)] (* a b)))] (time (sort n)))
15:20clojurebot"Elapsed time: 0.020855 msecs"\n()
15:20SegFaultAX,(let [n (dorun (for [a (range 100) b (range 100)] (* a b)))] (time (apply max n)))
15:20clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: core/max>
15:20ztellmanamalloy: add criterium to clojurebot plz
15:20SegFaultAX:)
15:21SegFaultAX,(let [n (doall (for [a (range 100) b (range 100)] (* a b)))] (time (apply max n)))
15:21clojurebot"Elapsed time: 4.397644 msecs"\n9801
15:21SegFaultAX,(let [n (doall (for [a (range 100) b (range 100)] (* a b)))] (time (sort n)))
15:21clojurebot"Elapsed time: 1.942586 msecs"\n(0 0 0 0 0 ...)
15:21Razzeeyyamalloy: oh you meant that by "not a benchmarking platform" I thought you was discouraging me from spamming time in a public chat :)
15:21SegFaultAXRazzeeyy: Well that, and the results you're going to get from clojurebot are going to vary wildly
15:22SegFaultAXYou need to run it on a controlled platform many many time with a tool like criterium for precision measurement.
15:22SegFaultAXClojurebot is none of those things.
15:22amalloyRazzeeyy: you can also /msg clojurebot if you're going to be noisy
15:22amalloybut i was indeed saying you will not get good results
15:23RazzeeyySegFaultAX: will I get somewhat better results if ran time on a larger collections?
15:23SegFaultAXRazzeeyy: I don't think I said that.
15:24TimMcRazzeeyy: Add criterium to a project, open a REPL, and use it to conduct your experiments.
15:26SegFaultAXRazzeeyy: But if you're trying to gain some intuition about the asymptotic performance of your process, that might help.
15:27Razzeeyyk thx :3
16:17Razzeeyyany built in opposite of (some)? or I guess the best way to go is (not (some))?
16:19Razzeeyyhm (not-any?) looks like the opposite of (some) am I right? :)
16:20SegFaultAXRazzeeyy: Kinda. some is not a predicate.
16:33Razzeeyybtw here is the thing I can't figure out how to do I need something like (range 1 +infitiy) but can't find a way to indicate that to range :O
16:33amalloy(rest (range))
16:34amalloyalso (range 1 Double/POSITIVE_INFINITY) but that's kinda silly
16:34Razzeeyyamalloy: oh yeah thanks
16:35Razzeeyyalso found a solution like (drop 1 (range))
16:35Razzeeyybut you solution with (rest) is most beautiful
16:37Razzeeyyoh man I love clojure
16:37Razzeeyyeven tho coding is uncomfortable in the beginning but the final code looks so neat
16:37Razzeeyylike a story in the book
16:41erik``given something like
16:41slipset,(def l '(+ 1 2))
16:41clojurebot#'sandbox/l
16:42slipsethow do I evaluate l as a function?
16:42slipsetThere should obviously be someting obvious I'm missing...
16:42amalloyslipset: don't do that
16:43slipsetamalloy: I promise, I won't :(
16:43justin_smithslipset: you can evaluate it as a list
16:43slipsetbut please, do tell me anyhow
16:43justin_smithbut it doesn't take arguments
16:43amalloyi mean, anytime you def a source-code form and then later plan to eval it, there is something better you should be doing instead
16:43justin_smithyeah, exactly
16:45slipsetamalloy: justin_smith: I'm sure you're both right, and right now I'm just playing around with some stuff which is far away from production. I guess I could eval it...
16:45slipsetHow does clojurebot do this?
16:46justin_smithslipset: the same way the repl does, eval
16:46justin_smithbut why not just use #(+ 1 2) instead of '(+ 1 2)
16:46justin_smithassuming your actual list is something more interesting than + of course
16:46clojurebotIn Ordnung
16:46slipsetjustin_smith: why not indeed :)
16:46slipsetYou just asked the correct question, thanks!
16:47justin_smitheg. I could see doing that if you had #(get-state place) - and you would call that to get an updated state
17:01kgarrison343hello
17:09AeroNotixkgarrison343: hi
17:17crazydiamondHi. How to read JSON file form Clojure?
17:19AeroNotixcrazydiamond: (-> "path/to/file/" slurp clojure.data.json/read-str)
17:20AeroNotixyou will need to have clojure.data.json as a dependency
17:20AeroNotixhttps://github.com/clojure/data.json/
17:20crazydiamondAeroNotix, thanks, but what to add to project.clj ?
17:20AeroNotixlook in the link I sent you
17:20crazydiamondI see now, thanks!
17:20AeroNotixnw
17:23Razzeeyyamalloy: and still bullying around with (range) how to make an infinite range but with a step? :D
17:25amalloyi'd probably use (range 1 n Double/POSITIVE_INFINITY), but you can do it with like take-nth if you prefer the elegance of that. ##(take 5 (take-nth 2 (rest (range))))
17:25lazybot⇒ (1 3 5 7 9)
17:29TimMcamalloy: Infinite step? :-)
17:29amalloyTimMc: i can never remember whether step comes before or after end
17:29amalloyi just guess at random and hope for the best, which must be a more efficient solution than reading the docstring
17:29TimMcThe optional end, start, and step params (in that order!) mess with me too.
17:30amalloyTimMc: wait what? start comes before end
17:31dnolencfleming: ping
17:32TimMcamalloy: I meant that the second parameter is the least optional.
17:42Razzeeyyamalloy: wow take-nth is cool thx
17:42Razzeeyyand sleeptime for me, bye all! :)
18:09bloop_context: I've played with clojure but not used it professionally before now. I've developed db servers but never set one up on my own before. Using sqlingvo.
18:10bloop_anyone know of any step by step tutorials on getting a db on disc and adding tables and whatnot to it using sligvo/postgresql?
18:10dahbloop_: there's also honeysql
18:11bloop_dah: yeah I looked at both. they seemed very similar. is there a reason to prefer one or the other?
18:11dahbloop_: looks like that's only for queries though
18:12dahbloop_: honeysql seems to have a map format which could be nicer for composition
18:13bloop_dah: oh, I could see that
18:15dahbloop_: i haven't used an sql db with clojure much -- been using datomic instead
18:16dahbloop_: if that's an option for you i recommend it highly =)
18:16dahbloop_: it can use postgres as a backend, which is what i've been doing
18:18ombloop_: if you're not after some fancy object relational mapping, check yesql
18:20dahah yesql looks nice
18:20ombloop_: I've been using it very successfully with java.jdbc
18:21omvery easy to maintain the code dealing with the db
18:21dahstill no help for schema management, but otherwise nice
18:22omdah: it's bare bone sql
18:23ompretty good if you want separation of concerns (which was my case :))
18:24Lewixwhere could I learn more about servers. load balancers etc...I would like to improve my knowledge in that area but there' isn't a structured resource out there
18:24Lewixlike a book about servers, devops tools etc
18:28bloop_om: yesql struck me as annoying. I don't see having a homoiconic DSL on top of SQL to be the same thing as ORM anyway.
18:29bloop_om: wouldn't ORM be if you had hash maps that represented rows that you could mutate to create mutations in the DB? That seems actually impossible with Clojure :p
18:29bloop_om: at least not idiomatic clojure / not the clojure way
18:30ombloop_: in my case the dsl was getting in my way... I used honeysql for the ORM-like features a little but hadn't any use case for it
18:31ombloop_: for the rest I have been pretty happy with managing the sql separetly from the rest of the code
18:32SegFaultAXbloop_: Yesql is awesome.
18:33SegFaultAXbloop_: What strikes you as annoying?
18:33ombloop_: I like the separation of concerns whe dealing with SQL databases but yes, your mileage may vary
18:34hiredmandocs on yesql seem pretty lacking, regarding keyword arguments and the like, and docs about passing arguments to the underlying clojure.java.jdbc functions
18:34ombloop_: I don't really need s-expressions to mimic SQL
18:34hiredman(I say this because I happen to be looking for those docs)
18:35omhiredman: yesql is just string parsing
18:35omI had a couple of functions doing basically the same thing when the library came out
18:35hiredmanom: I was more responding to "Yesql is awesome"
18:36hiredmanit is ok, I guess? we just sort of started using it at work and I am already finding it something of a hinderance
18:37tbaldridge(any library on top of SQL will be a hinderence)
18:37tbaldridgeso the less the better
18:37hiredmanhttps://github.com/krisajenkins/yesql/blob/master/src/yesql/core.clj#L27 this is just terrible
18:37hiredman~@ in to a vector, then calling doall on the vector?
18:37clojurebotexcusez-moi
18:39bloop_I think the thing that strikes me as annoying with yesql is being separated from me precious clojure and the fear that I'd be doing string manipulation to describe patterns. That might be ignorant of me though, please correct.
18:39hyPiRionhiredman: `(do ~@(map emit-def queries)) does the same thing, is that the problem you got with it?
18:39hiredmanI have been reconbobulating some of our queries to return reducers that do the query when reduced to avoid both pulling everything in to memory (as query does by default) and avoid dynamic scoping
18:39amalloyhyPiRion: well, the same thing except it returns something different. not clear whether that matters
18:40tbaldridge(inc hiredman)
18:40lazybot⇒ 71
18:40hiredmanyou can do it with clojure.java.jdbc's query function, but I am not sure you can with yesql
18:40hiredmanhyPiRion: basically
18:40hiredmanhyPiRion: the really annoying thing is eastwood sees a vector not being used and warns about it
18:42hiredmaneven in that formulation, the doall does nothing
18:43hyPiRionWell. I guess the library isn't *that* bad if that's one of your problems with it. :p
18:44hiredmanI am trying to avoid reading the code
18:45m1dnight_guys, I'm trying to use postgresql but i'm having issues with connecting. I have tried pgadmin and I can't supply as pass or it fails.
18:45hiredmanblackboxes are precious, I don't have enough of them
18:45m1dnight_how do I define this in clojure?
18:45m1dnight_I tried ":password """, or ":password <linux pass>" or remove it from the map, nothing works
18:47m1dnight_https://www.refheap.com/97690
18:47m1dnight_this is what i'm trying
18:48bloop_btw are there any open source projects inspired by datomic?
18:49bloop_it seems like rich's lunch could get eaten if enough nerds put their minds to it
18:49AeroNotixbloop_: I think the problem is that no-one really knows what datomic does
18:50AeroNotixAt first glance and the very few resources about it, it's quite enigmatic about what problem it solves.
18:53m1dnight_I solved my problem by simply putting a pass on my postgresql account :>
19:04jwmbloop_: eventstore
19:05jwmimmutable data store.. the concept behind datomic is great and needs to be behind every db honestly
19:06jwmthough revision control and data has been around for decades
19:06jwmstorage is just catching up to provide it
19:10bloop_jwm: right. the way I describe it to people is "you know how useful the log is? what if the DB *was* the log?"
19:10cddrWhat's the max size for very-big-collection in `(apply foo very-big-collection)`?
19:11amalloycddr: how much ram do you have?
19:11amalloy(it's more than that)
19:11cddrhow is it more?
19:11amalloylaziness
19:12amalloyconsider, eg, (defn f [& args] (count args))
19:12amalloy(apply f (range)) will run forever, consuming no memory
19:12cddrorly
19:13bloop_yep, and (first (range)) is 0, no infinite memory required :)
19:14TEttinger,(apply max (repeat 10000000 100))
19:14clojurebot100
19:15cddrSo there would be no point in writing a manual equivalent of `(apply merge-with + ...)` that looped over the ... and summed the values itself?
19:16amalloycddr: indeed i can't imagine why you would do that. if you did, the implementation would just be (reduce (partial merge-with +) {} xs)
20:15omwhat is the best practice when catching exceptions and ensuring a value is always returned? simply returning nil? wrapping the return value and exception in a maybe-like thing?
20:21dnolenhttp://swannodette.github.io/2015/02/23/hello-google-closure-modules/
20:22nuwanda_dnolen: you have a link on that blog post to http://localhost:4000/2015/01/06/the-false-promise-of-javascript-microlibs/
20:23dnolennuwanda_: thanks
20:53amalloy,(nth (java.util.ArrayList. (range 5)) 2)
20:53clojurebot2
20:53amalloy,(let [[a b c d e] (java.util.ArrayList. (range 5))] c)
20:53clojurebot2
20:53amalloyoh
20:54amalloy,(let [[a b c d e] (java.util.LinkedList. (range 5))] c)
20:54clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: LinkedList>
20:54amalloyi was surprised to discover that nth doesn't work on LinkedList but i guess it makes sense
20:54cddrom: I'd wrap the exception if the layer above could sensible use it to display an informative error
21:03omcddr: thanks. I made a couple of macros to this end (with all sort of wrapping, returning)
21:05omI was wondering if I am missing a common idiom
21:05amalloyactually why doesn't nth work on linkedlists? from the code it's clear that it's because LinkedList doesn't implement RandomAccess, but like...nth works on LazySeq, so we're clearly not super-concerned about performance. why make it illegal for LinkedList?
21:07amalloyalso, here is everyone's official reminder that someone thought ≇ NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO was a character important enough to get into unicode
21:15omcddr: looks like this: https://www.refheap.com/97691
22:42cddrom: Looks good
22:44omcddr: cool
22:46cddrdnolen: Could you spell out for someone who hasn't written a large clojurescript app why closure modules are a game changer?
22:46dnolencddr: for the same reasons it works for Google for the past 5 years at least
22:50ddellacostadnolen: why didn't you just give him your link? ;-) cddr: http://swannodette.github.io/2015/02/23/hello-google-closure-modules/
22:51cddrI read that which is what prompted the question
22:51ddellacostacddr: d'oh, sorry!
22:51ddellacosta(or her, shouldn't assume gender, sorry)
22:51cddrI can confirm that I'm a man
22:52ddellacostayeah, I just don't like to assume
22:52ddellacostatrying to shake that out of my habits
22:52cddrThat seems wise :-)
22:55cddrI guess I thought clojurescript apps were already pretty competetive on size with other frameworks. I'm just trying to make sure I understand why it's a game changer
23:02dnolencddr: yes but eventually your app gets big enough that you need to split it
23:02dnolencddr: for small-ish apps doesn't matter much, but medium & larger apps (which are starting to appear) will benefit a lot
23:05cddrdnolen: OK thanks. I love reading your blog. I just miss the context for some of it
23:19michaler`.
23:20dnolenanybody ever encounter this in an interop scenario "deftype/record/reify cannot access its superinterface" ?
23:20dnolentrying to port this http://slieb.org/blog/parseJavaScriptWithGoogleClosure/
23:21dnolentrying to implement NodeUtil$Visitor interface in a reify results in that error
23:40hiredmannever seen, my guess would be the interface has a super interface that is private or package private
23:41hiredmanoh, it looks like NodeUtil$Visitor is package private
23:41hiredman(I may be looking at an old version in grepcode)
23:42fellipebritoIs there any place I can find a kick off for TDD using clojure? I mean, right now I have my env completely set and useful for rspec + ruby. VIM's scripts, and all this stuff that would make the "write test + fail + code + green" very friendly (with tons of aliases)...
23:43fellipebritoI'd love to understand how people write tests, what is the best library, as well the best practices, and if it is not ask that much, how VIM guys use it in order to optimize their "fun@coding"
23:44tbaldridgefellipebrito: I've found that when it comes to testing, simple is almost always best. So I use clojure.test (comes with clojure), and I simply open a repl, move to the namespace with the tests and call (run-tests)
23:44tbaldridgefellipebrito: https://clojure.github.io/clojure/clojure.test-api.html
23:48fellipebritotbaldridge: Thank you dude!