#clojure logs

2012-12-18

00:15amalloyldh: reloading a defrecord won't modify the behavior of existing instances
00:17ldhamalloy: i think that was indeed the issue. passing the instance into the invocation of the protocol function had me turned around a bit, but i think i get it now
01:14TEttingergot kinda an odd question... I'm trying to find the exact probability of certain results coming up when rolling "special" dice (a game I play on the tabletop uses specially-marked dice with no numbers, just symbols with rhyme or reason to how many symbols are on each die).
01:14TEttingerclojure is my language of choice, so I am trying to solve it in clojure...
01:15TEttingerbut I am wondering if there is a way to use the for comprehension on a variable number of sequences (determined at runtime)
01:16TEttingerlike for through 3 8-sided dice, each bound to something temporary in the for
01:16TEttingerthen for-comprehend through 4 8 sided dice and 2 twelve-sided dice
01:17TEttingerto get a map of the symbols that came up in each pass through all dice
01:17TEttinger(each die is a vector of vectors of symbols)
01:17TEttingersomeone did a finite-distributions thing for the old clojure.contrib
01:18TEttingernot sure how to get it since it doesn't seem to have source...
01:18TEttingermaybe it does
01:18TEttingerhttps://github.com/clojure/clojure-contrib/blob/master/modules/probabilities/src/main/clojure/clojure/contrib/probabilities/finite_distributions.clj
01:29carkTEttinger: maybe use the sequence monad instead ?
01:29TEttingercark, never heard of it
01:31carklet me have a look and get back to you
01:35enamanuelhola
01:37carkTEttinger: have a look at this https://gist.github.com/4325580
01:37carkis this what you're looking for at all ?
01:38TEttingercark, looks like it
01:38TEttingerthanks
01:39carkyou can find the monad library here : https://github.com/clojure/algo.monads
02:13tomoj":db/cardinality :db.cardinality/ref" hmm
02:16tomoj":db/valueType :db.type/many"
02:23ro_sthaha
02:23ro_stlate night, or early morning?
02:30tomojlikely the later, I don't remember
02:32brainproxyanybody using the atmosphere library (websocket, jsonp stuff) with clojure?
03:05TEttingercark: I appear to have shot the garbage collector be making a monad seq with all possibilities for 4 12-sided dice and 4 8-sided dice
03:05TEttingers/be making/by making/
03:07TEttingerI get "java.lang.OutOfMemoryError: GC overhead limit exceeded"
03:08bbloomTEttinger: google says that's 7.156946e+118
03:08TEttingeroh
03:09TEttingerwell crud.
03:09TEttingerguess that's not going to stay in memory
03:09bbloomcombinatorics: they're big.
03:10TEttingerso bbloom, can you figure out a better way to figure out the odds of each specific set of face combinations coming up?
03:10TEttingerlet me pastebin my code
03:12mthvedthow about an fn that adds probability distribution + die -> probability distribution
03:12mthvedtand reduce with that
03:15TEttingerhttps://gist.github.com/4326031
03:15TEttingerI gotta say, I don't know much, if any, real probability stuff
03:15TEttinger^ mthvedt
03:15TEttingerso I don't know how I would work with distributions
03:16bbloomTEttinger: boom: http://www.khanacademy.org/math/probability
03:17mthvedtTEttinger: convolving probability distributions in discrete domains is easy
03:17mthvedtfor continuous data it's tricky
03:18TEttingerit isn't continuous for mine
03:18mthvedtbut if your stuff is much smaller than memory
03:18TEttingernot now
03:18TEttingeri mean it isn't right now
03:18mthvedtlike to add 2d6, take 1d6, map adding 1..6 and sum
03:19TEttingertake a look at the gist, I am probably doing something dumb
03:19TEttingerhttps://gist.github.com/4326031 the meat is in analyze-prob
03:20mthvedtwell, i don't have time to fine tooth comb things but
03:20mthvedtthere's a lot of repeated code
03:20TEttingerthe rest is the standard rolling stuff for a few calculations of the same dice
03:20TEttingeryes.
03:20mthvedta clojure programmer should never repeat code :)
03:20TEttingeri don't really know macros either
03:20mthvedtoh, you should
03:20bbloommthvedt: i wouldn't take that particular statement all the way to it's logical conclusion
03:20bbloomTEttinger: macros aren't necessary here
03:20mthvedtbut functional programming itself can eliminate
03:21TEttingerand there are frequent changes, but easy enough to just rectangular insert the names
03:21mthvedtmost code repetition
03:21bbloomTEttinger: it looks like you're trying to learn both clojure and statistics at the same time
03:21TEttingeryeah I am not trying to code-elegantly. i am trying to make it work
03:21bbloomTEttinger: I always find it helps to simplify and try to do fewer things at once
03:21TEttingerbbloom, yeah
03:22bbloomlooks like you got the basics of clojure, but need help with the stdlib
03:22TEttingerthe task should be fairly simple, but my math isn't great
03:22bbloomi recommend grabbing the cheatsheet and then doing some problems at 4clojure.com
03:22bbloom~cheatsheet
03:22clojurebotCheatsheets with tooltips can be found at http://jafingerhut.github.com/ .
03:22bbloom~4clojure.com
03:22clojurebotmake a note of http://scienceblogs.com/goodmath/2006/11/the_c_is_efficient_language_fa.php it is yet another article about picking c or c++ for performance being naive
03:22bbloomer thanks clojurebot, i guess i didn't really need to ~ a domain already
03:23bbloomwww.4clojure.com should be clickable :-)
03:23bbloomthen mozzy on over to kahn academy and brush up on your probability skills
03:23TEttingeri've been using clojuredocs a lot
03:23bbloomi recommend you follow some top users on 4clojure, so you can see near functions and tricks they use to solve problems more eloquently
03:23bbloomthen try to put the two things together :-)
03:24bblooms/near/neat
03:24bbloomand get that monad out of there!
03:24TEttingersigh...
03:25TEttingermake up your minds!
03:25bblooma bunch of folks in this channel are obsessed w/ monads
03:25TEttingershould i use the sequence monad or not?????
03:25bbloomi dunno, maybe it's useful
03:25bbloombut you've still got a lot to learn about the std lib before you start venturing out into experimental monad libraries...
03:26TEttingeri think i know a fair bit of the std lib, my problems are on tricky things like doseq
03:27bbloomyou're code has a ton of opportunities to simplify, cleanup, clarify
03:27bbloomyour*
03:27TEttingeryeah
03:27TEttingerI know
03:27bbloomi'm not trying to shit on you
03:27bbloomi'm trying to help us help you
03:27bbloomin order to get good advice here, you need to ask for it in small pieces
03:27TEttingerthe big thing that I am using is a rectangular insert in jEdit. it lets me edit each block as basically one line of code
03:27TEttingergot it
03:27bbloomthis is a pretty big paste
03:28TEttingerthe issue is almost entirely with analyze-prob
03:28TEttingerthe rest is just so you can run it
03:28TEttingersince it needs multiple inputs, which I provided via a swing GUI
03:28wei_how do people deal with multiple build targets using lein-cljsbuild? I find myself having to add two entries (dev and prod) in my project.clj for each page that I want to have clojurescript in. it works but doesn't seem very DRY e.g. https://gist.github.com/4326069
03:34Raynesggreg: What is a pretty big paste?
03:34bbloomwei_: I think that most people using cljs are doing singlepage apps
03:34RaynesUgh
03:34Raynesbbloom, not ggreg.
03:35RaynesAnd I found it, so never mind.
03:35RaynesDamn it, gist.
03:35bbloomRaynes: I never mind you
03:35RaynesDamn everyone who doesn't use refheap.
03:35TEttingerok, using https://gist.github.com/4326117
03:35TEttingerheh just as you say refheap
03:36wei_alright Raynes, next time :)
03:36wei_and I guess I could just dry it up with "map"
03:36Rayneshttps://www.refheap.com/paste/7692 Fixed it for you, TEttinger
03:37Raynes;)
03:38bbloomRaynes: maybe you should write a bot that finds gist posts in here and copies them to refheap :-P
03:38TEttingerRaynes, forgot to remove seesaw :usage https://www.refheap.com/paste/7693
03:38bbloomwe'll just stick a EULA in the channel topic: if you write in here, you assign all copyrights to Raynes, even if it's somebody else's post
03:38Raynesamalloy_ has suggested that a million times. I figure people would get angry pretty quickly. That might be a fun reason to do it anyways, see how fast people get annoyed.
03:38RaynesHahaha
03:41TEttingerprotip: don't run that code in the latest refheap paste
03:41TEttingerjust (use)'ed it in a lein repl
03:41RaynesYou have some very weird formatting.
03:41TEttingeryeah, I don't have an auto-format function in jedit
03:41RaynesYikes, jedit for Clojure? That can't be fun.
03:41TEttingerso indents are all over
03:42bbloomTEttinger: and some sort of weird block edit fetish
03:42TEttingerit starts up faster than eclipse
03:42TEttingerheh
03:42RaynesAlso, you are like the smallest minority in the whole Clojure community.
03:42TEttingeryeah
03:42RaynesFirst person I've ever heard of using it. :p
03:42TEttingerI use eclipse too
03:42TEttingerI contributed some code to CCW a while back
03:43bbloomTEttinger: if i were to try to make sense of this code, i'd basically have to rewrite it
03:43TEttingeryeah
03:43RaynesHaha, I was gonna let emacs reformat the code, but realized I was in Windows when I went looking for it.
03:43RaynesI don't have Emacs on this thing.
03:43nbeloglazovHi. I have a performance issue. There is a snippet: https://www.refheap.com/paste/7694 The problem is that clojure works much slower if I use (current-surface) instead of (current-applet). It seems that clojure compiler need to use reflections because (current-surface) can return objects of 2 different types while (current-applet) return object of 1 type and compiler optimizes it.
03:43nbeloglazovHow can I avoid this without creating 2 sets of functions - one for current-applet and another for current-graphics?
03:43bbloomTEttinger: see if you can get all those "reduce +" lines down to a single map transformation
03:44nbeloglazovCan protocol help this?
03:44bbloomnbeloglazov: try (set! *warn-on-reflection* true)
03:44bbloomyou probably need a type-hint
03:45nbeloglazovWhat kind of? And where? In current-surface?
03:45bbloom(doc *warn-on-reflection*)
03:45clojurebot"; When set to true, the compiler will emit warnings when reflection is needed to resolve Java method calls or field accesses. Defaults to false."
03:45bbloomjust set! that to true and run your code
03:45bbloomit will tell you whenever reflection occurs in clj code
03:45nbeloglazovOk, I'll try
03:47TEttingerbbloom: you mean turn (reduce + (map #(* (count (filter (fn [c] (= :s c)) (flatten %))) (/ (get freqs %) num-rolls )) kf))
03:47TEttingerinto a function call on some local function?
03:49bbloomTEttinger: start there
03:51TEttingeri think the big issue with this code is that I am storing all combinations of all dice in memory at once.
03:51nbeloglazovbbloom: yes it shows a lot of reflection warnings when I use (current-surface). Still I need to fix it somehow. Type hints won't help as I understand because current-surface can return values of 2 different types.
03:53bbloomnbeloglazov: a typehint basically compiles to a cast (afaict)
03:54bbloomnbeloglazov: you can typehint at the call site, if you know what type you got
03:54bbloomnbeloglazov: or, if the method you need is higher up in the type hierarchy, you can hint with a base type
03:55debugger98(def read-data [user-id] (let [sid (shard user-id) entity (symbol (str "shard" sid))] (select entity (where {:id user-id}))))
03:55debugger98sorry should be
03:55debugger98(def read-data [user-id] (let [sid (shard user-id) entity (symbol (str "shard" sid))] (select entity (where {:id user-id}))))
03:55debugger98the entity dones't eval to its real value
03:55debugger98select is a macro
03:56debugger98how should I make entity eval to its value in this function definition
03:56debugger98basically entity is a predefined val in the same file
03:57debugger98just need to shard to the right one according to user id at run time
03:59debugger98oops, s/def/defn/g
03:59bbloomdebugger98: that would be your issue.
04:00debugger98would be very grateful if someone points out the problem, thanks
04:29adamvhWhen I try to start Leiningen, I get the error message "java.lang.NoClassDefFoundError: clojure.lang.Symbol"
04:29adamvhAny idea why this might happen?
04:29clgvadamvh: sounds pretty weired. whats you environment? do you start "lein repl" outside a project?
04:30adamvhYes, I get that error outside a project
04:30adamvhI've been running a script with lein-exec
04:30adamvhand it has ceased to work
04:30adamvhfor reasons unknown
04:30clgvdo you have a .lein/profiles.clj?
04:31adamvhNo, I do not
04:31clgvleiningen 2 preview 10 right?
04:31adamvhI assume it's the most recent one
04:31clgvyou can check via "lein version"
04:32adamvhI get the class not found error when I run lein version
04:34clgvand you are sure there is no project.clj in the directory where you do that?
04:34clgvthen just delete ".lein" and reinstall leiningen
04:36adamvhHappens when I try to reinstall leiningen
04:37adamvhI get the "Downloading Leiningen now"
04:37adamvhand the little status indicator
04:37adamvhfollowed by the class not found error
04:39clgvhuh? there is something pretty messed up. what did you do before?
04:39adamvhInteresting
04:39adamvhIt appears that the cluster Java was 1.4
04:40clgvuff
04:40borkdude:-0
04:40adamvhnow that I have instructed the cluster to use 1.6
04:40adamvhthings seem to be in order again
04:40adamvhIt seems they changed the default while I wasn't looking
04:40clgvthey have legacy software that old running on that cluster? :O
04:40adamvhfrickin' high performance computing
04:40adamvhwhat a pain
04:41clgvI thought I use an outdated version with java 1.6 ;)
04:41borkdudewhat programming language is 25 years old today?
04:41clgvwell it still has support until next year...
04:41adamvh1987...
04:41adamvhC++?
04:42llasram`Hmm. Perl?
04:42borkdudeIt must be Perl
04:43borkdudesomeone on twitter said: Happy 25th to the "duct tape that holds the Internet together"!
04:44borkdudeI actually know of only one "web shop" which is Perl based in my environment
04:44clgvright it is perl according to wikipedia
04:47adamvhOh thank goodness I got that working. Did not want to re-write that script in something else
04:47clgvperl is the language where you can have source code that looks like a hash sum ^^
04:48Iceland_jackOh, perl jokes :)
04:49borkdudeI saw some generated C# code yesterday in which every name was represented by a guid…
04:49clgvborkdude: decompiled? ;)
04:50borkdudeclgv not even, just generated from some tool
04:51clgvah kk.
05:03silasdavisHello, I'm trying to run a main function with lein run -m messaging.models.message
05:03silasdavisbut I get: "Exception in thread "main" java.lang.Exception: lib names inside prefix lists must not contain periods"
05:03silasdavisthe -main function is in a file in the project with (ns messaging.models.message) at the top
05:04silasdaviscan anyone tell me how to refer to it to get it to run with lein?
05:04rodnaphu need to use :gen-class too i think silasdavis
05:04rodnaph(in the namespace with -main)
05:05llasramNo, not with 'lein run'
05:05nbeloglazovsilasdavis: are you using require,use or refer in your clojure file?
05:07silasdavisSame issue: http://pastebin.com/K1tBk2eE
05:07clojurebotI think you mean gnir.
05:08nbeloglazovTry (:require [monger.core :as mg] [monger.collection :as mc])
05:09silasdavisnbeloglazov: thanks, different error: Exception in thread "main" java.lang.ClassCastException: clojure.lang.Var$Unbound cannot be cast to com.mongodb.DB
05:11nbeloglazovsilasdavis: did you try some examples of using monger? I think you use it somehow incorrectly
05:13silasdavisyes I had separately, I'll strip that out, I'd just like this file to run
05:14silasdavishow does lein find clojure modules? is it just everything below src?
05:19nbeloglazovsilasdavis: try to move (mg/connect) inside main function
05:21silasdavisit seems to be the find call that is causing the problem
05:23nbeloglazovI'm not sure that mg/connect is called when you run -main function. So may be when you call mg/find you're not connected.
05:27silasdavisconnect is fine outside of main function it seems. I wasn't selecting a database to use
05:27silasdavisdo you understand why the require statement was causing the 'lib names inside prefix lists' issue?
05:39ro_stwhat's an idiomatic way to gather a flat list into a grouped-by… *checks for a group-by fn in core*
05:40ro_staha!
05:40ro_st(inc read-core.clj-already)
05:40lazybot⇒ 1
06:13tomojanyone seen the core.logic condp/condw gisted or available elsewhere?
06:14tomojI found a condr that orders clauses randomly
06:14tomojhttps://gist.github.com/2876680
06:14clgvtomoj: for better average performance by chance?
06:15tomojI'm thinking about logic programs for card games which involve shuffling
06:16clgvoh, wouldnt have thought of that ^^
06:16tomojdunno what the motivations for condr or condp really are, I hear there's a conj talk about condp but don't know if it's available
06:17no7hing,(.foo (proxy [Object][] (foo [] (println "foo!"))))
06:17clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: foo for class sandbox.proxy$java.lang.Object$0>
06:17no7hingshouldn't this work?
06:17clgvwell I think, if you cannot determine the best order of clauses for a given problem or there is not a single one, than condr might improve performance on average
06:19clgvno7hing: no. you need an interface which contains foo
06:19clgvor a protocol
06:19no7hingthis is new in 1.4?
06:19clgvdoes that work in 1.3?
06:20clgvno, it does not
06:20no7hingprobably not, i just looked up an example and they all did an override on existing functions
06:20no7hingdammit
06:20clgvtry: (definterface IFoo (foo []))(.foo (proxy [Object IFoo][] (foo [] (println "foo!"))))
06:21no7hingworks
06:21clgvah. you definitely need to refer to an interface
06:22clgveven with protocol (defprotocol IBar (bar [this])) defined you need to use the interface of that protocol (.bar (proxy [Object user.IBar] [] (bar [] (println "bar!")))) assuming it was defined in namespace "user"
06:23no7hingsilly me thought it'd would be awesome that proxy just creates an ad-hoc interface for me
06:24clgvno. I think there is no clojure construct that does that. proxy, reify, deftype/defrecord all need interfaces or protocols...
06:24tomojhow do you make a defne fail if an argument is an lvar?
06:24tomojI expect (l/conda [(l/nonlvaro ?arg) l/fail] ...) to work, but it doesn't
06:24tomojoh
06:25tomojI mean, I expect (l/conda [(l/lvaro ?arg) l/fail] ...) to work
06:26no7hingno idea what drove me there
06:32clgvno7hing: ah :gen-class should be able to define new methods^^
06:36algernonis it possible in any way to expose a PersistentArrayMap to Java, so that amap.get("foo") would look up :foo, instead of the string?
06:37algernon(I have a clojure lib, that ends up producing a map, with keyword keys, I'd like to expose that to Java, preferably by allowing the users to use strings instead of having to know a thing about clj keywords)
06:43no7hingclgv: i tried to steer clear of gen-class because of AOT ;)
06:44clgvalgernon: you can construct clojure keywords
06:44clgvalgernon: like that (clojure.lang.Keyword/intern ns name)
06:47algernonclgv: I know, that's what I do now, but that's kind of awkward in this case
06:48clgvalgernon: well since it caches keywords it should be quite fast. you can write a wrapper aroung the map that automatically does the keyword creation
06:48clgv*around
06:48algernonI have things like for (Object o: s) { Map m = (Map) o; System.out.println(m.get(Keyword.intern("MESSAGE")); }
06:48clgvalgernon: build the wrapper if you use it frequently in java
06:49algernonyeah, that's what I don't know how to.
06:49clgvwhat's the problem?
06:49algernonI tried extending PersistentArrayMap (which o is, under the hood), but then I get errors that say it can't be cated to my derived type
06:50algernonException in thread "main" java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to bb.XMap
06:50algernonstuff like that.
06:50clgvno dont do that. there is the golden rule: "Prefer composition over inheritance." one of the main messages of the gang of four book ;)
06:52algernonhrm. so, I should create a whole new class, that pretty much just wraps PersistentArrayMap, proxying everything but get?
06:53clgvselect the interfaces you need and build a class base on them: the constructor gets a clojure map and you implement the interfaces
06:53algernonhmmm. that sounds reasonable.
06:53clgvso you should have your custom interface which gives you something like: "get-kw"
06:53algernonthanks, this'll get me going!
06:54clgvkeep in mind the principle^^
07:00bosiei use "lein midje" to run my midje test cases. works fine except if something fails i get a rather long stacktrace
07:03bosieexample: https://gist.github.com/4327382
07:05tickinghow much bad style would it be to have a keyword argument that takes a numerical value or a magical keyword
07:05tickingsay (rotate 45 :x 10 :y 5) and (rotate 45 :x :left :y :top)
07:06algernonclgv: thanks again, got my desired API to work fine :)
07:06clgvalgernon: great :)
07:07clgv ticking: well the semantics seem unclear
07:07clgvticking: I would add additional keywords for :left :top
07:08tickingclgv: yeah but what would you name them :D
07:09clgvticking: no idea, I dont know what they do
07:09tickingprovide an anchor around which a rotation occurs
07:10tickingmy thought is that always providing thing like height/2 heigth and 0 is cumbersome when all you want is top bottom and center ^^
07:26clgvticking: how about :vertical and :horizontal then?
07:27clgvticking: what do you use for keyword args? pure clojure?
07:27tickingclgv: right so you mean one could in theory do (rotate img 45 :x 5 :y 10 :horizontal :center :vertical :top) but in such case x and y will simply ovverride the horizontal and vertical?
07:27tickingclgv: you mean the calling code?
07:27clgvticking: or you throw an error
07:28tickingit should be pure clojure yeah
07:28clgvticking: you can specify either-or in the contract and throw an exception if both are given
07:28tickingclgv: that sounds as if there were already code for such thing ^^
08:07cemerick2test, sorry
08:09cemerickthat was bizarre
08:10ejacksoncemerick: you forked yourself ?
08:11cemerickejackson: I had said something, but it didn't show up in my log, or in the web logs
08:12cemerickonce I logged in from the freenode web client, messages from my regular client started showing up again
08:15ejacksonthat is bizarre.
08:28bosiehow would i be able to pass an arrayseq into clojure.java.io/file ?
08:42cemerickbosie: you mean you have a seq containing a bunch of file path parts?
08:43clgvcemerick: "friend" does not offer brute-force protection, yet?
08:43cemerickclgv: as in, throttling authentication requests and such?
08:44bosiecemerick: yes, apply seems to be the thing
08:44cemerickbosie: yup, that's what you want
08:44clgvcemerick: yeah temporary bans after several attempts
08:46cemerickclgv: nope. Would be pretty easy to do in a naive way (which would probably work just fine in nearly all cases)
08:47clgvcemerick: would be a nice addition to friend ;)
08:47cemerickThings like lock-outs would need to be implemented on a per-workflow and per-credential-source basis though.
08:47borkdude(def as (clojure.lang.ArraySeq/create (to-array ["tmp" "test" "textfile.txt"])))
08:47borkdude(apply file as)
08:47cemerickclgv: Be my guest. ;-) Should go into a separate library though, at least to start.
08:48borkdudemeanwhile the question had already been answered and I have figured out how to create an ArraySeq :P
08:49cemerickborkdude: just (seq any-java-array) will do
08:49clgvcemerick: I did not investigate the internals of friend,yet. you could add it to the list of goals as hint what others may work on
08:49borkdudecemerick I knew there had to be an easier way ;)
08:50borkdudeI've really not worked with java arrays in clojure, never needed to
08:53borkdudehowever, the arguments of a vararg function get collected in an ArraySeq
09:19jsabeaudryRecommendations for async http server besides aleph (too slow)?
09:26ro_stjsabeaudry: atmosphere was in the most recent clojure digest
09:27ro_stno clojure abstraction yet, but it seems to be well liked
09:36ejlohas anyone here managed to get the clojurescript browser repl working with node-webkit?
09:40jsabeaudryro_st, great, will try it out right now, I found another one named http-kit but it throws on big files
09:43samratcould someone take a look at my attempt to upload files using Dropbox API(its not working): https://bitbucket.org/samrat/jopbox/src/620d223b33b85dbe16b787e653c20d25864f2ca6/src/jopbox/client.clj?at=default#cl-66
09:43jsabeaudryro_st, isn't that a social network api?
09:46jsabeaudryro_st, oh nevermind, finally found it
09:46Fauno1@samrat, Access denied
09:46Fauno1Use the links at the top to get back.
09:56jsabeaudryDoes lein uberjar AOT compile everything by default?
09:56carknope
09:58carkactually i think yes, but it will include the source code
09:58carkthere is the :omit-source true option in project.clj
09:59jsabeaudrycark, that will not affect start-up time however, right?
10:00carki don't think so
10:00carkbut you know, your best bet is to check the content of an ubberjar for yourself
10:01carkjar xf myjar.jar
10:01clgvjsabeaudry: lein uberjar compiles those files transitively which are required in the namespace with your main method.
10:01carkthat should unpack it
10:02samratFauno1: sorry, I've made it a public repo now
10:56moogatronicAny emacs exp. people using SublimeText2? I'm looking for a workable setup that gives at least some of the sexp eval, Paren, and general 'integrated' feel that Emacs/nrepl gives. (Mostly to show other people who have 0 emacs experience a working clojure setup that isn't really annoying to work in)
10:59borkdudemoogatronic no, but maybe eclipse+ccw is good for beginners/no-emacsers too
11:00moogatronicborkdude: yeah, though, having had to use eclipse for about 10 years, I would *really* like to avoid inflicting that thing on anyone, especially casual newb-ish programmers.
11:00moogatronicccw itself looks pretty awesome though.
11:01borkdudemoogatronic maybe light table, but that's not very stable and complete yet
11:01rkzwhat's wrong with the web editor bodil made? it's very noob friendly
11:01borkdudemoogatronic I recommend ccw to my students, if they don't want to go the emacs road
11:01rkzhttps://github.com/bodil/catnip
11:03borkduderkz now that you mention it, I used it when it was at version 0.1
11:03borkduderkz gonna try that again
11:03moogatronicrkz: nothings wrong, but I am wanting local 'app' editor / configurations.
11:04rkzmoogatronic: it's local, just runs via browser :)
11:04borkdudemoogatronic everything runs local in catnip
11:04borkdudein fact Bodil is here, the creator of this
11:04moogatronicmaybe i'll check it out. does it fire up nrepl from lein and all that stuff?
11:05moogatronicborkdude: yeah, I saw her preso at the conj
11:05borkdudemoogatronic I wouldn't know about nrepl, ask Bodil
11:08borkdudewow, catnip really improved since I saw it
11:08moogatroniclooks like this may be what i want, based off the read me at any rate. =)
11:10borkdudeI think I made it crash though, by evaluating (read-line) in the repl… ;)
11:22Ferdy_Hi, on behalf of 3 Bsc students competer science I am looking for a thesis project/internship. Is there anyone who can help me or point me in the right direction?
11:23Fauno1i'm starting to build my own continuous integration platform in clojure which i could open-source if you're interested
11:23borkdudehello Ferdy, I see you are from Delft, how nice
11:23Ferdy_=)
11:24borkdudeborkdude I'm working at hogeschool utrecht and have done some clojure projects with my students
11:24borkdudeFerdy_ I mean… (something up with my typing)
11:24vijaykiranFauno1: interesting - something like Jenkins ?
11:24borkdudeFerdy_ would you like to work with a company or within your university?
11:25Ferdy_Depends on the project
11:25borkdudeFerdy_ doesn't the project depend on what you want in the first place?
11:27Ferdy_borkdude True I suppose. However we don't have too clear of an idea of what we want to do. We have to do a project for a third party such as a teacher or company. Either could be interesting
11:29ciphergothShould I have stars either side of the name of my dynamic vars? Is that the convention?
11:29borkdudeFerdy_ should it involve clojure and is that the reason why you're asking in here?
11:29borkdudeciphergoth it's convention, but really the metadata decides if it's dynamic from 1.3 onward
11:30ciphergothborkdude: OK - yep noticed that it's now a metadata thing, but wanted to follow the conventions too!
11:30tbaldridgeciphergoth: but I think these conventions are "enforced" via warnings these days. So if you have a dynamic var without them it might complain
11:30ciphergothno it doesn't complain
11:30ciphergothbut it does complain if you put stars without a dynamic marker
11:30ciphergoththat's how I know about the convention :)
11:31Ferdy_borkdude The 3 of us really enjoy working with clojure and think there is a lot of interesting ground not covered in our curiculum. So we would like to do it in clojure but our university doesn't seem to care for clojure.
11:31vijaykiranciphergoth: yeah, it complains the otherway round
11:32TimMcWhenever somesome says *earmuffs*, I always think @earmuffs@ instead. :-/
11:32borkdudeFerdy_ let's talk private in Dutch if you don't mind, maybe we can exchange some contact details
11:37creaseis there any way to implicitly specify project-wide namespace stuff in a leiningen profile? Like if I wanted every namespace to require pprint when developing, but didn't want that explicitly in the ns form
11:37bosieis there a way to overload functions based on values?
11:37bosiei.e. i have one parameter and if its nil, do this, if not do that
11:37moogatronicbosie: multi methods?
11:38gtrakcrease: it sounds like a bad idea.. I would just make a utility function for that and put it in a shared namespace
11:38bosiemoogatronic: lemme check
11:38moogatronicyou can dispatch on type, value, etc.
11:39bosiewas hoping for sth like (defn foo [nil] 0 [x] (println x))
11:39moogatronicgoogle turns up some pretty good examples
11:39borkdudebosie multmethods yes
11:39bosiek
11:39borkdudebosie or pattern matching
11:40bosieborkdude: that was the word i was looking for, thx
11:40borkdudebosie defn doesn't support it out of the box, but there's this https://github.com/clojure/core.match
11:40bosieborkdude: yup
12:16creasegtrak: yeah, probably a bad idea
12:17gtrakcrease: you could put some require's in a fn in a test namespace, that's probably the easiest thing
12:18gtrak(crease.util/repl-bits) or something like that
12:18technomancycrease: you can do that using nstools
12:18technomancybut it's out of scope for leiningen
12:19technomancyI agree it's annoying to have to copy/paste things all around for simple things like pprint; nstools does a decent job of making that better
12:19gtrakhrm... I feel like if you're doing repetitive stuff, you'd want to group it into its own namespace... what's wrong with a little indirection?
12:20joevandyk_are all the lein project templates embedded in lein? or does it look them up somewhere?
12:20creasegtrak: it's not a very principled thing, it's just that my hands start falling off after typing (use 'clojure.pprint) (use 'clojure.repl) a billion times
12:20technomancyjoevandyk_: it comes with a few templates (see the lein-newnew project) but can download them dynamically from clojars as well
12:21joevandyk_technomancy: clojars == rubygems.org?
12:21technomancyjoevandyk_: more or less
12:21creasetechnomancy: I'll look into that, thanks.
12:21gtrakcrease: sounds like you need a pprint foot-pedal
12:21joevandyk_what's with all the "Could not find artifact lein-ring:lein-ring:pom:0.7.5 in central (http://repo1.maven.org/maven2)&quot; warnings/errors?
12:21joevandyk_just me?
12:21creasegtrak: I'm guessing you're joking but that's actually an awesome idea
12:22creasehm
12:22gtrakhaha
12:22technomancygtrak: yeah actually nrepl middleware or something to auto-pprint things might be worth experimenting with
12:23TimMccrease: It really is.
12:24joevandyk_i did 'lein new compojure hello', then 'lein run' and i get "No :main namespace specified in project.clj" Shouldn't that be put in the project.clj by the template generator?
12:24technomancyjoevandyk_: lein looks in central (java-centric repo) as well as clojars
12:24technomancyso it's saying it can't find it in central and is falling back to clojars
12:24technomancywhich is kind of silly; the master version is better about only telling you things that matter
12:24weavejesterjoevandyk_: Why would it? There's nothing to run...
12:24weavejesterjoevandyk_: If you want to start a development server, you can do "lein ring server"
12:25joevandyk_weavejester: ah
12:25joevandyk_weavejester: i'm confused by "there's nothing to run"
12:25technomancyjoevandyk_: yeah it's not obvious how that template doesn't give you an embedded jetty server
12:26weavejesterjoevandyk_: Well, you're defining a web application, which in Clojure terms means a Ring handler.
12:26weavejesterjoevandyk_: How a Ring handler is turned into a web server is up to you
12:26creaseI haven't played around with nrepl middleware much, it looks like the place to go though. and pretty easy to write… I've been wanting a way to throw together queries on projects quickly
12:26technomancyI wonder what the numbers are on non-jetty web users
12:27technomancysuspect they're pretty slim
12:27joevandyk_weavejester: ah. ok.
12:27weavejesterThe latest snapshot of lein-ring allows you to create an executable jar which uses the embedded Jetty server
12:27weavejesterI'll probably release it this weekend, since it seems to work well enough
12:27creasetap the foot-pedal, get a tree of all references to a function in a project…
12:27technomancypersonally I think including a :main in the template would be a good default for beginners
12:28antoineBhello, how to import a protocol in clojurescript? (i get " is not a protocol" warning )
12:28gtrakcrease: I use this in a util namespace all the time: (defn and-print [val] (pp/pprint val) val)
12:28joevandyk_What's the best way to learn about the infrastructure parts of clojure? testing, packaging, deploying, organizing, etc?
12:28weavejesterThe README of the template does explain how to get the server started, though maybe a (println) would be useful as well
12:28technomancyjoevandyk_: start with `lein help tutorial`
12:29antoineBi used (ns some.ns (:use [some.other.ns :only [ISomeProto someProtoDef]])
12:29joevandyk_technomancy: perfect! thanks!
12:29technomancyjoevandyk_: clojure-doc.org has some great content too
12:29gtrakduring threading, it's kinda like a ruby's tap, afaict
12:29technomancytap is doto, isn't it?
12:29weavejestertechnomancy: I'm a little adverse to including a main method in the template, as that combines a method of deployment with the actual code...
12:29gtrakyea, suppose so
12:30weavejesterMy preference is to provide different outputs: war file, executable jar, development server, etc.
12:30technomancyweavejester: well that's the thing about templates; it's very obvious what they're doing, and the 5% who are deploying to tomcat typically know what they're doing
12:30technomancyso it's easy for them to just strip out the bits they don't like
12:30technomancyin fact people deploying to tomcat are probably a lot less likely to use the template to begin with
12:30gtrakdoto pprint is more general, you're right
12:31TimMcsppy
12:31weavejestertechnomancy: Yes… but templates should also guide users to the "right way" of doing things
12:31TimMc(defmacro sppy [form] `(doto ~form (pprint)))
12:32weavejesterI don't think having a main method in your project is the right way to start out.
12:32gtrakit's weird to use doto because I learned as a java interop form
12:32weavejesterBecause you're writing a web application, not a console application
12:33technomancyI don't see the point of distinguishing unless you're trying to integrate into an existing legacy environment
12:33Ember-hmm, I see no problem in having a main function if you are doing a web application
12:34amalloyman, are you guys writing this macro again? you're missing the key feature: (defmacro ? [x] `(let [x# ~x] (printf "%s is %s" (pr-str x#) ~(pr-str x)) x#))
12:34joevandyk_technomancy: the 'lein help tutorial' stuff is *perfect*
12:34technomancyjoevandyk_: swet
12:34Ember-in fact, that's the way I'd prefer to do it if app containers would allow it all the time
12:34technomancysweet
12:35amalloyer, except i got the two args to printf backwards. you get the idea, i think: print the form as well as its value
12:35gtrakamalloy: nice
12:36weavejestertechnomancy: It's not necessarily just legacy environments like servlet containers
12:36joevandyk_best way to get autotest-like functionality?
12:36hyPiRionjoevandyk_: lazytest I think
12:36technomancyjoevandyk_: keep it in the repl
12:36ejacksonwhich profile does leiningen use to find repositories for lein jar ?
12:36technomancyfor emacs, clojure-test-mode
12:36joevandyk_vim?
12:36clojurebotGesundheit!
12:37weavejesterAnd the idea is to separate the definition of a web app from the implementation
12:37ejacksonlein repl finds my nexus repo, lein jar gets upset. I have the repo described in ~/.lein/profiles.clj under {:user ....}
12:37amalloywait, servlet containers are legacy environments now?
12:37TimMcamalloy: No, I was just writing the basic version, knowing you'd fill it in. :-D
12:38weavejesteramalloy: In my view ;)
12:38technomancyejackson: the user repo is the wrong place for repos that you can't build the jar without
12:38technomancyejackson: that's what you call a recipe for Works on My Machine =)
12:38TimMcamalloy: The background there was wanting to have a pprint version.
12:38ejacksonhehehe, yeah, rather what I'm discovering :)
12:39amalloyyeah. but i never use pprint so i couldn't remember how to get it to write to *out* without just lamely (binding ...)
12:40TimMcamalloy: The key is to have that foot-pedal change an atom (I think) so that a (printer) fn returns the right print fn.
12:40gtrakI want a write-my-program button on my foot pedal
12:40amalloyspeaking of which: foot pedal, really? i mean, i'm all in favor of foot pedals, but this sounds more like a job for a keyboard shortcut
12:40amalloyor a keybinding, if you're in emacs
12:41TimMcFOOT PEDAL
12:41TimMcIt's a mode, not a command.
12:41TimMcOr maybe it should be a set of stops, like on an organ.
12:41gtrakI've been thinking of using this for a generic controller: https://github.com/overtone/grid
12:41gtraknow that we're talking about organs
12:42gtrakit even lights up and stuff
12:42ejacksontechnomancy: the problem is that I don't control the source, and the dep in question is not on a public repo. No problem, just host locally in nexus, but now I figure out how to resolve the repo without changing the project.clj.
12:42technomancyejackson: so the source is broken =(
12:43ejacksontechnomancy: alright, I'll go upstream then :)
12:45creasefoot pedal, definitely. with stops
12:46creaseI was thinking pressure plates on desk chairs, so you can instruct the repl exactly how pretty to print by shifting your weight
12:47creasegtrak: you shouldn' t put buttons on your pedal. finger-pinch
12:47gtrakhook up an extra monitor to your tongue: http://www.dailymail.co.uk/sciencetech/article-1210425/Blind-people-able-using-amazing-tongue-tingling-device-bypasses-eyes.html
12:50TimMcUgh, the Daily Mail.
13:12bosieis there a way to make midje use nailgun ? the startup times of midje are too slow
13:14mabesbosie: you're best bet is to try to use drip since it has lein integration (https://github.com/flatland/drip)
13:14mabess/you're/your/
13:14mabesdrip will only save on the JVM start up time though
13:14joevandyk_i'm using vimclojure, but i'd love for the output of the repl to go to a different terminal window (or maybe the terminal that's running nailgun. is that possible?
13:15bosiemabes: as opposed to?
13:16technomancybosie: you should just start a repl and do all your work in it
13:16technomancystarting a new process just to run your tests is not the way to go
13:17bosietechnomancy: and then execute midje through the repl?
13:17joevandyktechnomancy: is there a screencast or something about how to edit code and work with files inside a repl? i'm so used to editing files and running them
13:18technomancybosie: yeah
13:18technomancyjoevandyk: hmm... not sure what would be helpful there
13:18joevandyktechnomancy: you edit functions and save them to files inside the repo?
13:19technomancyright
13:20mabesbosie: as opposed to JVM start up time + load time of midje and your app. technomancy is right about using the repl.. the newest version of midje has nice repl support
13:21bosiemabes: looking at it now
13:26bosiemabes: can't seem to figure out how to do it in the repl
13:27antoineBis there someone here, involved in clojurescript analyzer dev?
13:27dnolenantoineB: yep
13:28antoineBi get "is not a protocol" error, when i use a protocol imported from another file
13:28mabesbosie: this may help https://groups.google.com/forum/?fromgroups=#!topic/midje/XH5WOZFMrAA ... So, in 1.5-alpha3 you can say (load-facts :all)
13:28antoineBi suspect the "resolve-var" in cljs.analyzer remove the meta-data
13:31bosiemabes: i use alpha3. i load a repl with "lein repl" and do "> (use 'midje.sweet)"
13:31bosie(load-facts :all) results in "unable to resolve symbol"
13:31dnolenantoineB: do you have a minimal reproducible case? Can you make a gist of what you're trying to do?
13:32antoineBdnolen: i will test in a repl
13:32bosiemabes: clearly i am doing it wrong ;)
13:33pandeirois declare supposed to work in cljs?
13:33dnolenantoineB: a little more info would be helpful. Are you running into this problem when using lein-cljsbuild? the clojurescript compiler directly?
13:33dnolenpandeiro: yes
13:36pandeirodnolen: definitely doesn't work in the Rhino REPL on the latest release, cleaning my cljsbuild cache and testing in browser...
13:36antoineBdnolen: lein-cljsbuild, i haven't the problem before, but a update to lein-cljsbuild form 0.2.9 to 0.2.10
13:37antoineB*i update form 0.2.9 to 0.2.10 and the problem appear
13:38dnolenpandeiro: declare still works - but it seems like it may have issues in the Rhino REPL.
13:39pandeirodnolen: w/ lein-cljsbuild 0.2.10 + :whitespace i get nothing in the output js from declare
13:39dnolenantoineB: please create a minimal case and open a ticket.
13:40dnolenpandeiro: declare shouldn't generate any code, it doesn't do anything.
13:40pandeirodnolen: shouldn't it just create the key in the namespace?
13:41dnolenpandeiro: I don't see why it should, it's likely to get removed anyway.
13:42TimMcdnolen: Because of var hoisting in JS?
13:42pandeirodnolen: i thought of declare as a way of "re-enabling" the JS hoisting behavior we're used to?
13:42dnolenTimMc: no because of optimizations.
13:42dnolenpandeiro: declare is meant to be used precisely as it's meant to be used in Clojure, hoisting has nothing to do w/ it.
13:43dnolenit's for forward declarations of top levels
13:44pandeirodnolen: not sure what that accomplishes if the JS interpreter will still trip up on any var that hasn't been actually defined when it is used in code
13:44dnolenhttp://dev.clojure.org/jira/browse/CLJS-444
13:44pandeirok
13:44dnolenpandeiro: will look into it, this probably an unfortunate side effect of some dead code elimination improvements.
13:45pandeirodnolen: i had been using declare in the manner TimMc and I alluded to in previous versions of CLJS and i remember it working... so i think you might be right
13:46dnolenpandeiro: it's error to use it that way.
13:46dnolenno promises were ever made about unintended uses of declare
13:46pandeirodnolen: hmm, then i don't understand the use case, honestly
13:46dnolenpandeiro: forward declaration, that's it
13:46pandeiroi mean cljs doesn't really exist apart from the JS runtime
13:47dnolenpandeiro: however if you're running into something where the semantics don't line up w/ Clojure then by all means, that's a bug too.
13:47antoineBdnolen: https://gist.github.com/4330709
13:47dnolenpandeiro: but I can't think of case that doesn't involve ns manipulation where it wouldn't blow up in Clojure JVM
13:47antoineBdnolen: i tested it in a fresh project
13:47pandeirodnolen: hard to assess, because in my mind 'forward declaration' and function housing in JS are practically synonymous, albeit achieved by different means
13:48dnolenpandeiro: that's not what it means
13:48dnolenpandeiro: there are no hoisting semantics to `declare` in clojure at all
13:48antoineBjust also notice that the command "lein cljsbuild once" don't end (don't give me back the bash)
13:48dnolenpandeiro: using any top level name before def or declare is an error. it's that simple.
13:49pandeirodnolen: ah no, you're misunderstanding me: i am doing (declare foo) and then (defn foo ...) later in the namespace file
13:49dnolenantoineB: that's a lein-cljsbuild bug.
13:49pandeiroand JS trips up regardless with an undefined error
13:49antoineBdnolen: you mean the "once" command or the warning?
13:50antoineBfor the "once" it's a cljsbuild bug
13:50pandeirodnolen: i understand the semantics are different, but functionally, the two mechanisms allow for the same common coding technique: defining things later in the file than they are used, ie code organization
13:50dnolenpandeiro: heh, ok, I thought we were talking past each other.
13:51dnolenpandeiro: attach a minimal case not at the REPL that demonstrates what you're talking about. Though that seems weird since we're using declare in core.cljs and not seeing any undefined issues.
13:51dnolenpandeiro: to the ticket
13:51pandeirodnolen: k, will do
13:51pandeirodnolen: commen to the same ticket as yours, or new ticket?
13:52dnolenpandeiro: i'll change the ticket title.
13:52dnolenpandeiro: done
13:53dnolenantoineB: can you include the error you are seeing in your paste?
13:53antoineBi made a comment
13:55antoineBcljsbuild 0.2.10 use ClojureScript version 0.0-1552.
13:57antoineBdnolen: if you look like at the error message, you go into "extend-type" macro
14:01dnolenantoineB: are you sure there is not a type involved here, I just tried it and it works for me no error
14:01dnolentype -> typo
14:02antoineBdnolen: do you use cljsbuild?
14:03dnolenantoineB: yep 0.2.10
14:03dnolenpandeiro: feel free to comment on this ticket, http://dev.clojure.org/jira/browse/CLJS-444
14:04pandeirodnolen: i'm afraid it was user error on my part, expecting "hoisting" behavior, as you pointed out
14:04pandeirosorry
14:04pandeiroit's because in JS, I can call a function before it's defined
14:04pandeiroand in Clojure, declare really doesn't allow that
14:04pandeirosorry to waste your time with that
14:04dnolenantoineB: if you're certain you can reproduce - it's easiest if you can make a project that illustrates the issue, then I can clone that and try it out using your exact setup modulo OS & JVM environment
14:04pandeirobut the Rhino REPL really does barf on (declare ...) in any case
14:04pandeironot sure that's a major bug
14:05dnolenpandeiro: ok, updating the title.
14:05antoineBdnolen: ok
14:05dnolenpandeiro: it's a bit annoying for interactive dev
14:05harobHi all, I wanted to get your thoughts on a recurring problem in my code: I often want to have alternating computations and side-effecting statements (e.g. logging of the intermediate computed results). The way I do that now is with "fake" let variables, but it seems really hackish:
14:05haroblet [a (compute-a)
14:05harob _ (log-a a)
14:05harob b (compute-b a)
14:05harob _ (log-b b)
14:05harob ...]
14:05harobThe other way I can think of would be to have many nested let statements, and do the logging in the implicit do's, but that makes the code even less readable. Is there a better solution for this?
14:05technomancyharob: 0) please use a paste site like gist or refheap; 1) try (doto (compute-a) log-a)
14:06pandeirodnolen: i really wanted to be able to define an "on-ready" fn for initiating my app, but throw that definition at the bottom of the file, after the more 'important' code, which is something i could do in JS of course
14:08dnolenpandeiro: I don't see how that problem isn't solved w/ declare.
14:08harobtechnomancy: got it for gist! doto sounds good, although I would have as many doto statements as intermediate variables. I think ideally there would be a higher-level construct similar to let but that supports skipped
14:08joevandykwhat is "trampoline", as in "lein trampoline"?
14:08harobexpressions
14:08borkdudeyou could also let the logging function just return its argument… let [a (log (compute a))] …, don't know.. is that evil?
14:09technomancyjoevandyk: it's a way to avoid having both Leiningen's JVM and the project's running at the same time
14:09hyPiRionborkdude: it's okay for debugging at least
14:09technomancyjoevandyk: Leiningen enforces a separation between your code and its code, which is pretty different from ruby. it tries to be as transparent as possible, though there are a few necessary exceptions.
14:09hyPiRionBut purists/functional extremists may want to hunt you down
14:10borkdudehyPiRion we can wrap it inside an IO monad anytime, to hide the evil
14:10pandeirodnolen: (declare on-ready) (defn do-stuff []) (on-ready do-stuff) (defn on-ready [f] (set! (.-onload js/window) f)) <-- this won't work b/c the call to on-ready comes before the definition
14:10squidzcan anybody point me to some code using enlive for html templating?
14:11pandeirodnolen: which is expected, right? same would happen at the clj repl
14:11antoineBdnolen: for my test project, i find the typo, i used a .clj instead of a .cljs
14:12dnolenpandeiro: yeah that won't work.
14:12squidzso far Ive mostly found tutorials on how to use enlive for scraping, but I would really like to see real examples of it being used for templating
14:12TimMcsquidz: Here's some I wrote recently: https://github.com/timmc/pellucida/blob/master/src/org/timmc/pellucida/listing.clj
14:12squidzTimMc: thanks
14:12dnolenantoineB: good to hear it's not a bug in CLJS that would have been a bad bug :)
14:13pandeirodnolen: so basically i was asking for JS weirdness to be brought into CLJS and was appropriately scolded by you ;)
14:13TimMcsquidz: I found Enlive to have a long learning curve.
14:13joevandyktechnomancy: hm, if I use lein 2 with heroku, 'lein deps' doesn't seem to be ran automatically?
14:13harobBy the way, is the let-with-fake-undercore pattern acceptable in the clojure community? I saw it in the Emerick-Carper-Grand book.
14:13squidzis it worth it in the end? Normally Ive only really used java's wicket, i'm guessing it's much different
14:14technomancyjoevandyk: correct; running deps hasn't been necessary for a long time
14:14borkdudesquidz here is something from a project of mine https://www.refheap.com/paste/7701
14:14dnolenpandeiro: heh hopefully not scolded. I was confused by you asking for something clearly not allowed in Clojure.
14:14TimMcsquidz: I'm not familiar with Wicket. I like Enlive's separation of HTML and transformation.
14:14squidzborkdude: thanks
14:14harobsquidz: The Programming Clojure book has an excellent tutorial on Enlive, much better than I found online. And yes, it is worth it?
14:14joevandyktechnomancy: ah. on the first request to heroku, it starts downloading all the dependences, which takes a minute or two
14:14pandeirodnolen: i was totally trying to get hoisting into cljs :)
14:14joevandyk(while the request hangs)
14:14technomancyyeah
14:14joevandykwhich doesn't happen with lein1
14:15technomancyhm; should be the same
14:15squidzharob: thanks for the tip, ill take a look at it
14:15TimMcborkdude: Combining Hiccup and Enlive, there?
14:16borkdudeTimMc yes, is that evil also?
14:16TimMcWell, it certainly startled me.
14:17borkdudeTimMc it's called pragmatic instead of pure ;)
14:18borkdudeTimMc or a lack of enlive knowledge, probably that
14:18technomancyenlive is hard =\
14:18squidzwhy is it so hard?
14:19technomancyit's not documented and the conceptual model behind it is difficult to grasp
14:19squidzah, okay, so the documentation is really a problem i guess
14:20squidzI thought my google-fu just wasn't sufficient
14:20technomancyall the docs for it I could find were like "here, do it like this" rather than explaining what was really going, which leads to copy/paste coding rather than real understanding
14:20technomancy*going on
14:20borkdudeyes, I agree. there is documentation, but it lacks examples
14:20squidztechnomancy: you used to program ruby if I remember corrrectly, how long did you do ruby?
14:20technomancysquidz: around 2005-08, and I've picked it up a bit again for work
14:21squidzokay, are you happy with almost completely moving over to clojure?
14:21technomancyI'm much happier working in Clojure, but there are still some things the JVM is rubbish at
14:21callentechnomancy: other than scripts, what?
14:22squidzinteresting
14:22technomancycallen: subprocess management and unixy things primarily
14:22technomancydisposable processes
14:22callentechnomancy: oh yes.
14:22callenborkdude: compared to most template libraries, Enlive is black magic in a bad way.
14:22squidzhas learning clojure changed the way you program ruby now
14:22callenborkdude: I'd rather use Fleet or Stencil.
14:22technomancythe codebase I manage at work is practically all messing with subprocesses and SSH
14:23Ember-well, it did get better though, process management with java at least
14:23callenI'd *really* rather have something like Play or Django/Jinja templates though.
14:23squidzcallen: what templating engine do you recommend?
14:23technomancysquidz: well I never wrote "proper" OOP ruby to begin with
14:23borkdudecallen I like css selectors and total separation of html and templating
14:23callensquidz: Fleet or Stencil, to taste.
14:23Ember-not saying it couldn't be better though
14:23technomancyjust a bunch of methods on modules
14:23callenborkdude: yeah uh, what you just said doesn't mean what you think it means.
14:23callenborkdude: think carefully to yourself about the implications of writing backend code that complects CSS classes with passing data to the frontend.
14:23callenborkdude: how much does that make really?
14:24callenfurther it makes the ludicrous assumption that templating is only needed where HTML or XML are involved.
14:24callenhow much sense*
14:24borkdudecallen what do I think it means?
14:24TimMcsquidz: Enlive requires you to be *really* comfortable with higher order functions if you want to do anything non-trivial.
14:24callenborkdude: backend code should not care about CSS classes on the frontend.
14:24callenI have great news though, you see, the world found a better way.
14:24squidzTimMc: so it enforces good practice?
14:24borkdudeI feel a religious debate is coming up
14:24TimMcNo, it' just requires a certain way of thinking.
14:24callenIt's called passing a map or dictionary of data to the template-side. works great.
14:25hyPiRionOh, it's almost time for the quine to reappear.
14:25borkdudecallen that is basically how you use a deftemplate I guess?
14:25squidzcallen: what do you use for making sites instead of enlive?
14:25callentechnomancy: that doesn't surprise me that work there involves that amount of mucking about.
14:26callensquidz: usually Stencil, mostly because of refheap (raynes), but I've tinkered with fleet and been fairly impressed.
14:26technomancycallen: our platform is all based around HTTP applications, and I'm stuck maintaining an SSH-based app =(
14:26callenFleet is analogous to JSP for Clojure.
14:26amalloyhyPiRion: Raynes removed the timer because he is a spoilsport who thinks that a message every 16 hours is spammy
14:26hyPiRionUnless Raynes killed it.
14:26hyPiRionoh
14:26TimMcsquidz: http://clojure-log.n01se.net/date/2012-11-29.html#00:38
14:26squidzt
14:26squidzTimMc: thanks
14:27hyPiRionWell, I don't mind. Did he remove timers altogether?
14:27TimMcThat was my insight.
14:27technomancyI'm working on a replacement with HTTPS-based git, but HTTP really sucks for this kind of thing in a number of ways
14:27hyPiRion$timer 0:0:1 foo
14:27lazybotTimer added.
14:27lazybotfoo
14:27TimMcmuahaha
14:27callen"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." --Brian Kernighan <--- this applies to Enlive.
14:27technomancynot the least of which being lack of support for client-side SSL certs
14:28callendnolen: you are the guy behind core.logic/match, nobody expects you to find things like that difficult.
14:28TimMcamalloy: If he had removed timers altogher, I'd stage a civil disobedience action by tossing clojurebot a lazybot-flooding command.
14:28hyPiRionecho Gotta love echo
14:28borkdudeI like enlive, only more examples would be welcome.
14:28callendnolen: nevertheless, I have things I want to make. I'd like to make them in Clojure rather than Python. Sadly the state of templating on Clojure makes a compelling argument for not using Clojure. I'm not the only one who feels this way.
14:28hyPiRionOh, he removed that one. Smart guy.
14:28dnolencallen: a lot of people seemed to enjoy my old tutorial - http://github.com/swannodette/enlive-tutorial
14:29dnolencallen: I think the primary issue is the lack of more good documentation and example usages
14:29callendnolen: I am of course familiar with it, as I followed along with it when I originally tried to learn Enlive.
14:29callendnolen: no, I'm sorry but it's really not. It's a fundamental property of the design.
14:29TimMcdnolen: It didn't help me, but I haven't gotten my own understanding tight enough to write my own tutorial. :-P
14:29Ember-I know this isn't exactly about templating in clojure, but we are currently super happy in using clojure+noir+angular.js combo
14:29lazybotGotta love echo
14:29callendnolen: performing whole comprehensions/transformations of the HTML is unnecessary and complecting HTML markup with data injection is insane.
14:29TimMc(inc lazybot)
14:29lazybot⇒ 11
14:29TimMcEmber-: Shouldn't you be using ember.js? ;-)
14:30dnolenTimMc: callen: heh fair enough, I tried my best to explain.
14:30Ember-development is super speedy, it's ridiculous how much you can achieve with so few lines of code and it's SPA all the way
14:30callenEmber-: I'm considering side-stepping the insanity of templating by making it a 100% single-page-app
14:30technomancyhiccup forces you to be disciplined about not mixing logic and presentation, but is that really too much to ask?
14:30hyPiRionWow, was lazybot in the kitchen when I echoed or something?
14:30Ember-TimMc: hehe, true that. But it's inferior imho :)
14:30Ember-callen: go for it
14:30Ember-I've done 100% SPA stuff for 2-3 years now
14:30technomancyall that practice clojure devs have separating side-effects from functional values helps
14:30Ember-ain't going back without a good reason
14:30TimMcI hate single-page apps.
14:30callenEmber-: I just resent being forced to do so. I don't believe in 100% SPA or 100% server-side.
14:31callenEmber-: I also don't like that in 100% SPAs how much work I have to do to make it behave like a normal webapp
14:31TimMcMaybe with a proper history mechanism...
14:31callenso that it doesn't break user expectations
14:31joevandykhas anyone done any work with postgresql returning json to clojure? seems like it might be a natural fit.
14:31callenTimMc: that exists bro
14:31dnolencallen: perhaps, but different projects have different needs. Enlive does make getting pure CSS and HTML from designers feasible. You have Hiccup at the other end of the spectrum of designs.
14:31Ember-callen: like a "normal" webapp?
14:31Ember-huh?
14:31TimMcEmber-: <a href...>
14:31TimMchistory
14:31technomancyjoevandyk: I think that would depend on the underlying jdbc driver
14:31tbaldridge(inc dnolen) I don't linke enlive much but that feature is hard to beat
14:31Ember-TimMc: those are done by the spa libraries
14:31Ember-for you
14:32technomancyjoevandyk: when I looked into hstore (a similar feature to json) the JDBC support was really half-baked
14:32technomancyhaven't tried json yet because IIRC heroku postgres doesn't have it yet
14:32callendnolen: I understand fully why people like Enlive, but it's not appropriate for working on webapps where you have a frontend guy.
14:32borkdudewhat the heck is a SPA webapp? a single page application web application?
14:32Ember-I built one myself actually, unfortunately proprietary
14:32Ember-borkdude: hehe, nitpicker
14:32callenborkdude: JS-driven navigation, history, templating, state transition web app.
14:32TimMcSWPA
14:33TimMcsingle world wide web user-agent page view application
14:33Ember-borkdude: but if you did not actually know SPA then think it as fat client on browser
14:33dnolencallen: sure, I agree it's not applicable in many cases.
14:33borkdudeEmber- I have tried GWT for a while, so I think I know what it means … (yikes)
14:34Ember-no, GWT is not SPA
14:34callendnolen: for someone who's mostly trying to build web apps, that's most cases.
14:34squidzand some of you have made SPAs in clojure?
14:34callenborkdude: ...no.
14:34Ember-and it's bad. Cool hack, but bad
14:34Ember-squidz: \o
14:34Ember-but using plain javascript, not clojurescript
14:34borkdudewell GWT generates a single page application
14:34callensquidz: SPAs aren't all that special when it comes to backend. You're mostly kicking around JSON.
14:34squidzEmber-: why not clojurescript?
14:34callensquidz: the frontend is usually the more interesting part.
14:34joevandyktechnomancy: that's too bad :(
14:34Ember-squidz: learning clojure still, babysteps :)
14:34callensquidz: because you lose convenient access to a lot of really nice libraries.
14:34Ember-and that
14:34callensquidz: using JS libraries from CLJS can be really irritating.
14:35callenthat's why JayQ exists.
14:35technomancyjoevandyk: that was over 6 months ago though; maybe it's gotten better
14:35dnolencallen: I've worked on projects where there is no front end person, just designs in HTML/CSS. So it doesn't work in your experience. But perhaps it works in other people's experience. In anycase, not worthy of extended discussion.
14:35callendnolen: I'm just so tired and frustrated with the state of templating being so utterly broken that it shifts the pragmatic decision back over to using Python for my projects.
14:36TimMccallen: I still want a pony that can generate markup either on the client or server, depending on whether JS is enabled on the client.
14:36callenI hate that I can't reasonably choose to use a great language because batteries aren't included for a critical component of making a web app.
14:36Ember-use angular? :) Not that I weren't a fan of separation of concerns in layout and templating logic
14:36callenTimMc: I could think of a few ways to go about that. The JS enabled thing is rough though. noscript on the client means you'd be doing an image load callback or something which is effin' weird.
14:37Ember-wicket has a great idea, not a fan of wicket and it's hugely verbose way of doing things (plus it's trying to do too much, contain state in backend)
14:37Ember-but the component mapping to html is great in it
14:37callenI don't want anything that involved, complicated, or holistic.
14:37Ember-similar and elegant solution to clojure would be awesomesauce
14:37squidzwicket is all ive use so far but i actually like it
14:37technomancyRaynes: how's that enlive-like lib coming anyway?
14:37callenI want a template library made by somebody who seems to have experience with writing web apps for a living.
14:37technomancycallen: ^
14:38squidzjust seems very Object-Oriented
14:38solussdenlive works wonderfully for me working with our front end guy. I "fill in the blanks" with enlive.
14:38solussdi cant imagine anything better than "pure html" templates… I hate most templating languages
14:38Ember-callen: I hear your pain and suffering. Unfortunately I don't see the need anymore with advanced client side templating libraries
14:38Ember-or well, if you need to support browsers without javascript
14:38TimMccallen: image load callback? I just mean render the whole page on the server side on first load, then incrementally update the page via either client or server rendering when I capture clicks.
14:39borkdudeEmber- what does this component do?
14:39craigbro switches from enlive to jsoup
14:39Ember-borkdude: could you elaborate?
14:39craigbroenlive is sloooooooow for large tempaltes
14:39callenTimMc: you'd want this to be holistic I take it?
14:39Ember-what component
14:39callenhttp://jinja.pocoo.org/ <--- first example. That's how template inheritance, overrides, loops, and map/dictionary data access work in Jinja. Enlive and Hiccup do not compare favourably.
14:39borkdudeEmber- from wicket
14:39ivanis there a better way to define step functions than condp <=?
14:39Ember-borkdude: ah
14:39craigbroJsoup can do many of the same things, and I can avoid the cost of converting eveything from java objects to vectors
14:40Ember-component is a core concept in wicket, it can do pretty much anything
14:40Ember-it can populate text for example into <p> or any html tag
14:40dnolencallen: to be honest, it's a known issue. I had a chat w/ Jen Myers (who works at Relevance) at the Clojure Conj. Clojure's web story as far as gracefully integrating w/ modern front end dev practice is still evolving.
14:40callenIt's all simple, it works how you expect it to, no crazy CSS-reach-in, no need to touch backend.
14:40Ember-or it can contain it's own html snippets
14:40squidzfor me wicket is kind of like developing a swing/swt app
14:40Ember-and stuff like that
14:40Ember-squidz: it is, but it has a huge problem
14:40Ember-1) java and it's verbosity with anonymous classes
14:40ibdknoxcallen: https://github.com/weavejester/comb
14:40dnolencallen: fingers crossed she gives a talk about this at Clojure/West, it's an important topic
14:41callendnolen: I've talked to the author of another template library about it, he's thinking about a potential equivalent to something like Jinja.
14:41Ember-2) it's trying to do too much: it contains the UI state at server side in HTTP session
14:41callenibdknox: looks a lot like Fleet. Thanks for sharing this!
14:41Ember-and due to this it has a LOT of magic under the hood which will bite you in the leg sooner or later
14:41ibdknoxcallen: it is *much* better than fleet
14:41Ember-pretty much the same as Hibernate
14:41squidzEmber-: Ember- yes I dont like #2
14:41borkdudeEmber- is that like webforms in ASP.NET?
14:41callenibdknox: oh, just wondering, what does it do better?
14:41ibdknoxcallen: the impl is like 60 lines
14:42ibdknoxcallen: it's very fast
14:42Ember-borkdude: not familiar with webforms
14:42Ember-borkdude: http://wicket.apache.org/learn/examples/
14:42Ember-you can view the source code from those
14:42callenibdknox: the real question is, what would it take to build this up to something appropriate for writing templates for a web app.
14:42callenibdknox: looks really promising.
14:42Ember-it's overly verbose and I don't like it
14:42callenseems like you'd still need to build up the machinery for things like template inheritance, injection, overrides, etc.
14:42Ember-I mean, we have this search functionality in our app with clojure+angular
14:43squidzEmber-: wicket makes doing ajax pretty simple though. Ive never done ajaxy stuff outside of wicket, but I needed zero experience to get ajax enabled components up and running
14:43ibdknoxcallen: you have the full power of clojure, you'd just need a couple convenience functions for those things :)
14:43Ember-we have a fully functional search from 3rd party API to browser with less than 20 lines of clojure, 15 lines of javascript and 15 lines of HTML
14:43TimMcivan: "We're sorry, #clojure is currently closed for our monthly templating argument. Please leave a message and we'll get back to you when we return. *beep*"
14:43craigbrooi
14:43ivanTimMc: no problem ;)
14:44callenibdknox: yeah I think I might give this a whirl. Thank you very much.
14:44Ember-3rd party server takes in a HTTP request, returns XML
14:44technomancy(inc TimMc)
14:44lazybot⇒ 23
14:44technomancy
14:44callen(inc TimMc)
14:44lazybot⇒ 24
14:44ibdknox(dec
14:44ibdknox(dec TimMc) ; #Clojure is not a place for humor :p
14:44lazybot⇒ 23
14:44TimMchaha
14:45TimMcI mean
14:45ibdknoxalso your karma is getting too high. Gotta take you down a peg ;)
14:45TimMc"Yes sir."
14:45TimMcI would never laugh in #clojure.
14:45craigbroguffaw?
14:45mdeboardThis is very serious business.
14:45amalloywe need a movie-preview announcer's voice to narrate the upcoming KARMA WARS
14:46pjstadig"In a world were karam is the most valuable commodity..."
14:46ibdknoxhaha
14:46squidzEmber-: so you said you were using fleet mostly right?
14:46hyPiRionSay I have the following form: (let [a (foo ?a?)] a). What is the idiomatic way of getting ?a? to point to a here?
14:46TimMcivan: Is your step function returning existing values, or is this more of a control flow thing?
14:47Ember-squidz: fleet? not familiar
14:47squidzEmber-: sorry, what do you normally use instead of enlive?
14:47squidzEmber-: ah right, you come from javaland?
14:47Ember-we use enlive for XML parsing
14:47Ember-yes, been working in a real project with clojure a bit over two weeks now
14:47ivanTimMc: existing values
14:47Ember-before that, just random hacking
14:48Ember-nothing even remotely serious
14:48amalloyhyPiRion: wat?
14:48ivanTimMc: it just seemed like a common thing that should exist in some library rather than as code generated by condp
14:48borkdudejust println to the HTTPServletResponse's outstream guy's, who needs static html files anyway.
14:49Ember-squidz: ok, fleet looks like a templating library. No, we use angular.js
14:49Ember-and it's templating
14:49Ember-simple, efficient. But does not separate layout from templating
14:49TimMcibdknox, callen: comb doesn't have any facility for output escaping. o\__/o
14:49Ember-but it does it's templating with style (although I'm not very happy with all the curly braces)
14:50ibdknoxTimMc: I'm pretty sure with a 60 line codebase it could be added trivially :p
14:50bbloomivan: how about (some pred vector) where vector is a vector of [threshold value] pair or something like that, and pred checks the threshold
14:50bbloomivan: some returns the first item to match the predicate
14:50TimMcI can't believe people are still writing templating libs that are not XSS-safe by default.
14:50Ember-I really should try LightTable in our project
14:50bbloomor you can do (first (filter ...)) to be clearer
14:50Ember-have been mostly using the instarepl in it
14:50Ember-ibdknox: which is awesome :P
14:50ivanbbloom: thanks. I'll give that a try.
14:50callenTimMc: fuck it, XSS doesn't even real.
14:51TimMc...
14:51eggheadxss safe ? like what -- xss is a lot more than just escaping <>
14:51callenTimMc: well gee willikers we wouldn't be considering using such evil stygian tools like eval'ing unescaped strings all over the place if we had decent template libraries...
14:52TimMcOh... kay...
14:53hyPiRionamalloy: nevermind, I think I'll have to work with Y-combinators to make this work
14:53llasramcallen: OOC, since you have strong opinions about how templating libraries should work, are you developing one?
14:53TimMcegghead: I don't mean such as stopping people from doing eval(location.hash.substring(1)) -- just basic context-aware escaping.
14:53TimMcOr even just plain ol' escaping by default.
14:53callenllasram: I'm awful at parsers. I actually said this to the author of Stencil, who's already planning to make the sort of template library I have in mind.
14:53Ember-callen: write your templating with clojure :)
14:53Ember-lisp is trivial to parse
14:53callenllasram: but until he does, I'd like to convey my suffering to the rest of you.
14:54callenEmber-: that's called Hiccup.
14:54hyPiRionamalloy: I realised that I was asking how I could pass the result of a value as a parameter to the function call which realized the value
14:54Ember-callen: yup
14:54Ember-but do it the way you like it :)
14:54callenThat...is not what I have in mind.
14:54hyPiRionSince Clojure can't send unbound variables, that's rather hard.
14:54callenEmber-: http://jinja.pocoo.org/ I want this.
14:54jkkramercallahad: https://github.com/sjl/dram - release date TBD
14:54Ember-callen: no offense, but that looks horrible to me :)
14:55Ember-just what I *don't* want to use
14:55jkkrameroops, callen ^^
14:55ro_stwhat's wrong with Hiccup?!
14:55callenEmber-: well, Jinja and Django templates have suited many projects for me for the last 4+ years.
14:55TimMchyPiRion: Go on...
14:55callenjkkramer: I know about Dram. I'm just kinda hoping Losh picks it back up.
14:55Ember-callen: I understand and not saying that it wouldn't work
14:55callenjkkramer: if he doesn't, I'll have to wait on Santiago.
14:55hyPiRionI don't know if there's more to discuss, heh
14:55TimMchyPiRion: I smell a code horror, and I want to know more!
14:55bbloomthe reason there are 39385935 templating languages is because there are lots of different use cases and many people haven't explicitly stated their use cases and design goals
14:56Ember-but you previously said you'd like a templating library for clojure which has been developed by a guy doing web apps for living
14:56Ember-well, I do web apps for living and I wouldn't desing a templating system like that
14:56Ember-it's a matter of taste which is good
14:56callenjkkramer: the last commit was, "Basic template file loading!"
14:56bbloomif you want a template language for designers, than maybe django/jinja is a reasonable choice
14:56callenjkkramer: very encouraging.
14:56bbloomi've never worked with a designer smart enough to figure out django templates, but dumb enough not to be able to learn HAML
14:56bbloomi figure they could learn hiccup to
14:56bbloomo
14:57hyPiRionTimMc: Okay, it's basically like this: Create a recursive merge function by calling e.g. merge-with
14:57callenbbloom: there's a *lot* to Jinja that makes it my template lang of choice.
14:57callenbbloom: not just that a designer can use it.
14:57bbloomcallen: like what?
14:58hyPiRionTimMc: So (fn [& r] (apply merge-with merge r)) would merge two levels only.
14:59callenbbloom: registering template filters and custom tags for extending the functionality to match your use-case without repetitiously processing the data on the backend logic, template extension, overrides, and injection that actually work really well to eliminate duplicate logic/markup, syntax that is both simple and easy and doesn't break down once you hit a moderately complicated use-case, good separation of frontend/backend in terms of markup/layout an
14:59borkdude"Clojure html templating libraries: the grand tour", free blog post idea =)
14:59hyPiRionTimMc: That's solved through (fn rec [& r] (apply merge-with rec r)) usually, but I can't do that since I'm calling a function which expands that fn
14:59callenborkdude: it'd just be me walking around with a baton, pointing at things and going, "so this sucks...this sucks too. Oh yeah, that definitely sucks."
14:59hyPiRion/s/fn/fn-form/
15:00ro_stborkdude, callen: it'd be interesting if you included _why_ it sucks
15:00borkdudero_st probably because it's not ninja, like clojure is not common lisp
15:00callenro_st: I could talk for weeks about why 99% of templating libraries are awful.
15:01ro_sti don't doubt it.
15:01callenfor the record, I hate CL-WHO too.
15:01bbloomcallen: every single one of those use cases can be more directly accomplished via functions. jinja reifies particular signatures of functions into particular convinenent syntaxes. but if you're a programmer, you should be just fine writing normal functions....
15:01callenbbloom: you're missing...the damn point.
15:01callenbbloom: I'm not always writing the templates
15:01callenbbloom: most projects are not one dude.
15:01callenbbloom: I need to make the template filters and tags *ahead of time*, in the backend code, register them with the template handler, THEN let the designer use what I created
15:01bbloomcallen: which is exactly what i'm saying: if you have non programmers on your teamwriting templates, then you've got a justification for using jinja
15:02bbloomand you told me that wasn't the reason :-P
15:02callenbecause if I don't do that, it'll end up in JS somewhere.
15:02callenbbloom: I said that wasn't the only reason.
15:02callenbbloom: there's a lot about Jinja that makes my life simpler as a lone programmer, but it's positively critical when I have a frontend guy.
15:02TimMchyPiRion: So how does this end up with you trying to pass around unbound vars?
15:03callenreplicating even the simple example here: http://jinja.pocoo.org/ would take way too much work in Hiccup and Enlive.
15:03callenyou could get sorta close in Stencil, but it'd be laborious and involve {{{ }}}
15:03clojurebotCool story bro.
15:03hyPiRionTimMc: I have a function foo which takes a function and returns a function, I want to pass the returned function as the argument function.
15:04hyPiRionHence the fun.
15:04ro_stcallen: why do you want a mix of html and something else?
15:05callenro_st: https://github.com/sjl/dram#why
15:05callenro_st: just read the "why".
15:05ro_stthat, imho, is why 99% of TLs suck. they get soupy even with trivial examples
15:06Ember-callen: I know it is client side, but with angular.js those examples are less verbose, more like normal HTML and very designer friendly
15:06devinuswill 1.5 have a PersistentQueue literal?
15:06Ember-if you really need server side templating then it's of course off limits
15:06hyPiRionI mean, (fn bounce [args] (apply (foo bounce) args)) works, but it's hairy and computationally heavy.
15:06hyPiRionOr not hairy, but I don't know if it's idiomatic.
15:06dnolenhmm what's the dynamic var in Clojure that you can check for AOT compiles?
15:07callenhyPiRion: apply is pretty bad in Clojure.
15:07tomoj*compile-files*
15:07callenEmber-: I'd like to avoid resorting to an SPA if possible.
15:07tomojI think you mean?
15:07hyPiRioncallen: Slow you mean?
15:07dnolentomoj: yes, that's it thanks.
15:07Ember-callen: I can appreciate that if you have a good reason for that
15:07callenhyPiRion: why not.
15:07Ember-but in my experience SPA is way better than traditional
15:08callenEmber-: because I've done 100% SPAs before and it turned into a mess for usability and accessibility.
15:08Ember-even if you have to tolerate javascript and it's quirks
15:08callenstandard web apps are better unless you have something very specific going on.
15:08callenI don't mind JS.
15:08eggheadcan anyone who is familiar with carmine (the redis client) explain this to me? https://www.refheap.com/paste/7703 is it just that with-redis (wcar) only makes one trip to redis?
15:08Ember-callen: ok, well. No offense but someone in your team did not know how to build SPA then :)
15:08hyPiRioncallen: I think I lost you there
15:08callenEmber-: maybe so.
15:08Ember-the largest SPA project I've done had over 40kloc of javascript in it
15:08callenhyPiRion: just benchmark it, you'll see what I mean very quickly.
15:09Ember-and hundreds of thousands of lines of java code in the backend
15:09TimMccallen: How about you *explain* what you mean.
15:09hyPiRioncallen: Oh, I know it's slow. That's not the issue here though
15:09Ember-it was quite manageable, had great performance and usability
15:09hyPiRionI just wonder what's idiomatic to do.
15:09callenTimMc: as soon as somebody makes a template library that doesn't make me want to take the protesting buddhist monk way out of life with a bucket of gasoline.
15:09creaseI'm having trouble with cl-format… shouldn't (cl-format nil "~2@* ~D" 1 2 3) give you " 3"? I'm getting " 1"
15:10hyPiRion,(require '[clojure.pprint :refer [cl-format])
15:10clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: )>
15:10TimMccallen: Yeah, I'm not in that discussion anymore, sorry.
15:10hyPiRion,(require '[clojure.pprint :refer [cl-format]])
15:10clojurebotnil
15:10hyPiRion,(cl-format nil "~2* ~D" 1 2 3)
15:10clojurebot" 3"
15:11Ember-callen: well, fortunately for you someone is making that Jinja version for clojure
15:11callenI didn't know people actually wanted to use cl-format.
15:11callenEmber-: if you mean dram, he hasn't worked on it in awhile.
15:11Ember-fork and pick up it and finish the work?
15:11callenEmber-: Clango is in a similar state.
15:11callenEmber-: I'd end up replicating the work Santiago wants to do. I'd rather not trip over him, he has more experience writing template libraries.
15:12Ember-lure the original Jinja developers to the Clojure side? :)
15:12callenactually, Mitsuhiko is a good target for that
15:12callenhe's been pissed about Python 3 for awhile.
15:12Ember-go for it
15:13Ember-I really mean it
15:13hyPiRioncrease: huh, I think I need to read the docs
15:13callenEmber-: I already asked him in #flask.
15:13hyPiRion,(cl-format nil "~D ~0@* ~D" 1 2 3)
15:13clojurebot"1 1"
15:13hyPiRion,(cl-format nil "~D ~1@* ~D" 1 2 3)
15:13clojurebot"1 2"
15:13hyPiRion,(cl-format nil "~D ~2@* ~D" 1 2 3)
15:13clojurebot"1 1"
15:13hyPiRionEither that, or this is not working properly.
15:15hiredmanwin 15
15:15creasehyPiRion: yeah, maybe it's a bug… the doc says ~2@* is an absolute goto to the third argument. Maybe I'm missing something tho. It's a kind of scary doc.
15:16devinustechnomancy: do you use elein at all?
15:17hyPiRioncrease: yup, it's a bug. SBCL, clisp and clozure gives "1 3" for the last one there
15:17hyPiRionI'll check JIRA for bugs
15:18callendevinus: pretty sure he lives inside a perma-running lein terminal for that.
15:18callendevinus: so, "no"
15:18devinuscallen: that's what i figured
15:18callendoes explain why the lein command mode thingy exists though. He made it for himself, haha.
15:19devinusi'm trying to figure out the latest emacs/clojure stuff, trying to figure out the difference between clojure-mode and clojure-test-mode
15:19devinusthen there's clojure-project-mode
15:20creasehyPiRion: thanks! and appreciative clicking noises for firing up those languages. I don't see it in JIRA...
15:21zerokarmaleftwhat does clojure-project-mode have that clojure-mode doesn't cover?
15:22carkhum this FXML thing in javafx feels a bit half-assed
15:23devinuszerokarmaleft: no idea, trying to figure that out
15:24devinusthen there's cljdoc
15:25devinusi need technomancy's technomastery me thinks
15:25hyPiRioncrease: I tested it with 1.5.0-beta2, and it's still there. Want me to add a ticket for it?
15:26hyPiRionIt's either me or you.
15:26callendevinus: it's 12:18 pm in the bay area, he's probably at lunch.
15:27devinuscallen: good call
15:28callendevinus: not really. I noticed I was hungry. I'm in south bay.
15:29hyPiRioncrease: I'll add a ticket if you don't mind.
15:29devinuscallen: i'm guessing the bay area is the only place to get jobs that let you work with Clojure these days? :P
15:30craigbrodevinus: we're hiring, remote workers too
15:30craigbrooh, sorry, didn't detect your sarcasm
15:30clj_newb_2345what is the most robust (i.e. not adhoc) way of getting the maybe monad inside of clojure?
15:30clj_newb_2345(I'd like to use it together with map)
15:31Ember-devinus: I live in Finland and I am working on a Clojure project
15:31Ember-pretty far away from the bay area :)
15:31devinuscraigbro: half-sarcasm. i've looked around the austin area for people doing Clojure stuff
15:31devinushaven't seen much
15:31matthavenerdevinus: i think mass relevance does some clojure
15:31matthaveneror scala
15:32callendevinus: basically, yes, but I don't get to work in Clojure. I can't convince my boss the community has good templating libraries.
15:32Ember-and push your own organization to clojure?
15:32Ember-that's the way we started to use it
15:32Ember-internal evaluation after developers brought it up
15:33Ember-still baby steps, only 2 projects using clojure currently out of maybe 70 but the way we are progressing and just Getting Things Done(tm) I have a good feeling that more clojure projects will be coming...
15:33callenI'm considering evaluating Scala/Play for a project since the template story there is pretty good.
15:33ivanhttps://github.com/clojure/algo.monads/blob/master/src/main/clojure/clojure/algo/monads.clj#L354 <- would an explicit Just/Nothing make little sense in Clojure?
15:34devinuscallen: wait, is it really templating holding you back? i thought you were being sarcastic
15:34clj_newb_2345ivan: defmonad looks like a macor worth undersstanding
15:35callendevinus: it'd sap too much productivity to justify using Clojure. It tips the scales in favor of using Python or Scala.
15:35callendevinus: it's that bad.
15:35craigbrocallen: really? Mazel Tov
15:35Raynescallen: I think that if it is really that if you need django, chances are django is your best option.
15:35craigbroas if templating was a ahrd problem worthy of more than, oh, i don't know, 50 lines of code
15:36callenRaynes: I have a forthcoming project that will require a more...industrial language than python.
15:36callenRaynes: I'd like to have a few projects down before that happens.
15:36craigbroRaynes: agreed actually.
15:36RaynesI haven't had your problems with templating.
15:36callenRaynes: you use Stencil.
15:36RaynesWe obviously have different needs.
15:36callenRaynes: it's your git repo that I use to guide working with Stencil when I *do* make things in Clojure
15:36RaynesBut the constant shitting on of all the templating libs is getting a bit old, no offense.
15:37callenRaynes: but just because I was able to get it done, does it mean that it's a sensible choice wrt productivity.
15:37RaynesThe biggest problem I see is that nobody has finished that one you linked too a few days ago.
15:37devinuscallen: what are you looking for exactly? DTL in Clojure?
15:37callenRaynes: Santiago (Stencil author) sees the same problem I do.
15:38callenRaynes: he's just less vocal about it.
15:38callendon't act as if I'm some crazy man from the mountains who alone sees this problem.
15:38Ember-callen: I hear you!
15:39Ember-throw clojure at HTML/CSS guy's face and he'll punch you
15:39RaynesI'm not disagreeing with your desire for such a thing, just that we don't need to be so angry at the existing templating libs. Lots of people like them and use them, and lots of people put lots of work into them. They work really well for most people. I wrote one myself. You just want something different which is totally understandable.
15:39RaynesEmber-: Hiccup isn't the only templating lib he is talking about.
15:39Ember-yeah I know
15:40callenRaynes: if you know a better way to spur the development of something legitimately appropriate for building a web app with other people, I'd love to hear it.
15:40RaynesI think you're missing my point completely.
15:40callenI didn't know you had one, save to complain about my complaining.
15:40RaynesOkay.
15:40RaynesI should have known better.
15:41callenI asked for an actionable improvement to my approach, you demurred. That leaves me with no way to understand what you want to achieve.
15:41brehautcallen: shitting on developer set A does not cause people in developer set B to think 'oh! i'd like develop an alternative' it causes them to think 'glad im not getting shat on right now'
15:41ivanI'm looking at enlive for the first time and completely befuddled by why I would load some existing HTML and manipulate it in another file with some Clojure
15:41callenLOL ^^ you know what? I don't even need to say anything. I'll just let the truth speak for itself.
15:41ivanI guess I'll have to play with hiccup and see where the brick wall is
15:42HolyJakRaynes: Your point seemed to by quite clear to me, though :-) Don't fall into dispair.
15:42Raynesbrehaut: Your IRC client has an ignore feature designed specifically for trolls.
15:42RaynesExercise it.
15:42brehautRaynes: it does, but it comes unstuck
15:42devinusi think there's plenty of room for a logic-ful (as opposed to a logic-less like Stencil) templating lib for Clojure
15:42devinusis there not?
15:42RaynesSure.
15:42callendevinus: there's a great one called http://jinja.pocoo.org/
15:42callendevinus: just need a Clojure version.
15:43Raynesdevinus: Something like jinja would be great for Clojure.
15:43brehautdevinus: why not just use a java library in that case? there are heaps of options
15:43devinuscallen: right
15:43devinusyeah, or not even like jinga
15:43hyPiRionwoa, you guys are still going on with the template discussion? It's been 90 minutes.
15:43dnolenhaha
15:43devinusthe language it uses could be clojure-inspired
15:43dnolenhyPiRion: my thoughts exactly
15:43Raynesdevinus: But that doesn't mean we should shit all over the existing libraries that other people have made. But that appears to be callen's motive.
15:43devinusinstead of jinjaish
15:43callenI don't *really* want to talk about Enlive
15:43devinusRaynes: i must have missed a lot of previous context :P
15:43callenI want something better to crop up.
15:44Ember-callen: please use term "different" instead of "better" to keep this civil
15:44callenthey ignored me anyway, but noted.
15:44Ember-you're stabbing someone's baby the way you are going with your argument
15:45Raynesivan: I wrote a lib similar to Enlive that does that too (laser). It's simply a way of transforming HTML using selectors instead of markers in code such as you would do with mustache. Also, if you use hiccup your HTML is written in a Clojure DSL that a designer probably can't read or want to mess with.
15:45Ember-the father of that baby won't be happy
15:45devinusthis honestly shouldn't be too hard. i've worked on erlydtl for erlang and written my own mustache libs before. a clojinja would be relatively easy i think
15:46m0smithI chose stencil for just that reason: a designer needs to be able to work with it as well
15:46callenthe revolution begins! /me cackles
15:46brehautm0smith: my expiernece is designers are entirely capable of working with plain HTML too :P
15:47hyPiRiondevinus: Well, it's great news that it shouldn't be too hard - an even better reason for you to create your own solution :)
15:47Raynesivan: The point is to keep your code separate from your logic. Does that make sense?
15:47devinushyPiRion: yes :P the only problem is i'm on page like 160 of JoC
15:47m0smithbrehaut: They ceratinly are but clojure data structures are a bit of a stretch
15:47ivanRaynes: yeah, but I have the need to see some rendering logic with the HTML structure
15:47joevandykanyone find rendering html templates to be a bottleneck ever? i found that happened a lot with rails
15:47hyPiRiondevinus: don't stop ;)
15:47brehautm0smith: enlive does not use clojure data structures for templates. it uses plain HTML.
15:48joevandyk(possibly it was related to slow view helpers and route generation)
15:48Raynesivan: I'll be rewriting refheap's views with laser soon. Keep an eye out.
15:48brehautm0smith: that goes for a number of other libs too (tinsel, laser)
15:49ivanRaynes: cool, I'll check it out
15:49callenivan: it's like Enlive
15:49brehaut"i dont understand how to use X" is not the same as "X is bad". Nor is it a condemnation of anyone not understanding X.
15:50callenthere is such a thing as understanding just fine, but being horrified nevertheless. Of course it's a lot easier to think your position is tenable if you assume all who don't share it are ignoramuses.
15:51m0smithbrehaut: Yes I see what you mean. I prefer the mustache metaphor as it gives the designer a wider range of options without breaking the clojure coe
15:51m0smithcode
15:52m0smithfor example [:p#message] can be frgaile if the designer decides to not use the <p>
15:52brehautm0smith: do take the time to look at a transformational templating system though. its a different formulation of that idea where the designer _only_ worries about html and css etc, and doesnt concern themselves with population at all
15:53m0smithbrehaut: do you have a link? The stuff I am seeing is just some tutorials
15:53brehautm0smith: no more fragile than passing a map of keys through to the designer. you need to have some sort of interface/schema between the two sections of code nomatter what the soliution you use is
15:53Raynesm0smith: I had someone give me that exact same argument a few days ago, and it seems valid enough.
15:54Raynesbrehaut: I think the point is that with tags you can change what they are without breaking anything in a lot of cases, whereas laser and friends all require an exact DOM structure in order for them to work reliably.
15:54RaynesWell, not exact.
15:54m0smithbrehaut: True. It just seems easier for our designers to leave the key names in tact
15:54RaynesBut still.
15:55brehautm0smith: theres two tutorials. both are somewhat hard slog, but give them a crack. the actual documenation for enlive is somewaht mind boggling when you dont know enlive already.
15:56brehautRaynes: i understand that.
15:56gtrakmeh... there are java template libs, too... clojure ones implement java.util.Map
15:56gtrakclojure maps*
15:56brehautgtrak: exactly.
15:57m0smithbrehaut: It feels a bit like JQuery for clojure
15:57m0smithI like JQuery so that is not a slam (BTW)
15:58brehautm0smith: there are parallels
16:00gtrakcallen: does something like this float your boat?
16:00gtrakhttps://developers.google.com/closure/templates/docs/helloworld_java
16:03brehautgtrak: i've also heard that StringTemplate can be pretty good. (and stupidly fast)
16:03gtrakI even found the map line for you: http://code.google.com/p/closure-templates/source/browse/trunk/java/src/com/google/template/soy/tofu/SoyTofu.java?r=21#131
16:03gtrakbrehaut: I hated it when I tried to use it for even a toy program
16:03brehautgtrak: hah ok
16:03gtrakI can show you an integration though
16:04brehautsure
16:04gtrakhttps://github.com/gtrak/garytrakhman.com/blob/91813c7d0b6206e2821aadbf2b47c18135d5a6e1/src/garytrakhman/stview.clj
16:05gtrakthere's some extra bits like associating a JS file per view... I couldn't make myself happy with it though
16:05gtrakthe variable scoping's a huge pain
16:06devinusi know there's a condition-restart lib for clojure
16:06devinuscan anybody remember what it is?
16:07technomancydevinus: error-kit, but I don't think it's recommended
16:08devinustechnomancy: there was nother one too
16:08devinusanother*
16:08creasehyPiRion: ticket's a good idea, thanks
16:09devinustechnomancy: also you're back!
16:10gtrakhere's the bit in closure-templates that takes a map, anyway: http://code.google.com/p/closure-templates/source/browse/trunk/java/src/com/google/template/soy/tofu/SoyTofu.java?r=21#131
16:10devinustechnomancy: i have some clojure/emacs questions for you. your talk on leiningen inspired me
16:10devinustechnomancy: can you tell me what the clojure-project-mode does that clojure-mode doesn't?
16:13zerokarmaleftdevinus: https://github.com/psyllo/emacsenations, i don't think technomancy authored clojure-project-mode
16:13technomancydevinus: never heard of clojure-project-mode
16:13devinusah, it seems it extends project-mode
16:14devinusthere's also cljdoc
16:14technomancyI use ,,find-file-in-project for larger codebases
16:14technomancyoh wait, this isn't #emacs; no fsbot
16:14devinustechnomancy: i have find-file-in-project installed after your endorsement
16:14technomancyanyway, I think most of the project stuff around emacs is kind of silly; the only thing I need is scoped file opening
16:14zerokarmaleftfrom a glance, it looks like it does some project-wide string searching and source-file/matching-test-file navigation
16:15technomancyI highly recommend using M-x rgrep (or rgrep from eshell) for searches
16:15technomancywhen you can't use M-.
16:15technomancyclojure-mode has some functionality for jumping between implementation and test, but it's not great
16:15technomancyI wish he would have fixed the existing implementation instead of creating a new one =\
16:17callengtrak: not at all. My boat sinks.
16:18gtrakha, it seems to me similar to django's
16:19callengtrak: you don't appear to have used Django much.
16:19gtraknope... http://www.jangod.org/
16:19gtrak'inspired by django'
16:20gtrakcan you tell I don't work with designers? :-)
16:20callengtrak: that's not what you linked me
16:20callengtrak: you linked me a different library.
16:20gtrakah, yea, that's what I found just now
16:20callen...
16:21callenthat's for java and java classes
16:21callenI need something that works with maps.
16:21gtrakI'm not sure why closure-templates doesn't match your requirements... but perhaps that does the trick
16:21callenNo.
16:34tpope(v/length-of :password :within (drop 5 (range)))
16:34tpopeis there a less obtuse way to write this?
16:35gtrak(->> (range) (drop 5) (v/length-of :password :within)) ?
16:35TimMcWhat does length-of do?
16:35TimMchaha
16:36amalloy(nthnext password 4)? like, i don't know about this crazy validation library, but checking that a seq is at least 5 elements long is not hard in normal life
16:36tpopeit's from validateur to check if a password is at least x chars
16:37gtrakerr... I want my validations as data!?
16:37tpopethe existing implementation has (range 5 20) and I was like "why enforce a maximum length"
16:37xeqi(numericality-of (comp length :password) :gte 5) ?
16:38technomancypartial <= 5
16:39gtrak(= 5 (count (take 5 my-seq))
16:39xeqiwonder if you could just pass (comp (partial <= 5) length :password) to the validation-set
16:39tpopexeqi that's what we're trying
16:40rbxbxxeqi: that would work except it doesn't adhere toe the contract of a validator fn
16:40xeqiah, not quite, needs to return a [boolean #{errors}] pair
16:40rbxbxneeds to do something like... yes
16:40technomancywait what
16:40technomancywhy not just check for an empty set?
16:41xeqitechnomancy: how would you fail without providing any useful info?
16:41technomancycan't tell if serious =)
16:42rbxbxtechnomancy could if not using a library, but in order to adhere to what validateur expects from validator fns...
16:42technomancyrbxbx: yeah, arguing against the larger design, not the suggestions here
16:43rbxbxtechnomancy gotcha.
16:43gfrederickswhy did lein/maven just say something about looking for a snapshot of thneed?
16:43gtrakgosh.. validation as a Domain seems ill-suited to a DSL
16:44gfredericksI don't see thneed anywhere in my deps tree
16:44technomancygfredericks: I thought I added an exclusion for that or something
16:44technomancynot sure
16:45rbxbxtechnomancy gfredericks that has happened to me many times.
16:46technomancyrbxbx, gfredericks: running lein from source?
16:46rbxbxyes.
16:46gfredericksno, just a regular installation
16:46rbxbxer
16:46rbxbx2.0.0-preview10
16:47hyPiRionI've seen it pop up from time to time, not sure whether it has been on the preview or master though
16:48gfredericksarrays in postgres: korma doesn't seem to handle them correctly on insert. Should I expect clojure.java.jdbc to be any better?
16:48gfredericks(specifically korma generates "(?,?,?)" when it ought to "{?,?,?}")
16:48technomancyok, so I think master has the exclusions in place for thneed though I don't recall the details
16:50xeqigfredericks: thneed snapshot was used in the latest trammel, which is used by some versions of lein-jacker, which is used be some plugins
16:50xeqiI'd guess it came from there
16:50gfredericksxeqi: okay, thanks
16:50hyPiRionTravis doesn't pick up thneed though, so I assume it's not from lein itself
16:51xeqifor example, lein-ring pulls it in sometimes
16:51tomojclojure.java.jdbc would generate neither "(?,?,?)" nor "{?,?,?}", would it?
16:51gfrederickstomoj: I don't know. What happens if you give it a vector as a value?
16:52xeqirbxbx: ^
16:52gfredericksI was about to try it out myself.
16:52rbxbxxeqi okay. Thanks.
16:52frozenlockGoing through the slime->nrepl transition... I used to be able to send some interesting info to my REPL using a simple `print' function while running an application. (For example, I could see any webhooks received). However `print' doesn't seem to be sending the output to the REPL. Am I mistaken?
16:52frozenlock(print in nrepl that is)
16:53moogatronicfrozenlock: you mean like (print "some string") ?
16:53technomancyfrozenlock: possibly different flushing behaviour? see if println is different
16:53moogatronicshould be appearing. Also there's a *nrepl-server* buffer that nicely captures log4j output
16:54carkfrozenlock: your print is hapenning in some other thread, where *out* is not bound
16:54llasramfrozenlock: When I print form other than the main REPL thread, I see messages go to the JVM process's stdout instead of *out*
16:55msamiryhello all
16:55frozenlockOh I see o_O
16:55carkfrozenlock: i usually define a function debug like so (let [o *out*] (defn debug [s] (println o s)))
16:55carktho i'm not sure about order of parameters on println
16:55msamiryplease I'd like to ask a question
16:55technomancy~anyone
16:55clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
16:56hyPiRionmsamiry: fire away!
16:56msamiryis there something in clojure like numpy.linspace
16:57TimMcWhat does it do?
16:57msamiryReturn evenly spaced numbers over a specified interval
16:58msamirynumpy.linspace(start, stop, num=50, endpoint=True, retstep=False)
16:58amalloy&(doc range)
16:58lazybot⇒ "([] [end] [start end] [start end step]); Returns a lazy seq of nums from start (inclusive) to end (exclusive), by step, where start defaults to 0, step to 1, and end to infinity."
16:58TimMcmsamiry: So, if asked for 3 numbers in 0..20, what would it give back?
16:58carkfrozenlock: look at this : https://gist.github.com/4332383
16:58TimMcamalloy: Not absolutely trivially.
16:59msamirynumpy.linspace(0,2,1000) will give a list of 1000 item between 0 and 2 evenly devided
16:59TimMcOh, not just integers?
17:00TimMcThen range could work after all -- although you'd want to watch for error propagation.
17:00gtrakcark, if it's in a different thread, send the message to an agent or something
17:00TimMc*accumulation
17:00carkgtrak: this is quick and dirty debugging
17:00msamiryno not just integers
17:00hyPiRion,(range 0 2 (/ (- 2 0) 4)) ; not correct, but going there.
17:00clojurebot(0 1/2 1N 3/2)
17:00carkgtrak: if you want something serious, use a logging tool
17:00gtrakcark: future's quicker
17:01gtrakand it uses the same threadpool
17:01TimMcmsamiry: The incanter library might have something ready-made, if you don't mind pulling that in.
17:01carkgtrak: can't be quicker than my quick and dirty thing =P
17:02carkgtrak: surely could be more correct tho
17:02amalloy&((fn linspace [start stop num] (take num (range start Double/POSITIVE_INFINITY (/ (- stop start) (dec num))))) 0 20 3)
17:02lazybot⇒ (0 10 20)
17:02Fauno1&(+ 5 3)
17:02lazybot⇒ 8
17:02Fauno1o_O
17:02gtrakcark: yours will break if *out* is rebound, since it captures the value at initialization
17:02TimMcFauno1: Not the answer you expected?
17:03carkgtrak: i observed some mixing of log output with this, the agent way is indeed better, but best as i said is a logging framework
17:03carkgtrak: works for me !
17:03carktechnomancy: haha yes
17:03technomancy(actually just "framework" would be enough)
17:04brehautdont anyone else say it, or something unknowable will show up and destroy our sanity
17:04TimMctechnomancy: Just wait until you see my JPEG rendering framework.
17:04hyPiRion,((fn linspace [min max n] (let [step (/ (- max min) (dec n))] (range min (+ max step) step))) 0 20 3)
17:04clojurebot(0 10 20)
17:04frozenlockcark: thanks!
17:05gertHi all, we're working on a cljs mocking tool and we would like to use something like with-redefs in clojurescript -- we're using binding to temporarily bind defined functions to their mocked versions, but that generates a lot of "... not declared dynamic" warnings. What's the best way to go about this?
17:06amalloybrehaut: i imagine the next mention of "logging framework" would gradually turn into http://stackoverflow.com/a/1732454/625403
17:06brehauthaha
17:07carkwoah was digging my biggest project for the logging thing i have in it, and it still uses c.c.def and c.c.duck-streams
17:07brehautamalloy: i found an accurate diagram on wikipedia http://upload.wikimedia.org/wikipedia/commons/2/28/Azathoth.jpg
17:08dnolengert: probably need an official `with-redefs` that works like `bindings` minus the warnings, open a ticket in JIRA
17:08msamiry@TimMc @hyPiRion @amalloy thanks, I appreciate ur help
17:08gfredericksso if I want to use arrays in postgres am I best off patching clojure.java.jdbc to handle them?
17:09gfredericksthere's no existing clojure lib that does this well?
17:09technomancyamalloy: ... wow.
17:09creaseman, backbutton.el's great
17:09carkit indeed uses an agent, a ref and does daily log file rotation, the whole of which is about 30 lines of code...
17:09gertdnolen: cheers. as a temporary workaround, we're trying to figure out how to set *cljs-warn-on-dynamic* to false from leiningen when we're running our tests, but not sure how to do that
17:10technomancygfredericks: I think it would go deeper than c.j.jdbc to the actual underlying jdbc drivers?
17:10gfrederickstechnomancy: I'm not sure what that statement implies
17:10gfrederickscertainly the details involve the driver...
17:10technomancygfredericks: oh never mind I'm thinking of the json datatype
17:11technomancycarry on
17:11dnolengert: are you using lein-cljsbuild?
17:11gertyes we are
17:11brehautpostgres's json datatype intrigues me. Im thinking of porting my site from couchdb to postgres and using it as a datamullet
17:12dnolengert: k not sure how that's done but you just need to bind that to false when calling lein-cljsbuild to compile the files. I don't think we provide a fine grained way to tweak warnings yet via build options.
17:12dnolenno sure how things are handled in lein-cljsbuild I mean as far as where you need to set up the binding
17:12dnolenI mean
17:12technomancybrehaut: I don't think the underlying jdbc driver supports it yet
17:13brehauttechnomancy: ah :/
17:13technomancybut yeah, it looks like it could replace document DBs nicely once it does
17:13technomancysomeone told me that postgres is the emacs of DBs
17:13gertthanks dnolen, we'll do some more digging
17:13brehautnightmare to set up but does everything once you succeed?
17:13brehautsounds apt
17:15ynnivI'm having issues with AOT compilation, but I'm not compiling on purpose
17:15TimMc"datamullet"...
17:15ynnivI think this is due to import / use?
17:15technomancyynniv: do you have :main in project.clj?
17:15TimMcDo you have any protocols or defrecords?
17:15brehautTimMc: business (relational) in the front, party (adhoc blobs) in the back
17:16brehautTimMc: originally meant for a system that uses an SQLDB with a NoSQL db
17:16ynnivi have no protocols or defrecords, but I do have a :main
17:16technomancyynniv: try :main ^:skip-aot my.ns
17:16TimMcbrehaut: Hmm, in that case I misunderstand the pg/json usage.
17:16technomancyynniv: the next version of lein won't require that, FWIW
17:17ynnivthat sounds good, because ^:skip-aot is pretty magical
17:17brehautTimMc: Im not sure i can explain it sorry :/
17:17TimMctechnomancy: lein 2 defaults to non-AOT?
17:17technomancyynniv: it used to be that :main was only used for uberjars, but these days it's usually used for lein run instead
17:18TimMcbrehaut: Ah, relational calls producing JSON blobs?
17:18ynnivyes, I'm using it for lein(2) run.
17:18technomancyTimMc: better to be explicit about AOT instead of magically flipping it on and having a hidden switch to turn off the magic
17:18TimMctechnomancy: Man, who wants it for uberjars anyhow? ;-P
17:19TimMcs/;/:/
17:19technomancyTimMc: I tell ya, back in the day it was all uberjars all the time
17:19TimMcall AOT'd uberjars, too
17:19TimMcLet me tell you about this one plugin...
17:19ynnivuberWar is still very useful
17:19technomancylein 1.0.0 actually compiled everything by default
17:20technomancythat didn't last long
17:20creaseAnyone know if it's possible to extend protocols over primitive types?
17:20creasenot having much luck :(
17:21ynniv(inc technomancy)
17:21lazybot⇒ 42
17:21ynnivwow! congrats!
17:21TimMcbrehaut: I somehow thought it was a JSON-ish interface backed by relational stuff. :-)
17:21TimMcibdknox! We need a downvote in here!
17:21AimHere(dec TimMc)
17:21lazybot⇒ 22
17:22TimMcoh no!
17:22AimHereI think we got one
17:22technomancy(dec inc)
17:22lazybot⇒ 1
17:22TimMc(inc dec)
17:22lazybot⇒ 1
17:22dnolencrease: you can extend the object versions of the primitives
17:23ppppaulwould someone be able to help me with a datomic issue
17:23ppppauli'm in the datomic channel
17:23creasednolen: it is so! thanks!
17:24hyPiRion(inc TimMc)
17:24lazybot⇒ 23
17:24TimMca good number
17:25hyPiRion$karma TimMc
17:25lazybotTimMc has karma 23.
17:25AimHereAnd only yesterday I made an illuminatus reference.
17:26craigbro(inc foo)
17:26gman_Hi all can someone tell me what an expression like header->body means?
17:26lazybot⇒ 2
17:26craigbro(inc craibro)
17:26lazybot⇒ 1
17:26craigbro(inc craigbro)
17:26lazybotYou can't adjust your own karma.
17:26craigbrogood
17:27AimHere(dec ChanServ)
17:27lazybot⇒ -1
17:27gtrakthat guy's a jerk
17:27hyPiRionYou can adjust your own karma.
17:27hyPiRion,(println "(inc hypiRion)")
17:27clojurebot(inc hypiRion)
17:27lazybot⇒ 4
17:28gtrakgman_: when I write names like that, that usually signifies a map
17:28gtrakfrom key->value
17:29amalloygman_: it's just the name of something. probably a function
17:29gman_ok so you can dereference a map with that syntax?
17:29crease,(type crease)
17:29clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: crease in this context, compiling:(NO_SOURCE_PATH:0)>
17:29creaseho hum
17:29gtrakgman_: it's not a syntax
17:29technomancyit means it's converting between "types" loosely
17:29technomancybut header->body makes no sense
17:29technomancybecause you can't convert between them
17:29amalloytechnomancy: just confusing the issue. the point is it's a name, with no special signifigance in the language
17:29technomancyoh, sure
17:30gtrakdata row header to human body conversion function
17:30amalloyheader->body exists in gloss and makes sense in context
17:30crease(type craigbro)
17:30craigbro(inc (var-get (resolve 'craigbro)))
17:30lazybot⇒ 1
17:30craigbro(inc (var-get (resolve 'craigbro)))
17:30lazybot⇒ 2
17:30craigbrowell well well
17:30creaseuh oh
17:30TimMcwhat
17:30amalloydunno if that's the one he's run into, but saying it makes no sense seems silly
17:31technomancycraigbro: you're way over-thinking it =)
17:31gman_yes it is from gloss, I just can't glean what it expresses
17:31amalloyTimMc: that's just the karma plugin
17:31technomancycraigbro: it only looks like lisp; it's really not.
17:31crease(type (var-get (resolve 'craigbro)))
17:31TimMcoh, ha
17:31TimMcI get it.
17:31craigbro$karma craigbro
17:31lazybotcraigbro has karma 0.
17:31craigbroah
17:31Bronsalol
17:31TimMc$karma (var-get (resolve 'craigbro))
17:31lazybot(var-get has karma 0.
17:31Bronsa$karma (var-get (resolve 'craigbro))
17:31lazybot(var-get has karma 0.
17:31Bronsawhat.
17:31hyPiRionit's escaping incorrectly
17:32ibdknox2pro4u
17:32hyPiRionWe've been through this before
17:32ibdknoxlol
17:32craigbroi imagine so
17:32gman_i mean the -> operator when between two symbols
17:32TimMcOh, (inc and $karma have differnet parsing.
17:32hyPiRion(inc ~@:*)
17:32lazybot⇒ 1
17:32TimMcgman_: It's not between them -- it's part of the name.
17:32ibdknoxppppaul: is that cljs pprint stuff somewhere? :)
17:32hyPiRionkarma ~@:*
17:32amalloygman_: -> isn't an operator anyway, and in header->body it's just the name of a thing, named "header->body"
17:32hyPiRion$karma ~@:*
17:32lazybot~@:* has karma 1.
17:32clojurebot@ has nothing to do with whether sth is evaluated or not
17:32gtrakgman_: ##[(class 'a->b) 'a->b]
17:32lazybot⇒ [clojure.lang.Symbol a->b]
17:33TimMc,'foo->>>>-->->>bar ;; gman_
17:33clojurebotfoo->>>>-->->>bar
17:33gman_ahh.. ok thanks TimMc
17:33TimMcgtrak: Don't you mean... ##((juxt class identity) 'a->b) :-P
17:33lazybot⇒ [clojure.lang.Symbol a->b]
17:33gtrakof course
17:34TimMcAlways use juxt, even if it will confuse people.
17:34amalloyTimMc: well done preempting me there; i was going to scold you for confusing people
17:34TimMcs/even if/especially when/
17:34ibdknoxespecially when it'll confuse people.
17:34TimMcBAM
17:34amalloyibdknox: TimMc is on fire
17:34ibdknoxoh no's
17:34ibdknoxlol
17:37gtrak,(map #(%) (map #(partial % 'a->b) [class identity]))
17:37clojurebot(clojure.lang.Symbol a->b)
17:38creasehrm, is there a good way to traverse maps in core.logic?
17:38dnolencrease: nothing beyond seq'ing them
17:39amalloymaps are almost as hard as numbers
17:40creasednolen, amalloy: oh. So what do people use to run queries on map literals in source?
17:40solussdwhat do people use for custom decoders when using cheshire?
17:40dnolencrease: or you could do some custom unification
17:41gtraklast one: ##(drop 1 (reductions (fn [_ a] (a)) nil (map #(partial % 'a->b) [class identity])))
17:41lazybot⇒ (clojure.lang.Symbol a->b)
17:41dnolencrease: people haven't tried it much so it's still a developing topic. lynaghk implemented partial maps which is useful - but I need to tweak it a bit to make it sound.
17:42frozenlockcark: I must be missing something... I still don't see anything appearing in my *nrepl* or *nrepl-server*. :(
17:43mindbender1what the best way of adding new library dependency to a running nrepl session
17:44moogatronicfrozenlock: what version of nrepl.el are you running?
17:44brehautpomegranate ?
17:44frozenlockeh... the one from lein 2.0.0-preview10
17:45creasednolen: yah, I was just looking at that branch… I'm trying to write a source navigator for projects using zippers and logic queries
17:45moogatronicfrozenlock: well, nrepl.el is separate from nrepl that lein uses. oh wait, are you using emacs even?
17:45creaseI suppose I could represent the source as a tree of records and do queries on that
17:45frozenlockOh sorry, I didn't see .el
17:46moogatronic0.1.6-preview fixed some stuff that was broken for me in the prev ver, but that's not likely related to your issues..
17:46hyPiRion,(mapv #(% 'a->b) [#(`%%%) class])
17:46clojurebot[a->b clojure.lang.Symbol]
17:46frozenlock0.1.3
17:46dnolencrease: partial maps are actually in master now. that sounds interesting.
17:46frozenlockOh! I'll try that then, thanks for the tip!
17:46mindbender1brehaut: ok thanks just making sure
17:47brehautmindbender1: i dont know for certain, but thats the only thing that springs to mind
17:47creasednolen: oh, awesome!
17:47moogatronicfrozenlock: yeah, maybe update to at least 0.1.5, but the preview fixed restarting the repl for me.
17:47moogatronic(0.1.6-preview i mean)
17:48gtrakthere must be a market for manual clojure obfuscation
17:49aperiodicsounds like a good kibbit plugin
17:49creasednolen: the idea is something a bit like the call-hierarchy stuff in Eclipse, where you can display and navigate through potentially cyclic or otherwise infinite trees
17:49dnolencrease: again I don't recommend using them heavily in their current form. At some point in the future I hope to see how well having a constraint version of some of Clojure's core APIs plays out. for traversal I need some hammock time
17:51gfredericksseancorfield: ping
17:51dnolencrease: rhickey at ClojureX had a good idea - relations should really be polymorphic - Clojure already has a rich notion of sequences, core.logic should perhaps have something that mirrors that but allowing moving back to the original data that generated the sequence.
17:51dnolencrease: have you seen this - http://github.com/cderoove/damp.ekeko ?
17:52dnolencrease: queries of the Java AST in Eclipse, it uses core.logic
17:58hyPiRiongtrak: manual clojure obfuscation? Sure thing!
17:58gtraklet's start a company
17:58hyPiRionWe need to find a market first
17:58gtrakthe users don't know what they want... it's our job to tell them
17:59creasednolen: no, I hadn't seen that! It looks really cool
17:59hyPiRionMaybe we can sell our services to rhickey, explaining that he can focus on working with the language instead of reviewing bugfixes and whatnot
17:59Bronsalol
18:00gtrakI meant obfuscating the code, not the language itself.. ;-)
18:00hyPiRionI meant the code for the language :)
18:00technomancywas going to say; that explains contains?
18:01hyPiRionAnd (Boolean. false) and friends?
18:01gtraktechnomancy: just use java interop in order to doTheRightThingTM
18:02gtrakwhat's the big deal? #(.contains [:a :b :c :d] :d)
18:02gtrak##(.contains [:a :b :c :d] :d)
18:02lazybot⇒ true
18:02hyPiRionOr some
18:02hyPiRion,(some :d [:a :b :c :d])
18:02clojurebotnil
18:03hyPiRionSee, that works nice.
18:03hyPiRion,(some #(= :d %) [:a :b :c :d])
18:03clojurebottrue
18:03hyPiRiongah.
18:04dnolen,(some #{:d} [:a :b :c :d])
18:04clojurebot:d
18:04hyPiRion,(some #{false} [false :a :b :c :d])
18:04clojurebotnil
18:04hyPiRionBut yeah, if you know they are truthy, #{} is sweet.
18:05gtrakcontains? makes more sense as clojure.set function, but it's used all over core.clj
18:06AimHere,(contains? [:a :b :c] :c)
18:06clojurebotfalse
18:06AimHere,(contains? [:a :b :c] 1)
18:06clojurebottrue
18:06rbxbxweavejester: am I incorrect in thinking that https://github.com/weavejester/ring-json-response/blob/master/src/ring/middleware/json_response.clj#L11 should work for things other than maps which are representable as JSON? (ie: a vector)
18:06amalloyrbxbx: the docstring is pretty clear that it's not intended to work that way
18:07weavejesterrbxbx: That library is deprecated. Try: https://github.com/ring-clojure/ring-json
18:07rbxbxaha
18:07weavejesterI need to update the README to mention that. I thought I did, but maybe I didn't push it.
18:08rbxbxweavejester: awesome. That's how I expected the impl to work :D
18:08rbxbxamalloy I get that, just figured https://github.com/ring-clojure/ring-json/blob/master/src/ring/middleware/json.clj#L41 was the apropos behavior ;)
18:08rbxbxThanks weavejester!
18:08weavejesterrbxbx: Note it only works with vectors, not seqs, because seqs are used for streaming Ring responses.
18:11rbxbxweavejester: noted.
18:19hyPiRion..well, that was easier than I though it would be.
18:20hyPiRionAnyone here who has submitted patches to bugs in core?
18:20yediis it called boolean pattern, or boolean equation, or?
18:28TimMc&(-> class class class)
18:28lazybot⇒ java.lang.Class
18:28technomancyhyPiRion: I have, but the process has changed so as to be unrecognizable since Jira was introduced
18:28technomancys/unrecognizable/incomprehensible/
18:28hyPiRiontechnomancy: okay, that's exactly why I asked.
18:30hyPiRionOh well, I'll just hop down the rabbit hole and hope for the best.
18:30TimMchyPiRion: #(`%%%) is still my favorite.
18:31hyPiRionTimMc: it's shorter than identity!
18:32hyPiRionThere's some gensym leakage within #() though
18:33hyPiRion,(#(do `%) :foo)
18:33clojurebotp1__87__88__auto__
18:34bbloomdnolen: could you elaborate on the polymorphic relationship and bi-directional navigation?
18:36mmitchellis there a core fn that takes a map and a set of functions, and then applies the functions to the *values* of the map, and then returns the map with the new values?
18:36technomancymmitchell: no, but it'd sure be nice
18:36RaynesThere is one in useful.
18:36technomancy(zipmap (keys m) (map f (vals m))) is the closest
18:36RaynesI hate that version
18:36mmitchellhaha
18:37technomancys/closest/shortest/
18:38hyPiRionNo love for reduce-kv?
18:38hyPiRion&(reduce-kv (fn [m k v] (assoc m k (+ 1 v))) {} {:a 1, :b 2, :c 3})
18:38lazybot⇒ {:b 3, :c 4, :a 2}
18:39mattmoss(into {} (map (juxt key (comp f val)) coll)
18:39dnolenbbloom: just that if you want to do anything w/ the various Clojure data structures in core.logic you end up doing a lot of explicit seq'ing. Would be nice if this could be pushed under the covers somehow. seems like you might need a slightly smarter notion of seq to do this.
18:39hyPiRion(reduce-kv #(assoc % %1 (f %2)) {} ...)
18:39amalloyTimMc: that's a neat identity function
18:40bbloomdnolen: smarter in what sense?
18:40dnolenbbloom: in general miniKanren abounds with cases where there are missed opportunities for polymorphism - constraints for example. !=fd vs !=. Of course it make it's more challenging to implement, and it's not clear how constraints might / should interact.
18:40bbloomdnolen: one thing i've considered is "the seq" or "a seq". unsorted collections are seq-able, but really there are N! arbitrary sequences you can pick
18:41dnolenbbloom: you put a map in your want to get a map out. that won't happen if you seq a map.
18:41mattmoss,(let [m {:a 1 :b 2 :c 3}] (into (empty m) (map (juxt key (comp inc val)) m)))
18:41clojurebot{:a 2, :c 4, :b 3}
18:41bbloomdnolen: ah, i see, some kinda seq that carries with it the notion of conj! and empty
18:42dnolenbbloom: something, to be honest I have the haziest of notions at the moment.
18:43TimMcamalloy: Praise/blame goes to hyPiRion for #(`%%%)
18:43bbloomdnolen: clearly your AbstractRehydratableCollectionSequence needs to have an AbstractLinearizableCollectionFactory
18:43bbloomer i mean, yes more hammock time.
18:44dnolenbbloom: :)
18:45bbloomdnolen: but yeah: makes sense to me. definitely worth exploring
18:45hyPiRionTimMc: http://i.imgur.com/cvEFp.png
19:03bosieis midje supposed to reload the code in the repl?
19:03bosiei am using (load-facts) and it doesn't seem to see the changes i make outside of the test files
19:05S11001001bosie: I don't think it will globally load; if you're using nrepl press C-c C-l when in a buffer to reload it
19:05S11001001bosie: global reload is more trouble than it's worth
19:06bosieS11001001: lein repl
19:06S11001001bosie: well, you can use require :reload then, but I'd suggest getting going with nrepl instead
19:06bosieS11001001: i am just trying technomancy's suggestion of executing midje test cases through the repl and not with "lein repl"
19:09technomancybosie: I recommend handling reloading through your editor
19:09bosieS11001001: will look into nrepl
19:10tickingwhat if file implemented count to get the number of files in a directoy?
19:10technomancyticking: you can count file-seq
19:11tickingtechnomancy: yeah but that is recursive
19:11technomancyoh right
19:11tickingtechnomancy: tbh a non recursive file-seq would probably better ^^
19:11technomancylike .listFiles
19:11technomancy?
19:12S11001001but there's the burning question of whether you must count "." and "..", therefore all file list counters must be custom
19:12tickingyes, but without the java interop
19:12technomancywhy without java interop?
19:12tickingbecause its nasty
19:12technomancyit is not nasty
19:12tickingjust think of the higher order functions^^
19:12amalloyuse another language, then
19:13amalloyclojure can't get anything done without *someone* talking to java
19:13hyPiRion"eww, java. Let's build a language on top of it"
19:13hyPiRion"with good interop"
19:13tickinghyPiRion: you know what they say "The jvm is a nice runtime, but its reference language sucks."
19:14amalloyticking: not relevant? nobody is telling you to write java
19:14amalloyonly suggesting you use the jvm runtime's method-invocation feature
19:14tickingamalloy: there is a reason why you don't write java.io.File. everytime you now use clojure.java.io/file
19:14RaynesUh
19:14RaynesNo, I don't.
19:14S11001001One time I needed to use httpcomponents-client.
19:15S11001001clj-http-client didn't have the features I needed.
19:15RaynesIf you hate Java so much that you aren't willing to use perfectly acceptable code already written in it, you're probably using the wrong language.
19:15S11001001So I...used interop to work with hc-client directly, it worked out
19:15dakroneS11001001: out of curiosity, which feature?
19:16tickingRaynes, I'm not saying that this shouldn't be used but that it should be wrapped by the core already
19:16RaynesThat's insane.
19:16RaynesYou want to wrap every single bit of Java code in clojure.core?
19:16RaynesFor the sole purpose of not having to write a dot before the name?
19:16tickingRaynes, no, I just want to wrap the usefull file io bits in clojure.java.io
19:17tickingRaynes: I agree that the old testament "The only good about java are 1 billio lines of java." is true
19:17Rayneshttps://github.com/Raynes/fs <-- some file system stuff
19:17S11001001dakrone: it was 2 years ago, but probably something to do with headers or persistent connection handling
19:17tickingRaynes: thus we should use what is there
19:17S11001001ticking: define useful
19:17tickingRaynes but that still doesn't mean that I want to use interop in non libary coe
19:18tickingRaynes: yeah I know, I actually use your lib in a lot of projects, could use jome javadoc btw ;D
19:19RaynesIf I could get weavejester to reply to my codox issue. ;)
19:19weavejesterHm?
19:19Raynesweavejester: https://github.com/weavejester/codox/issues/16
19:19Raynesy u no work
19:19tickingS11001001: everyday stuff, not esoteric things like getters and setters for sticky bits or ZFS hash information
19:20S11001001ticking: it's not a dichotomy
19:20S11001001for example, suppose you're walking a tree.
19:20weavejesterOh yep, I've been meaning to look into that, but I've been sick lately, so I haven't worked up the courage to go through the code in Lein master and work out why the dependencies have changed.
19:20S11001001Do you need file types beyond isdir?
19:20RaynesAwww.
19:21S11001001Well, maybe.
19:21brehautRaynes: weavejester is in england, they drink tea
19:21S11001001Depends on how good you want it to be.
19:21tickingS11001001: you need isDir? isFile? isSpecial?
19:21weavejesterWe have chicken soup too
19:21Raynesbrehaut: I'm in Alabama. We drink whiskey and cough syrup.
19:21weavejesterI had some earlier :)
19:21brehautweavejester: what‽ my entire understanding of england is coming unraveled!
19:21RaynesI'll be in LA soon though. And they drink protein shakes.
19:22bosieRaynes: many clj programmers in alabama? ;)
19:22Raynesbosie: I know of just one.
19:22RaynesHis name is Raynes.
19:22S11001001So the definition of "everyday stuff" isn't clear-cut.
19:22bosiehah
19:22creaselovin protocols
19:23Raynesweavejester: Where is that assert at? I can probably fix whatever the problem is for you.
19:23RaynesOh, dur
19:23RaynesNever mind.
19:23RaynesDear Anthony, you has stacktrace.
19:23tickingS11001001: then you grow and shrink the library based on user input
19:23brehautS11001001, ticking: I think java.util.concurrent Queues are a great example of everyday stuff that nobody wraps because they are so useful already
19:24S11001001ticking: that sounds like "grow and ...grow" to me. We can't even kick if-not out of clojure.core.
19:25tickingS11001001: then there are 1 or 2 functions in there that are already use or you aply this conservatively and try to keep it at a minimum
19:25S11001001I think the main area where you might want a library, and you can't do something nice with clojure like write a dsl, is "stuff you might want to do in cross-clojure code"
19:25tickingS11001001: still no reason to keep it nonexistent
19:26Raynesweavejester: How would you feel about inlining source code instead of linking to Github, sort of like rubydoc does?
19:26S11001001ticking: anyway, since it's just a few functions, why not introduce a new library with impls for jvm,clr?,js? The bar isn't that high for new libs in clojure-land
19:26tickingS11001001: the same goes for the queues, just because they are usefull doesn't mean they are idiomatic
19:26weavejesterRaynes: Not sure. Too tired right now to have an opinion.
19:26Raynesweavejester: I'm interested in adding it with pygments highlighting. It would basically just change the source link to expand to the code. Could also still do the linking to github thing with an option.
19:26RaynesHaha
19:26weavejesterRaynes: Codox does support custom outputs, though
19:27RaynesAlright, no prob.
19:27tickingS11001001: the bettern thign to do would probably write a pull request for fs to Raynes
19:27S11001001hmm
19:27S11001001@mail rplevy you'll be happy to know I'm getting RHCA'd
19:28RaynesI don't accept pull requests. You have to send me a CA, a blood sample, make a jira issue, wait 6 months, attach a patch, and then wait for me to vet it and send it to amalloy for code review and then brehaut will merge it if all goes as planned.
19:29tickingRaynes: sounds simpler than contributing to clojure ;)
19:29brehautticking: you havent seen me try to merge a patch
19:29RaynesHaha, that's exactly the process for contributing to Clojure, except the blood sample.
19:31tickingyeah thats the only thing from submitting a 400% faster version of partition-by which is implemented in the even faster partition-between which can split at arbitrary places instead of just borders between values
19:31hyPiRionwait 6 months for what?
19:31hyPiRionthe CA to be accepted?
19:32tickinghyPiRion: it takes rick that long to channel the dark spirit of clojus the deamon of programming from the 11th dymention to give is dark blessing to the patch ^^
19:33hyPiRionWell yeah, obviously.
19:33tickinglol
19:33hyPiRionbrehaut: how the.. what? wouldn't it be [1 1] [1 3] ?
19:34brehauthyPiRion: not if you are partitioning in arbitrary places instead of just the borders between values
19:34hyPiRionoh right
19:34brehauti never said it was rational :P
19:34tickinghrhr
19:34amalloybrehaut: you made it produce rational numbers
19:34tickingI wonder how the params for the partition funciton would look like
19:35brehautamalloy: someone always has to be pedantic
19:36amalloyno, the pedants would have pointed out your lame implementation produces real numbers
19:36Raynessattvik: leinjacker's dep stuff is broken against recent leiningen 2 previews.
19:36tickingI would already be happy about something like (partition-between (fn [x y] …) …)
19:37Raynesamalloy: Didn't leiningen start using ordered maps as an internal representation of dependencies instead of vectors?
19:37tickingin the core
19:37amalloystarted, then stopped, i think
19:44dhmanyone know if it's possible to make ring watch and reload namespaces defined in a project's dependencies and imported at startup time via a symlink in directory 'checkouts'?
19:45sattvikRaynes: Hmm… I'll have to take a look at that. Could you open a bug, please?
19:45Raynessattvik: I found out why
19:46Raynessattvik: Dependencies isn't a vector of vectors anymore, it's a seq of vectors. Just need to change the assertion to look for a seq instead.
19:46Raynessattvik: https://github.com/Raynes/leinjacker/blob/master/src/leinjacker/deps.clj#L47 these assertions
19:46sattvikRaynes: Ah, OK.
19:47Raynessattvik: Want me to throw a pull request at you?
19:47RaynesWell...
19:47sattvikRaynes: That'd be great.
19:47RaynesI guess asserting a seq would break lein 1 compatibility.
19:47RaynesAre you going for compatibility with lein 1 here?
19:47RaynesI could assert (sequential? ..)
19:48sattvikYes, both Lein 1 and Lein 2.
19:48sattvikThat could work.
19:48RaynesI'll give that a shot.
19:52eggheadhey all, I am trying to use a function which slurps up keys/vals via [& {:keys [..]}] -- I have a object containing those keys but I need to pass them individually (somefn :a 1 :b 2) rather than (somefn {:a 1 :b 2}) -- if it wasn't a hashmap I'd use apply, is there anything I could do?
19:53bbloom,(apply concat {:a 1 :b 2})
19:53clojurebot(:a 1 :b 2)
19:54eggheadah, that works... thanks bbloom
19:54eggheadI was thinking 'I could mapcar list over the keys and vals....' but concat works much better
19:55Raynessattvik: I'm having a bit of trouble running the tests.
19:55Raynes Actual: java.lang.IllegalStateException: Unable to find Leiningen 2 in the path as lein or lein2. Please make sure it is installed and in your path under one of those names.
19:55RaynesI have lein on my path (leiningen 2) as well as lein1 for lein 1.
19:55RaynesIs something wrong with that setup?
19:56eggheadmapcat*
19:57amalloyegghead: you could mapcat identity over the map-entries. concat is better, but mapcat solutions also exist
19:58Raynessattvik: Never mind, drip was breaking it.
19:58Raynesamalloy: Damn your drip.
19:58bbloomI found a solution to the slow JVM startup time! i got a faster machine :-P
19:59eggheadamalloy: ah, mapcat identity is even simpler than what I was thinking, still apply concat seems to make sense since I just want to concatenate all the key/value pairs
19:59Raynesamalloy: Remember how we always had that issue where we'd want to kill cake's persistent jvm just to be sure it wasn't causing problem? I do that now with LEIN_JAVA_CMD= lein test
19:59eggheadyou guys are so smart :3
20:03mpanwhat's the most convenient way to run a standalone clojure file?
20:03osberthi, is there somebody here that is an admin on clojars that can delete the jars osbert/hiccup-bootstrap and org.clojars.osbert.osbert/hiccup-bootstrap for me? i just had two huge brain farts. sorry and thanks in advance.
20:03technomancyosbert: sure; I can get that
20:04amalloythe jvm really doesn't start up slowly enough for developers to notice, bbloom. it's the time spent compiling clojure.core, lein, and your app that you notice
20:05akhudekamalloy: can you aot clojure core? I've found even if you aot your entire app the startup time is still ~2 sec
20:05bbloomamalloy: i'm just enjoying my new mbp being much faster than my prior machine. `lein repl` now only takes 1ish second to get to a useful prompt, which is a huge improvement for me
20:05amalloyprobably that's your ssd rather than a faster cpu
20:05bbloomamalloy: my prior machine was an older air which had an ssd too
20:06technomancyosbert: *voip*
20:06technomancygone
20:06osberttechnomancy: thanks, sorry about that.
20:06technomancynp
20:06amalloyakhudek: even if you AOT namespaces, i believe the compiler checks to see if a source file is available and recompiles it if so; AOT is more for exposing a java-friendly interface. not sure about that, though
20:06technomancyAOT does allow for faster loading
20:07technomancybut the bytecode still needs to pass through the verifier
20:07Raynessattvik: Just sent you a pull request. When do you think we can get a release? Codox is broken until we do.
20:07akhudekyep, we have a command line app and AOT is pretty crucial to have it start up quickly
20:07technomancyFSVO "quickly"
20:07akhudekwell, people still complain about the 2s :-/
20:08akhudekwhich is funny because it's a compiler that is not fast
20:08Raynesakhudek: I would have written it in Haskell! :D
20:08akhudekRaynes: hah, not a bad choice :-)
20:11amalloytechnomancy: so if your code is AOTed, the compiler doesn't attempt to recompile it? i have a heck of a time figuring out what code is run when you (require 'some.ns) so i can't really track it down myself
20:12technomancyamalloy: it still checks the timestamps; if the source is newer it will recompile.
20:12amalloyit looks to me like (require 'foo.core) unconditionally involves a call to (load "foo/core.clj") eventually; where's that timestamp check?
20:15technomancywouldn't surprise me to find it in load
20:15technomancyrequire is all about translating symbols to paths and preventing unnecessary reloads
20:16amalloyah, it's in c.l.RT/load. i was looking in c.l.RT/loadResourceScript, since that's what people are usually encouraged to use; it doesn't do that check
20:22dhmregarding my previous question about auto reloading a ring app's dependencies, turns out ring-reload-modified is a great solution for that
20:32RaynesHouston, we have documentation http://raynes.github.com/laser/
20:33technomancyRaynes: you had documentation before too
20:33Raynestechnomancy: I don't think I did.
20:33Raynestechnomancy: Not pretty html documentation
20:33technomancyI mean before you generated and published the HTML
20:33Raynestechnomancy: You're talking about the code, right?
20:34technomancyRaynes: right; just a pet peeve
20:34amalloyi think your big rambling README is more interesting/useful documentation than some html that's autogenerated from the sources
20:34technomancyIMO repl-accessible docstrings and long-form prose are way more important as documentation
20:34Raynestechnomancy: So now I can't use when without side efforts or generate documentation? Jesus, I give up.
20:34technomancyRaynes: I'm objecting to your treatment of in-repl docstrings =)
20:34technomancydon't discriminate!
20:35Raynestechnomancy: Well, the docstrings are still there.
20:35RaynesNothing has changed.
20:35Raynesamalloy: I need to make it even bigger with more rambling.
20:35technomancyright; that's what I was getting at; "you had documentation before too"
20:35RaynesI'm going to cause you physical harm.
20:36technomancysorry I am getting a bunch of snark tossed my way in #git for expressing my wish that the gc operation was documented and am deflecting it over here
20:36technomancywere documented
20:36Rayneswuz
20:36amalloyRaynes: you already have caused him physical harm by claiming docstrings aren't documentation
20:37RaynesI did not claim that.
20:37RaynesI hate you all.
20:37technomancy"Performs a bunch of housekeeping stuff. Don't sweat the details."
20:37brehauttechnomancy: pity that goes against git's general philosophy of sweating the details
20:38technomancy(inc brehaut)
20:38lazybot⇒ 10
20:39amalloytechnomancy: isn't the behavior of gc explained in the --auto option and CONFIGURATION section of that help page?
20:39technomancyamalloy: not really
20:40technomancyamalloy: it says it does two things: repack and prune, but I have a repo with 5MB of loose objects and no unreferenced objects, and a gc brings the size from 1.5GB to 35MB
20:40technomancyso either something else is happening, or the loose objects count is completely bollocks
20:41ivanwhat size were you expecting?
20:42hyPiRionwell, 5 MB less I suppose.
20:42amalloyreally, no unreachable objects? how did you get to that state?
20:42technomancyamalloy: well, ~0
20:43technomancyamalloy: small enough that pruning had no effect on du -hs
20:43technomancyivan: I'd expect count-objects to show ~1.5 GB of loose objects
20:43amalloyhow did you determine 5MB of loose objects?
20:43sattvikRaynes: I'm not sure I'll be able to get to it in the next day or two since I am travelling. tcrawley should also be able to make a new release.
20:43technomancyamalloy: git count-objects
20:44ivantechnomancy: but repack compresses tons of nearly-identical text files into one pack
20:44ivansee .git/objects before and after
20:44technomancyah, because repack is overloaded; it's actually two operations?
20:45technomancyI guess by now I should expect that of git
20:45amalloytechnomancy: i think that's the last paragraph of the --auto docs
20:45amalloyie, it can operate on more than just loose objects
20:46Raynestcrawley: Make a new release or I hurt you
20:46RaynesI cut you
20:46technomancyyeah, true
20:47technomancythey did tell me in #git that gc.auto is not actually used exactly; it uses an estimate to determine whether it's over the limit, but it's frequently wrong =\
20:49technomancyhm; I don't think that's it; `git repack -A` actually increases the repo size
20:49hyPiRionI'm not saying I find Raynes threatening at times, but if someone would setup a donation for an anger management therapist to him, I would donate a significant amount of money to it.
20:49hyPiRionClojure need healthy developers.
20:49RaynesI could probably use some anger management
20:50dhmI mean some people make the anger work for them. Like Rambo.
20:50neilmockdamnit, I came to clojure to avoid the anger of ruby
20:51technomancyyeah, gc must be doing some other undocumented operation
20:51hyPiRionneilmock: It's only Raynes, everyone else are nice
20:51technomancyawesome
20:51technomancyand the only person who knows how it works in #git has me on ignore
20:51neilmockhigher order functions be damned
20:51technomancybecause I told him the man page was wrong
20:52bbloomtechnomancy: that'll teach you to correct people
20:52hyPiRiontechnomancy: You never tell people that they are wrong. You ask "hey, I see the documentation states X, but I see Y. Is there something I don't understand here?"
20:53bbloomRaynes: I get annoyed when i see API docs with no obvious link back to the README
20:53bbloommainly b/c i hate API docs....
20:53technomancybbloom: I was actually just repeating what someone told me earlier; there was one nice guy in #git, but he went to bed
20:53hyPiRionPeople hate people correcting them, so better let them "figure" out errors themselves.
20:53technomancyhyPiRion: well this was just after he kept pointing me to the man page
20:54brehautif someone doesnt like being corrected, they probably shouldnt use IRC
20:54hyPiRiontechnomancy: Oh, then it's rather fruitless, yeah.
20:54bbloomit's always entertaining how much the attitude of the BDFL for any community influences the tone of that community
20:54technomancybbloom: sorry, it's done; I'm about to head to dinner =)
20:59It_the_zfealianRaynes,
20:59It_the_zfealianI Worship His Shadow.
23:20creasednolen: can core.match take arbitrary predicates in the guards?
23:25dnolencrease: yes, :when is restricted, :guard is not
23:25creasednolen: cool, thanks.
23:50dnolengfredericks: hey the core.logic version of 4clojure is cool! :D
23:50tcrawleyRaynes: sattvik: sure thing! I'll do a release tomorrow morning. FIRST THING
23:51RaynesExcellent, sir.
23:51tcrawley*phew*