#clojure logs

2011-04-25

00:34kwertiiHello. I'm trying to hook up Analemma and Compojure by copying and pasting the Analemma examples. However, when I load one of these pages in my browser, it only displays 2 data points (in all of the examples I've tried.) Everything else looks normal. Any idea what's causing this?
00:46amalloyRaynes: i love /about/version. i can see whether dbyrne deployed changes yet
00:51kwertiihttp://pastebin.com/1cty5hFm only 2 "circle" elements appear in the output, rather than 25 as I would expect. Almost verbatim cut and paste from the Analemma docs.
01:05seancorfield__finally clubbed #53 into submission... makes your solution look positively elegant tho' amalloy :)
01:06seancorfield__most of my solutions were fairly brute force :(
01:38seancorfield__so amalloy why was it 4clojure.com not 4clojure.org ? :)
01:38amalloyseancorfield__: don't ask me. dbyrne founded the site and registered the domain
01:39amalloymaybe he really was hoping to cash in on mortgage hunters with bad spelling
01:40seancorfield__LOL
01:44amalloyseancorfield__: i'll float the suggestion that we register 4clojure.org as well
02:02ambrosebs,(println "test")
02:02clojurebottest
02:02ambrosebsI'm trying to create a multimethod that dispatches on class of the first and second argument
02:02ambrosebs,(defmulti basic (fn [a b] [(class a) (class b)]))
02:02clojurebotDENIED
02:03ambrosebsoh
02:03ambrosebs(defmethod basic [clojure.lang.Keyword clojure.lang.Keyword] [a b]
02:03ambrosebs "yay")
02:03ambrosebsi'm getting an arity error
02:03ambrosebsI want (basic :foo :bar) to return "yay"
02:04amalloyambrosebs: your code looks fine. defmulti has defonce-semantics, so you probably need to (def basic nil) to flush the old dispatch function out of your namespace
02:04ambrosebsah
02:05ambrosebs"yay!"
02:05ambrosebsthanks amolloy
02:05ambrosebsamalloy
02:05amalloy*chuckle*
02:05ambrosebshaha
02:35fliebelWhen I consume a lazy seq on 2 threads, where does the computation happen?
02:36Raynesfliebel: How many licks does it take to get to the center of a tootsie roll pop?
02:37fliebel42
02:37RaynesReally? The damned owl lied to me.,
02:37fliebelOr just as much roads as a man walks down
02:38fliebelor 9*7
02:38fliebelRaynes: But I guess what I really meant to ask is how the work is coordinated, if at all.
02:50kwertiiwas there some subtle change in the semantics of (reduce) in 1.2?
02:50amalloykwertii: not afaik; what's the problem?
02:52kwertiiamalloy: tracking down what seems to be a bug in the Analemma library. this code http://pastebin.com/DES9YWmS should/used to return a 25 element vector; now it just returns 2
02:54fliebelRaynes: I figured it out I think. Lazy seq just seems to lock itself up, so when I have 2 consumers, only one does the actual work.
02:55amalloykwertii: i don't really believe that. reduce would never call your accumulator function more than twice if you pass it a two-element vector to reduce
02:55kwertiiamalloy: that's what I don't get, this should never have worked
02:56amalloydo you have evidence that it did? maybe someone included it as a code example, or a feature that never wound up being used or something
02:57kwertiiamalloy: it's (points->xy) from line 124 of https://github.com/liebke/analemma/blob/master/src/analemma/charts.clj. The "Labeling Data Points" example at http://liebke.github.com/analemma/ only plots 2 points for me.
03:14kwertii ah. nm. the project documentation had a typo.
03:54fliebelCan anyone help me break things? It passes the tests 1000 times in a row, but that does not mean it is perfect. https://gist.github.com/934781
04:08markomanI have (for [division form-coll] ...) how do I get auto increment index number working on this scenario? I mean I have tried let n and (inc n) but cant get it working...
04:10ambrosebs,(map (range) ["first" "second"])
04:10clojurebotjava.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to clojure.lang.IFn
04:11ambrosebsis it zipmap or something
04:11ambrosebs,(doc zipmap)
04:11clojurebot"([keys vals]); Returns a map with the keys mapped to the corresponding vals."
04:11ambrosebshmm
04:15ambrosebs,(map #(vector %1 %2) (range) ["first" "second"])
04:15clojurebot([0 "first"] [1 "second"])
04:15ambrosebsis that what you meant markoman?
04:15ambrosebsthen you can use destructuring in the for loop
04:23markomanim not sure how it could work in case I have (for [div [{:k 1} {:l 1} {:m 1}] ...)
04:29ambrosebsjust tripped over my internet.. did you get a solution markoman?
04:31ambrosebs,(map #(vector %1 %2) (range) [{:k 1} {:l 1} {:m 1}])
04:31clojurebot([0 {:k 1}] [1 {:l 1}] [2 {:m 1}])
04:31markomanIm still struggling: I have this kind of map: (for [div [{:k 1} {:l 1} {:m 1}]] ...)
04:31ambrosebsis that similar to the output you need?
04:32markomani suppose i cant use div same way now, I need to get both index and {:k 1} from loop, lets see
04:33ambrosebs,(for [[inx div] (map #(vector %1 %2) (range) [{:k 1} {:l 1} {:m 1}])] (println "index is " inx) (println "div is " div))
04:33clojurebotjava.lang.IllegalArgumentException: Wrong number of args (5) passed to: core$for
04:33markoman,(for [divs (map #(vector %1 %2) (range) [{:k 1} {:l 1} {:m 1}]) :let [ind (divs 0) div (divs 1)]] (println ind))
04:33clojurebot0
04:33clojurebot1
04:33clojurebot2
04:33clojurebot(nil nil nil)
04:36markomanso yes, It could work either way
04:36markomanbtw, it seems its possible to make infinite loop for clojurebot?
04:37ambrosebs(range) is lazy
04:37raek,(map-indexed (fn [ind divs] (println ind)) [{:k 1} {:l 1} {:m 1}])
04:37clojurebot0
04:37clojurebot1
04:37clojurebot2
04:37clojurebot(nil nil nil)
04:38ambrosebsnice
04:38markomanambrosebs: not in this case but in theory :)
04:39markomanmap-indexed looks nice too
04:39ambrosebshow far does it get? :)
04:41markomanhmh... it may cause lot of changes to my original code thou
04:41thorwili had a working handler (views/journal models/paginated-articles-converted). but paginated-articles-converted actually has to take an argument. after changing the signature, (views/journal (models/paginated-articles-converted 1)) fails with "clojure.lang.LazySeq cannot be cast to clojure.lang.IFn"
04:44raekthorwil: is models/paginated-articles-converted a function?
04:45thorwilyes
04:46thorwilhttp://paste.pocoo.org/show/377742/
04:47raekif the exception originates from the line you showed us, then either views/journal or models/paginated-articles-converted most be a lazy-seq and not a function
04:47ambrosebsmarkoman: probably best to stick with the for loop. You don't need a :let at the end, just use destructuring to extract first and second element in vector
04:47thorwilraek: paginated-articles-converted does return a lazyseq, but i i change it to use it without argument, the handler works
04:49raekthorwil: are you aware of what happens if you have a (def ...) in a function body?
04:49ambrosebsmarkoman: also a bit map: (map vector (range) div)
04:49ambrosebs*bit shorter
04:50raekthorwil: it seems that in the first case, you send the function to views/journal, but in the second case you call the function, and then return the result to views/journal
04:50thorwilraek: the fact you ask makes me think no :)
04:50raekthorwil: I think #(models/paginated-articles-converted 1) could be what you are looking for
04:51raekthorwil: def is only for global variables. even though the call is inside a function, it will have global scope and not local scope
04:51raekso, use a let
04:51raekor move the def out to the top level
04:51thorwil#(models/paginated-articles-converted 1) does the trick
04:51thorwilthank you, raek
04:53thorwilbest part of this is that even understand what's going on. i really have to get my mind off of the simple text replacement model that i started with
05:04markomanambrosebs: thanks, I got it working. the context I already have :let statements so it was natural to use it in this case
05:04ambrosebsgreat
05:06markomanhas anyone used clojure on android 2.2 tabs? im thinking to buy samsung galaxy for a trip
05:07markomanjust to have fun and learning more clojure. I wonder if its full feature clojure and jvm working there...
05:18fliebel$google android clojure
05:18sexpbotFirst out of 20500 results is: Android Adverse To Dynamic Languages - Stack Overflow
05:18sexpbothttp://stackoverflow.com/questions/973386/android-adverse-to-dynamic-languages
05:23fliebelmarkoman: ^^
05:27markomannice talk there
05:31markomanthis is also what I found and thinking: http://www.appbrain.com/app/clojure-repl/com.sattvik.clojure_repl
06:55LajlaSo
06:55Lajlayou guys seen any good shadows to worship lately?
06:59ttmrichterI only worship His Divine Shadow.
07:00ttmrichterhttp://goo.gl/9WNsg to be specific, Lajla.
07:01LajlaFinally
07:01Lajlasome one gets it.
07:01LajlaI've been making that reference here for months and no one got it.
07:01ttmrichterFirst time I saw it. :)
07:06ilyakhi *
07:06ilyakin ccw eclipse plugin, how do I tune JVM parameters of VM that starts when I open current file in REPL?
07:11cemerickilyak: See the run configurations associated with the project/file you're starting the REPL from.
07:11cemerickMenu item @ Run -> Run Configurations
07:15ilyakYeah, thanks
07:15ilyakfound it
07:16ilyakWhat's the best way to find the cause of stackoverflowerror?
07:16ilyakI can't find where it originates from
07:17cemerickIf you print the stack trace, one of the mentioned repeated lines will be where you're performing unbounded recursion.
07:25ilyakIn fact it's not because there are not enough lines by default
07:27cemerickThe line that's shown is where you're making the bad recursive call, no? Otherwise, you wouldn't blow stack.
07:28ilyakAfter slashing stack size I've found that the problem seems to be the accumulation of drop-whiles in split-with
07:28ilyakI.e. I do (split-with foo lazy-seq)
07:28markomanis there some easy way to make "unique" shortened strings from any string like: "what ever long phrase" -> "9WNsg" ?
07:28ilyaklazy-seq is [_ lazy-seq] (split-with foo lazy-seq) itself
07:29ilyakand therefore sometimes on unlucky data this chain can become too long
07:29cemerickmarkoman: that's hashing?
07:30cemerickilyak: that must be a *huge* chain
07:30ilyak(I think it frees when drop-while finds something to drop and therefore returns a new clean head
07:30markomanyes, I think so.
07:30ilyakcemerick: The whole sequence is like 2 mln records
07:30ilyakbut the problem only happens after 1 mln are processed
07:31ilyakStill I don't understand yet how to fix that problem
07:31raekilyak: you can add a (doall ...) around each split-with call
07:32ilyakraek: Would it unwind all 2 mln records? If it would, it's unfeasible
07:32markomani was guessing 22 chars * 2 (small and capitals) + 10 numbers = 54 with 5 long string would give enough combination for my use
07:32raek...that will cause the steps to be forced incrementally, instead of building up a huge chunk of work
07:33raekilyak: this can be a solution if you have something that becomes (map f (map f (map f (map f .... (map f some-small-coll) ...))))
07:34cemerickmarkoman: you could just base-36-encode the hashCode of the string in question
07:34raeki.e. when the resulting sequence is not very long, but when the number of copmutations is very large
07:34ilyakcan I force finding the next record of a lazy sequence and using it as "head" so it would drop all the chain it needed to get to that "head"?
07:34cemerickThat's certainly easy. It depends on what characteristics you want out of your hash function.
07:35raekilyak: sure, that's what this "losing your head" thing is about
07:35markomani see
07:36raekilyak: but holding on to the head does not cause a stack overflow, it will cause an out of memory error
07:36ilyakI don't hold head
07:37ilyakRather I pass a drop-while sequence around instead of head of sequence found with drop-while
07:37cemerickso you're just doing a ton of filtering, essentially?
07:37ilyaki.e. immediate drop-while would return a new head
07:37ilyakcemerick: I'm reading three sorted files and then applying a function of rec1 [recs2] [recs3]
07:38ilyakwhere rec1, recs2, recs3 are records with same id from different files
07:38ilyaktherefore I have three tails which I compute by split-with
07:39markomani found this said on web: base 62 makes a distinction between upper and lower-case letters
07:39ilyakis there a way to eagerly call drop-while, i.e. assign the lazy sequence that drop-while would find to variable instead of asssigning a lazy drop-while to it?
07:39cemerickThe data and semantics are irrelevant, I think. The point is that you're not consuming the seq, you're lazily building up a series of drop-* results?
07:41raekif what cemerick said is true, the perhaps you can do something like (do (first the-old-lazy-seq) (drop-while ... the-old-lazy-seq)) instead of just (drop-while ... the-old-lazy-seq)
07:41raekto "shake out" the laziness up to the first element
07:41cemerickraek: if what I said is true, then just (seq (drop-while …)) should do it << ilyak
07:41ilyakWould that help? I think that the-old-lazy-seq would not mutate and would still be lazy
07:42ilyakisn't it?
07:42raekoh. that's better. :)
07:42cemerickilyak: lazy seqs are always lazy; it's not like a bit flips and they're not lazy anymore. :-) You can certainly have a partially-realized lazy seq.
07:43cemerickhrm, I didn't say that quite right :-P
07:43ilyakI've tried wrapping recur parameters with do
07:43ilyak...and it didn't work
07:43cemerick`do` doesn't do anything
07:43raek(didn't think of the fact that 'seq' actually forces the first element)
07:45cemerickilyak: try (seq (drop-* …))
07:45ilyakAdded two (first rest-foo)
07:45raekilyak: do has nothing to do with laziness. it's just a way to evaluate multiple expressions in the place of one (the result of the last one is returned). this is usually done for side-effects
07:45ilyakraek: (first)ing those seems to do the trick
07:46ilyakit's ugly tho because it now depends on that side-effect of first\
07:46ilyakI'll try with (seq)
07:46cemerickfirst and seq are not side-effecting
07:48ilyakcemerick: In this case (first) is
07:48ilyakit de-lazies seq preventing SOE, isn't it
07:49cemerickilyak: materializing a lazy seq is not a side effect, unless the head's value causes IO and such in order to be determined -- but that's application-dependent, not a characteristic of first/seq
07:51raekI guess it depends on what you consider a side-effect. one way of defining side-effects is as anything a function does except for producing a value.
07:52cemerickYou can pass slurp and some args to apply; that doesn't make apply side-effecting.
07:53raek...but I guess Haskell guys wouldn't say that `seq` performs a side-effect
07:53raek(the Haskell `seq`)
08:03ilyakcemerick: I think that side-effect is anything that affects program execution not thru return value
08:03ilyakThis one affects (no SOE)
08:06cemerickilyak: it's an interesting case
08:08cemerickthe seq call is affecting program execution via return value, but I can see how the SOE could be seen as a side effect
08:09cemerickI think it might be more accurate to say that the unwinding of lazy seqs are potentially side-effecting given the potential of SOEs in the context of specific sets of seq transformations.
08:26TimMc"SOE"?
08:27raekStackOverflowError
08:28TimMcah
08:49fliebelDoes anyone know a nice language that lets you do pointers and memory management, but still do high level functional stuff?
08:50fliebelRemotely related: What was the lisp used by that old game company?
08:59TimMcfliebel: Rust, in maybe 5 years.
09:04ilyakfliebel: haskell
09:04ilyakalso, afaik, ocaml
09:06cemerickfactor, perhaps
09:22manutterhaskell lets you manipulate pointers and do your own memory management?
10:05jweissdoes leiningen support setting properties, like in a pom with <property>?
10:07manutterhmm, http://clojuredocs.org/leiningen/lancet/set-properties!
10:07manutteronly it's an empty page template
10:13bennyluhi all, is there a way to get the source of a function after it is writen to the repl? rep-utils/source can do it only if the source script is available but i want to get the source for a function writen directly to the repl
10:14raekbennylu: no :)
10:15raekwhen a (fn ...) is evaluated it will be compiled into bytecode and loaded. the source code is not stored with it
10:16raekI would recommend using an editor that supports a "eval expression" feature
10:17raekI have only used Emacs and Eclipse for that so far
10:17bennyluanyone?
10:17clojurebotPlease do not ask if anyone uses, knows, is good with, can help you with <some program or library>. Instead, ask your real question and someone will answer if they can help.
10:17raek(and they can both do it)
10:18raekclojurebot: hush. his question was fine.
10:18clojurebotHuh?
10:21bennyluraek, thanks i guess i will have to redefine defn to include the source in the metadata of the var ..
10:23raekbennylu: so you need to programmatically get the sourcecode of a function at runtime?
10:24fliebelbennylu: Are you aware of he *1*2 and *3 vars?
10:24fliebeloh, noe… stupid thinking
10:25bennyluraek, yep..
10:25fliebelrlwrap/readline seems to know what I wrote though :)
10:26raekmost repl wrappers (Emacs, leiningen, directly or indirectly via JLine or rlwrap) have command line history, but I don't think that was the problem here
10:26bennylufliebel, but i cant know when the function was writen - what i need is a command to store the newly created function into a script file - after someone writen it in the repl
10:26raekbennylu: what problem are you solving with this approach?
10:27raekah
10:27raekI think this is more easily achieved by storing the user's input instead
10:27fliebelWho wrote that gist for a printable fn?
10:28raekeither in text form (before form) or in datastructure form (after reader)
10:34bennyluraek, this is also a possability but it forcing the user of my program to create a function twice - once via defn and after (or before) adding it source to a datastracture- i was hoping to eliminate this behaviour .. and let the user program with (as close as i can) native clojure then call (save fn) ..
10:40raekbennylu: my idea was that your code would sit between the user and the clojure repl. this can be done by making a new Reader and Writer (e.g. with proxy) and using http://clojuredocs.org/clojure_core/clojure.main/repl
10:41raekbennylu: also: https://github.com/technomancy/serializable-fn
10:41raekwith this, your original approach might indeed be possible
10:58bennyluis there a way to backup a macro - i want to override the defn macro but saving the old defenition of defn as other macro
10:58gfrlogthat sounds like a totally normal thing to do
10:59gfrlogdammit I can't be in here for one minute without saying something sarcastic...
11:00fliebelbennylu: Look at refer-clojure. You can have your own, and still use the clojure.core one with its full name.
11:02gfrlogare the clojure-cucumber tools well integrated with compojure?
11:12bennyluraek, if you interested - this is what i writen, any better solution?(defmacro defn+
11:12bennylu [& params]
11:12bennylu `(do
11:12bennylu (defn ~@params)
11:12bennylu (def ~(first params)
11:12bennylu (with-meta
11:12bennylu ~(first params)
11:12bennylu {:source (str
11:12bennylu "(defn "
11:12bennylu ~@(interleave (map str params) (repeat " "))
11:12bennylu ")"
11:12bennylu )}))))
11:12raekbennylu: gist.github.com
11:13raekbennylu: you could simply add the metadata to (first params) instead of defining it twice
11:14bennyluhttps://gist.github.com/940651
11:14bennyluraek, i tried but for some reason it hasnt got the same effect ..
11:15gfrlogwould the source be nicer as an s-expression than a string?
11:15gfrlog(I'm not sure why I thought of that...)
11:16raekbennylu: also, str won't give the correct result. you probably want pr-str on the whole thing
11:16bennylugfrlog, it can be nice but for my project i need to save the source to file - so it is one less function call
11:16gfrlogif nothing else I think (pr-str (cons 'defn params)) would be shorter
11:16gfrlogright, what raek was saying
11:17raekbennylu: I still think that storing what is passed to the evaluator before it is evaluated is a more general and simpler approach
11:17bennylugfrlog, raek, didnt know about pr-str - i will read about it now ..
11:17gfrlogit's a handy thing
11:18raekbut I still don't know enough about the big picture idea of what you are trying to solve
11:18raekso it's hard to know what's best
11:18bennyluraek, but how can i know without reparsing the strings that was given to the terminal where was the function decleration
11:21gfrlogis anybody using cucumber with clojure? the lein-cuke project doesn't seem to be up-to-date :-/
11:21bennyluraek, i adding clojure repl to an existing program and transforming it to somting similer to emacs (where clojure functions can be submited as events listeners at run time ) and if a user want to persist the behaviour that he just added he would write (save function-name) and this function will be registered automaticly at program startup
11:23gfrlogoh this reminds me of an idea I had to make lazy seqs printable...
11:26raekgfrlog: but lazy-seqs are printable: ##(pr-str (range 10))
11:26sexpbot⟹ "(0 1 2 3 4 5 6 7 8 9)"
11:26gfrlograek: ##(pr-str (iterate inc 0))
11:26raek(but maybe that was the point)
11:26gfrlograek: what I want is...
11:26sexpbotExecution Timed Out!
11:27raekah, that kind... :)
11:27gfrlog(pr-str (drop 20 (iterate inc 0))) => (iterate inc 20)
11:27raekthought you were referring to ##(str (range 10))
11:27sexpbot⟹ "clojure.lang.LazySeq@9ebadac6"
11:27gfrlogoh right
11:27raekwhich might give one the impression that they cant be printed...
11:28gfrlogyeah it would
11:29raekbennylu: I know little about how these things are usually done. it could be worth to investigate how other lisps do such things (if they do it), for example emacs lisp
11:30raekI have to go now, but I don't see any reason that your alternative defn macro wouldn't work
11:31bennylugfrlog, raek, https://gist.github.com/940669 this is the implementation using pr-str - neat function.. but still have to do double defining - i guess that if i want to remove this behaviour i will have to use def and not defn but this will make me have to rewrite defn and if it will get changed i will have to rewrite it again every time .. (or am i missing somthing? )
11:32raekno, you should be able to add metadata on the name symbol
11:32bennylui will try again ..
11:32raekperhaps you could look at the sourcecode for clojure.contrib.def
11:33raekwhen you are still developing the macro, it might be best to not call it defn
11:34raekto make it simpler to not mess up things
11:34raekoh, you already did that... :)
11:34raekmy bad
11:35bennyluraek, (defn (with-meta x {:bla 'bli}) [] (print "hi")) => java.lang.Exception: First argument to def must be a Symbol (repl-1:49)
11:36gfrlogthis sounds like the kind of situation where quining skills could be applicable...
11:36raek(defmacro defn+ [name & params] `(defn ~(with-meta name {:source (list* 'defn name params)}) ~@params))
11:40bennyluraek, (defn+ hello [] (print "hello")) => java.lang.LinkageError: loader (instance of clojure/lang/DynamicClassLoader): attempted duplicate class definition for name: "learned$hello"
11:41raekhrm, saw that too...
11:42thorwilis there a shortcut to define things like {:adam adam :eve eve :snarf snarf}, working from def's or let bindings for adam ...?
11:43gfrlog,(into {} (for [x ["adam" "eve" "snarf"]] [(keyword x) (symbol x)]))
11:43clojurebot{:adam adam, :eve eve, :snarf snarf}
11:43gfrlogbeyond that I have no idea
11:43raekthorwil: you can make a macro for that, but here is nothing like this in core
11:44thorwilok, i was already trying to write a function for it
11:45raekit isn't possible to make this as a function, since you need to know the names of the local variables
11:46raek(defmacro map-shortcut [& syms] (zipmap (map (comp keyword name) syms) syms))
11:47raekuser=> (let [a 1, b 2] (map-shortcut a b))
11:47raek{:b 2, :a 1}
11:47thorwilty
11:48gfrlogoh hmmm
11:48thorwiloh boy, this is the second time i run into the you-don't-actually-have-the-names-at-that-point thing. maybe i will learn it, after all :}
11:49gfrlogoh the joy of macros. They never backfire.
11:50thorwilgfrlog: ? my admittedly very limited experience suggests that they do backfire sometimes, making it harder to compose on top of them
11:50raekbennylu: (defmacro defn+ [name & params] `(defn ~(vary-meta name assoc :source-form (list 'quote (list* 'defn name params))) ~@params))
11:50gfrlogI agree. I have a bad habit of using too much irony in IRC.
11:50raekI forgot that the metadata is evaluated too
11:51thorwilgfrlog: i see. i never use any irony in any place
11:52gfrlogthorwil: I think the normal approach is to create a function that does what you need using ugly syntax, and a macro that does just the syntax-sugar part. In this case though there's no corresponding function
11:52gfrlogand probably little danger
11:56gfrloghmmm
12:02gfrlogdoes leingingen let you specify a git repo for a dependency, or is there no way to accomplish that besides sticking something on clojars?
12:09technomancygfrlog: you probably want either a private archiva/nexus instance or checkout dependencies
12:10gfrlogtechnomancy: is "checkout dependencies" a noun or an imperative?
12:11technomancyoh heh; it's a noun. should be covered in lein help faq.
12:11gfrlogokay thanks
12:11technomancyor rather lein help readme, under the fqa
12:11technomancyfaq
12:12technomancyit's hard to make a feautre like that discoverable
12:13gfrloghmm, maybe "Leiningen is a build tool for Clojure designed to not set your hair on fire, and it has a nice checkout-dependencies feature."
12:14technomancyit's friendly.
12:14gfrlog:)
12:21gfrlogtechnomancy: so do I leave the project out of the 'project.clj' file?
12:22ilyakHow do I run clojure tests in ccw?
12:24technomancygfrlog: no, checkout dependencies supplement dependencies in project.clj
12:25gfrlogtechnomancy: I think I'm using it wrong...doesn't leiningen have to know not to download the dep from clojars?
12:26ilyakI run test file in repl, nothing happens, I press ctrl-t, my eclipse hangs
12:34ilyakOkay, figured that out
12:34ilyakNow when I press ctrl-t, nothing happens
12:34ilyakwhere does the test result go?
12:39cemerickilyak: The run tests feature in CCW is ancient, ill-conceived, and from a prior regime. :-)
12:40cemerickI think Laurent is going to simply rip it out in the next patch release.
12:40ilyakcemerick: sad
12:40ilyakdoing (run-tests) by hand
12:40cemerickilyak: it's not at all clear what a "Run Tests" command should do.
12:40ilyakcemerick: It should run tests!
12:41ilyakAnd display results
12:41ieureHaha.
12:41cemerickilyak: For what? clojure.test, lazytest, midje?
12:41ilyakcemerick: clojure-test
12:41cemerickilyak: all well and good, except for those that don't use it. :-P
12:42ilyakWhy? I already see it's pretty basic tho
12:42cemerickRight, lots of people like having various bells and whistles that clojure.test doesn't provide.
12:42cemerickIn any case, test-ns (or whatever) from the REPL is hard to beat in terms of usability.
12:45ilyakIt's two step
12:45ilyakRun REPL, type in
12:45technomancyreplaca: does clojure.pprint have any mechanism for pprinting clojure code?
12:46technomancyor is it planned?
12:47amalloytechnomancy: i'm a bit puzzled how it could work. it would have to be psychic to guess where to put the newlines, no?
12:49technomancyamalloy: well, it could know the basics for common stuff like if
12:49ieureUgly code goes in, pretty code comes out. You can’t explain that.
12:51dnolentechnomancy: clojure.pprint has a code mode, that's how macroexpand works in swank-clojure
12:51technomancydnolen: aha; I missed that somehow. thanks.
13:04ilyakWhat would (= a b c) return?
13:05amalloytrue iff a==b==c
13:05ilyakcool
13:05ilyakI hope you don't mean c == (a == b) which is boolean
13:05amalloylol
13:05amalloyno, this isn't java
13:05amalloy&(= 10 10 10)
13:05sexpbot⟹ true
13:05amalloy&(= false false false)
13:05sexpbot⟹ true
13:07gfrlog,(= 7)
13:07clojurebottrue
13:07gfrlog,(=)
13:07clojurebotjava.lang.IllegalArgumentException: Wrong number of args (0) passed to: core$-EQ-
13:10gfrlog&(let [x 15] ((binding [x 10] (fn [] x))))
13:11sexpbotjava.lang.Exception: Unable to resolve var: x in this context
13:11gfrlogoh nm
13:12gfrlog&((binding [+ (constantly 20)] +))
13:12sexpbot⟹ 20
13:12gfrlog&((binding [+ (constantly 20)] (fn [] (+))))
13:12sexpbot⟹ 0
13:12gfrlogsomething I hadn't considered before...
13:16gfrlog&(take 10 (binding [+ (constantly 20)] (let [ret (repeatedly (fn [] (+)))] (doall (take 5 ret)) ret)))
13:16sexpbot⟹ (20 20 20 20 20 0 0 0 0 0)
13:16gfrlogbinding + laziness == weird
13:32amalloyi need to attend a Juxt Abusers Anonymous meeting. writing an email and slipped in juxt instead of just
13:34gfrlogthat'd probably be a fn meeting
13:34amalloyaugh
13:45clizzinis there anything required besides a :gen-class in ns and a -main function in order to make something work via jar? i'm getting an error message about not being able to find the class that is my ns
13:51ilyakclojure doesn't have binary literals does it?
13:52seancorfieldamalloy: i just tried the RSS feed on 4clojure.com and RockMelt rejected it as not being valid - just FYI
13:52gfrlogilyak: nope
13:52gfrlog,0b0110110
13:52clojurebotInvalid number: 0b0110110
13:52seancorfieldalso it looks like you don't have the right RSS autodiscovery metadata in place... since my browser isn't showing the feed as available when i visit the page
13:53seancorfield,0x36
13:53clojurebot54
13:53seancorfield,2r0110110
13:53clojurebot54
13:53seancorfieldso, yes, it has binary literals but using the {base}r{number} format
13:54gfrlogI'm a disgusting liar
13:54seancorfieldi didn't know until i tried it :)
13:54gfrlog,3r0112012
13:54clojurebot383
13:54ilyak,(+ 1 nil 2)
13:54clojurebotjava.lang.NullPointerException
13:55Raynesseancorfield: Duly noted. Feel like making an issue on the github page?
13:55gfrlogthe cantor set is the set of all numbers in the unit interval that can be expressed in ternary with just 0's and 2's
13:55gfrlogI think
13:55seancorfieldRaynes: remind me of the 4clojure github URL? is it /dbyrne/4clojure ?
13:55Rayneshttp://github.com/dbyrne/4clojure
13:56seancorfieldyay, i guessed right!
13:56Raynes:)
13:57amalloy&#b1010
13:57sexpbotjava.lang.Exception: No dispatch macro for: b
13:57amalloyoh well
13:58amalloyseancorfield: yeah, having <link rel> stuff for the rss feed would be nice
13:59seancorfieldadded issue with metadata that i think is correct
14:00seancorfield8r66
14:00seancorfield,8r66
14:00clojurebot54
14:00gfrlog,66r8
14:00clojurebotRadix out of range
14:00amalloyseancorfield: chrome doesn't like it either, fwiw. firefox is happy with it
14:00seancorfield,13r42
14:00clojurebot54
14:00seancorfield6 * 9 = 42 in base 13 (HHGTTG)
14:01ataggartradix is limited to what could be supported with [0-9a-z]
14:01seancorfieldyeah, i just tested in chrome and that's what rockmelt is based on
14:01gfrlogseancorfield: my personal interpretation is that that was not the intention
14:01seancorfieldgfrlog: possibly - but it is funny :)
14:02amalloywe probably need to wrap links/descriptions in CDATA sections or something
14:02gfrlogI think it's funnier to think that the ultimate question is meaningless and the ultimate answer is wrong
14:08seancorfieldamalloy: i opened two separate issues - one for auto-detect, one for chrome/rockmelt compatibility
14:08seancorfieldrockmelt serves as my RSS reader (and main browser)
14:09seancorfieldamalloy: does 4clojure save all the solutions? will users be able to review their submissions and update them with cleaner solutions later?
14:10seancorfieldi know if you share your solution, it gists it...
14:11amalloyseancorfield: we'd like to eventually. currently we persist hardly anything
14:12seancorfieldyou only save which problems they've solved? (looking at the code - nice, clean code)
14:12amalloyseancorfield: yes, though i'm working on a branch to track how many characters the solutions are, to start a code-golf league
14:14seancorfieldheh, what about folks who've already solved them (and didn't gist any of them)? :)
14:14seancorfieldi have a few of mine in files locally - when i struggled to solve them... and man, are some of them fugly!
14:15seancorfieldit was a great fun project to work on over the weekend - thoroughly enjoyed the problems so far!
14:16seancorfieldunfortunately it completely distracted me from working on a talk i'm giving at a conference in three weeks :(
14:25amalloyseancorfield: good news: three weeks is a long time
14:27ilyakHow do I make a lazy function call
14:27ilyakOr whatever
14:28ilyakI want some expression only execute when its value is used somewhere\
14:29hiredman(doc delay)
14:29clojurebot"([& body]); Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls."
14:31ilyakIt isn't transparent :((
14:35ataggart(defn dfn [f & args] (let [d (delay (apply f args))] #(deref d)))
14:35ilyakhow do I destructure a seq into head tail?
14:36ataggartyou can't destructure for the tail
14:37ataggartbut you can name the whole seq, e.g., (let [[head :as whole] aseq] [head (rest whole)])
14:38technomancyilyak: it's not transparent, but you can call force on any value, not just delays.
14:39ataggart,(deref 5)
14:39clojurebotjava.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IDeref
14:39amalloyataggart: huh? you can't destructure the tail? ##(let [[head & tail] (range 4)] [head tail])
14:39sexpbot⟹ [0 (1 2 3)]
14:39ataggart,(force 5)
14:39clojurebot5
14:40ataggartamalloy: wow am I an idiot
14:40ataggartthe coffee, it does nothing!
14:41ilyaktechnomancy: The problem is: I do let [foo (bar)]
14:41ilyakand (bar) immediately gets called :(
14:41ataggartilyak, did you see the dfn example I gave above?
14:41ilyakeven if I don't use foo
14:41ataggartilyak: what do you mean by "use foo"?
14:41ilyakataggart: I did
14:42ataggartis foo a fn that you plan on calling?
14:42amalloyclojure has laziness all over, but you can't really sprinkle magic lazy-dust over it and get haskell out
14:42ilyakataggart: It's a variable. I use it in if's predicate
14:42ilyakSometimes it can't be calculated, then I won't use it
14:44ataggartan example usage might help clarify things
14:44ilyakHowever it tries to compute immediately
14:44ilyak(if (> new-weight best-weight) new-right)
14:45ilyakthere, new-weight and best-weight are declared in let and might be not computable
14:45ilyakIf they aren't, this if won't be executed
14:45ilyakbut they are computed anyway, it seems
14:45ataggartthen don't call them in the let binding
14:46ataggartand you're omitting the important part, namely the boundary between calling and not-calling
14:48ilyakataggart: The boundary is another if
14:48ataggartan example usage might help clarify things
14:50ilyakOops, it seems that I had a logical problem
14:52ilyakataggart: http://pastebin.com/mNURgYRr
14:52ilyakPlease ignore the fact that it's a half-assed fold
14:53ilyakif remaining-rights is empty, nothing would be executed
14:53ilyakwhich doesn't prevent calculation of new-weight, which would then fail on nil input
14:53ilyakplease disregard the thing
14:54ilyakI think it shouldn't happen on my input, so my problem lies somewhere else
14:54ilyakI'll try to confirm
14:58ilyakataggart: Can you look at my example? I've figured that it's still the case.
15:00amalloyilyak: when you ask to call a function, it gets called
15:00amalloyif you want to not call it sometimes, then wait until you've decided whether to call it or not, and then either call it or don't
15:01amalloyor do as hiredman and technomancy suggested: wrap it in a delay, and force it if you decide you need it
15:02ataggarthttps://gist.github.com/941012
15:02ataggartilyak: ^
15:11ilyak,(cond false "a" "b")
15:11clojurebotjava.lang.RuntimeException: java.lang.IllegalArgumentException: cond requires an even number of forms
15:11ilyaksad
15:11ilyakwhy doesn't it have else on last odd
15:11jweissfor core fn's that take predicates, do those preds need to return true/false, or just does it behave just the same with non-nil/nil?
15:12ataggartfor the same reason 'if doesn't, they default to returning nil
15:12mecjweiss: truthy and falsy
15:12jweissmec - so it's idiomatic to make preds (fns with ? at the end) that return truthy and falsey rather than true/false?
15:13jweisseg, i can call "some" in my pred and just return whatever it returns
15:14mecjweiss: ah I believe pred? should return true and false/nil, and pred should return something useful and false/nil
15:14ataggartpred-taking fns use logical truth, fns ending in ? return booleans
15:14jweissataggart: ok, so my next question is, is there a core fn that converts truthy/falsey to true/false
15:14jweiss(not (nil? x)) does it but that's 2 calls :)
15:14amalloyboolean
15:15amalloy&(map boolean [1 true false nil])
15:15sexpbot⟹ (true true false false)
15:15jweisssweet thx
15:15amalloyjweiss: (complement nil?) is also wrong, since it would convert false to true
15:16mecIs there a non-imperative way to do this: (let [x (if (pred-a x) (b x) (c x)) x (if (pred-d x) (e x) (f x))] ...)
15:16jweissah right
15:17mecjweiss: (comp not not)
15:17jweissmec - fun but i can imagine scratching my head when i read that code later :)
15:17mecAlthough I don't think that should be used, exactly
15:18amalloymec: you could use https://github.com/amalloy/amalloy-utils/blob/master/src/amalloy/utils/transform.clj#L4 and (comp) together two calls to it
15:18amalloy(let [decider-fn (comp (transform-if pred-a b c) (transform-if pred-d e x)), x (decider-fn x)]...)
15:19amalloythough i guess you'd want to reverse the other of the two comp'd functions
15:20mecya
15:20mecI like that you dont have to repeat yourself, but I'm not sure thats any clearer for me
15:25ilyakI've rewrote it into fold
15:43stuarthallowaycemerick: you around?
15:44cemerickstuarthalloway: for the moment :-)
15:44stuarthallowayquick rummage question for you
15:44stuarthallowaywould you be open to having build-attrs and delete-attrs call as-set instead of as-collection?
15:45stuarthallowayas it works right now, all Clojure collection types get shoehorned into SDB's set-valued semantics
15:47stuarthallowaycemerick: if rummage made parameters with as-set, then https://gist.github.com/941069 would be a great encoding map (IMO)
15:48cemerickstuarthalloway: I was going to say, that change wouldn't matter unless you were collection-type-dependent in an encoding
15:48stuarthallowaycemerick: just wondering when you would want ordered collections to magically become sets in SDB
15:49stuarthallowayif there are use cases for it then I will find another way to get pure Clojure encoding
15:50cemerickstuarthalloway: I don't think I considered it explicitly. I've been assuming that values are scalars or sets.
15:50cemerickstuarthalloway: got to run; I'll mull it over
15:50cemerickmaybe it's time to have a rummage GGroup :-P
15:50stuarthallowaycemerick: thanks. Cheers!
16:05malkomalkois there a quick way to pull out certain columns from a vector? I know about nth, but that works on one col.. possibly juxt? I know I can probably do it with map, but was looking for another way
16:07mrBliss`,(select-keys '[a b c d] [1 2])
16:07clojurebot{2 c, 1 b}
16:08malkomalkoguess (map #(nth v %) [1 3 5]) works just as well
16:09TimMc(map (partial get v) indices)
16:11amalloy&(map '[a b c d] [1 2])?
16:11sexpbot⟹ (b c)
16:12amalloymalkomalko: ^
16:12no_minddo function calls with a bang in the end represent something special in clojure ?
16:13pdkexample?
16:13clojurebotexamples is http://en.wikibooks.org/wiki/Clojure_Programming/Examples/API_Examples
16:13TimMcno_mind: They are a note to the programmer that mutation will occur.
16:13malkomalkoamalloy: how does that work? :)
16:13pdkah yeah
16:13pdkif the function is named with !
16:14TimMcamalloy: Ack! Of course.
16:14pdkthat's basically a warning "this may clobber stuff"
16:14amalloy&('[a b c d] 2)
16:14sexpbot⟹ c
16:14amalloy&('[a b c d] 1)
16:14sexpbot⟹ b
16:14amalloyit works like that
16:14TimMcmalkomalko: Vectors are functions of indices to values. :-)
16:14malkomalkoahhhh hah
16:14malkomalkoright!
16:15malkomalkothanks... always forget
16:24TimMcno_mind: Specifically, bang is often used to mark a function that may not *obviously* have side effects, or is an alternative version that uses side effects.
16:25no_mindk
16:26raekmore specifically, it signifies that the side-effects are not safe in a transaction
16:26raek(compare 'alter' for refs and 'swap!' for atoms)
16:29S11001001b
16:32TimMcraek: Ah! Nice distinction.
16:54mecIs there any way to create 2 maps that contain eachother?
16:56_gfrlogmec: nope
16:56_gfrlogmec: I think that would violate some of the assumptions that you can make about immutable data
16:57_gfrlogand maybe one of the axioms of set theory
17:14mecIs there anyway to delay a value in a map until its key is accessed? (:a {:a (delay ...)}) without needing @(:a {:a (delay ...)})
17:15TimMc_gfrlog: There might be some Haskelly way of doing it.
17:17amalloymec: you don't need @ - you can use force, which will also be safe on non-delay objects
17:17mecamalloy: no way to do it transparently?
17:18amalloymec: no. if there were, there would be no way to refer to delays *without* forcing them
17:18mectrue
17:18_gfrlogTimMc: yeah?
17:19_gfrlogmec: a curried function has a similar functionaly
17:19_gfrlogs/functionaly/functionality
17:19sexpbot<_gfrlog> mec: a curried function has a similar functionality
17:29gfrlog_TimMc: what happens if I create a map of all maps that do not contain themselves?
17:30ataggart,(long 10000000000000000000/3)
17:30clojurebot3333333333333333333
17:30mecyou blow the stack?
17:30ataggart,(double 10000000000000000000/3)
17:30clojurebot3.333333333333333E18
17:30amalloythe heap, probably
17:30gfrlog_but will it contain itself!!??!1
17:31amalloygfrlog_: you'll never know. you'll run out of heap before you get to calculating all its elements
17:31ataggart,(long *1)
17:31clojurebotjava.lang.IllegalStateException: Var clojure.core/*1 is unbound.
17:31gfrlog_amalloy: okay, what if I did it on a clojure turing machine?
17:32mecHeat death of the universe?
17:32gfrlog_new project: cluring machine
17:33gfrlog_turing majine?
17:34hiredmanclasical turing machines are both single threaded and mutation based
17:35gfrlog_hiredman: we can simulate both
17:37hugod_is this expected behaviour? ##(let [f (fn [x] x)] (= f (vary-meta f assoc :b 1)))
17:37sexpbot⟹ false
17:38amalloyyes. functions don't have "values"
17:38amalloythey're compared with identical?, and if you assoc in some new meta you get a new pointer
17:40hugod_ok. hw annoying…
17:46ataggartcan someone else please double check my thinking that the float->long conversion test is wrong: https://github.com/clojure/clojure/blob/master/test/clojure/test_clojure/numbers.clj#L109
17:46brehautTimMc, gfrlog_ the haskelly way is http://www.haskell.org/haskellwiki/Tying_the_Knot
17:47brehautTimMc, gfrlog_ though im dubious that it would work with a strict datatype
17:49gfrlog_TimMc: man now I gotta read haskell syntax...
17:51brehautgfrlog_: maps are strict, so perhaps you shouldnt worry about it
17:51TimMcI don't suppose the Clojure reader supports sharp variables, like Mozilla's JS does?
17:52gfrlog_brehaut: what's a strict datatype?
17:53TimMcletrec in Scheme can do recursive lists, I think.
17:53amalloyTimMc: it doesn't
17:53gfrlog_any mutable datatypes can do recursion like that
17:54brehautgfrlog_: one with strict (rather than non-strict) evaluation semantics. the opposite of lazy. in clojure all the builts are strict except seqs; in haskell the majority of datatypes are non-strict by default (not quite the same as lazy, but close enough)
17:54gfrlog_brehaut: gotcha
17:54gfrlog_come to think of it, I think that means a clojure list can contain itself, doesn't it?
17:55brehauta clojure sequence can, not sure about a list
17:55gfrlog_ah right
17:55brehaut,(take 10 (cycle [1 2 3]))
17:55clojurebot(1 2 3 1 2 3 1 2 3 1)
17:55gfrlog_uh
17:55gfrlog_I don't think that's at all what I meant
17:56brehautits implementation dependant on cycle i guess, but its easy to conceive of an imp that does exactly what you suggest
17:56raekgfrlog_: yes: (def ones (lazy-seq (cons 1 ones)))
17:57gfrlog_I new there'd be a short way to do it
17:57raekdon't forget your (set! *print-length* <finite number here>) when playing around with these things :-)
17:57gfrlog_of course
17:58gfrlog_man this is like finding out that santa clause doesn't exist
17:59gfrlog_laziness doesn't necessitate self-reference though, does it?
17:59gfrlog_just laziness with mutability?
17:59raekthe expression in (lazy-seq ...) can be anything seqable
18:00gfrlog_but could you do the same thing in haskell?
18:00brehautgfrlog_: you dont need mutability for self reference and laziness
18:00brehautgfrlog_: trivially. the haskell version is ones = 1: ones
18:00raek(also, my example was an example of a sequence that has itself as its rest, not a list)
18:01gfrlog_brehaut: that's valid haskell?
18:01brehautyes
18:01gfrlog_brehaut: I am surprised
18:01brehautmodulo any type errors i might have made
18:01raekif clojure would be non-strict, it would be (def ones (cons 1 ones))
18:02brehautgfrlog_: haskells lists are its seqs; they dont have a seperation
18:02brehautgfrlog_ and : is cons in haskell, its simply defining a constant sequence
18:03gfrlog_brehaut: yeah, I understand that much
18:03gfrlog_brehaut: I just would expect that using a variable in its own definition would be disallowed
18:03brehautgfrlog_: not in a non-strict language
18:03brehautgfrlog_: its exactly like raeks definition of ones above
18:04brehautgfrlog_: the most common example of it in haskell is sadly the very nerdy fib definition
18:04gfrlog_brehaut: what would it harm if you did disallow it?
18:04brehautwell cyclic data structures would be out
18:05brehaut(cyclic by reference anyway)
18:05gfrlog_brehaut: right, that's what I'm trying to remove :)
18:05raekand recursive functions?
18:05brehautraek: yeah i think you are right
18:05gfrlog_raek: no you can do recursion indirectly
18:05raekY combinator?
18:05gfrlog_brehaut: I feel like erlang would be what I'm describing
18:06gfrlog_brehaut: if it were lazy
18:06brehautmy experience with erlang is even more limited than haskell
18:06gfrlog_maybe a succinct way of saying what I'm thinking is that I can imagine a lazy (=? non-strict) language that doesn't permit self-reference
18:08brehautyou can call it lazy, only wadler will correct you
18:09brehautim sure its possible to create such a language but it seems like you'd be going out of your way to make life harder
18:09gfrlog_brehaut: what useful features would be lacking?
18:10brehautwhat useful features are lacking from assembly? you can tarpit yourself to death if you really want to
18:10gfrlog_so...you're saying that all features would be lacking?
18:10gfrlog_I just can't think of any and assumed you had one in mind
18:10brehautonly self reference would be lacking
18:11brehautit doesnt make things impossible, just a bit harder
18:11gfrlog_and how often do you use that?
18:11brehautnot too often (excepting funs)
18:11brehautbut implementation wise (especially for a dynamic language) its harder to make it disallow that than to allow it
18:12gfrlog_syntactic sugar could take care of the recursive functions
18:14brehautgfrlog_ this is going too far down a hypothetical rabbit hole and i have actual work to do sorry
18:14gfrlog_brehaut: okay
18:39milkposttechnomancy: the graph-api looks kinda shabby, can't figure otu how the hell to use it
18:40technomancyI'm sorry, what graph api?
18:40milkposthttp://richhickey.github.com/clojure-contrib/graph-api.html
18:41technomancyyeah, I don't think that's maintained these days.
18:41milkposti may be barking up the wrong tree, but i am sick of coding in python and I want something faster. the only nice thing about python is it has a pretty good library for network stuff. looks like haskell does pretty well there too ...
18:41technomancythere's a neo4j wrapper that seems to be hot stuff
18:42milkpostahh cool
18:45milkpostnot sure what this neo4j thing is though, but i'll give it a shot
19:35chrissbxIs it possible to get a backtrace of the clojure function calls?
19:35chrissbxAll I'm always seeing are backtraces of java code, with no frames of my clojure code.
19:36chrissbx(At least when I enter code at the slime repl)
19:37brehautyes its definately possible. but dont know how to do it with slime though
19:37chrissbxHm maybe I was wront, there are frames from my code further down the trace.
19:37chrissbxBut they don't show locals.
19:37brehautchrissbx: yeah they are pretty huge
19:38chrissbxWhat do I have to do to get locals?
19:38brehauti have no idea actually
19:38amalloychrissbx: it's not easy to get locals
19:39amalloyyou can get them with the latest version of swank, which integrates the cdtr
19:39amalloycdt
19:39amalloybut you still have to set a breakpoint explicitly, i think - i don't think you can get locals when stepping in to save an arbitrary exception
19:40chrissbxexception?
19:40clojurebothttp://www.mindview.net/Etc/Discussions/CheckedExceptions
19:40chrissbxdo you mean frame?
19:41chrissbxWell I just want to know what's going on... so I'll have to find out what cdt is and install that?
19:43amalloychrissbx: i think that's out of date; last i heard the cdt was being bundled as part of swank (as of like yesterda)
20:04dnolenwhat's the best way to go from var to namespaced symbol - look at the var's meta?
20:05hiredman,(.getName #'+)
20:05clojurebotjava.lang.IllegalArgumentException: No matching field found: getName for class clojure.lang.Var
20:05hiredmanbleh
20:05hiredman,(.ns #'+)
20:05clojurebot#<Namespace clojure.core>
20:05hiredman,(.sym #'+)
20:05clojurebot+
20:06dnolenhiredman: thx
20:57technomancyduuuuuuude: https://github.com/technomancy/slamhound
20:57hiredmanwoa!
20:58technomancyhiredman: it's a sight to behold, innit?
20:58technomancyright after pushing it I hit random-play, and it queued up protomen act 2.
20:58hiredmannice
20:58technomancyIT"S A SIGN.
20:58hiredmanit's a good one
20:58technomancy[sic]
20:59hiredman(now I really want a picture of a road sign with the text replaced with 'IT"S A SIGN')
21:00technomancyyessss
21:01joshua__technomancy, what have you done!?!?! Literally.
21:05technomancyexcellent question
21:22dnolentechnomancy: that is pretty cool.
21:27technomancydnolen: thanks
21:28benreesmangreat name too
21:28TimMctechnomancy: What does it *do*?
21:29technomancyTimMc: http://wondermark.com/190/
21:29technomancyTimMc: maybe this is clearer: http://groups.google.com/group/clojure/browse_thread/thread/20d314bc0a23b574
21:29technomancyI should put before/after in the readme
21:31ataggartso, the "organize Imports" feature in most IDEs
21:32TimMcI actually don't understand the examples.
21:32TimMcDoes the "before" have hidden requires and uses?
21:33technomancyTimMc: no, the idea is you wrote the -main function but haven't bothered to change the ns form yet.
21:33technomancyyeah, I guess it's sometimes a feature of IDEs?
21:33TimMcHow does it know that io/foo is foo from clojure.java.io?
21:33TimMcMagic?
21:34technomancyclasspath search
21:34TimMck
21:34TimMcfancy
21:34technomancyit has a pluggable disambiguator for matches.
21:34technomancyby default it takes the first non-swank namespace.
21:34TimMcAw, that's my favorite kind of disambiguator!
21:34ataggartwhere is the classpath searching code?
21:35ataggartI figure asplode, but doesn't look like it
21:35benreesmantechnomancy: just tried it out, got 'prefix cannot be nil'. any hints?
21:35technomancyataggart: slam.hound.regrow/candidates
21:35technomancybenreesman: hmm... go ahead and open a github issue I guess
21:36technomancyI haven't tried it on much yet
21:36benreesmani'll mess around with a bit first, it looks rad
21:36ataggartah, the part I was looking for is apparently buried inside swank.util.class-browse
21:37technomancyataggart: yeah, I need to factor that out
21:38technomancymy favourite part is there are only 2 impure calls
21:44ataggarthow long did it take to put that all together?
21:45ataggarttrying to guage how sucky I am
21:45technomancycouple hours saturday and then maybe half of today
21:45technomancyor maybe most of today
21:45ataggartnice
21:46technomancygot some pairing time on it for a few hours today though; that helps
21:46technomancyit can come together a lot more quickly when it's mostly pure like that
21:55brehautugt?
21:55clojurebotugt is Universal Greeting Time: http://www.total-knowledge.com/~ilya/mips/ugt.html
21:55brehautalmost a win
21:55brehautdont know why he thinks his name is clojurebot
21:56brehautoh. wrong channel. duh
21:58cemericktechnomancy: Slamhound looks nice, well done :-)
22:10weavejesterJust saw it. Slamhound looks very cool :)
22:25technomancythanks. it was a lot of fun to write.
22:50seancorfieldquestion about maps and keys / vals - are the keys / vals pair of functions guaranteed to bring things back in the same order (as each other)
22:50seancorfieldit looks that way but i wasn't sure if it was guaranteed by the language
22:51cemerickno
22:52cemerickI think they do, for all of Clojure's map impls right now, but that's not written in stone.
22:52cemerickIf you need both, in the same order, just use `entries`.
22:58ataggartIt's guaranteed in as much as vals and keys are dependent on seq, so as long as seq is consistent, so will keys and vals
23:00drewrrhickey has stated before that you can depends on keys/vals being commensurate
23:03drewrcommensurate isn't really the correct adjective there but you know what I'm' sayin'
23:08ataggartcoordinated?
23:10Miguel_InzHello, I've been having troubles to install enclojure, so I am decided to test clojure directly but i don't know the way to get integrated to netbeans. I'm interested to do some 'rapid' guis to test with clojure and lisp that's why I choosed Enclojure to do some examples.
23:11Miguel_Inz.
23:11cemerickMiguel_Inz: Enclojure isn't yet compatible with NetBeans 7, if that's what you're using.
23:11Miguel_InzSorry for the english, isn't my native language : )
23:12Miguel_InzIs any version available of netbeans compatible? like 6.7?
23:12cemerickMiguel_Inz: Last I knew, it was compatible with 6.8
23:13cemerickThe Counterclockwise plugin for Eclipse is pretty good as well, if you're not wedded to NetBeans.
23:13Miguel_InzThats the unique that works for me
23:14Miguel_Inzjust interested in netbeans to do some exercises of books implemented with a little GUI 'the netbeans way'
23:15ataggartI agree with cemerick. Eclipse + Counterclockwise is good.
23:15Miguel_Inzwell has been like 1 week of research with the netbeans i suppouse i have to do it with Ecplipse
23:16Miguel_InzYes, i've been tested Counterclockwise it really works fine :)
23:16cemerickMiguel_Inz: FYI, Google has made windowbuilder pro free: http://code.google.com/javadevtools/wbpro/
23:16cemerickI don't do a ton of thick-client UI stuff, but I've been impressed with it compared to NetBeans' Matisse layout tools.
23:17Miguel_Inz:0
23:17Miguel_Inzwow didn't know it
23:18Miguel_Inzthe thing for why I was atached to netbeans was WYSIWYG :P, you know I want to apply clojure to school projects
23:18Miguel_Inzwell I think this resolves the problem :D
23:19cemerickYeah, windowbuilder is certainly reasonable for that :-)
23:19cemerickBuild up your form, make all the controls public, and then you can create it and wire everything up from Clojure.
23:22Miguel_Inzthank you cemerick, I'll try windowbuilder sounds pretty good :)
23:22Miguel_Inzthanks for the attention
23:40mecIf I want to implement ISeq on a defrecord I have to make it a deftype right?
23:44mecOr is there any other way to make a custom seq?
23:45dnolenmec: records are seqable.
23:46chrissbxHow would you install newest swank (like "as of yesterday"), and still have it work with the slime part?
23:47chrissbxMy previous installation attempts were pretty difficult to make both parts match up.
23:50technomancychrissbx: the swank-clojure readme covers it pretty well
23:51chrissbxOk; technomancy, should I take your branch at https://github.com/technomancy/swank-clojure for the cdt work?
23:52technomancyyeah
23:52chrissbxok
23:53chrissbxHm, the readme says how to install using leiningen; but how to build from git?
23:53chrissbx(I'm a clojure and java newbie)
23:54technomancyif you're new to things it's best not to go from scratch
23:54chrissbxHm. Problem is the code I'm writing right now is really asking for a debugger.
23:55chrissbxI'm used to debuggers in Scheme, which tell me exactly where the error happens, and let me inspect the environment.
23:56tomojmec: seems you can override the record implementations
23:57tomoj(do (defrecord Foo [bar baz] clojure.lang.ISeq (first [_] 21)) (first (Foo. 1 2))) returns 21
23:57chrissbxHere I just got "Wrong number of args (1) passed to: state$-GT--GT--EQ-$fn" without any location information whatsoever.
23:57mecchrissbx: you can use swank.core/break and in the break go to the repl and type (swank.core/local-bindings) to see the environment map, or just eval expressions as normal to see whats what
23:57chrissbxthanks, trying
23:58mectomoj: I thought you couldnt implement ISeq on a record because its already builtin?