#clojure logs

2012-02-10

00:31clj_newbI create an JList. I select an element. The selected element now has white fg + blue bg. The JList loses focus. Now, the selected element has black fg + white fg + a blue border. How can I change it so that when the JList loses focus, it's still white fg + blue bg?
00:55sgarrettHello all. I was wondering if someone could explain how to make my function immutable and still get the same result.
00:56sgarrettI'm a noob just learning clojure...
00:58sgarrettAny takers?
00:59sgarrettThe function is quite short. Basically I'm taking a vector of numbers and I'm wanting to multiply each number by the previous product so [1 2 3 4 5] would return 120.
00:59radshas anyone tried out waltz (https://github.com/ibdknox/waltz)? I don't understand what how the set and unset functions work. ibdknox?
01:00sgarrettThe problem that I'm running into is I keep thinking of the previous product as a mutable state and I'm not sure how to "store" the previous product without using a (def) declaration.
01:00ibdknoxrads: hm? they set or unset a state within the statemachine
01:01ibdknoxwhich forces in or out for that state to be called
01:02ibdknoxsgarrett: look up (reduce)
01:02radsso if you try to unset a state you're not in, it simply does nothing?
01:02ibdknoxyep
01:03sgarrettidbknos: Perfect! Thank you.
01:03ibdknoxthat allows you to specify groups of states that might be mutually exclusive
01:03radsibdknox: can you explain that a little more?
01:04ibdknoxlet's say I have an item that can be in good, neutral, or bad
01:05ibdknoxit can be in any one of those, but not two. So to ensure that I might do something like this
01:05radswait, so each state machine can have multiple states at the same time?
01:06radsI thought state machines only had one state at a time
01:06ibdknoxhttps://refheap.com/paste/692
01:06ibdknoxrads: these are non-deterministic finite state machines
01:06ibdknoxwhich is important
01:07ibdknoxsince it would require immense boilerplate to declare all possible combinations of states that exist in UIs
01:08muhoo,(doc deftrans)
01:08radsok
01:08ibdknoxadding that modifier to the readme
01:08clojurebotCool story bro.
01:08muhoo&(doc deftrans)
01:08lazybotjava.lang.RuntimeException: Unable to resolve var: deftrans in this context
01:08rads ibdknox: so in reality you only use unset and set once per transition?
01:09ibdknoxrads: depends on the transition, it's not uncommon for a single transition to put you into two states
01:09ibdknoxrads: let me get the more complicated version of that metric thing to show you
01:10hiredmanreally you need an expert system with rules specify actions for states and events
01:10ibdknoxrads: https://refheap.com/paste/693
01:11radsso how come there is an imperative api (set, unset) vs a declarative one. for example something like (trans me old-state new-state) instead
01:11hiredmanconditions
01:11ibdknoxrads: because a single transition can cause any number of state changes
01:12ibdknoxthat may or may not actually be related to eachother
01:13ibdknoxhiredman: I think that's basically what you end up creating with this
01:13radsI see. I don't completely understand it yet. the idea of using state machines to model an application is new to me
01:14ibdknoxrads: to be honest, I think it's one of those things you have to work through before you really end up understanding how it works
01:14ibdknoxit was that way for me and I wrote the darn thing :)
01:15ibdknoxbut it was based on lots of work I had done previously
01:15hiredmanibdknox: well then I approve
01:15radsthat's part of why I enjoy clojure/clojurescript. I've already learned a lot from just experimenting with people's libraries
01:16ibdknoxrads: yep :)
01:16radspeople in this community are always trying new things
01:16radswhereas it seems like you see a new JS MVC framework every week
01:16radsall with very similar underlying concepts
01:16ibdknoxthis was my reaction to those failing miserably
01:18radsI'm working on a clojurescript app right now, and it's kinda scary how many of your libraries I use :) I hope to give back and make them better as I get more experience with clojurescript
01:19ibdknoxrads: haha well let me know how it goes. These are still pretty early
01:21radsI use them more as a guideline, which is why I was reading through the waltz source. the new ones are small right now, something I would have written myself, but I figure it would be more useful to work and improve your efforts rather than start my own
01:22radswith rails you don't need to know what a FSM to build an app, but cljs is so young and new that I want to learn these things and make them more accessible to less experienced programmers
01:22radswhat a FSM is*
01:24radsit's been what, six months? I'm looking forward to the next few years of clojurescript
01:25radsibdknox: my question is, how did you come up with the idea to use FSMs? you say you've used them in previous projects?
01:27ibdknoxrads: my friend and I built a really insane website for a client about 5 years ago. At the time people weren't really building large JS apps, but we decided to try anyways and built JSSM (the javascript statemachine)
01:27ibdknoxwe used it to help us manage the ridiculous amount of transitions the site had
01:27ibdknoxwe never used it again for some reason
01:27ibdknoxflashforward 5 years.. and I'm building large JS apps again :)
01:28ibdknoxTried backbone, sproutcore, etc
01:28ibdknoxthey all turned into a mess after a while, because what I truly need is very explicitly defined states that have in's and out's and well understood transitions
01:29ibdknoxand that basically describes a non-deterministic FSM :)
01:30radsI see
01:30ibdknoxwe'd been kicking it around at the office for a bit
01:30radsso do you actually go and draw a state diagram when you build an app?
01:30ibdknoxno
01:30ibdknoxI'm far too lazy for that ;)
01:31ibdknoxthough I suspect it would actually be quite helpful at times
01:32radsI've messed with the clojurescript one event handling with react-to, but it felt like it was an overwhelming amount of freedom and lack of structure
01:33ibdknoxrads: it's not really much different than how you build JS apps now
01:33radsperhaps thinking of the problem as a well studied topic like an FSM will make things clearer when I'm designing my app
01:33ibdknoxand that will invariably breakdown once you have more than a few things going on
01:33ibdknoxit definitely did for me, but it's hard to extrapolate that to others... I'm weird :)
01:34radsit's beautiful to be able to link back every day problems to the theory
01:36radstoo often I've felt like I base my design decisions on someone else's framework, which is what everyone does with backbone etc... with this approach I feel like I understand why I'm structuring my code in a certain way
01:40ibdknoxrads: that's a good sign
01:42rads"clojure changes the way you think" rings true for me more and more every day
01:44clj_newbsupose I do (proxy [JavaInterface] ... ); then, later on, is there a way to (in Clojure) test if a given object is a JavaInterface or a clojure proxy?
01:45clj_newbhmm; can I attach meta data to these objects? that would do it
03:17JulioBarrosI'm having a problem integrating with a java library. I try to create a class and get Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException, compiling:(core.clj:20) and then many lines later Caused by: opennlp.tools.util.InvalidFormatException: Missing the manifest.properties!
04:09ejacksonmorning folks
04:09clgvmorning
04:47thhellerso whats the most popular way to deploy compojure apps to the web? .war via tomcat & co or standalone with jetty?
04:48fliebelcemerick: ping
04:49cemerickhi :-)
04:49fliebelhi
04:50fliebelI don;t understnd your tweet. ClojureScript One also has ClojureScript as a git dep, right? So how is it unrelated? I mean, sure it's not a couchapp, but it solved the dependency thing.
04:51fliebelAfter I understand it correclty, I might find some time to try that tomorrow.
04:52cemerickfliebel: oh, you're thinking of using clojurescript dependencies in couchdb views?
04:56fliebelcemerick: no, really the only thing I referenced clojurescript one for is the 'lein bootstrap' part, to get rid of the cljs jar htat you currenlty use.
04:56cemerickwell, cljs itself is now available as a regular maven/lein dependency, so that'll go away
04:57cemerickso clutch-clojurescript can use cljs without bundling its own build w/o a problem
04:57cemerickclojurescript one is really unrelated
04:58fliebelok, now I get it, the couchdb side at least. I'm not sure why One would not use just the lein dep.
04:58cemerickfliebel: ^
04:58cemerickfliebel: they want to use git for dependency resolution across the board instead of maven artifacts, etc
04:58fliebelI thought that One was supposed to be a reference for how to do things in ClojureScript.
04:59cemerickwell, it's one way, anyway ;-)
04:59fliebel:)
04:59cemerickClojureScript One is really only relevant for webapps anyway.
04:59cemericke.g. there's no possibility of a browser-connected REPL for a couchdb view, etc.
05:00fliebelcemerick: true
05:00cemerickI suppose it might eventually be desirable to use cljs dependencies in couch views…
05:00cemerickbut, one thing at a time
05:01cemerickand, I really doubt that I'll be promulgating the use of git for dep resolution ;-)
05:03cemerickfliebel: anyway, if you want to send me a patch req with all the custom cljs bundling junk ripped out, replaced by the latest cljs dep per usual, that'd be ok :-)
05:03fliebeli'll see
05:04fliebelit'll prob be this week or never.
05:23clgv*know
05:23ejacksonthat took longer that it should have in order to find
05:53dEPyWork,(= (seq "aba") (reverse (seq "aba")))
05:53clojurebottrue
06:08clj_newbof all langautes taht have nice C/Objective-C FFi (i.e. not running on JVM); what has the closest to clojure semantics? (things like agents, stm, immutability)
06:10cemerickclj_newb: does the JVM not have nice FFI? (i.e. via JNA?)
06:10clj_newbof all languaes that I can write ipad apps with, what has the closest to clojure semantics? :-)
06:10clj_newbmy bad for asking confusing question
06:11cemerickah-ha
06:11cemerickyou could probably write an ipad app using a good scheme
06:11cemerickchicken or gambit
06:11clj_newbenh
06:12clj_newbI was really hoping for sometign like (:require clojureX.ipad); (clojureX.ipad/compile ...)
06:12clj_newbi've played with both chicken and gambit in the past; didn't like either of the
06:12clj_newbm
06:12cemerickthen maybe ocaml?
06:13clj_newbah; ocaml
06:13clj_newbwhy did I not think of ocaml
06:13clj_newbactually; ocaml even has types
06:13clj_newbwhy am I using clojure at all; now I wonder
06:13cemerickhah
06:13cemerickJ has types too
06:14cemerickactually, I'll bet factor could pull off an ipad app
06:14clj_newbbuilding a DSL for crancking out iphone games on top of J = infinite money
06:14cemerickthat'd be nifty
06:14clj_newbI dunno; doesn' factor use it's own compiler/assembler
06:19cemerickI thought it had a C target?
06:20clj_newbiirc, no
06:20clj_newbi never understood; what about clojure requires the dynamicness of the jvm?
06:20clj_newbit feels like everything I do can be statially comipled to efficient C
06:22clj_newbdamn it; does app store reject java apps?
06:22clj_newb(this is osx app store, not ipad app store)
06:22cemerickyeah, no Java on any apple store
06:23clj_newbon iphone/ipad, it's a matter of effieciency ; on mac book pros / imacs / mac pros ... what is the reasoning?
06:23cemerickClojure is by definition JVM-hosted. ClojureCLR and ClojureScript also have their respective hosts.
06:23cemerickThough, you could *probably* retarget ClojureScript to emit C or scheme or…
06:27cemerickclj_newb: well, except it's *not* a matter of efficiency, as android has proven
06:27cemerickThey want what they want in their market. *shrug*
06:28ivan`you can sort of write iOS apps in JS using Titanium or Trigger
06:28ivan`I hear Titanium has a lot of bugs
07:05_phili wonder if it would be possible to package up a clojurescript generated js file together with rhino and some native bindings in a binary
07:06_philand voila, jvm-less native clojure
07:06clojurebotPardon?
07:06_philclojurebot: botsnack
07:06clojurebotThanks! Can I have chocolate next time
07:53TimMc_phil: Isn't Rhino a Java program? >_>
07:54clgvclojurebot: chocolate
07:54clojurebotexcusez-moi
08:02ljoshi - I am trying to set up a little REST api for a small project I am doing, but I keep getting a problem. I am using compojure, clojure.java.jdbc clj-json and ring. I run it with lein and when I start the server everything works fine and dandy. What happens is after a few requests sent to the server I get: <h1>404 Not Found</h1>No context found for requestpc ; with debug or anything on the server side. I run everything as localhost.
08:03ljosThe pc thing at the end of the response is just bad copying. It is the start of my computers name.
08:03ljosDoes anyone know what ould be wrong?
08:05ljosOh. I'm using curl to connect to it. It seems curl can't connect anymore.
08:19kenshoHi. I have emacs configured with clojure-mode (installed through package.el from marmalade) and I use lein with clojure-jack-in. Now I'd like to also work with common lisp code (clozure). What is the best approach to achieve this? Sorry if this is a dumb question, I'm a complete emacs and lisp noob (but I'm familiar with java and clojure).
08:20tdrgabikensho: good question. I have the same problem. Clojure & Common Lisp slime don't mix in my emacs. it would be nice to find a way
08:21mrBlisskensho: https://github.com/mrBliss/swank-clojure it's a bit outdated and doesn't work with clojure-jack-in, but gives you CL compatibility.
08:21mrBlissI'm working on an update that also fixes macroexpansion and CDT integration
08:22scottjmrBliss: why do you need to use an old swank-clojure for cl support, does latest swank-clojure not work with the old recommended version of slime?
08:23kenshomrBliss: thanks I'll have a look
08:24mrBlissscottj: the old recommended version of slime doesn't work with CL. It also lacks a couple of features (presentations to name one).
08:25mrBlissscottj: I have modified swank-clojure-1.4.0 to support the newer version of Slime, but haven't it uploaded yet. I find it hard to keep a fork of a git repo up to date, certainly when it includes multiple branches ;-)
08:27scottjmrBliss: newer or latest?
08:29mrBlissscottj: I have only tested it with Slime @ 2010-11-13,
08:29scottjmrBliss: btw, I've been using the old recommended version (minus two days) with CL for years.
08:30scottjmrBliss: does that happen to be the same version ritz is using?
08:30mrBlissscottj: yes
08:30mrBlissscottj: did they introduce a breaking change in those two days?
08:32scottjmrBliss: not sure, it's basically github.com/technomancy/slime minus technomancy's commits
08:32mrBlissscottj: I assume you got it working with StumpWM too?
08:32scottjmrBliss: yep
08:33scottjthat's actually the only CL thing I connect to
08:34mrBlisskeep making those videos :-)
08:34scottjmrBliss: thanks for watching :)
08:34mrBlisscould you also publish your .stumpwmrc?
08:42scottjmrBliss: https://github.com/scottjad/dotfiles/commit/4601dccb3f3de93d0a09a4843dfe0bbc8438630c
08:44mrBlissscottj: thanks, I'm gonna read them all today!
09:59pjstadigwhat's up my Clojure/core
10:00pjstadigi have a suggestion for open source friday
10:00pjstadigCLJ-855
10:05pjstadignot that i want to make things more confusing, but I recommend reverting the change
10:05pjstadighttp://dev.clojure.org/jira/browse/CLJ-855?focusedCommentId=27705&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-27705
10:20pandeiroanyone know how i can consume POST data from aleph?
10:35TimMcSeconded.
10:36TimMcHow many committers are there?
10:37stuartsierra3
10:38stuartsierraFor Clojure the Language that is. Lots more for contrib.
10:42TimMcOuch, sounds like quite the bottleneck.
10:42stuartsierraTechnically, Rich is supposed to approve every language patch, so it's more like one.
10:42TimMcunless you have some sort of tiered committer setup like the linux kernel has?
10:42TimMcOK.
10:43stuartsierraI only wish we were as organized as the Linux kernel, or had as many people working on it.
10:43cmajor7are there any Clojure conferences on east cost this year? I see ClojureWest: http://clojurewest.org/ but it is a bit too far..
10:43stuartsierraClojure/conj 2012 will almost certainly be on the East Coast. In the Fall.
10:44`foguscmajor: There will be another installment of the Conj later this year
10:44`fogusor what stuart said
10:44cmajor7stuartsierra, `fogus: that's great! thank you!
10:45jcrossley3`fogus: nevermind packaging those core.cache tests. i've come to the conclusion that they're not appropriate for distributed caches.
10:46`fogusk
10:48jcrossley3`fogus: i'm still using defcache, which is very handy, just not the tests
10:49stuartsierralater dudes
11:04devnlater bro
11:34geoffeg_cis there a good brogramming community for clojure? :)
11:35TimMc"brogramming"... o.O
11:36Scriptorlike, pair programming?
11:37TimMcIf this has anything to do with cheap beer and backwards baseball caps, then... I hope not.
11:39Scriptorfrom googling it it sounds like a satirical thing
11:43geoffeg_cit is, year
11:43geoffeg_cs/year/yea/
12:10mrevili know this exists but I can't find it: given a series of sequences [1 2 3] [:a :b :c] return [1 :a] [2 :b] [3 :c]
12:11TimMcmrevil: map vector
12:11mreviloh, ty
12:12TimMc(def transpose (partial map vector))
12:12Fossimidje question: i need to check for ({:value foo}{:value bar}), bit i don't know the sort order in the list
12:12Fossiany way i can get contains? to do that for me or any other clever ideas?
12:13TimMccontains? only operates on keys
12:13TimMcFossi: Sort the input and output before comparing?
12:13clgvFossi: (contains {:value foo}{:value bar} :in-any-order)
12:13Fossii meant midje/contains, not clojure/contains?
12:13TimMcOh, nice.
12:13Fossisorry about not being clear :)
12:14Fossiclgv: excellent :)
12:14clgvFossi: https://github.com/marick/Midje/wiki/Checkers-for-collections-and-strings
12:14clgvthere is a lot of useful checkers there
12:33yazirianHow would you write a function that takes a seq, and returns a function which, each time it is called, returns the next element of the given seq? Is there already something standard that does that?
12:34lpetityazirian: certainly not something standard, because it's a side effecting function you're describing. What problem are you trying to solve ?
12:35yaziriani need a callback that round-robins over a cycle of open connections, basically
12:35lpetityazirian: and how does it need to work from a thread safety perspective?
12:36llasramyazirian: ? &(take 5 (repeat [:conn1 :conn2 :conn3]))
12:36llasram&(take 5 (repeat [:conn1 :conn2 :conn3]))
12:36lazybot⇒ ([:conn1 :conn2 :conn3] [:conn1 :conn2 :conn3] [:conn1 :conn2 :conn3] [:conn1 :conn2 :conn3] [:conn1 :conn2 :conn3])
12:36llasramOh, should test first
12:36yazirianlpetit: thread safety is necessary, its executing inside an aleph handler
12:37llasram&(take 5 (apply concat (repeat [:conn1 :conn2 :conn3])))
12:37lazybot⇒ (:conn1 :conn2 :conn3 :conn1 :conn2)
12:39yazirianthat's not really the pattern it'll be called in though; more like first, first, first, over and over again -- but each call to first should return the next element instead of always returning :conn1
12:39yazirian(next-conn) -> :conn1
12:39yazirian(next-conn) -> :conn2
12:39yazirianetc etc
12:41llasram&(let [conns (atom (apply concat [nil] (repeat [:conn1 :conn2 :conn3]))), next-conn (fn [] (first (swap! conns next)))] [(next-conn) (next-conn) (next-conn)])
12:41lazybot⇒ [:conn1 :conn2 :conn3]
12:43jkkramer,(take 5 (cycle [:conn1 :conn2 :conn3]))
12:43clojurebot(:conn1 :conn2 :conn3 :conn1 :conn2)
12:43llasramcycle!
12:43llasramUgh, I couldn't remember it
12:43llasramThanks, jkkramer :-)
12:43yazirianthe issue is maintaining the state of the cycle
12:43yaziriani've been fiddling with it for a while now but the trick is not getting :conn1 every time
12:43llasramyazirian: Storing the state in an atom solves that
12:45llasramEasier to read: https://refheap.com/paste/694
12:45lpetit, (let [yield (fn [seq] (let [a (atom (cons nil seq))] (fn [] (first (swap! a next))))), test (yield [1 2 3 4])] [(test) (test) (test) (test)])
12:45clojurebot[1 2 3 4]
12:46lpetityazirian: ^^^
12:47lpetitnot sure yield is a good name
12:48yaziriani kinda like it, its what python uses for generators :)
12:48lpetit, (let [yield (fn [seq] (let [a (atom (cons nil seq))] (fn [] (first (swap! a next))))), test (yield (cycle [:conn1 :conn2 :conn3 :conn4]))] (dotimes [_ 10] (test)))
12:48clojurebotnil
12:49lpetit, (let [yield (fn [seq] (let [a (atom (cons nil seq))] (fn [] (first (swap! a next))))), test (yield (cycle [:conn1 :conn2 :conn3 :conn4]))] (for [_ (range 10)] (test)))
12:49clojurebot(:conn1 :conn2 :conn3 :conn4 :conn1 ...)
12:49lpetityazirian: not sure if it's the right way to do that in the context of your problem, but it works
12:50lpetityazirian: if you don't mind starting with :conn2 instead of :conn1, then you can drop the (cons nil seq) and simplify it even further:
12:51yazirianit doesn't actually matter, no
12:51lpetit(defn yielder [s] (let [a (atom s)] (fn [] (first (swap! a next)))))
12:51yazirianso that's fine :)
12:52yazirianoutstanding! that's perfect!
12:52yazirianthanks :)
12:52lpetit,(letfn [yielder ([s] (let [a (atom s)] (fn [] (first (swap! a next))))),
12:52clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
12:52lpetit test (yielder (cycle [:conn1, :conn2, :conn3, :conn4]))]
12:52lpetit (for [ _ (range 10) ] (test)))
12:52lpetit
12:52lpetitoups
12:54lpetit,(let [yielder (fn [s] (let [a (atom s)] (fn [] (first (swap! a next))))), test (yielder (cycle [:conn1, :conn2, :conn3, :conn4]))] (for [ _ (range 10) ] (test)))
12:54clojurebot(:conn2 :conn3 :conn4 :conn1 :conn2 ...)
12:55ibdknoxgood morning folks :)
12:55lpetit,(let [yielder (fn [s] (let [a (atom s)] (fn [] (first (swap! a next))))), test (yielder [:conn1, :conn2, :conn3, :conn4])] (for [ _ (range 10) ] (test)))
12:55clojurebot(:conn2 :conn3 :conn4 nil nil ...)
12:58yaziriani hadn't even considered an atom, i was messing around with recursion
12:58radswhat's the most idiomatic way to add something to a sorted set and immediately get its position in the set?
12:58technomancyibdknox: any further progress on that CPU-eating lein bug?
13:00TimMctechnomancy: Did you see that I fixed lein-otf by adding :aot [lein-otf.loader]? I still don't understand why that wasn't implied by :main lein-otf-loader...
13:00technomancyoh, very strange
13:00TimMcand why it stopped working, too!
13:01TimMc(although that was probably just a screwup on my part somehow)
13:07ibdknoxtechnomancy, haven't looked it into it much. Anecdotally it seems to happen when checking for *new* deps and the length of time is related to how many new deps there are.
13:08ibdknoxtechnomancy, I'm also not entirely sure moving .lein actually fixed it or if it was just because the deps were fetched by then :/ I'll fiddle with it this weekend and let you know what I find out
13:10technomancythanks. I haven't heard from anyone else, but that could just be because I haven't announced 1.7 yet
13:15hagna_so suppose I want to add interactivity to my program so I can modify it while it runs do I do that with a repl?
13:22technomancyhagna_: look into nrepl
13:27hagna_technomancy: so would you agree a repl is the best way to go about interacting with running clojure?
13:28technomancyabsolutely
13:28technomancyprograms that don't expose a repl are rubbish
13:29jkdufair#purdue-itap
13:30muhooi remember someone here was running clojure on an arm
13:30jkdufairoops sorry
13:30muhooi just got a beagleboard, for other things, but i think i'll try running clj on it
13:30hagna_technomancy: hehe thanks
13:30muhoos/got/ordered/
13:37leviMmm, beagleboards.
13:38leviI think I fried mine. :(
13:38cwardellI have a newbie question. I created my project "lein new testProject". I would like to add the dependency for org.clojure/str-utils2 however I don't know the version # i should be appending to it in the project.clj file. How would I find this out? I get errors when trying to do a "lein deps". Sorry if this has been asked before, but I couldn't really find a straight answer on the web. Thanks..
13:39technomancycwardell: try clojure.string instead; str-utils2 is deprecated
13:39technomancy(:require [clojure.string :as string]) in your ns clause
13:40cwardelllike this in the project file? :dependencies [[org.clojure/clojure "1.3.0"]
13:40cwardell [org.clojure/str-string "1.3.0"]])
13:40technomancyno, it's built-in to clojure now
13:40cwardellok.
13:40seanm_cwardell: if it's core clojure, you won't need to add it to your project file
13:41cwardellAnd if it's not core clojure, how would I dissever that version #. Is that something that shows up on git?
13:41technomancycwardell: "lein search" should get you what you need
13:41technomancyonce it finishes downloading the indices, which is very slow
13:41seanm_alternatively you can just browse clojars.org
13:42technomancyor search.maven.org
13:42cwardellperfect. Thank you. Much appreciated.
13:42technomancycwardell: you'll want to read through "lein help tutorial" at some point
13:42cwardellok, will do. Thanks again.
13:57djh_Has anyone got any decent Clojurescript tutorials? What I mean by this is a "getting started" kinda thing, like, is there a leiningen plugin out there similar to Noir where you can just run "lein [x] new" to get a skeleton going?
13:57djh_I've seen Clojurescript One, which is nice, but ideally I want to start setting up my own project with Clojurescript/Clojure elements
13:57technomancyfrom what I gather lein-cljsbuild is the closest we have to that
13:58technomancyI haven't tried it myself yet, but emezeske is fairly active in here
13:58djh_technomancy: thanks man, I'll check that out!
13:59emezeskedjh_: sean corfield wrote up a little "getting started" article that you might find helpful: http://corfield.org/blog/post.cfm/getting-started-with-clojurescript-and-fw-1
14:00djh_emezeske: excellent thanks, I'll give that a read. Just been having a quick skim through the README for lein-cljsbuild - I'm liking the amount of detail on there
14:01emezeskedjh_: great!
14:02pandeirodjh_: clojurescript one on github gives you a nice skeleton and a lot of the machinery already hooked up; but it's not a blank slate... however you can make a branch in the repo that removes all the app-specific code and then clone from that
14:06djh_pandeiro: yeah I was thinking of doing that but I kinda what to build from the ground up rather than knocking everything down first
14:06djh_pandeiro: if you catch my drift
14:06pandeirodjh_: for sure
14:20ohpauleezdjh_: https://groups.google.com/forum/#!topic/clj-noir/wsCVajG0-YE/discussion and the projects here: https://github.com/ibdknox
14:20ohpauleezjayq, waltz, fetch, crate, monet should give you a lot of the building blocks you're looking for
14:28seancorfieldi have another "getting started" blog post in the works that covers using jayq to get jquery up and running with FW/1 (but will apply to any web app)
14:28seancorfieldi should get that tested and finished this weekend
14:29ibdknoxI want to figure out why the resources thing still doesn't work with cljsbuild
14:29ibdknoxseancorfield, have you tried 0.0.12?
14:30ibdknoxin theory you shouldn't need to take the extern out of the jar now
14:33ibdknoxthe response on the CinC work that guy is doing makes me a little sad :(
14:35arohneribdknox: yeah. that's a real wet blanket.
14:36seancorfieldibdknox: i'm on 0.0.11 right now
14:36seancorfieldi'll try 0.0.12 this weekend
14:36ibdknoxseancorfield, okidoke, let me know how it goes
14:37TimMcibdknox: Mailing list stuff?
14:37ibdknoxTimMc, yeah. Maybe it was just the way I read it, but it struck me as a "go ahead, but there's no way it's coming back in"
14:38ibdknoxpretty discouraging for an effort that would be well appreciated otherwise
14:39arohneribdknox: that's how I read it too
14:39hiredmanactually we were just mocking ss's response in a work chat
14:39TimMcUgh, yeah. THey need to get a new lawyer. :-P
14:39arohnerand a new workflow
14:40TimMcthat would be the goal
14:40hiredmanthis guy will actually be at least the second guy to write a clojure compiler in clojure
14:40TimMc"Merely having signed the Clojure CA is not enough." WTF!
14:41TimMcIf he's the only committer and he forked the original repo, the SHA sums + CA should be sufficient.
14:41hiredmanrich didn't like the first guys because it was a port of the java compiler, and included it's own bytecode generating lib instead of asm
14:41TimMcI don't see any particular problems with this: https://bitbucket.org/remleduff/cinc/changesets
14:42ibdknoxit'd be awesome if it came about :)
14:42hiredmanand a clojure reader in clojure that landed with a dud on the mailing list
14:42TimMcMan, why didn't rhickey just write the compiler in Clojure in the first place? Would've saved us all this trouble. ;-)
14:42ibdknoxhaha
14:43ibdknoxsrsly.
14:43hiredmanand I had hacked the ant build to compile the java bits of clojure, compiler my reader with the java reader, then blow it all away and recompile everything with the compiled version of my reader
14:44ibdknoxhiredman, what happened to it?
14:44hiredmannothing
14:44hiredmanit's sitting on github
14:45hiredmanambrose has had some interest recently
14:45ibdknoxhiredman, readerIII?
14:45hiredmanII maybe
14:46Raynesibdknox: Yeah, his response would probably be enough to make me go away and never come back.
14:47ibdknoxRaynes, yeah, it's tremendously ungrateful
14:47RaynesHis response re: the CA and accounting for code can easily be read as "Hey, just make sure we can account for every author. We'll need to talk to them all.". It's the second part that bug me. "And by all means, have fun, but you're probably not good enough for us."
14:47ibdknoxhiredman, that's officially the longest single Clojure function I've seen :)
14:47romain_p_Hi everyone, how do I describe a has-many relationship in korma ? (a user has-many tips, a tip belongs-to a user)? I run into a circular dependency problem in the defentity declarations
14:47hiredmanthe style is odd because deftype didn't exist so I didn't have a way to generate a stable class name
14:47ibdknoxromain_p_, just declare the var before the first one
14:47hiredmanand due to the bootstrapping nature there were some tricky bits with dependencies on the runtime
14:48romain_p_ibdknox: thanks
14:49hiredmanI imagine these days I would pull the bits out into to definlines
14:50dsantiagoIs there any detailed explanation of what exactly inlines are in Clojure?
14:51hiredmandsantiago: a macro expansion
14:51hiredmanwith some mechanism to make it into a function you can use as a value
14:52dnolendsantiago: expressions that will be inlined instead of actually emitting a function call. Mostly useful for fast numerics
14:53dsantiagoHm, OK.
14:53hiredmanhttps://github.com/hiredman/clojure/commit/5f34cb4acbea7bfe976acb57936860a09452c076 jop was pretty cool
14:54hiredmanyou could ^{:primitive true} (+ (int 1) (int 2)) and it would just emit an iadd instruction
14:55dsantiagoI've been running into holes in Clojure's numeric stuff lately, thought it might help, but it's looking like it wouldn't.
14:55TimMcdnolen: Work proceeds apace on an import-static that produces inlineable functions, by the way.
14:56TimMcI'm pretty excited.
14:56dnolendsantiago: what problems specifically?
14:56dnolenTimMc: neat
14:57dsantiagodnolen: I want to unchecked-divide-int a value in a long that is larger than an int, so this throws an exception because the value is out of range for an int. And there does not seem to be an equivalent function for longs.
14:57dsantiagoAnother one is I want to do an unsigned bit shift right, which Clojure doesn't have a function for, as far as I can tell.
14:58hiredmanthere is a patch in jira for unsigned bit shift right I think
14:58dsantiagoYeah. Hopefully that goes into 1.5 so I can use it.
14:58dsantiagoRight now I'm just calling into some Java functions I wrote.
14:58hiredmanhttp://dev.clojure.org/jira/browse/CLJ-827
14:59hiredman:/
14:59TimMcOh, that's mine!
14:59TimMcWell, I'm not the reporter, but I did submit a pretty thorough patch.
14:59dsantiagoYour patch is awesome. I want it.
15:00hiredmanit's not mine
15:00hiredmanjoegallo's
15:01TimMcI'd be happy with either patch, I think.
15:05dsantiagoSure.
15:07Raynesibdknox, TimMc: I figure the only work flow that would be truly as secure as they want it to be would be the one where everybody sends patches through postal mail with a picture of the author holding up a newspaper with the date of the authoring of the patch on it and the code in the other hand.
15:07Raynes~rimshot
15:07clojurebotBadum, *tish*
15:07ibdknoxlol
15:08ibdknoxbetter solution: all patches must be noterized
15:09the-kenny-wAll patches should be validated via `M-x checkdoc' prior submission :)
15:10Raynesibdknox: The lawyer must watch the production of the patch. If a character of code typed is not accounted for by the lawer, the author must start over with a new solution to the problem.
15:11TimMcWith true clean-room coding, the programmer is first given a medium-term amnesia drug.
15:12TimMcWell, I've responded, asking for clarification -- we'll see if I get any.
15:12pandeiroit sounds like you guys are describing some bizarre hostage crisis
15:12TimMcsort of.
15:12ibdknoxhaha
15:13TimMcClojure/core is holding the codebase hostage (using the gun of legitimacy.)
15:13ibdknoxhold on too tightly and things slip away...
15:14ibdknoxit'd make me sad if something like this ended up being the fracturing point. heh
15:15hiredmanwell, as we discovered yesterday most people have been running forks of 1.2
15:15pandeirois there a link i can read about the "something like this"? it's the CinC thing?
15:15hiredman(most people with clojure code in production)
15:15TimMcpandeiro: https://groups.google.com/group/clojure-dev/browse_thread/thread/a6e2753c1104b28c
15:16ibdknoxhiredman, wait, what? I missed this
15:16hiredman~logs
15:16clojurebotlogs is http://clojure-log.n01se.net/
15:17stuartsierraYou just need to be able to find everybody who committed.
15:18hiredmanhttp://clojure-log.n01se.net/date/2012-02-09.html#15:32e
15:18hiredmanibdknox: -^
15:18dsantiagoThis guy looks like he's started from scratch.
15:19ibdknoxhiredman, yeah just found it
15:20hiredmannathanmarz: so are you guys using a fork of clojure too?
15:20ibdknoxwe're still on 1.2.1
15:20stuartsierraRich makes the rules, I just try to follow them.
15:20TimMcYeah, I know.
15:21TimMcBut it's a little hard to figure out what the rules are sometimes.
15:21stuartsierraTell me about it.
15:21ibdknoxheh
15:21TimMcIt comes down to what the lawyer says, right?
15:23TimMcAh, saw your response. OK.
15:46Raynesibdknox: You should be getting the first chapter in your inbox for review soon.
15:46Raynes:D
15:46RaynesIf it isn't already there.
16:02seancorfieldjust catching up on the fork convo... World Singles isn't on a fork, never has been... we went from 1.2 to 1.3 early on in dev and went to production on alpha 7 (I think, maybe alpha 8)... but it's a lot easier if you never had a bunch of legacy code on 1.2 :)
16:02seancorfieldand we're using lein-multi to test everything on 1.4.0 as it evolves
16:03seancorfieldwhat's folks biggest obstacle to moving from 1.2 to 1.3 or 1.4? the contrib breakup? or language issues?
16:03cemerickstuartsierra: there was a fork conversation?
16:03cemerickstuartsierra: sorry
16:03ordnungswidrigmine was contrib and dynamic vars.
16:03cemerickseancorfield: ?
16:03seancorfieldi see hiredman mentioned CLJ-855 (exceptions) as a blocker
16:03stuartsierracemerick: ?
16:03seancorfieldhttp://clojure-log.n01se.net/date/2012-02-09.html#15:32e
16:03cemerickstuartsierra: nm, autocomplete fail
16:03cemerickoh, yesterday
16:03seancorfieldfolks running on forks of 1.2 rather than official builds
16:04stuartsierrawhy?
16:04clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
16:04Raynesseancorfield: Since technomancy_ isn't here to brag: "You won't need multi in lein 2, because of profiles. :D"
16:05hiredmanstuartsierra: because of issues with 1.3 (hashing, equality, and clj-855) and 1.4 (clj-855)
16:05stuartsierrahm
16:05maravillasRaynes: you mean lein-multi, right?
16:06seancorfieldyeah, i know Raynes and i'm looking forward to migrating World Singles to lein 2 "soon" (but right now we're focused on a deadline for specific platform features and data migration so it won't happen before then)
16:06neddoes clojure have something similar to CLOS
16:06Raynesmaravillas: Yessir.
16:06nedCLOS with persistence
16:06maravillasgood to know, I won't mess with testing it against 2 then :)
16:06nedbasically i want a EAV or prototypical object system (i.e., where i can add fields at a whim) that persists to a DB
16:06Raynesseancorfield: Really? That's awesome. When you do, be sure to help us with documenting migrating and stuff.
16:06seancorfieldi love lein-multi btw and i've been adding it to various clj projects i maintain as i work on them...
16:07seancorfieldRaynes: huh?
16:07nedso if i have something like "person" and a year down the line i want to add a field like "twitter account" (asssuming the object was defined before twitter was popular) i could add that field
16:07hiredmanned: sounds like you want a map
16:07seancorfieldRaynes: oh, i get it... when i migrate to lein 2... sorry, not enough coffee yet :)
16:07Raynes:p
16:07nedhiredman: mmm...
16:07neda map in clojure is just a hashmap/dict k,v store right?
16:08TimMcYep.
16:08nedhow does the structure of the objects work out
16:08seancorfieldned: sure sounds like a map to me... which is easy to save to mongodb...
16:08seancorfieldwhy do you want an "object" ned?
16:08hiredmanned: why do you want objects, and what are objects?
16:08nedseancorfield: thats the paradigm in which i think :P
16:08TimMcned: Specifically, it is a persistant data structure -- low cost to "modify", and it's immutable.
16:08nedby all means, change my outlook :v
16:09seancorfieldned: yeah, for OO folks coming to FP, shaking off ObjectThink is the first / biggest hurdle :)
16:09nedi mean.. ok so a new person comes in.. how do i get prompted for all those fields
16:09nedif i want to instantiate "bob" from SLIME (where bob is a new employee)
16:09nedhow do i know which fields exist
16:09seancorfieldyou mean "how do i drive my form generation?"
16:09TimMcned: I think the big question here is how do you manage your backing store.
16:09ibdknoxRaynes, sweet :D
16:09TimMcand migrations
16:10nedTimMc: well, with EAV (aka openschema) you don't need to
16:10nedmigrate at all?
16:10ned(sorry for the linebreak) didnt mean to hit enter
16:10seancorfieldsounds like you need metadata to describe 'person'... perhaps a vector of field names (or something richer, depending on what metadata you need)
16:10nedseancorfield: ahhhhh
16:10nedok now im getting pointed in a right direction it would seem.
16:10TimMc(not to be confused with clojure's IMeta metadata)
16:10seancorfieldan object itself doesn't buy you that - unless you have the metadata in the first place
16:10seancorfield(right TimMc yeah)
16:11nedwhats the difference between IMeta metadata and 'metadata'
16:11nedones an interface you implement?
16:11seancorfieldIMeta is a language feature, you want something persistent in a DB to describe 'person'
16:11TimMcThe latter is the general programming concept.
16:11nedseancorfield: ahh correct.
16:12seancorfieldi'm off to lunch but happy to chat more about metadata-driven stuff later since that's actually how we do most stuff at world singles
16:12hiredmanyou just need a list of fields you want values for
16:12TimMcClasses that implement clojure.lang.IMeta get to have equality-exempt maps of data attached to them.
16:12nedseancorfield: excellent. when do you think you'll be back?
16:12hiredman(def fields #{:foo :bar :baz})
16:13nedhow do you correlate that (def fields #{:address :date-of-birth :employee-level}) with an 'object'
16:13ned(excuse my stupid OO terminology)
16:13nedits just a mental roadblock im trying to overcome.
16:13nedbear with me pleases :P
16:13seancorfieldned: hour or so... feel free to email me to discuss (obvious: first name at company name dot com)
16:13hiredmancorrelate for what purpose?
16:13nedseancorfield: excellent. i'll be around to hit you up and extract knowledge from your mind :P thanks!
16:14nedhiredman: well, lets say i want to create a new employee. how do i 'inherit' those fields?
16:14TimMcned: In OO-land, "object" specifically means a value with a type and a limited set of functions that are attached to it. In FP, the attachment is only in your mind. :-)
16:14nedi understand that with CLOS and clojure, methods are entirely different from "classes" (sorry to use the lisp terminology)
16:14nedyes i got that.
16:15nedim just trying to figure out how the relationship between the defmethod and the defclass exist
16:15ned(again, sorry i might be conflating CL with clojure)
16:15hiredman(defn fill-in-form [fields] (loop [[f & fs] fields m {}] (if f (recur fs (assoc m f (read))) m)))
16:15hiredmanthere is none
16:15nedgive me a second to digest that. that's a mouthful.
16:15TimMcned: You just populate a new map with stuff. ##(assoc {:id 45} :name "Bob")
16:15lazybot⇒ {:name "Bob", :id 45}
16:16hiredmanit takes a list of fields and for each field reads in a value producing a map of fields to values
16:16nedTimMc: so theres no way to 'inherit' the fields that existed with the symbol (? not sure if "fields" is a symbol in this example) re (def fields #{:foo :bar :baz})
16:17nedbasically from slime i want to be able to say something like "new object" and then be prompted for fields to fill.
16:17nedwhere object = an Employee or whatever
16:17hiredmanned: write a create-employee function that does that
16:18nedahhha.
16:18TimMcned: Well, you can loop over that set (which is what the #'fields var contains) and ask for the value of each in turn.
16:18TimMcand as you get them, 'assoc the values onto a map with the keys from 'fields.
16:18nedboth are interesting solutions.
16:18nathanmarzhiredman: we're not using a fork of clojure
16:19nathanmarzhiredman: what gave you that idea?
16:19hiredmannathanmarz: informal survey
16:19nedhiredman: where does defrecord come into play (if at all)
16:19hiredmannathanmarz: other people apparently have been
16:19hiredmanned: don't worry about it
16:19ned(and if it does, can you arbitrarily add fields?)
16:19nedhiredman: hmm
16:20hiredman"but..." "don't worry about it" "I thought..." "don't worry about it" etc etc etc
16:20nedhiredman: i get you.
16:20TimMcned: defrecord makes (classes for) associative data structures. They're mostly useful for interop with Java, and add some pain for Clojure users.
16:21JohnnyLwhy is Clojure so slow?
16:21nedand def-protocol?
16:21RaynesHahahahatroll.
16:21nederr, extend-protocl
16:21TimMcRaynes?
16:21clojurebotif it's not one thing it's another
16:22TimMcThat was unexpected.
16:22RaynesTimMc: JohnnyL
16:22RaynesRead a few lines above mine.
16:22TimMcOh, I have him ignored.
16:22TimMc/ignore JohnnyL <- emezeske
16:23emezeskeTimMc: Thanks!
16:23TimMcThere's also a useful -replies option.
16:23RaynesI don't generally ignore people. IIRC hiredman has had me ignored for like 2 years now and has never told me why (and I can't really ask him, since he has me ignored), which kind of turned me off of ignoring people unless they're actually spamming or something.
16:23nedso, is there a way to auto-persist any changes made to a entity to mongodb via hooks?
16:23TimMcned: Protocols are a fast-dispatch mechanism that is externsible to new types retroactively. It's basically the cat's pajamas.
16:24ibdknoxRaynes, I have myself ignored. ;)
16:24emezeskeRaynes: That's reasonable. In this case, I think the perpetrator knows why people are ignoring him, though :P
16:24RaynesIndeed.
16:24TimMcRaynes: hiredman is an outlier, he has like half the channel ignored.
16:24TimMcIt's kind of funny when he responds to questions that have already been answered.
16:24RaynesEverybody is wrong.
16:25hiredmanned: you are entities are immutable data, how are you going to change them?
16:25hiredmanyour
16:25hiredmanwow
16:25ibdknoxhaha
16:25ordnungswidrig*g*
16:25ibdknoxhiredman, you've been taking typing lessons from me :p
16:25hiredmanfirst time that's ever gone that way for me
16:26RaynesI'm sure I did something to earn it though. I was 15 two years ago, so I wouldn't be surprised if I said something pretty stupid.
16:26RaynesEr, 16?
16:26RaynesSomething like that.
16:27TimMcned: You can use refs (or atoms or agents or even vars) to handle mutable state, and add watchers on them to propagate changes.
16:30nedhiredman: so what's the right way of mutating the data?
16:30nedto put this in perspective, this is a little customer-relation manager where salesforce is overkill for our software shop, but excel and emails have long since been under-kill since we've got such a large influx of clients
16:31hiredmanned: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
16:31nedso we basically have a lot of customers, a few programmers, a PM, a set of projects, and we're constantly keeping track of email/contacts/last contact/ and internal notes
16:31nedhiredman: ah, a hickey talk. excellent.
16:31nedhe's a damn good engaging speaker :)
16:31nedoh my, an hour ten minutes :v that'll be on my queue for later tonight i suppose.
16:32RaynesRich Hickey told me I was a good speaker. Made a man that day. :>
16:33RaynesI've been trying to get my ego under control ever since.
16:33jodaro`hows that working out for you?
16:33Raynesjodaro`: I had to go up to my room and shave immediately after.
16:34jodaro`your face or your legs?
16:34ibdknox~rimshot
16:34clojurebotBadum, *tish*
16:34Raynes$guards
16:34lazybotSEIZE HIM!
16:34ibdknoxlol
16:34jodaro`i guess i could have gone way more crasser with that one
16:34jodaro`but like
16:35Raynesjodaro`: It's a family channel.
16:36Raynes;)
16:36jodaro`right
16:37hagna_so I'm watching clojure for java programmers and he's talking about interacting with a running process. How is that typically done?
16:38hiredmanhagna_: a repl
16:39TimMchagna_: The easiest way is to launch the app *from* the REPL.
16:39hagna_TimMc: ahh from the repl I see
16:39TimMcand then you get to redefine stuff and poke around.
16:39TimMcIt's great to be able to modify a GUI app on the fly. :-)
16:40TimMcI suppose your app could also expose a REPL on some port -- I don't *know* what the "nrepl" project is, but that's my best guess.
16:40ibdknoxis nrepl probably the easiest solution for doing that after the fact?
16:40ibdknoxlol
16:41TimMcibdknox: What does it do?
16:41Raynesibdknox: Yes.
16:41ibdknoxTimMc, provides a server and a client for a repl
16:41TimMcMy Google button is broken, you see.
16:41hiredmanswank-clojure is fairly easy to embed
16:41Raynesibdknox: nrepl is God.
16:41RaynesIf you embed swank-clojure, you are not my friend.
16:41ibdknoxRaynes, I've been thinking of wrapping it into everything I build
16:41hiredmanor just a socket repl
16:41ibdknoxjust for kicks and giggles
16:41hiredmanthere used to be one in contrib
16:42hiredmana socket repl is what we have at work
16:43cemerickhiredman: you mean something you can telnet into?
16:43ibdknoxI'm excited for when vimclojure gets converted over to nrepl, as that will make connecting it to things easier
16:43hiredmancemerick: netcat actually
16:44TimMcyay nc
16:44cemericknrepl provides a telnet-happy transport (which I called tty, but whatever)
16:44cemerickit's not the default, but it's there
16:44cemerickI'm keeping the HTTP one off to the side.
16:44hiredmanwe have a little shell script that controls a long running java process, one of the options is to connect to the repl
16:45hagna_anyone know how nrepl works? I sure don't
16:45hiredman*cough*
16:45hagna_but launching from a repl sounds just great
16:45ibdknoxhaha
16:45ibdknoxhagna_, cemerick wrote it
16:45hagna_oh err uh
16:45ibdknoxso I'm fairly certain he knows :)
16:45hagna_yeah didn'
16:46hagna_t notice that
16:46technomancy_seancorfield: do you still have a mixed scala/clojure codebase?
16:46cemerickhagna_: the README on master hasn't been updated yet to reflect the recent redesign
16:46cemerickbut the API docs and test suite are mostly complete and accurate
16:46TimMccemerick: Can nrepl "hack into" a running JVM?
16:47hagna_TimMc: of course
16:47technomancy_only if you've got the skills
16:47TimMc(shouldv'e just said "attach to"...)
16:47cemerickTimMc: you mean opening a repl to a process that isn't explicitly running a repl server?
16:47hagna_cemerick: you ought to do your development on master like leiningen
16:48cemerickhagna_: development *is* on master, I just haven't rewritten README yet
16:48hiredmanhttps://github.com/wirde/swank-inject
16:48TimMccemerick: Right. Let's say I've launched an uberjar from the command line. Can I attach?
16:49cemerickTimMc: No, but it's possible.
16:49cemerickThere's already a project that allows for that, but I'm away from my browser at the moment.
16:49ibdknoxcemerick, where are the API docs? On the wiki?
16:49TimMc$ nrepl hindsight -p 23695 :-P
16:50hagna_cemerick: can I attach to a jvm on TinMC's machine from my own?
16:50cemerickibdknox: in the source :-P
16:50ibdknoxhaha
16:50cemerickhagna_: if he's running a repl server, yeah
16:50cemerickibdknox: hrm, theoretically there's automatic autodoc?
16:51cemerickheh, *very* old autodoc
16:52cemerickstuartsierra: how/when does the autodoc for contrib projects get generated/updated?
16:58stuartsierrait doesn't
16:58cemerickwell, there's autodoc for tools.nrepl, and I didn't put there…
16:58stuartsierraneither did I
16:58cemerickhuh
16:58cemerickninja job by replaca_? ;-)
16:58stuartsierraTom F.?
16:58TimMcOoh, historical question: I see git tags in clojure.contrib up to 1.3.0-alpha4 -- did it *almost* get released?
16:58ibdknoxgithub is making me sad lately
16:58ibdknoxthey seem to be having issues a lot
16:58technomancy_ibdknox: huge ddos, apparently
16:58stuartsierraTimMc: I made those for a while. It was painful3.
16:58ibdknoxtechnomancy_, really?
16:58technomancy_so they say
16:58cemerickibdknox: been hedging my bets by looking at bitbucket
16:58cemerickwhich, on a whole, isn't so bad
16:58cemerickhardly as good, but a far cry from the shite it used to be.
16:58trptcolini'd post a link to the blog post about the ddos, but, well... site's down.
16:58hiredmancemerick: if you end up with a browser repl widjet in js that talks to nrepl then I will be interested
16:58technomancy_I mirrored clojure on gitorious back in the svn+kevinoneill days
16:58TimMcI have one private repo on bitbucket, but it's just wedding-planning stuff.
16:58cemerickhiredman: well, I'm not going to build the front-end, but a decent ring handler is done.
16:58TimMcstuartsierra: So, was there almost a release, then? Like, was most of contrib actually made compatible with 1.3?
16:58cemerickhah @ gitorious
16:58stuartsierraTimMc: yes, but that was before most of the breaking changes
16:58hiredmancemerick: the front-end is the only thing I am interested in, I have plenty of repl backends
16:58TimMcstuartsierra: Ah, I see.
16:58cemerickhiredman: not my bag; ibdknox might oblige eventually
16:58technomancy_wow, that would have averted so much confusion
16:58stuartsierrasomewhere on GitHub somebody made a clojure-contrib repo that continues to work on 1.3
16:59cemerickhiredman: there's also https://github.com/djpowell/liverepl, which doesn't require starting the process in debug
16:59aperiodi1trptcolin: the blog post is still up for me: https://github.com/blog/1036-about-this-week-s-availability
17:03ibdknoxaperiodic, that's because github just came back :)
17:04hagna_so I just launched this irc bot from a repl with (-main nil) and suprinsingly it didn't block like I thought it would. Why is that?
17:06MenTaLguYmaybe the main function effectively just spawns some (non-daemon) threads and returns
17:06TimMctechnomancy_: What would have?
17:06technomancy_TimMc: 1.3-compatible contrib
17:07TimMcEh, it was probably for the best.
17:07technomancy_would have sped up adoption of 1.3 hugely and given us more time to spread the "get off contrib while you can" message
17:07TimMchmm
17:07TimMcThere would just have been more trouble later. People use what is convenient.
17:07technomancy_TimMc: depends on whether your goal is to get people to stop using contrib or lower overall frustration
17:08TimMcThey don't read docs, they copy code.
17:08TimMc("copy code" = learn by example)
17:08technomancy_it's courteous to at least provide a single release between deprecation and removal
17:08stuartsierraThe biggest motivation was time.
17:08stuartsierraToo much time was being sucked up trying to maintain monolithic contrib.
17:09stuartsierraMost of the code had long been abandoned by its original authors.
17:09TimMctechnomancy_: 1.2.2 changelog: "contrib is deprecated" :-P
17:09technomancy_all it would have taken is a recompile using the 1.3 compiler
17:09hiredmanlooks like java.jmx is getting abandoned :/
17:09technomancy_don't actually have to fix any bugs
17:10stuartsierratechnomancy_: It doesn't compile under 1.3
17:10stuartsierrahiredman: so, aren't you a contrib committer?
17:11hiredmanstuartsierra: if I am it's the first I've heard of it
17:11stuartsierraok, well, you could be
17:11technomancy_in case you don't have enough jira in your life
17:11hiredman:)
17:12hugodhttps://github.com/arohner/clojure-contrib/tree/1.3-compat if anyone still needs it
17:12hiredmanstuartsierra: so make it so
17:13stuartsierrahiredman: I can't. But someone on clojure-dev can.
17:17arohnerstuartsierra: the code may have been abandoned by the *authors*, but not by the *community*. There are still tons of actively-used projects that still depend on contrib
17:18stuartsierraThen the community can continue to maintain it, or fix those projects.
17:19arohnerstuartsierra: yes. and it's a pain in the ass, and has delayed 1.3 adoption significantly. https://github.com/arohner/prxml
17:20stuartsierraI don't know what to tell you. I don't have time to maintain it.
17:21technomancy_neither did Mark McGrangahan, yet somehow clj-http is still maintained
17:21technomancy_quite actively
17:21TimMcby dakrone et al, right?
17:21dakroneaye
17:22stuartsierraIf you want/need something, don't rely on someone else to do it for you.
17:22hiredmandakrone: so I've been thinking it might be a good idea to rename the namespaces in clj-http-lite
17:22TimMcI think it is reasonable to expect community maintenance.
17:22hiredmanI was thinking clj-http.lite.* no longer a drop in replacement but no collisions
17:23dakronehiredman: I'd be down for that
17:23dakroneso they could be used side-by-side
17:23stuartsierraTimMc: Who is this community? YOU are the community.
17:23dakronewould be easier to test if/when they converge/diverge
17:23stuartsierraNo one here is obligated to do anything.
17:23hiredmandakrone: I dunno about side by side, just in case something transitively pulls something else in
17:23TimMcstuartsierra: I think you misunderstood me -- I agree with you.
17:23stuartsierraoh good :)
17:24dakronehiredman: yea, the only person who would use them side-by-side probably would be me, and that would be to make sure they lined up
17:24TimMcI wanted clojure.contrib.import-static, so I started hacking on it.
17:24stuartsierraNow that was just a bad idea of mine.
17:24TimMcstuartsierra: How so?
17:25stuartsierra copies.
17:25TimMcExpand?
17:25stuartsierraIt creates new Vars, copying the values from static constants.
17:25stuartsierraThe new Vars are not constants, so the JVM can't inline them.
17:26TimMcAh, I see.
17:26TimMcFor me, the important part is the static methods.
17:26stuartsierraless of a problem, but still adds unnecessary Fn wrapping.
17:26TimMctmciver and I are majorly overhauling it -- it won't produce macros, but instead (where possible) inlineable functions.
17:27TimMcproxying AFn
17:27stuartsierracool
17:27TimMcI don't know enough about inlining yet to be *sure* this works, but it seems legit.
17:28TimMcShould work with both 1.2 and 1.3's invokePrim stuff.
17:29stuartsierrag'night folks
17:29TimMcsee ya
17:29TimMcAlso planned are renaming imports, so Math/PI could become M/PI
17:46pjstadigwait... i thought one of the whole points of contrib was that Clojure/core pledges to maintain it
17:50seancorfieldtechnomancy: no, we retired all our scala code - replaced by clojure
17:51technomancyoh, ok.
17:51technomancybut who will use my new lein-scalac plugin then? =)
17:53seancorfieldi quite enjoyed deleting that scala code :)
17:53seancorfieldand removing all the scala-related stuff from our build.xml file
17:55seancorfieldpjstadig: no, clojure/core doesn't maintain contrib - clojure/dev folks maintain contrib
17:56seancorfieldwho is maintaining clj-http officially these days?
17:57TimMcseancorfield: dakrone
17:57dakroneseancorfield: I do
17:57seancorfieldah yes... thank you dakrone ! i use that heavily at world singles - very nice!
17:57dakroneglad to hear it! :)
17:58seancorfieldi ended up with mark's clj-time (because i needed it to run on 1.3)
17:58dakroneheh
17:58seancorfieldbut i'll be honest - i use date-clj more because it works with jdbc
17:59seancorfieldi'm trying to switching our code base over (since clj-time can convert to/from regular dates and it's so much nicer for date arithmetic etc)
17:59seancorfieldover to clj-time from date-clj i should say
18:01TimMcWhat is World Singles?
18:02seancorfieldInternet dating
18:02seancorfieldwe have 50+ niche sites, mostly ethnic verticals
18:02seancorfieldten are on our new platform that uses clojure, the rest should be migrated within a few months
18:03TimMcNice.
18:03TimMcMet my fiancée on OKCupid
18:03seancorfieldare you going to Clojure/West? i'm talking about World Singles there
18:04TimMcNah, I'm in Boston.
18:04seancorfieldi met my wife on usenet :)
18:04TimMcsweet
18:04seancorfieldi was living in england back then, she was in california... i moved...
18:05TimMc(Note: I no longer recommend OKCupid -- they've really changed from 5 years ago.)
18:05seancorfieldi highly recommend the world singles sites :) (of course)
18:06seancorfieldseveral of our customer service reps are former customers (they liked the brand so much they joined the company :)
18:06Scriptorheh, clojure/west falls on st patrick's day
18:06seancorfieldand our head of HR met our CEO on one of our sites (before she joined the company)
18:07TimMcScriptor: Oh man, I have to be in Boston for St. Patrick's Day ^W^W^WEvacuation Day!
18:07TimMcDefinitely can't make it.
18:08Scriptorhah, even better!
18:08seancorfieldi couldn't believe my eyes the first time i experienced St Paddy's Day over here... insane!
18:08TimMcIt's pretty weird, yeah.
18:08seancorfieldi was born and raised in N. Ireland and it's nowhere as big a deal over there
18:09Scriptorwell, it's the same deal with cinco de mayo
18:09TimMcFrom my perspective, a bunch of people wear green and puke green, and then things go back to normal.
18:09seancorfieldlol
18:09TimMc(all the green beer, you see)
18:10seancorfieldned: btw, i'm back (he announces, redundantly) if you want to chat about metadata :)
18:10TimMcYet another night the roads aren't safe. -.-
18:10seancorfieldare the roads ever safe in america??
18:10lazybotseancorfield: What are you, crazy? Of course not!
18:10TimMchaha
18:11TimMcseancorfield: In BOston, there's a huge Irish immigrant population -- I think nostalgia contributes to the holiday's popularity.
18:11technomancyheh; my parents refused to teach me to drive when I was growing up; they said I had to be back in the states before I could learn
18:11seancorfieldtechnomancy: where were you?
18:11technomancyIndonesia
18:12TimMcToo dangerous or not dangerous enough?
18:12technomancyterrifying
18:12TimMcYou shoulda learned there.
18:12TimMcThen you could hit Miami with *confidence*.
18:12technomancyassuming I survived
18:13TimMcI learned in a 1985 Volvo station wagon. Friggin' *tank*.
18:13technomancyseattle is crazy though; people don't bother speeding
18:13technomancyit's the weirdest thing coming from California
18:14seancorfieldi find driving over here so "zen"... big wide roads, slow speeds (even in california, to be honest), everyone stays in lane
18:15seancorfieldwe're considering driving to florida in a couple of weeks (cat show) because flying with cats is such a pain
18:15Null-AI just switched from emacs to aquatics on osx. And when I C-x C-e, it's using the current namespace in the repl to eval the last sexp. Whereas on emacs it would use the namespace declared at the top of the file where C-x C-e was used.
18:15Null-AHow do I get the latter behavior in aquatics?
18:15Null-Aaquamacs*
18:15technomancyaquamacs isn't very well supported; I recommend switching back
18:16Null-A*nods* i'm prepared to do that
18:16TimMcWhy did you switch in the first place?
18:16technomancythey ship their own copy of slime iirc
18:16seancorfieldi tried aquamacs and very quickly gave up and went with emacs
18:16Null-Aaquatics has some slightly useful patches
18:16Null-Ai'll switch back
18:17seancorfieldemacs 24 + marmalade repo + swank-clojure (and either starter kit or clojure mode depending on who you listen to)
18:17technomancyeither?
18:18seancorfieldsee what i mean?
18:18seancorfieldeveryone has a different opinion :)
18:18Null-A24 works well?
18:18Null-Atime to upgrade
18:18technomancy24 is great
18:18seancorfieldthat's why it's so hard to get up and running with emacs - there's as many different instructions as there are emacs users :(
18:18nedseancorfield: could you pastebin some demo code (a few tens of lines) to lead me in the right direction (if you remember my project reqs)
18:18seancorfield24 has package management built in
18:19nedseancorfield: that might be asking too much, if you could point me in the right directoin that'd be good too
18:19nedbasically i want dynamic ability to add fields to each "customer" or whatever, and have persistence to mongodb.
18:19seancorfieldned: well, we have some fixed-schema database tables that describe the fields each "object" has - enough data for display and validation
18:20nedehh the problem is its more of a dynamic schema, we dont know when fields are going to be added, and we dont want to deal with migrations (if we can avoid it)
18:20seancorfieldthen we put those fields / values in a map and save it in mongodb
18:20nedhm
18:20seancorfieldthe metadata has a fixed schema
18:20seancorfieldthe "objects" don't
18:20nedoh? you cant dynamically add fields to the metadata?
18:21seancorfieldadding a new field to the "objects" is just a matter of inserting a new row of metadata
18:21seancorfieldwe almost never need to change the schema of the metadata
18:21patchworkHey all, getting a weird error with lein:
18:21patchworkException in thread "main" java.lang.NoSuchMethodError: clojure.lang.RT.keyword(Ljava/lang/String;Ljava/lang/String;)Lclojure/lang/Keyword;
18:21patchworkIt can't find keyword?
18:22patchworkthere are some other entries online about it, and I have tried all of their workarounds, but none of them fixed the problem
18:22seancorfieldned: does that make sense?
18:22technomancypatchwork: probably have code compiled with two different version of clojure in your deps
18:22technomancyclojurebot: java.lang.NoSuchMethodError?
18:22clojurebotGabh mo leithscéal?
18:22patchworktechnomancy: How would I detect this?
18:22patchworkor work around it?
18:22seancorfieldpatchwork: yeah, what technomancy said... i ran into that with a lein plugin that had some AOT code in it
18:22nedseancorfield: trying to process that. give me a few seconds.
18:22technomancypatchwork: maybe lein pom && mvn dependency:tree
18:24patchworkHmm… that did say there is a problem
18:24nedseancorfield: ok so how would you add a new "row" of metadata
18:24patchwork'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: antler:caribou:jar -> duplicate declaration of version 0.3.0-SNAPSHOT
18:24patchworkduplicate declaration of a snapshot version?
18:24patchworkhow does that happen?
18:24seancorfieldned: insert into metadata ( ... ) values ( ... ) - we keep metadata in mysql right now :)
18:25patchworkSo how do I remove the duplicate?
18:25patchworkodd
18:26seancorfieldeach row of metadata specifies a field (on an "object") and either describes its type / length / etc or names a function for custom validation and so on
18:27patchwork???
18:27lazybotpatchwork: Oh, absolutely.
18:29seancorfieldpatchwork: do you have any global lein plugins?
18:29seancorfieldthat's what bit me
18:31technomancy1.7 fixes that
18:32patchworkIs 1.7 out?
18:33technomancy"soft launch"
18:33nedseancorfield: ok im going to process all of this.
18:33nedthanks for giving me a lot to digest. im going to read docs, and ruminate.
18:34nedlikely going to return with a lot of questions :P
18:35patchworkI just upgraded to 1.7 and have the same problem
18:35seancorfieldned: feel free to email me directly
18:36seancorfieldmy email address is on the Where Did Clojure Contrib Go page if you can't guess it or find it elsewhere :)
18:36technomancyoh, sorry; it fixes that problem at plugin install time
18:36technomancyso any newly-installed plugins won't cause it
18:37patchworkSo, how do I see what plugins are installed?
18:37patchworklein plugin just lets me install and uninstall
18:37seancorfieldls ~/.lein/plugins
18:37patchworkAha! So I just remove it then?
18:38technomancysure
18:38technomancyre-install the ones you actually use
18:38patchworkAlright, removed the one plugin in there, same problem
18:38patchworkI didn't use it
18:38technomancyis it lein-marginalia?
18:38patchworkNo it was lein-noir-1.2.1
18:38patchworkbut it is gone now
18:39nedseancorfield: totally appreciate it :)
18:40technomancyjust get rid of them all and re-install the ones you use
18:40seancorfieldpatchwork: then do lein clean, deps
18:41patchworkI got rid of all of them
18:41seancorfieldsee what state you end up in after that
18:41seancorfieldthen it'll be a case of picking thru what's in your lib and lib/dev folder i suspect, looking for the culprit
18:41patchworkSame problem
18:42patchwork: (
18:42technomancyclojurebot: lein debug is <reply>Paste the contents of project.clj and ~/.lein/init.clj along with the output of ls ~/.lein/plugins and lein version.
18:42clojurebotAck. Ack.
18:42patchworkWhat would cause this result of > mvn dependency:tree ?
18:42patchwork'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: antler:caribou:jar -> duplicate declaration of version 0.3.1-SNAPSHOT @ line 58, column 17
18:43patchworkduplicate declaration?
18:43technomancyhard to say without seeing project.clj
18:44patchwork(defproject nikebetterworld "1.0.0-SNAPSHOT"
18:44patchwork :description "FIXME: write description"
18:44patchwork :dependencies [[org.clojure/clojure "1.3.0"]
18:44patchwork [antler/caribou "0.3.1-SNAPSHOT"]
18:44patchwork [antler/sandbar "0.4.0-SNAPSHOT"]]
18:44patchwork :dev-dependencies [[lein-ring "0.4.5"]])
18:44technomancyclojurebot: paste?
18:44clojurebotpaste is gist
18:45patchworkSorry, don't know the conventions around here
18:45patchworkso you are saying use gist?
18:45ibdknoxyeah :)
18:45ibdknoxor refheap!
18:45technomancyyeah, best not to flood the channel
18:45patchworkAlright
18:45ibdknoxhttp://refheap.com
18:45technomancylemme see if I can repro
18:46the-kenny-wpatchwork: The convention everywhere in irc is: Use a pastebin.
18:46patchworkGot it
18:47patchworkSo this only happens when I try to run a custom lein task, now that I look at it
18:47patchworkhave custom lein tasks changed somehow?
18:47patchworkI have one called bootstrap
18:47ibdknoxhuh, never heard of caribou
18:47patchworkThat is the project I am working on
18:48patchworkwe are building sites with it
18:48ibdknoxit looks like scaffolding on crack?
18:48patchworkYeah it is a basis for building websites
18:48patchworkgathering all of the solutions in one place so we only have to solve them once!
18:49ibdknoxhm
18:49patchworkit is a rewrite of a project that has grown long in the tooth
18:49patchworkbut at one point had about 50 sites in production
18:49patchworkI convinced the boss to go with clojure : )
18:49patchworkit has been great so far
18:49patchworkexcept for issues like this
18:50patchworkYeah I have been teaching a bunch of the devs here clojure
18:50patchworkspreading the clojure gospel, as it were
18:51patchworkthe boss likes it because it is fast!
18:51technomancyman, apparently I've forgotten what it's like to use maven
18:51technomancystill downloading...
18:51patchworkand because we can just pass our big clients a war file and be done with it
18:51technomancyhm; that was anticlimactic
18:51technomancyworks fine here
18:52patchworkYeah, I was saying up there, I realized it only happens with my custom lein tasks
18:52SirDinosaurquestion: how can i specify an online jar (hosted on google code) dependency in my project.clj for lein?
18:52technomancySirDinosaur: get it into a maven repository
18:52technomancyclojurebot: repeatability?
18:52clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
18:52SirDinosaurtechnomancy: is there no other way?
18:53technomancythere's no other good way
18:53patchworktechnomancy: https://refheap.com/paste/696
18:53patchworkthat is my custom task in src/leiningen/bootstrap.clj
18:53patchworkyou call it like > lein bootstrap projectname
18:54patchworkthat is when it fails
18:54technomancyapparently you forgot to add jdbc to project.clj?
18:55patchworkIt is a dependency of caribou
18:55patchworkyou mean in dev-dependencies?
18:55technomancyyeah, leiningen doesn't have access to it, so you can't use it from a task
18:57hagna_so say I rebind (def *bot* (pircbot)) of an already connected bot. Is there any way to get back to the original one?
18:57patchworkAlright here is my new project.clj with caribou in dev-dependencies: https://refheap.com/paste/697
18:57patchworksame issue
18:59technomancypatchwork: oh, ok. you can't run any clojure 1.3 code in leiningen
18:59technomancycaribou is compiled using 1.3 apparently
18:59technomancyyou can run it in your project using eval-in-project
18:59jodaro`drinking time!
18:59technomancypatchwork: or just make it a regular namespace and use lein run -m myproject.bootstrap
19:00technomancyI recommend the lein run approach
19:02patchworktechnomancy: So can I pass arguments in from the command line then?
19:03technomancysure
19:03patchworklein run -m myproject.bootstrap projectname ?
19:03technomancyexactly
19:03technomancythe only downside is you don't have access to the project map
19:03technomancybut really there's no reason db initialization needs to live outside the project
19:03patchworkWell, I have a whole slew of commands that people can run on the command line
19:04patchworkI was using lein tasks for these
19:04patchworkIt is nicer to type > lein bootstrap rather than lein run -m ….
19:04patchworkbut I guess I can make my own script for this
19:04technomancyin lein2 you can create aliases to partially-applied tasks
19:04patchworkOkay, thanks for your help
19:05patchworkis lein2 in production?
19:05technomancyvery close to having a preview release
19:05technomancypartial application of aliases makes me unreasonably happy
19:06technomancyI hadn't thought of how it could be useful for lein run though; that's sweet
19:06technomancyI'd be happy to help out with any snags if you do end up trying it
19:09TimMc&(println "lein-jit") ; sorry, just testing a hilight :-/
19:09lazybot⇒ lein-jit nil
19:09TimMcI give up.
19:12emezeskeTimMc: I had to fliddle a bunch with irssi hilights to get them how I wanted
19:13TimMcI was trying to do a regexp. Complete failure.
19:13emezeskeHeh
19:13emezeskeIt took me forever to keep it from hilighting the word "relevant" (it contains my first name, evan)
19:13emezeskeThat word comes up a lot in programming channels, and this one in particular
19:14TimMchaha
19:15TimMcSomeone on another channel was having a hard time with cat -- just needed \bcat\b, but until she figured that out, she was getting all these random beeps and couldn't see why. :-D
19:17emezeske^_^
19:32originalserverI selling dedicated servers in different countries, only windows xp, 2003,2008, seven! write who need them.
19:35TimMchaha
19:44muhoomeow
19:51seancorfielddo we have an op around to kick/ban the spammer?
19:54Null-Aseancorfield: When you C-xC-e does it eval the sexp in user?
19:54Null-Aafter setting up emacs 24 and packages, i'm having the same problem as I did with aquamacs
19:57seancorfieldC-x C-e seems to evaluate in the file's ns for me, not the repl's ns
19:57seancorfieldhow did you start the repl?
19:58Null-Aseancorfield: slime-connect
19:58seancorfieldmaybe that's the difference
19:58Null-Awhy what did you do?
19:58seancorfieldi use clojure-jack-in and have swank-clojure 1.4.0 in the dev-dependencies
19:58patchworkAlso, what is up with the occasional "unable to start embedder" error with lein?
19:58seancorfieldnever seen that patchwork
20:00patchworkhttps://refheap.com/paste/698
20:00patchworksomething with a bad zip file maybe?
20:04duck1123did something change recently in ring that it no longer turns params into a keyword if they contain a dot with wrap-keyword-params?
20:09Null-Aseancorfield: hm, still no luck, with clojure-jack-in
20:09Null-Aweird, I wonder what changed in my configs
20:14patchworkYeah I am getting this error every time now
20:14patchworkhttps://refheap.com/paste/699
20:14patchworkis this something in lein 1.7?
20:15patchworkwhen I run lein jar or lein push
20:23patchworkOkay, it was the autodoc dependency somehow
20:26ibdknoxso are we taking best on what the ClojureWest announcement will be?
20:26patchworkOkay, question: how do I run a main function that is from a dependency?
20:27patchworkI have a dependency in my project that has a main function
20:27patchworkbut running > lein run -m package.name fails
20:27TimMcinteresting.
20:28patchworkhttps://refheap.com/paste/700
20:28ibdknoxbets*
20:30amalloyibdknox: i think we're still in some kind of complaining phase
20:30ibdknoxamalloy: hm?
20:30ibdknoxfrom earlier?
20:31ibdknoxby the dismissal of CinC earlier, my bet would be something along those lines
20:32amalloymore like "what's with all the drama around every announcement, they never tell us anything and also are never interested in accepting contributions"
20:32ibdknoxmm
20:33ibdknoxI think I've started not really caring
20:33ibdknoxGot too much real stuff to worry about :)
20:50patchworkIs there a standard way to output code to a string that can be reread and executed again?
20:50patchwork(str code) mostly works, but it turns lists into (), which tries to evaluate them as a function
20:50patchworkwhen it is reread
20:50patchworkand evaluated
20:51hiredman,()
20:51clojurebot()
20:51mdeboard,'()
20:51clojurebot()
20:51patchworkYeah
20:51patchwork''()
20:52patchwork,''()
20:52clojurebot(quote ())
20:52ibdknox,(doc pr-str)
20:52clojurebot"([& xs]); pr to a string, returning it"
20:52ibdknoxwow that's a terrible docstring
20:53patchwork,(pr-str '())
20:53clojurebot"()"
20:56patchworkBasically I need a function that will convert lists into a string with quoted lists
20:56patchworkwhich (str code) does not do
20:56patchworkdoes this exist?
21:02patchworkapparently not
21:02patchworkwhy would the built in "str" output something that is not evaluatable?
21:02patchworkthat doesn't make sense
21:58muhoois there a way to fish the numerator and denominator out of a clojure ratio type, without converting it to a string and splitting it based on the / character?
21:58muhoo'cause i can do that, but it feels... wrong.
22:00muhooahn, nevermind, i found it
22:00muhooyay reflect :-)
22:00devnhey all -- anyone know their way around enlive?
22:00muhoo,(denominator 9/14)
22:00clojurebot14
22:02devn,(def extracted-log-line {:tag :p, :attrs nil, :content ({:tag :a, :attrs {:name "20:46"}, :content ("20:46")} " " {:tag :b, :attrs nil, :content ("Chouser: ")} "Hm. Not exactly packed in here. Anyone paying attention?\n")})
22:02clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
22:02muhoodenied!
22:02devn:(
22:02devnSo, yeah, enlive
22:02muhoosanbox? is that like david sanbox?
22:03muhooor sandisk?
22:03muhoo:--)
22:03devnIf I try to run (html/select *above-line* [html/text-node])
22:03devnI get "\n"
22:03devnI don't know how the hell that is possible.
22:03amalloy$findfn 9/14 9 ; muhoo - easier to discover than with reflect
22:03lazybot[clojure.core/numerator]
22:04muhooamalloy: wow. that's just. wow.
22:04devnbasically I want to extract "20:46", "Chouser: ", and "Hm. Not exactly packed in here. Anyone paying attention\n"
22:05devnI can't seem to figure out the right selectors to achieve that goal without doing a bunch of custom (first) (last) (nth) (:foo line) etc.
22:07muhooamalloy: this? https://github.com/Raynes/findfn that's insanely cool.
22:07devnI've had this experience with enlive before. I know dnolen and brian marick have written tutorials but I seem to wrestle with these little subtle problems every time
22:07amalloyyeah. i wrote a lazybot plugin and Raynes decided (correctly) it should be its own lib
22:07devn</whining> -- if anyone has any suggestions or ideas let me know
22:08muhoodevn: sorry, i'm still getting a boner over findfn
22:08devnmuhoo: im working on something that hopefully will give you an even bigger boner
22:08muhoodevn: loooks like clojurescript?
22:08devn:\
22:08devnthe boner or my project?
22:08muhoothat snippet you posted
22:08muhoothe one that is failing
22:09devnnah, it's a node I've selected from an html document with enlive
22:09muhooenlive, i see. ok.
22:09muhooi dunno enlive, but it looks to me like it's working
22:09muhooyou want the line above, and it's giving you the \n, which is the last line in that text
22:10muhoo" Anyone
22:10muhoopaying attention?\n"
22:10devnmuhoo: findfn is totally awesome -- what im trying to do is build that + clojure cheat sheet explorer + example finder via clojuredocs, irc
22:10muhoothe \n is the last line, no?
22:10devnmuhoo: yes, but i would expect it to return that entire text-node
22:10devnnot just the \n
22:11muhooi guess it doesn't
22:11muhoolook at the docs or source of enlive?
22:11devnyeah im there, cgrand is just way smarter than me
22:11muhoo&(source html/select)
22:11lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
22:11devnmuhoo: i have (:require [net.cgrand.enlive-html :as html])
22:12devnyou wont be able to do that in here
22:13muhoohave you tried getting ALL the lines above, not just the last one?
22:13devn*nod* -- i think i may have a clue -- i think i need nested []'s
22:14devn"A trickier to translate CSS selector is a[href] which is [[:a (attr? :href)]]"
22:18muhoowow, it's only 2 files?!
22:18muhoolike 1000 lines, that's it? woww.
22:18devnmuhoo: findfn?
22:19muhoono enlive!
22:19muhoothe whole thing is > 1000 loc
22:19muhoosorry < 1000 loc
22:19devnyeah cgrand is awesome. his blog about clojure was like a giant pile of "i'm never going to be good enough"
22:19devnfor me
22:19muhooit is (< 1000 loc )
22:20devni've heard the remark that 500 lines is the sweet spot for most well-written clojure libraries
22:20devnit seems like that's enough to construct a full DSL for most problems you're trying to solve
22:20muhooduh (> 1000 loc )... gawd i suck.
22:22muhoook
22:22muhooit looks like html/select "Returns the seq of nodes or fragments matched by the specified selector."
22:22muhooso, maybe it is returning all the lines
22:23muhooand, your repl is only printing the last one
22:23muhooof the seq
22:24muhoodevn: i dunno what a fragment is, but maybe it considers that \n to be a fragment?
22:30devnmuhoo: i dont think that's right
22:31devnmuhoo: i'm consciously only selecting the first of the returned nodes from the seq of nodes i've narrowed down to
22:52muhoodoes it pop them in reverse order?
22:53muhoomaybe you're pulling the last one off, which is the \n, and the previous ones are the other lines of the text in reverse order?
22:53muhooi'm taking wild-ass guesses here; i haven't used enlive yet.
23:00RaynesSomeone who has used hg: ping me.
23:06RaynesActually, never mind. Figured it out.
23:06RaynesFor the curious, hg log sucks. I was trying to figure out how to make it stop sucking.
23:06Raynes--limit helped.
23:07RaynesSo do I. Unfortunately, Pygments does not.
23:07amalloyseems like you meant to ask that in #hg, bro
23:07Raynesamalloy: l wouldn't dare. The people in #git would never forgive me.
23:07amalloynone of them will ever find out. there's 0% overlap in membership
23:08muhoowho has time to monitor irc channel membership for ideological purity?
23:08Raynesmuhoo: I know you wander into #scala every once in a while. I've got your family.
23:09muhooanyway, back kind of on topic, trying to get pomegranate to run, no love.
23:09Raynesmuhoo: What's wrong?
23:09muhooCaused by: java.lang.Exception: Couldn't connect
23:09RaynesBesides the fact that I just threatened the well being of those you love.
23:09RaynesOh, connect to the internet. ;)
23:09RaynesWhat are you trying to do?
23:09muhooit wants monads
23:10muhoono, it can connect to the interent just fine
23:10muhooRaynes: https://refheap.com/paste/701
23:10muhoowtf are monads?
23:10RaynesI wonder who got 700.
23:11muhooit keeps kicking me in the monads
23:11RaynesWell, it looks like it got monads.
23:11RaynesIs that the whole stacktrace?
23:12muhoomore or less, the rest is here: https://refheap.com/paste/702
23:13RaynesOkay, this is lein 2?
23:13RaynesNope.
23:13muhoono this is old lein
23:13Raynespoll_repl_connection
23:13RaynesYeah, I rewrote this task in lein 2. I automatically assume any problems are a result of me breaking shit.
23:13muhooheh
23:13RaynesYeah, I don't know. technomancy? ^
23:14muhoois it a lein problem? or pilot error?
23:14RaynesIt looks like a lein problem.
23:14RaynesOr at least some weirdness.
23:14RaynesIt means that the repl is trying to connect but can't connect in time.
23:14muhooconnect to what?
23:15muhooclojars?
23:15RaynesNo, the repl.
23:15RaynesHaha, what I said doesn't make sense.
23:15muhoothe repl is trying to connenct to the repl
23:15RaynesLeiningen starts a repl on a socket and then connects to that.
23:16muhooah, cool, thanks. i've been wondering how it does stuff.
23:16muhoothis machine is barely able to keep up with java
23:17muhooso it wouldn't be surprising if, by the time the jvm starts up, everyone has already gone home and gone to sleep.
23:17muhoopomegranate brings in an insane amount of crap
23:17RaynesYeah, but that never actually happens.
23:17muhooaether, sonatype, yikes.
23:18muhooRaynes: is it in the shell script? maybe i could stick some sleeps in there and try to get it to be more patient.
23:19RaynesNope.
23:19muhoooh, LEIN_VERSION="1.6.2", FYI
23:22muhoohmm, it works now
23:22muhoothird try is the charm?
23:29muhoonow i gots this: https://refheap.com/paste/703
23:29muhoosorry for being such a clueless louis here.
23:32muhooi can find the "artifact" just fine with a browser. but pomegranate can't? http://search.maven.org/#artifactdetails%7Corg.clojure%7Cmath.numeric-tower%7C0.0.1%7Cjar
23:36muhooclearly, i am a moron.
23:40ldopais there a replacement for to-byte-array in 1.3 (specifically, for File) ?
23:59seancorf~log
23:59clojurebotlog is forget where
23:59seancorfunhelpful