#clojure log - Oct 22 2012

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

2:32 Sgeo: ,(let [+ 5] (resolve '+))

2:32 clojurebot: #'clojure.core/+

2:32 Cubic: Hi! If I want to do something with side effects that depends on multiple refs, how do I get the values of the refs without risking inconsistency?

2:32 Sgeo: Not sure why I'd expect anything else to happen

2:38 Cubic: Nevermind, I just saw that dosync returns the last evaluated form

3:41 cmdrdats: Hey guys, I started putting together an app for refactoring clojure project and would appreciate some feedback: https://github.com/CmdrDats/ns-refactor

3:42 basically just a readme for now, just want to get the goals fleshed out first

4:01 scottj: cmdrdats: not sure if this is out of your scope, clojure-refactoring's unthread, thread-first, thread-last, and extract-fn refactorings are pretty nice. I didn't seem them on your list.

4:01 ro_st: cmdrdats :-)

4:03 cmdrdats: scottj: i'll check it out

4:03 ro_st: anyone know how to use clojure.core/*assert* to conditionally compile code with clojurescript? i'm guessing some sort of macro?

4:03 cmdrdats: ro_st: o/

4:05 scottj: ye, probably out of scope - I'm planning ns-refactor to be more of a large-scale refactoring tool, so not really an individual expression thing

4:18 Raynes: callen: I figured out the connection issue re: refheap.el. It was my setenv call in my init.el. Don't even ask how long it took me to track that down.

4:36 kral: namaste

4:42 antares_: Elastisch 1.0.2 is released: http://blog.clojurewerkz.org/blog/2012/10/22/elastisch-1-dot-0-2-is-released/

4:45 doomlord: anyone here program in both haskell and clojure ?

4:45 Cubic: ,(doc dosync)

4:45 clojurebot: "([& exprs]); Runs the exprs (in an implicit do) in a transaction that encompasses exprs and any nested calls. Starts a transaction if none is already running on this thread. Any uncaught exception will abort the transaction and flow out of dosync. The exprs may be run more than once, but any effects on Refs will be atomic."

4:46 Cubic: ,(doc sync)

4:46 clojurebot: "([flags-ignored-for-now & body]); transaction-flags => TBD, pass nil for now Runs the exprs (in an implicit do) in a transaction that encompasses exprs and any nested calls. Starts a transaction if none is already running on this thread. Any uncaught exception will abort the transaction and flow out of sync. The exprs may be run more than once, but any effects on Refs will be atomic."

4:47 Cubic: Hm, neither says anything about returning a particular value. So my earlier observation of it returning the value of the last form isn't defined behavior? Or just an undocumented feature?

5:21 leoncamel: doomlord: I use both clojure and haskell in my toy projects. :)

5:22 doomlord: i keep oscillating between something else to learn..

5:22 i like loads of the ideas in haskell but get put off by the record system;

5:23 shachaf: You should learn about lenses!

5:23 doomlord: i'm finding clojure much easier to get into; but i would much prefer something with the type inference of haskel

5:23 shachaf: Lenses = the future (maybe).

5:23 doomlord: clojures' ability to just throw datastructures together ad-hoc is very appealing to me

5:24 lenses require 'template haskel' to implement?

5:25 i'm lukewarm on the JVM aswell

5:25 lucian: jvm is a definite downside for me

5:25 doomlord: Will haskell's record system stay broken and just be patched over with 'lenses' ?

5:26 how much is involved in using lenses

5:27 the thing with clojure is... decent datatsructures appear to work and its very simple to use

5:29 note that by "put off by record system" i dont mean any limitations of immutability, just the simple inability to define 2 datastructures with the same element name :)

6:16 shachaf: doomlord: Having unique accessor names *does* help type inference, you know. :-)

6:16 f(x) = x.foo // what's the type of f?

6:17 doomlord: i'm not convinced its essential; it seems like an oversight and thats an excuse invented

6:17 shachaf: Yes, there are various ways it can be worked around.

6:17 What's your proposal? :-)

6:21 doomlord: a waste of time me proposing fixes for haskell; peeps who work on the compiler will drive it

6:23 in the above example, there is simply a constraint that f is a function of something that must support .foo

6:25 shachaf: Yes, that's one way of doing it.

6:25 E.g. http://blog.ezyang.com/2012/04/how-urweb-records-work-and-what-it-might-mean-for-haskell/

6:25 doomlord: of course when i say 'simply', i've not personally implemented a type inferer :)

6:29 i've been assuming that under the hood clojures literal maps can be turned into simple structs... perhaps i'm hoping too much

6:31 clgv: doomlord: depends on what you mean with "under the hood"

6:35 doomlord: if you make a {:foo ?:bar ? :baz ?} .. and other routines use :foo :bar :baz acessors - so long as they can be traced to always come from construction in the same form, does it boil down to "struct FooBarBaz {...} " and loads from offsets from the base of that...

6:36 of course routines could get the same names from different structures.. perhaps it requires whole-program analysis to seperate out the cases where it can be infered simply

6:36 cemerick: doomlord: those are records

6:36 clgv: doomlord: defrecord can optimize access to its defined fields

6:36 cemerick: There is no automatic optimization where records are substituted for regular maps.

6:37 clgv: s/can optimize/optimizes/

6:37 lucian: doomlord: a regular map will be just a hashmap

6:38 doomlord: fair enough.

6:39 do you have to declare references to the record types when they come into a function as arguments, or can it at least trace those ok

6:39 (so long as the origin is always the record constructor)

6:40 clgv: doomlord: you can use it like a regular map when you want to access its values

6:40 mklappstuhl: hey... I'm looking for examples of clojure in the field (companies/products/...)

6:41 cemerick: doomlord: slot access is always mediated through the Associative and/or ILookup interfaces; "declarations" (called type hints in Clojure) are only ever useful to avoid interop reflection.

6:41 clgv: doomlord: e.g. (defrecord Foo [a b]) (let [f (Foo. 1 2)] (println (:a f) (:b f)))

6:44 doomlord: is there any difference between (:a f) and (f :a)

6:46 cemerick: Yes; :a is the function in the former, f is the function in the latter.

6:46 :a always looks itself up in an arg passed to it; (f :a) will do whatever f is defined to do

6:50 mklappstuhl: anyone here who could point me to a list oif commercial clojure companies/projects?

6:57 wingy: how do one check what country an ip is bound to?

6:57 so i know what language to show

6:58 andrewmcveigh|w: wingy: which language do you show for bilingual countries?

6:58 wingy: andrewmcveigh|w: yeah no idea

6:58 suggestions how to handle locales?

6:59 andrewmcveigh|w: wingy: Accept-Language headers?

6:59 wingy: probably a good idea

7:00 andrewmcveigh|w: that one is coupled with the language the browser is using right?

7:01 andrewmcveigh|w: wingy: yeah, I think so. Of course the browser must be set in the preffered language. Not sure if the OS does that.

7:01 wingy: seems like a smarter choice than checking on ip

7:03 andrewmcveigh|w: wingy: let me tell you, it pisses me off no end that infer that I speak Dutch because I live in Brussels/Belgium.

7:03 wingy: yeah .. i let you chooce language .. but need to know what to display at first

7:03 Accept-Language

7:04 andrewmcveigh|w: personally I'd go with that. Google do IP based lookup FWIW.

7:05 wingy: but as you said IP cant be mapped to a lang

7:07 andrewmcveigh|w: no, it can't for non-natives, travellers, multi-lingual places. I guess many sites don't think that's a big enough group to matter.

7:08 wingy: i want it to be perfect .. so whatever their browser is showing i am using :)

7:08 that cannot be bad right :)

7:08 makes sense

7:08 andrewmcveigh|w: That's my opinion.

7:09 wingy: i just hope that a browser using Vietnamese would send the correct Accept-Language header

7:09 andrewmcveigh|w: If my browser shows I'm using US English, I want US English.

7:09 I think it's a standard... could be wrong. Not really looked into it in great detail.

7:09 wingy: I'll install Windows and use different languages for the whole OS and see what it sends out

7:10 or I can just do the same on my Mac :)

7:12 bordatoue`: >>

7:12 hello could anyone tell me how to manage local .jar files in lein 2

7:14 I am using lein 2 can't see ./lib directory ,

7:14 andrewmcveigh|w: bordatoue`: I think the recommended way is to install to a maven repo, or if not possible install to your machines' local maven repo.

7:14 bordatoue`: lein 2 doesn't use ./lib - it uses the local maven repo

7:15 bordatoue`: andrewmcveigh : i don't have a local maven repo, why can't I just use lein as I had used lein version 1

7:16 andrewmcveigh|w: bordatoue`: you can install jars locally using -> https://github.com/kumarshantanu/lein-localrepo

7:17 bordatoue`: I'm not sure of the motivations for the change, so I can't advise you on that.

7:17 bordatoue`: thanks, do you think lein 2 is easier than lein 1, it keeps getting complicated for me

7:19 andrewmcveigh|w: personally, I prefer lein2 - it has enough functionality built-in so I don't have to use maven for some things.

7:20 not sure if it's easier though.

7:26 clgv: the motiviation seems to be to not have a copy of the deps in every project but only once in the maven repo

7:28 wingy: i am using a rest param in a function [foo & options] .. what is the idiomatic way to check if :details is specified in options

7:33 bordatoue: is there an equivalen of lein update in lein version 2

7:34 wingy: this was a long one

7:34 ((fn [& options]

7:34 (= (filter #{:flag} options) '(:flag))) :flag)

7:35 ,((fn [& options] (= (filter #{:flag} options) '(:flag))) :flag)

7:35 clojurebot: true

7:35 wingy: ,((fn [& options] (= (filter #{:flag} options) '(:flag))) :no-flag)

7:35 clojurebot: false

7:35 wingy: i combined = and filter and #{} .. if there is a more idiomatic way let me know

7:36 andrewmcveigh|w: wingy: you could use destructuring in the fn declaration (fn [& {:keys [flag]}] ...)

7:36 wingy: oh!

7:37 andrewmcveigh|w: ,((fn [& {:keys [f]}] f) :f 8)

7:37 clojurebot: 8

7:38 AtKaaZ: that's pretty epic, I was just reading about that few minutes ago here: http://clojure-doc.org/articles/language/functions.html

7:38 with :syms and :strs too

7:39 bordatoue: could anyone tell me what is the command in lein version 2 to update dependencies

7:39 wingy: andrewmcveigh|w: i cant get it to work .. isn't the rest params a sequence?

7:39 hyPiRion: ,((fn [& {:keys [f] :or {f 5}}] f) :non-existing :f)

7:39 clojurebot: 5

7:39 wingy: you are using :keys

7:40 ,((fn [& {:keys [flag]}] flag) :flag)

7:40 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: :flag>

7:40 hyPiRion: Yeah, rest of the args must be k-v pairs.

7:40 andrewmcveigh|w: ,((fn [& {:keys [flag]}] flag) :flag true)

7:40 clojurebot: true

7:40 AtKaaZ: ,((fn [& {:keys [flag] :or {flag nil}}] flag) :flag)

7:40 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: :flag>

7:41 AtKaaZ: it's like an incomplete map that way

7:42 ,((fn [& {:keys [flag] :or {flag nil}}] flag) )

7:42 clojurebot: nil

7:42 AtKaaZ: ,((fn [& {:keys [flag] :or {flag nil}}] flag) :a 1 :b 2 )

7:42 clojurebot: nil

7:42 AtKaaZ: ,((fn [& {:keys [flag] :or {flag nil}}] flag) :a 1 :b 2 :flag 3)

7:42 clojurebot: 3

7:42 wingy: there is no way to destructure a sequence since the rest params is a sequence

7:42 AtKaaZ: ,((fn [& {:keys [flag] :or {flag nil}}] flag) :a 1 :b 2 :flag 3 :c)

7:42 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No value supplied for key: :c>

7:43 andrewmcveigh|w: you can destructure a sequence, but only by position/index (i think)

7:43 AtKaaZ: I mean, the number of params must be even

7:43 wingy: andrewmcveigh|w: yeah just tried that

7:44 i should look at (require)

7:44 since it allows :reload :reload-all etc

7:44 andrewmcveigh|w: ,((fn [& [[flag]]] flag) [:flag 2 3])

7:44 clojurebot: :flag

7:46 hyPiRion: hm

7:49 Well, now I learned something.

7:49 ,((fn [& [a b :as {:keys [f] :or {f 5}}]] [a b :f f]) :a 3)

7:49 clojurebot: [:a 3 :f 5]

7:50 hyPiRion: doesn't work the opposite way though.

7:51 wingy: so this one is my best shot?

7:51 ,((fn [& options] (= (filter #{:flag} options) '(:flag))) :flag)

7:51 clojurebot: true

7:51 wingy: i believe you clojurebot

7:53 hyPiRion: wingy: it really depends on how the flags and so forth are set up.

7:54 If you're only testing for existence of one element, then just doing (some #{:flag} opts) should be sufficient.

7:55 Otherwise (empty? (reduce disj #{:set :of :flags} opts)) would be good, as it then wouldn't be order dependent.

7:57 wingy: hyPiRion: some was pretty good and concise

7:57 no need to use =

8:00 AtKaaZ: ,(some #{:flag} {:flag 1 :a 1 :b 2})

8:00 clojurebot: nil

8:01 AtKaaZ: what am I missing here?

8:02 ,(some #{:fred} '(:fred 1 2 3))

8:02 clojurebot: :fred

8:02 AtKaaZ: ,(some #{:fred} {:fred 1 2 3})

8:02 clojurebot: nil

8:02 AtKaaZ: ok got it i guess:)

8:02 andrewmcveigh|w: AtKaaZ: when you seq a map, it's not the same as a sequence

8:03 ,(seq {:flag 1 :a2 3 4})

8:03 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Map literal must contain an even number of forms>

8:03 andrewmcveigh|w: ,(seq {:flag 1 :a 2 3 4})

8:03 clojurebot: ([3 4] [:a 2] [:flag 1])

8:05 AtKaaZ: I just didn't know that opts was a seq instead of a map

8:05 andrewmcveigh|w: I think it's a bit of a special case.

8:06 AtKaaZ: just trying to understand what hyPiRion said

8:06 ,((fn [& options] (some #{:flag} options))) :flag)

8:06 clojurebot: nil

8:07 AtKaaZ: ,((fn [& options] (some #{:flag} options)) :flag)

8:07 clojurebot: :flag

8:07 AtKaaZ: lol how did that not err?

8:08 ,((fn [& options] (some #{:flag} options))) :flag

8:08 clojurebot: nil

8:08 mklappstuhl: anyone here who could point me to a list oif commercial clojure companies/projects?

8:08 AtKaaZ: oh i see, clojurebot does only first form

8:08 hyPiRion: Oh, right.

8:09 AtKaaZ: I consider opts as a sequence, not a map. With a map, you'd prolly do (keys) or something.

8:09 AtKaaZ: ,,((fn [& options] (boolean (some #{:flag} options))) :flag)

8:09 clojurebot: true

8:20 frawr: Hello, looking for some help on twitter-api http://github.com/adamwynne/twitter-api

8:23 wingy: how do i add a key/value pair to a Ring request so that the other middleware can use what i have added

8:23 i know how to add a key/value pair to the request map but then it just creates a new one, and the old request map is still used in the subsequent middlewares

8:24 oh of course i get it now

8:25 https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session.clj

8:56 is there a way to simplify this: https://www.refheap.com/paste/6026

8:56 instead of fetch acount in a second line

8:58 edbond: wingy, I think you can't. It simple enough.

8:59 noidi: ,(let [{{bar :bar} :foo} {:foo {:bar 123}}] bar)

9:00 clojurebot: 123

9:00 noidi: ,(let [{foo :foo} {:foo {:bar 123}}] foo)

9:00 clojurebot: {:bar 123}

9:01 noidi: so you can replace the variable name with another destructuring form

9:02 jcromartie: Does anybody know if there's a name or way to refer to the idea of separating your personal beliefs from understanding opposing views? E.g. understanding any point of view on different sides of an argument, no matter what your view is?

9:02 And conversely: when someone confuses explanation or understanding with justification or support?

9:03 noidi: wingy, I think this might work: (GET "/" {:keys [lang color], {account :account} session})

9:03 jcromartie: totally off-topic but I figure if any of the programming channels I frequent was home to an armchair philosopher, this would be it

9:03 noidi: or at least something like that

9:04 oopes, that should be {account :account} :session

9:04 -e

9:05 mpenet: jcromartie: being objective? as the opposite of subjective, maybe

9:05 AtKaaZ: jcromartie, maybe being objective? can't be it , too simple right?

9:06 jcromartie: I think it's "confusing explanation with excuse/justification"

9:06 yeah

9:06 AtKaaZ: misunderstanding?

9:06 noidi: wingy, and my last attempt after checking Compojure's destructuring docs :) (GET "/" [:as {:keys [lang color], {account :account} :session}] ...)

9:07 (not tested)

9:07 AtKaaZ: jcromartie, possible good read? http://plato.stanford.edu/entries/reasons-just-vs-expl/

9:08 wingy: noidi: doesn't make sense to me

9:09 noidi: but it worked :)

9:09 ro_st: wingy: clojuring instead of noding, i trust?

9:10 wingy: ro_st: huh?

9:10 noidi: thx

9:10 ro_st: using clojure instead of node.js, i trust?

9:10 last time we spoke you were dithering

9:10 wingy: ro_st: yeah

9:10 ro_st: im back!

9:13 found clojure more logically correct, good data manipulation, fp, has datomic and light table, less hacky

9:15 AtKaaZ: jcromartie, unbiased? naah it would be too easy

9:17 wingy: noidi: (GET "/" [:as {:keys [lang color], {:keys [account]} :session}] ...)

9:17 even better :)

9:19 AtKaaZ: jcromartie: anyway I figure that is the job of an arbiter

9:19 Cheiron: Hi, I have a ref type that holds many maps and I would like to employ something like self expiring maps

9:19 time to live maps

9:23 andrewmcveigh|w: wingy: I think you can do this (GET "/" {:keys [lang color] {:keys [account]} :session} ...) - if I'm reading it right. Is :session on the request map?

9:23 AtKaaZ: jcromartie, unbigoted ? impartial? ok I give up:)

9:23 wingy: andrewmcveigh|w: yeah that is what i ended up doing

9:24 clj is so nice .. handling every detail

9:35 jcromartie: AtKaaZ: thanks anyway :) but I think you are on the right track

9:35 AtKaaZ: jcromartie: is it maybe the Scientific method?; or 'rationalizing' for what you said: "when someone confuses explanation or understanding with justification or support"

9:35 ok now I give up :D

9:36 jcromartie: for example: explaining the actions of terrorists is not justifying the actions of terrorists

9:36 zoldar: Cheiron: I don't know if it would suit your use case but maybe you could build something based on this: https://github.com/clojure/core.cache/wiki/TTL

9:36 AtKaaZ: rationalizing the actions of terrorists?

9:37 oh wait, nvm:)

9:37 that's when you're justifying

9:38 too complex for my little brain to compute

9:39 Cheiron: zoldar: is it safe to use one of those types inside a ref type?

9:43 zoldar: Cheiron: from the looks of it, I don't see anything that would cause problems: https://github.com/clojure/core.cache/blob/master/src/main/clojure/clojure/core/cache.clj#L241

9:58 Cubic: Is sync/dosync guaranteed to return the value of the last evaluated form (it does that in 1.4 and probably in the earlier versions too, but is that guaranteed behavior)?

10:00 clgv: Cubic: yes, it is. an implicit do is mentioned in the docstring

10:01 AtKaaZ: ,(dosync ((throw nil) 2))

10:01 clojurebot: #<NullPointerException java.lang.NullPointerException>

10:01 AtKaaZ: ,(dosync ((throw (Exception. "a")) 2))

10:01 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.Exception: a>

10:01 AtKaaZ: didn't return 2 =)

10:02 clgv: lol. because an exception happened. that is the same with clojure functions

10:02 AtKaaZ: ,(dosync (map #(throw (Exception. "a")) '(1)) 2)

10:02 clojurebot: 2

10:02 AtKaaZ: :)

10:02 Cubic: AtKaaZ: fair point, but I was more talking about something like (dosync [@a @b @c])

10:02 AtKaaZ: clgv, you have a point:)

10:03 clgv: Cubic: dosync in your example returns that vector

10:03 Cubic: ,(doc dosync)

10:03 clojurebot: "([& exprs]); Runs the exprs (in an implicit do) in a transaction that encompasses exprs and any nested calls. Starts a transaction if none is already running on this thread. Any uncaught exception will abort the transaction and flow out of dosync. The exprs may be run more than once, but any effects on Refs will be atomic."

10:03 Cubic: It says it does an implicit do, but it doesn't say that the value of the do is returned.

10:04 I mean I know it DOES that

10:04 clgv: Cubic: it wraps the expressions in an implicit do

10:04 AtKaaZ: ,(do 1 2)

10:04 clojurebot: 2

10:04 clgv: Cubic: and do is for side effects and returns the value of its last expression

10:04 AtKaaZ: I guess the fact that it acts like a do is implicit :D

10:05 Cubic: clgv: Maybe my lack of english skills is in the way here, but for me, wrapping in do could technically also mean ((do ,@stuff) nil)

10:05 clgv: AtKaaZ: thats through dosync -> sync -> fn -> do

10:06 ;)

10:06 Cubic: thats only valid clojure if a function is returned from the do

10:06 Cubic: ,(doc when)

10:06 clojurebot: "([test & body]); Evaluates test. If logical true, evaluates body in an implicit do."

10:07 clgv: Cubic: like in a lot of macros finally your expressions are put into `fn` or `fn*`

10:07 AtKaaZ_k: what's with irc failing :)

10:08 Cubic: I mean like that. Ok bad example because the do is bound to a condition, but for me the implicit do part only says that it does all the stuff you listed in that order, not that there's necessarily nothing else that happens afterwards.

10:10 clgv: Cubic: well read th `do` docstring

10:10 AtKaaZ: ,(dosync)

10:10 clojurebot: nil

10:10 AtKaaZ: ,(declare ghost)

10:10 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

10:11 Cubic: I know what do does, I just don't read "implicit do" as "there is an implicit do, and the value which it evaluates to will be returned". Maybe that's just me being silly though

10:13 AtKaaZ: implicits are evil

10:13 clgv: Cubic: well you cant repeat the do semntics on every function that uses it. saying that the given expressions are wrapped in a do, should suffice as a pointer

10:13 AtKaaZ: ,(#(do &% nil) 1 2 3)

10:13 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: & in this context, compiling:(NO_SOURCE_PATH:0)>

10:14 AtKaaZ: ,(#(do %& nil) 1 2 3)

10:14 clojurebot: nil

10:15 AtKaaZ: ,(#(do %&) 1 2 3)

10:15 clojurebot: (1 2 3)

10:17 clgv: AtKaaZ: lol what's your point with those?

10:17 AtKaaZ: failing to emulate do :)

10:18 AdmiralBumbleBee: emulating do using do?

10:18 AntelopeSalad: is this the #1 resource for clojure-related podcasts? http://stackoverflow.com/questions/2758783/podcasts-for-clojurians

10:18 AtKaaZ: well on the second one, but the first one was meant to not return 3 lol

10:18 S11001001: AtKaaZ: not possible

10:19 AtKaaZ: S11001001, to emulate the special form do?

10:19 clgv: AtKaaZ: `do` is a special form, so it's very unlikely that you can do that... at least not exact

10:19 AtKaaZ: ok, trying...

10:20 does it unlazy the lazy seqs?

10:20 clgv: AtKaaZ: no.

10:21 AtKaaZ: can we destruct [& all] into "all except last" and "last" ?

10:21 clgv: (do (create-my-lazy-seq) 42) would create a lazy-seq and throw it away

10:22 AtKaaZ: without let?

10:24 AdmiralBumbleBee: droplast and last?

10:24 S11001001: AtKaaZ: no

10:24 AdmiralBumbleBee: you can't destructure without let

10:24 AtKaaZ: ,((fn [& all] (let [xall (reverse (rest (reverse all))) last (first (reverse all))] (map #(eval %) xall) last)) (println 1) 2 3)

10:24 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

10:24 AtKaaZ: ah eval:)

10:24 thing is, println would get evaluated unless i make it a macro

10:24 evaluated before being passed

10:25 AdmiralBumbleBee: what are you trying to do?

10:25 AtKaaZ: emulate do :)

10:25 S11001001: AtKaaZ: that's the #1 reason you can't

10:25 AtKaaZ: S11001001 but then I make it a macro, I can?

10:25 S11001001: AtKaaZ: and if you were to have that, you would have...

10:25 AtKaaZ: that=as macro?

10:26 S11001001: AtKaaZ: do

10:26 AtKaaZ: I didn't understand

10:26 S11001001: AtKaaZ: try to implement do as a macro, without using core do *or* anything that provides implicit do (e.g. let)

10:27 AtKaaZ: eval?

10:27 clojurebot: eval is DENIED

10:27 AtKaaZ: lol

10:27 ok let me try

10:27 clgv: eval would work.

10:27 but why would you even try?

10:27 S11001001: clgv: no, you lose enclosing scope

10:27 AtKaaZ: like for xp

10:28 S11001001: AtKaaZ: I take it back, there's a function you can write that simulates do, with exactly the same semantics as do.

10:28 clgv: S11001001: ah right. for his trivial use cases it would work ;)

10:28 AtKaaZ: function?

10:28 clojurebot: function is <Chouser> there is one class per fn, one instance of it per closure

10:28 AtKaaZ: S11001001, what function is it?

10:28 S11001001, without evaluating my params beforehand?

10:29 clgv: AtKaaZ: there are more useful tasks for xp ;)

10:29 Kototama: I have a nasty bug with jayq.utils.clj->js, when I add a simple key to a map, the function doesn't work anymore http://paste2.org/p/2366957 Any ideas?

10:29 S11001001: it does eval your params beforehand, but that's not a phenomenon you can observe with a direct call, so you can implement do with it

10:29 AtKaaZ: wait, does do also eval the params beforehand? i wonder

10:29 Kototama: or it's a bug in clojurescript merge :-p

10:29 S11001001: (def lastarg [& args] (last args))

10:29 AtKaaZ: S11001001 oh thanks for that

10:30 S11001001: (defmacro do' [& forms] `(lastarg ~@forms))

10:31 AtKaaZ: ,(butlast '(1 2 3))

10:31 clojurebot: (1 2)

10:32 AtKaaZ: ,((fn [& all] (let [xall (butlast all) last (last all)] (map #(%) xall) last)) (println 1) 2 3)

10:32 clojurebot: 1

10:32 3

10:32 S11001001: AtKaaZ: no

10:32 AtKaaZ: yep i fail:) lazy

10:32 no doall? ::D

10:33 S11001001: AtKaaZ: try it

10:34 AtKaaZ: ,(class #())

10:34 clojurebot: sandbox$eval27$fn__28

10:34 AtKaaZ: I need something to can call either func or number :) not eval

10:35 maybe some if

10:35 S11001001: AtKaaZ: I don't know why you're doing any of it; lastarg is sufficient

10:35 frawr: Anyone here with some experience using twitter-api for their streaming api?

10:35 AtKaaZ: for this:

10:35 ,((fn [& all] (let [xall (butlast all) last (last all)] (doall (map #(%) xall)) last)) #(println 1) 2 3)

10:35 clojurebot: 1

10:35 #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

10:35 AtKaaZ: ,(#(2))

10:35 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>

10:36 Cubic: clojure?

10:36 clojurebot: "[Clojure ...] feels like a general-purpose language beamed back from the near future."

10:36 S11001001: ,(#(last %&) (println 1) 2 3)

10:36 clojurebot: 1

10:36 3

10:37 AtKaaZ: ,(#(last %&) #(println 1) 2 3)

10:37 clojurebot: 3

10:37 jweiss: i've heard it's better to use "for" rather than map and fn. But what about when you want to have a fn of multiple args and consume multiple lists? seems like map is easier. or is there a simple way also with 'for'?

10:38 AdmiralBumbleBee: who says it's better to use for than map?!

10:38 S11001001: jweiss: "It's better to use map and fn than for; for is terrible." There, now you've heard it both ways

10:38 AdmiralBumbleBee: I've never heard that before

10:38 though I've heard the exact opposite many many times

10:39 jweiss: AdmiralBumbleBee: so there's no general consensus that (for [i mylist] ...) is preferred to (map (fn [x] ...) mylist) ?

10:40 i know map is very straightforward when the function already exists, eg (map inc [1 2 3])

10:40 clgv: jweiss: they are both in clojure.core since they "shine" in different use cases

10:40 jweiss: so what i'm hearing is that map is the way to go when i have multiple lists?

10:40 AdmiralBumbleBee: jweiss: most clojure code I've seen uses map. the 4 clojure books I've read also highly prefer map

10:41 jweiss: AdmiralBumbleBee: map+fn?

10:41 AdmiralBumbleBee: jweiss: yes

10:41 in fact, it often seems that people try to figure out how to use map even when it doesn't make much sense

10:41 (incuding myself :))

10:41 jweiss: interesting, i don't know what "for" is for then :)

10:41 nDuff: *shrug*. There are places where for is the obvious thing.

10:41 AtKaaZ: ,(#(let [a (last %&)] a) #(println 1))

10:41 clojurebot: #<sandbox$eval177$fn__180 sandbox$eval177$fn__180@72f1f2f3>

10:41 jweiss: i suppose if you want to use :while or :when in there

10:41 nDuff: for lets you do :let [] within it.

10:42 AdmiralBumbleBee: for is useful certainly

10:42 AtKaaZ: ,(#(let [a (last %&)] (a)) #(println 1))

10:42 clojurebot: 1

10:42 AdmiralBumbleBee: but preferring `for` over `map` in general I would think is very very silly

10:42 clgv: jweiss: `for` is awesome if you have hierachic data to traverse ad/or constraints when to traverse a child collection

10:42 nDuff: *nod*; nesting is another case where for shines.

10:43 clgv: jweiss: e.g. (for [bs as :when (even? bs) b bs] (do-something-with b))

10:43 jweiss: i would guess for also doesn't add to the zillions of little classfiles i get when i make an uberjar

10:43 hyPiRion: ,(for [a (range 4), b (range 4) :when (not= a b)] [a b]) ; also practical

10:44 clojurebot: ([0 1] [0 2] [0 3] [1 0] [1 2] ...)

10:44 AtKaaZ: ,(fn? #())

10:44 clojurebot: true

10:44 AtKaaZ: ,(fn? 1)

10:44 clojurebot: false

10:44 clgv: jweiss: map shouldnt as well. only an (fn ...) inside it would.

10:45 jweiss: clgv: that is the case i'm referring to - when the function doesn't already exist

10:45 clgv: AtKaaZ: (ifn? #{})

10:45 (ifn? #{})&

10:45 AtKaaZ: thanks i'll try that after

10:45 ,((fn [& all] (let [xall (butlast all) last2 (last all)] (doall (map #(let [a %] (if (fn? a) (a) a)) xall)) (last2))) #(println 1) #(do 2) #(do 3) 4 #(do 5))

10:45 clojurebot: 1

10:45 5

10:45 clgv: jweiss: but thats not map's fault ;)

10:47 AtKaaZ: getting too ugly for a 1 liner

10:47 ,,((fn [& all] (let [xall (butlast all) last2 (last all)] (doall (map #(let [a %] (if (ifn? a) (a) a)) xall)) (let [b last2] (if (ifn? b) (b) b)))) #(println 1) #(do 2) #(do 3) 4 5)

10:47 clojurebot: 1

10:47 5

10:49 AtKaaZ: now without doall? lol

10:49 let's test is do is macro like

10:50 ,(do #(println 1) (println 2) 3)

10:50 clojurebot: 2

10:50 3

10:50 AtKaaZ: ,(do (doall #(println 1)) (println 2) 3)

10:50 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: sandbox$eval133$fn__134>

10:50 AtKaaZ: ,(do (doall (#(println 1))) (println 2) 3)

10:50 clojurebot: 1

10:50 2

10:50 AdmiralBumbleBee: your one-liner is spanning 2 lines on my screen

10:50 clojurebot: 3

10:50 AdmiralBumbleBee: and you also should have your own repl to try things in...

10:50 AtKaaZ: lol

10:51 AdmiralBumbleBee, I have that too

10:51 wingy: hate having to use (declare) because of the compiler is not smart enough

10:51 AtKaaZ: I'm doing most there, so imagine the fails

10:51 AdmiralBumbleBee: then there's no reason to be posting things that fail here I would think

10:52 AtKaaZ: ,,((resolve (symbol "declare")) 'ghost)

10:52 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$declare>

10:52 AtKaaZ: AdmiralBumbleBee, except this time, I didn't know they would fail

10:52 antoineB: hello, i use proxy to implement some method of java object, but how to create new method for those object?

10:53 AdmiralBumbleBee: you would if you used your local repl :|

10:53 AtKaaZ: AdmiralBumbleBee, I'm using it but not 100% of the time, but I get your point, less spam

10:55 lucian: i'm pretty sure the bots support privmsg

10:59 solussd: any monger users have any advice on how to switch to a 'test database' when running tests?

11:01 AtKaaZ: S11001001: ok this is it, emulated do: ##((fn i_do [& all] (let [xall (butlast all) last2 (last all)] (doall (map (fn [one] one) xall)) last2)) #(println 1) #(do 2) (println 3) 4 #(do 5))

11:01 lazybot: ⇒ 3 #<sandbox7657$eval318244$fn__318253 sandbox7657$eval318244$fn__318253@225c31>

11:02 jlewis: is there a way to serialize a bunch of PersistentHashMaps that preserves their structural sharing?

11:02 AtKaaZ: S11001001, wait... lol your version is the one

11:02 S11001001, this one: #(last %&)

11:03 good thing I finally realized it

11:03 thanks and sorry for the spam, I'll be more considerate in the future

11:03 clgv: antoineB: thats only possible if you define an interface or protocol that contains the new methods

11:04 simonadameit: hi

11:04 clgv: antoineB: if you do not want that you have to use :gen-class instead of proxy

11:05 antoineB: ok thanks

11:08 clgv: jlewis: javas serialization should do that but adds additional overhead

11:08 Kototama: I have written a code that reproduce the error http://paste2.org/p/2367082 it's either an error in clojurescript merge or in jayq clj->js any ideas???

11:08 lazybot: Kototama: Oh, absolutely.

11:09 Kototama: hum here: http://paste2.org/p/2367089 the first line was missing

11:21 jlewis: clgv: that makes sense, because it's just a tree of objects... what if i want to serialize a PHM that shares with a pre-serialized set of PHMs?

11:22 i suppose i'd have to deserialize the first set and link them somehow

11:24 clgv: jlewis: you can serialize the first PHM to string and for each derived PHM you only serialize the change operation to string (assoc, dissoc)

11:24 bordatoue: hello if I have a method say (str (.getVersionNo Instance)) , when i set warn on reflection is does say it cannot resolve the field of .getVersionNo, if .getVersionNo returns a int how do i specify this hint

11:24 clgv: jlewis: but you could also just serialize them all to string and compress that string.

11:25 jlewis: yes. what i'd really like to do, though, is something like the following...

11:25 clgv: jlewis: the last suggestion only reduces size. the read PHMs will not share anything

11:25 jlewis: take a PHM called a, and serialize it first

11:25 some time in the future, take some new PHM based off of a called b, and serialize just the differences between a and b

11:25 just like b is stored in memory as just the differences (more or less) from a

11:26 i'm guessing this isn't straightforward

11:28 wingy: i just dragged another guy into clj :)

11:28 from node.js

11:29 bordatoue: is it possible to provide a hint without a binding

11:30 TimMc: bordatoue: WRT reflection hints, I believe so, yes.

11:30 I'm not sure if primitive hints can be on arbitrary forms.

11:30 bordatoue: so if i have (str (.getVersionNo someInstance)) where do i add the hint

11:30 clgv: jlewis: you can use clojure.data/diff to find the differences (clojure 1.4.0+)

11:31 bordatoue: TimMc: say getVersionNo returns an int

11:31 mpenet: you need to hint your instance probably

11:32 bordatoue: (str (.getVersionNo ^Something someInstance))

11:32 clgv: bordatoue: your reflection warning is due to "Instance" being of unknown type

11:32 bordatoue: mpenet: I have done something like this (str (.getVersionNo #^Integer myInstance)) but i still get the reflection warning

11:33 TimMc: FYI, #^ is old syntax.

11:33 clgv: bordatoue: you have to type hin the class that has the property/method "getVersionNo"

11:33 mpenet: bordatoue: you need to hint the type of your instance, not the return type of the method

11:35 bordatoue: TimMc: #^ obsolete

11:35 TimMc: bordatoue: Right, so use ^Foo instead of #^Foo

11:35 not that it will make a difference here

11:36 bordatoue: clgv: it says in the warning message field can not be resolved not instance

11:36 clgv: bordatoue: yeah, the filed can only be resolved if the class of the instance is known

11:36 TimMc: bordatoue: import

11:36 clgv: *field

11:37 bordatoue: say if i define this instance globally using def , then every time i use this instance within a function do i need to provide hint

11:38 wingy: what do you think about this one: https://github.com/schani/clojurec

11:38 does it have a chance to get popular?

11:39 TimMc: bordatoue: CHeck for yourself. You can turn on reflection warnings.

11:39 I believe you can hint it in the def.

11:40 clgv: bordatoue: yes, I noticed that some time ago. thats because the def can be redefined

11:44 bordatoue: but checking by enabling reflection warnings will show you

11:47 wingy: has anyone used light table in project mode?

11:47 i cant get it to display all my project's namespaces

11:48 nDuff: bordatoue: ...well, you can put a hint on the var

11:48 bordatoue: that way you don't need to attach it to the uses.

11:49 bordatoue: thanks nDuff clgv

11:50 is there any good way to debug clojure application

11:50 most of the time i don't even get a line no corresponding to the error

11:50 jaley: I think the SoftCache has? implementation in core.cache may not be thread-safe? I'm getting an NPE from here: https://github.com/clojure/core.cache/blob/core.cache-0.6.2/src/main/clojure/clojure/core/cache.clj#L510

11:51 nDuff: bordatoue: If you haven't redefined the code since it was last AOT-compiled, you certainly should have a line number in the stack trace.

11:53 bordatoue: nDuff: is there any tool to step through the execution of each function

11:53 clgv: nDuff: oh right. you can add the typehint, but e.g. automatic detection from the java function does not work

11:54 nDuff: bordatoue: Maybe? Haven't needed one, haven't looked.

11:54 bordatoue: I try to write my code in small enough pieces that it can be tested and iterated on at the REPL.

11:54 clgv: bordatoue: do you use emacs?

11:55 bordatoue: swank has a `break` macro that starts a repl in the context of it position

11:56 bordatoue: is there any swank equivalent in eclipse also

12:02 mpenet: yes, counterclockwise has that I heard

12:02 hyPiRion: I think CCW and nrepl works fine now.

12:04 clgv: bordatoue: no break macro though. there is a debug-repl macro but that wont work with nrepl

12:08 michaelr525: bordatoue: https://github.com/clojure/tools.trace <-- i found this very usefull in a case where i desperately missed a stepping debugger :)

12:14 actsasgeek: I have a Java object that I created through Clojure interop that holds a reference to a proxy I created. When I serialize then deserialize the object, I get a "StreamCorruptedException invalid type code: 00" error. Is there a reason inherent in Clojure interop that explains why this would happen?

12:16 clgv: actsasgeek: serializing via Java's serialization?

12:17 actsasgeek: clgv: yes

12:17 clgv: actsasgeek: could be a classloader issue if the proxy is not compiled as a class file

12:20 actsasgeek: clgv: so when I'm doing it from the REPL, it can't figure out the class the pickled object is talking about; it should theoretically be fixed by AOT compilation?

12:20 clgv: actsasgeek: if that's the problem, yes

12:21 actsasgeek: clgv: thanks.

12:22 clgv: actsasgeek: but you might run in other problems regarding serialization id or such

12:24 actsasgeek: clgv: good point.

12:28 Cheiron: Hi, I want to use TTLCache that needs to be wrapped with a ref type . is it allowed?

12:28 http://clojure.github.com/core.cache/#clojure.core.cache/TTLCache

12:29 clgv: Cheiron: depending on it's implementation retries might ruin the cache behavior

12:30 Cheiron: I need a map that is guarded by ref, it is will be used by multiple resources

12:30 and and I need the behavior of TTL to perform a self house cleaning

12:31 clgv: Cheiron: you could use locking (pessimistic) on the cache isntead of transactions (optimistic)

12:31 Cheiron: that is my case : data structure will be used and updated by multiple resources and a TTL policy to prevent "zombie" data

12:32 what do you mean by that?

12:35 clgv: Cheiron: I am not sure if core.cache is a pure immutable implementation.

12:35 Cheiron: check that and you know whether you can use it in refs without a problem

12:35 Cheiron: it implements : Interfaces: clojure.lang.Associative, clojure.lang.Counted, clojure.lang.ILookup, clojure.lang.IPersistentCollection, clojure.lang.IPersistentMap, clojure.lang.Seqable

12:36 those wont guarantee the "immutability" ?

12:38 AntelopeSalad: question: the source for the fn 'last' says it calculates it in linear time

12:39 is that going to be worse than running count?

12:40 nDuff: AntelopeSalad: Depends on the implementation of Counted provided.

12:40 AntelopeSalad: ...worst-case, count is linear time, but it sometimes can be better.

12:41 AntelopeSalad: are implementation of length in other languages in linear time too?

12:41 *implementations

12:41 nDuff: AntelopeSalad: Completely depends on the data structure.

12:41 AntelopeSalad: let's assume vectors for now

12:41 nDuff: AntelopeSalad: ...Clojure is very explicit about its data structures' efficiency boundaries, to allow choosing the right one for the job

12:44 Derpherp: Hi I have a noobie question regarding gen-class

12:45 I would like to have a class created with gen-class then in the same file have a method that creates an instance of the class then call some methods on it

12:45 however I am getting class not found, which is likely due to AOT compilation?

12:45 (or lack there of)

12:46 nDuff: Derpherp: Getting class-not-found at what time? You need to do AOT to get a gen-class class to be created, yes.

12:46 Derpherp: ...if you can use one of the alternatives to gen-class, you may not need that.

12:46 AntelopeSalad: In the case of vectors, count is constant-time.

12:47 technomancy: yeah, gen-class is annoying. why do you need it?

12:47 Derpherp: I would not like to use an alternative because those classes would be one off (correct?)

12:47 (correct ? )*

12:47 nDuff: Derpherp: Do you mean compiled every time they're used? If so, no, they're not.

12:47 Derpherp: and that would possibly be bad/inefficent for a clojure web service

12:47 nDuff: Derpherp: ...indeed, the alternatives are generally faster/more efficient at runtime.

12:48 Derpherp: again want to note that i am new ;)

12:48 technomancy: gen-class is an advanced topic

12:48 AntelopeSalad: nDuff: ok thanks

12:48 technomancy: there are a few legitimate cases where it's needed, but it's a bad place to start if you're new

12:48 Derpherp: ok i will try proxy then?

12:48 nDuff: Derpherp: gen-class is slowest but works for the most situations, then proxy, and reify is fastest (but most restrictive).

12:48 AntelopeSalad: so in a vector's sake, using last would be a lot worse than count right?

12:49 nDuff: Derpherp: ...so -- always use reify if you can, proxy if you can't reify, gen-class if you can't proxy.

12:49 Derpherp: ok thanks

12:49 nDuff: AntelopeSalad: Actually -- getting the last element isn't linear for a vector.

12:49 AntelopeSalad: ...that'd be quite fast.

12:50 Cheiron: Hi, all. would you please have a look at http://stackoverflow.com/questions/13015906/is-it-safe-to-use-a-clojure-core-cache-guarded-by-ref-type feel free to answer here or on SE

12:50 nDuff: AntelopeSalad: Perhaps you're thinking of a list?

12:50 AntelopeSalad: i wasn't thinking of any data structure in specific, i just happened to see the docstring for count

12:51 nDuff: AntelopeSalad: ...well, that's the thing -- the specific data structure matters.

12:51 AntelopeSalad: i threw out vector because getting nth index is usually popular

12:51 nDuff: AntelopeSalad: ...the docstrings give you the guarantee that performance won't be worse than ${given_thing}

12:51 Derpherp: Can i do a reify if i want to extend a java class?

12:52 nDuff: Derpherp: No; you need proxy for that; reify will extend Java interfaces, but not classes.

12:52 Derpherp: ok thanks

12:53 AntelopeSalad: i don't really know clojure too well and am not an algorithm wizard either

12:53 but their implementation seemed really crazy to me

12:54 (for last)

12:56 joegallo: AntelopeSalad: is there a better way to walk through a linked list until you reach the last item?

12:57 lnostdal: hi guys .. get returns the value of a mapentry in a map based on the key .. is there a getter that returns the mapentry itself? the association?

12:58 AntelopeSalad: joegallo: i have no idea, but it didn't occur to me that other languages might be doing it the same way (i figured they wouldn't)

13:01 joegallo: i guess it stemmed from trying to understand things i'm just learning now but don't fully understand

13:02 for example, why can't it do a bisection search instead instead of going through every element?

13:02 nDuff: AntelopeSalad: Pardon? Which "it"? In what context?

13:03 AntelopeSalad: it = the last function in clojure

13:03 nDuff: AntelopeSalad: You can't seek efficiently within a linked list, period -- the structure doesn't allow it

13:04 AntelopeSalad: ...so how would you do that search?

13:04 AntelopeSalad: the code for last to me looked like maybe it was calling next on itself until next no longer existed

13:04 nDuff: AntelopeSalad: ...and again, last is implemented efficiently on structures that do allow it.

13:04 AntelopeSalad: Yes, and for linked lists, that's the only way it _can_ be done.

13:04 AntelopeSalad: bisection could be implemented by doing nth x right?

13:04 nDuff: AntelopeSalad: How do you think nth is implemented on a linked list?

13:04 AntelopeSalad: Hint: It's horribly, horribly inefficient.

13:05 Wild_Cat: again, bisection can't be done efficiently in a linked list

13:05 AntelopeSalad: good to know, thanks

13:05 Derpherp: Ok so I am stil trying to wrap my head around proxies. From what i gather they can dynamically create classes that can extend other classes. However, is it possible to: name the proxy class AND extend another class, and allow for multiple instances of the proxy to be created and methods called on it?

13:05 Wild_Cat: it is, in fact, worse than linear search.

13:05 jcromartie: proxy creates an *object* not a class

13:06 AntelopeSalad: Wild_Cat: only in the case of linked lists tho, no?

13:06 Derpherp: All i want is a class and a main static method to be in a file. Where the main creates an instance of the class and calls a public method

13:06 jcormartie: ya i got that feeling....

13:06 jcromartie: you want deftype and reify if you want to implement multiple instances of a Java class defined in Clojure

13:06 Derpherp: unlike gen-class

13:06 technomancy: Derpherp: what is it you're actually trying to do?

13:06 Wild_Cat: AntelopeSalad: yup. In array lists/vectors, bisection is fast because they allow O(1) element access.

13:07 technomancy: unless this is a homework assignment "a class and a main static method in a file" is not a goal in and of itself =)

13:07 nDuff: (...well, amortized O(1) if we're being pedantic)

13:07 Derpherp: tchnomancy: as above, have a class defined in a file, have a main static method which creates an instance of the class and calls a public method

13:07 AntelopeSalad: that's what i was thinking too Wild_Cat

13:07 i used vector as my example

13:07 technomancy: Derpherp: that's not what I asked

13:07 Wild_Cat: nDuff: why amortized? I'm talking about read access

13:07 AntelopeSalad: isn't a vector an array?

13:07 technomancy: presumably you have an actual problem that you're trying to write code to solve?

13:08 nDuff: Wild_Cat: Clojure's vectors require up to 7 lookups depending on their size, IIRC.

13:08 joegallo: AntelopeSalad: nope.

13:08 Derpherp: technomacy: apoligies, i am basically trying to use a java library in clojure

13:08 Wild_Cat: nDuff: oh? I thought they mapped directly to arrays.

13:08 nDuff: Wild_Cat: Definitely not.

13:08 Wild_Cat: (what with not being resizable and all)

13:08 interesting.

13:08 nDuff: Wild_Cat: ...keep in mind that arrays don't support structural sharing.

13:09 jcromartie: Derpherp: can you point to the library or API docs?

13:09 nDuff: Wild_Cat: ...and that vectors _do_ support conj

13:09 Derpherp: which requires that i extend a class to create a new one, and have a static method that can create an instance of the class and get it to do its stuff

13:09 Wild_Cat: nDuff: hrmm. Good point. I still have a lot to learn about Clojure's internals.

13:09 AntelopeSalad: then half my conversation needs to be re-evaluated then

13:09 Derpherp: I want to do this in clojure: http://dynamicjasper.com/docs/current/xref-test/ar/com/fdvs/dj/test/FastReportTest.html

13:09 AntelopeSalad: i thought vectors were arrays heh :/

13:09 they seem to work like them going by the little i read on them

13:10 joegallo: correct, they work a lot like them

13:10 and vectors are implemented in terms of arrays (and arrays of arrays), if i recall correctly

13:10 nDuff: AntelopeSalad: ...very, very large vectors are actually faster than arrays, for obscure reasons involving cache lines in modern processors. :)

13:10 Derpherp: (FastReportTest) http://dynamicjasper.com/documentation-examples/getting-started/

13:11 AntelopeSalad: i guess all this stems down to count vs last

13:11 jcromartie: Derpherp: so you just want to make a runnable class with a "main"

13:11 AntelopeSalad: is there any case when i shouldn't use last?

13:11 Derpherp: yes

13:11 AntelopeSalad: (assume in general with any data structure)

13:11 nDuff: AntelopeSalad: Use the one that fits the goal you're trying to achieve.

13:11 jcromartie: Derpherp: then gen-class is for you

13:11 Derpherp: but most examples lack an instantiation or self refercing (this.)

13:12 jcromartie i thought so initally but was advised against it

13:12 jcromartie: Derpherp: why is the instance or self-reference necessary?

13:12 AntelopeSalad: would last be the more commonly used way in clojure land?

13:12 jcromartie: you want to make a Clojure program not a Java program

13:12 nDuff: Derpherp: ...well, you're claiming that you have some fairly unusual requirements here.

13:12 Derpherp: You haven't shown any of us the Java API you're working from, so we can't really evaluate that.

13:12 Derpherp: however, if you try to directly convert that code ("new FastReportTest()") has an issue

13:12 nDuff: Oh, wait, you have.

13:12 *looks*

13:12 Derpherp: because the class is not recognized because it need AOT

13:13 :)

13:13 jcromartie: Derpherp: does something actually require you to instantiate a custom class here?

13:13 technomancy: Derpherp: ok, it sounds like you need :aot [whatever.ns] in project.clj then

13:13 jcromartie: Derpherp: like, you specify the class, and it instantiates it?

13:13 nDuff: Derpherp: You could still use proxy if you were providing a factory for generating instances.

13:13 Derpherp: If you need to provide a class name, not a factory, then yes, you need gen-class.

13:14 jcromartie: Derpherp: like, there is some interface that will call a certain static method on your class, and your method will return an instance of that class?

13:14 Derpherp: and unless you can do *exactly that*, then you can't do what you want to do?

13:14 or do you just want to write a class with a "main" in Clojure

13:15 because the example you linked is "public static void main(String[] args)" which means it really does not matter what you do inside of it

13:18 Derpherp: *takes a deep breath* i just want the code I posted to work in clojure... soo I know im probably not going about it the best way just following tutorials and my BASIC knowledge of clojure. Would you advise going the proxy or gen-class route? And if i go with gen-class how would i do the AOT? I tried using the :aot flag but i do not think i am doing it right. Also if i go the proxy route then how do i call methods that were defined in the proxy?

13:19 Also if i go the gen-class route then CAN I have a similar style as in the java class that has a main create an instance of the class?

13:19 or do i have to have the main in a separate file / name space

13:19 if so (which i have tried) there is a few other issues i ran into

13:20 technomancy: Derpherp: it sounds like the API you're trying to call might force you down the gen-class route. you can do it all in the same file though.

13:20 jcromartie: OK sorry all the gen-class and proxy stuff can be overwhelming :)

13:20 nDuff: Derpherp: If you can, go the proxy route. I don't know that you've answered the questions that need to be answered before we can tell whether "if you can" is true.

13:20 ynniv: lein is using clojure 1.3, even with :dependencies [[org.clojure/clojure "1.4.0"]]. am I insane?

13:20 technomancy: ynniv: one of your dependencies is insane

13:20 http://nelsonmorris.net/2012/07/31/do-not-use-version-ranges-in-project-clj.html

13:20 jcromartie: Derpherp: I did a basic example here v

13:20 https://www.refheap.com/paste/6028

13:21 technomancy: ynniv: see also: https://github.com/xeqi/lein-pedantic

13:22 ynniv: technomancy: wow, that is most excellent. The community is definitely the best part of clojure.

13:23 technomancy: ynniv: np. once you figure out which dependency is pulling in the wrong version you should see if you can open a bug report on it if it's still a problem in the latest version.

13:23 mpenet: ibdknox: ping

13:24 Derpherp: thanks jcromartie, i am trying to use it now (going through import and class not found errors atm)

13:24 brb

13:24 jcromartie: Derpherp: so are you trying to write a DynamicJasper test in Clojure?

13:24 Derpherp: yes

13:25 jcromartie: why do you have a gen-class and proxy use in the file?

13:27 tvachon: hey folks - is there any way to specify pre/post conditions on

13:27 methods implemented in a defrecord?

13:27 it seems to work in extend-* calls, but the hash is ignored in defrecord

13:27 dnolen: tvachon: not really

13:28 tvachon: k, thanks

13:28 dnolen: tvachon: though if you follow the CLJS pattern you could avoid calling protocol implementations directly and go through a fn instead.

13:28 tvachon: in CLJS you have -first, but everyone actually uses first

13:29 ynniv: defrecord still seems half baked

13:29 tvachon: I have different prereqs for different types tho, so I'd need to

13:29 have a function per type right?

13:30 Derpherp: jcromartie: ya i cant seem to get around BaseDjReportTest :/

13:31 jcromartie: like, you can't import it?

13:31 Derpherp: i have everything imported as stated on http://dynamicjasper.com/docs/current/xref-test/ar /com/fdvs/dj/test/FastReportTest.html

13:32 technomancy: Derpherp: if you're trying to learn clojure it might be more productive to find a project that doesn't involve crazy java APIs =)

13:32 I mean if that is an option.

13:32 dnolen: ynniv: not IME

13:33 technomancy: ynniv: people use it way more than they should

13:33 Derpherp: tachnomany haha ya

13:33 dnolen: tvachon: it seems a bit strange to me to have different pre/post for the same protocol regardless of the types involved - but hard to say w/o knowing more about what you're trying to do.

13:33 Derpherp: This is my current code https://www.refheap.com/paste/6029

13:33 ynniv: dnolen: perhaps I should qualify that by saying "for general use"

13:33 dnolen: ynniv: general use for what?

13:34 Derpherp: ya there are a few obvious issues in there (like Date)

13:34 ynniv: storing data and polymorphic functions

13:35 Derpherp: my (current) issue is with line 47

13:36 technomancy: ynniv: people with OO backgrounds jump to polymorphism way sooner than necessary

13:36 dnolen: ynniv: having used deftype / defrecord extensively they seem pretty well suited for exactly that.

13:37 ynniv: defrecord comes with unexpected tradeoffs. the records are java classes and require a specific kind of import. constructors are strictly positional. fields can only be specified as forms and not a value

13:38 you can't extend records, only protocols

13:38 dnolen: ynniv: so make your own ctor fn if the ones that doesn't come defrecord don't suit. using :import on deftype/record is an anti-pattern.

13:39 jcromartie: Derpherp: I think there's a simple solution waiting here

13:39 antares_: ynniv: Clojure compiler generates MyRecord->map and map->MyRecord conversion functions, you can use that instead of constructors

13:39 ynniv: i agree that polymorphism is overused, but when it's presented as part of the lang it seems like a good idea at first

13:40 yes, defrecord creates some functions, and it's good to make more. at some point it isn't clear why one would bother with defrecord

13:40 Derpherp: ok here is a simplification: https://www.refheap.com/paste/6030

13:40 ynniv: I've switched to validation functions, named field accessors, and plain old maps

13:40 Derpherp: what is the issue with line 12? How should i do AOT?

13:41 dnolen: ynniv: sounds like you didn't need defrecord then.

13:41 ynniv: dnolen: i agree, but that wasn't obvious when I started

13:41 jcromartie: Derpherp: well first the preferred way to do member access is (.foo bar) rather than (. bar foo)

13:41 ynniv: and when I describe what I need (weakly typed data records), it sounds like defrecord is what I want

13:42 Derpherp: jcromartie ok, just going from tutorials

13:42 dnolen: ynniv: yes it's hard to know when you need it, technomancy's advice is precisely what people say here all the itme.

13:42 jcromartie: Derpherp: what is going to be calling your code? that's the important part of interop

13:42 Derpherp: and in a local scope, you want let, not def

13:42 def defines top-level bindings

13:42 i.e. it creates a var in the namespace

13:42 Derpherp: i thought it might, just was using them temporarily (but thanks!)

13:43 jcromartie: so the AOT stuff

13:43 Derpherp: jcromartie another method within the file will be calling my code

13:43 its a kinda gross 1 file .clj file

13:44 jcromartie: Derpherp: if the ONLY thing instantiating your class is the "main" method, which is void, then it's not necessary to create a class to instantiate at all!

13:44 ynniv: dnolen: when do you reach for defrecord?

13:44 dnolen: ynniv: performance

13:44 technomancy: ynniv: where do you feel like defrecord is being presented as something you should use in lieu of maps?

13:44 ynniv: that's what I figured. it might be useful to mention that in defrecord's docstring

13:44 dnolen: ynniv: or some serious DSL / infrastructure like clojure.core or core.logic

13:45 ynniv: dnolen: what about defrecord helps with that?

13:45 jcromartie: Derpherp: it looks like this comes down to creating a JUnit test case in Clojure

13:45 Derpherp: jcromartie eventually i will have multiple methods using an instantion of a the class OR just have a static method within the class that will create the report BUT because of the way reports are created i need to create an instance

13:45 dnolen: ynniv: performance, high performance extensibility

13:46 Derpherp: jcromartie: JUinit test cas in Clojure?

13:46 dnolen: ynniv: you wouldn't want first to implemented over types via multimethods

13:46 Derpherp: case*

13:47 jcromartie: Derpherp: you're trying to replicate a subclass of BaseDjReportTest, which is a JUnit TestCase

13:47 so this makes more sense now

13:47 Derpherp: ah ok

13:47 jcromartie: as someone else said: it's probably better to learn Clojure with something that doesn't involve existing Java APIs :)

13:47 Sgeo: I wonder what people who hate typical OO systems think about Tcl Snit

13:47 It's OO but not inheritance-based

13:47 More delegation-based

13:47 Derpherp: but to try to work from one issue to the next... how do i go about creating an instance of a class that is defined in the same file! :P

13:48 jcromartie: Derpherp I don't think you really have to

13:48 ynniv: technomancy: defrecord is featured in Joy of Clojure, but also anyone who has used CLOS will likely end up with defrecord

13:49 Derpherp: so i should avoid creating classes in clojure and using them in the same file?

13:49 technomancy: Derpherp: files don't really matter when it comes to gen-class

13:49 Derpherp: (i apogize for my java mindset :P)

13:50 jcromartie: Derpherp: the whole point of gen-class interop is to provide a class to be consumed from Java

13:50 Derpherp: apologize*

13:50 jcromartie: Derpherp: and in this case you want to do that

13:50 Derpherp: ok

13:50 jcromartie: Derpherp: but you don't need to go any further than just implementing a certain method

13:50 the "main" is actually irrelevant

13:51 Derpherp: ok, i thought so at one point but then i was having issues refercing something similar to a "this" (like in java)

13:51 if i were not to have a main then how would i do the same task at hand

13:52 jcromartie: the key is buildReport

13:52 Derpherp: hmm i have an idea brb

13:52 jcromartie: so you would just use gen-class and (defn -buildReport [] …)

13:53 the "main" in this class just looks like it's for quickly running the test, I don't know though http://dynamicjasper.com/docs/current/xref-test/ar/com/fdvs/dj/test/FastReportTest.html

13:53 dnolen: ynniv: isn't CLOS considered a bit of overkill for many things as well?

13:56 ynniv: dnolen: it is, but you can use as much or little as you like. I was looking for some features (field accessors for sanity checking, some manner of validation, and some form of method dispatch), which lead me to defrecord. I eventually implemented these things as functions operating on maps instead.

13:57 defrecord looks like a slightly more structured map, but in reality seems to be a specific kind of performance optimization that leaks some of the runtime through and incidentally provides some structure

13:58 dnolen: ynniv: I think some pretty nice sugar could be built on top of deftype/record ... my hunch is that Clojure is expressive enough that few people bother. Those that do bother prefer flexibility to do things how you like.

13:58 technomancy: ynniv: sounds about right

13:59 dnolen: ynniv: yes and no, there's enough there to some Self style "Programming Without Classes" style programming.

13:59 ynniv: if your protocols are small (which they should be), delegation is pretty easy.

14:00 ynniv: defrecord doesn't appear to be more useful than defmulti

14:01 except for performance

14:01 technomancy: that's not really the right comparison; it's defprotocol that's less useful than defmulti (modulo performance)

14:01 dnolen: ynniv: both are useful in completely different ways - it's not unusual to combine both.

14:02 borkdude: I just got an e-mail about this job, might any of you be interested: https://doo.net/en/jobs.html#clojure (click on clojure on the left)

14:04 jcromartie: damn, gen-class and compile are pretty cool… you can genuinely redefine a compiled class on the fly

14:04 like, redefine the methods of an instance

14:05 ynniv: dnolen: I think, tho, that one should only use defrecord when performance is a problem

14:05 S11001001: jcromartie: sure, but you're better off using proxy's secret features for that

14:05 borkdude: gotta go again, bye

14:05 technomancy: jcromartie: not really, you just redefine stub vars

14:06 jcromartie: I understand, technomancy

14:06 bendlas`: dnolen: are you there?

14:07 jcromartie: but the effect is that you can instantiate a "real" Java object and, for all intents and poirposes, swap out its method implementations while it's still alive

14:07 I understand it's not so direct under the hood

14:07 technomancy: I guess if you're coming from Java that sounds novel =)

14:08 jcromartie: it does, in that context

14:08 but I've used Smalltalk and Ruby etc.

14:08 so it's not surprising in that regard

14:08 just surprising that it lets me do this with stodgy old Java objects

14:08 looks like I can't add a method, though

14:08 technomancy: it's a clever sleight-of-hand

14:08 ynniv: the JVM is actually quite permissive. most of the restrictions in Java come from the compiler.

14:09 jcromartie: ynniv: yeah, like "how do I use generics in Clojure" has a rather surprising answer to most people :)

14:10 * emezeske gets slightly ill at the thought of type erasure.

14:11 ynniv: yes. and method / field visibility

14:11 dnolen: ynniv: more or less. but I'm glad Clojure / ClojureScript isn't written on top of multimethods.

14:11 bendlas`: hey

14:11 ynniv: dnolen: for performance reasons?

14:12 TimMc: technomancy: I hope Java's security mechanisms don't assume that methods on an object can't change over time...

14:12 dnolen: ynniv: yes

14:13 ynniv: dnolen: I suppose, but perf is always a tradeoff. If I just wanted perf, clojure will never beat sbcl.

14:13 technomancy: ynniv: the original motivation for protocols was for Clojure to be able to achieve self-hosting. people seem to have forgotten that.

14:13 dnolen: ynniv: but also complexity reasons, protocols are simple. multimethods can easily involve :prefer-method and hierarchies which brings it's costs

14:14 ynniv: hmm, both interesting points

14:15 xeqi: technomancy: link? I must be missing what protocols provide over multimethods

14:16 ynniv: my philosophy is: first correct, then fast. so I will forego defrecord until performance is an issue

14:16 technomancy: xeqi: don't have anything off the top of my head. but yeah, it's purely a speed thing.

14:17 ynniv: time to go. thanks for the lein-pedantic link technomancy

14:24 lynaghk: technomancy: re: intro data vis, do you have a particular angle? Stephen Few's "Show me the numbers" is a very solid intro, though it can be a bit dry at times.

14:24 Cheiron: Hi, calling (cache/has? c3 :a) ==> false but printing c3 shows {:a 1} , why?

14:25 (def c3 (cache/ttl-cache-factory {:a 1} :ttl 20000))

14:25 technomancy: lynaghk: nothing really in mind other than a solid intro. I'll check it out; thanks

14:25 lynaghk: technomancy: Anything by Tufte (what I like to call "The Gospel according to Tufte") is fun to read and look at but doesn't have a ton of emperical research behind it or nitty-gritty technical details.

14:26 technomancy: hm; yeah, what I've seen is pretty accessible but I'm not in a position to evaluate it from a technical perspective

14:26 lynaghk: technomancy: this is a very good keynote on human perception w.r.t. data visualization: http://vimeo.com/26205288 I.e., when you should use color, shape, length, &c. to encode quantitative values.

14:27 technomancy: cool; thanks

14:29 lynaghk: technomancy: no problem, let me know if you have any more specific/technical questions.

14:30 technomancy: lynaghk: this project looks like what I wished incanter had when I did the lein survey

14:30 lynaghk: technomancy: c2po?

14:30 technomancy: yeah

14:31 I would link you, except apparently AWS is currently on fire

14:32 lynaghk: technomancy: yeah, I'm pretty stoked about it. I'm not looking to do much in the way of stats (depending on the survey results from folks signing up for the mailing list). As I mentioned to you earlier, I think most people are going to get a ton of value from just visualizing their data in reasonable ways without any advanced stats

14:32 technomancy: link me?

14:32 TimMc: technomancy: That would explain reddit being down.

14:32 cscheid: Hi folks, I'm a complete clojure idiot. I probably did something dumb when installing clojure and leiningen via homebrew, but i ran across this interesting bit: (clojure-version) returns "1.3.0" in a $ lein repl, but "1.4.0" in a $ clj -r. Is this expected?

14:32 technomancy: lynaghk: when the AWS outage is over you can try http://lein-survey.herokuapp.com

14:33 cscheid: yeah, never use clj from the command line

14:33 it's just some bogus script that the homebrew packagers added because they didn't realize that clojure is a library rather than an end-user application.

14:33 lynaghk: technomancy: ah, got it. Yeah, I'll keep that use case in mind. I'm trying to collect a variety of use cases now so we can make sure the system handles a good swath.

14:34 technomancy: https://github.com/technomancy/lein-survey if you want to see the horrible horrible code

14:34 cscheid: I'm guessing I'm ok with 1.3.0, then? clojure.org seems to say it's outdated.

14:35 technomancy: cscheid: whatever you define in project.clj will be used. for experimentation outside the context of a project it really doesn't matter.

14:35 hyPiRion: cscheid: If you setup a new clojure project and change the version in project.clj, you'll be fine.

14:35 technomancy: cscheid: but it does indicate you're not on the latest leiningen. I don't know much about homebrew beyong a vague suspicion of it, but lein is pretty easy to download manually

14:35 oskarth: Having problems testing a macro and understanding why I get different outputs in the repl vs in the test. https://www.refheap.com/paste/6032 How do I get the actual test to return the same thing as in the repl?

14:36 cscheid: ah, I see it. lein init created it, so I hadn't actually looked at that file

14:36 rather, lein new

14:39 sweet, switching to leiningen 2.0.0 did it. Thanks.

14:41 lynaghk: incidentally, good seeing you here. We chatted at visweek a few days ago.

14:46 ToBeReplaced: anyone know a good way to wrap enlive templates with doctype?

14:49 ebaxt: ToBeReplaced: You need to use all caps DOCTYPE because of TagSoup

14:49 https://github.com/cgrand/enlive/issues/15

14:52 ToBeReplaced: ebaxt: thanks; i'm looking for a way to hack or wrap deftemplate to tack it on automatically

14:54 emit* is buggy if you do multiple things before <html>... likely true whenever you aren't at-most-one-node then a valid xml structure

14:57 xeqi: oskarth: If I'm reading that right its checking ##(type (:name (meta #'+))) vs ##(type +)

14:57 lazybot: (type (:name (meta (var +)))) ⇒ clojure.lang.Symbol

14:57 (type +) ⇒ clojure.core$_PLUS_

14:58 xeqi: as an equivalent example

14:58 I think you want to use 'nand*

14:59 oskarth: xeqi: you are absolutely right, I was going about it backwards. Thanks!

14:59 silly - saw the output and assumed there was something up with ns

15:01 frawr: How Can I get the compilation exception Unable to resolve symbol realized? when realized is in clojure.core?

15:02 jcromartie: ,clojure.core/realized

15:02 clojurebot: #<CompilerException java.lang.RuntimeException: No such var: clojure.core/realized, compiling:(NO_SOURCE_PATH:0)>

15:02 jcromartie: ,clojure.core/realized?

15:02 clojurebot: #<core$realized_QMARK_ clojure.core$realized_QMARK_@c1ba52c>

15:02 jcromartie: frawr: I hope that answers your question :)

15:03 S11001001: frawr: C-M-i in emacs is your friend

15:04 frawr: in nrepl?

15:04 S11001001: uh, maybe; it worked in slime

15:04 Cheiron: Hi, from http://clojure.github.com/core.cache/index.html hit function Is meant to be called if the cache is determined to contain a value associated with e . what does this mean?

15:04 frawr: it's realized?, with the questionmark included

15:05 jcromartie: frawr: that's the one

15:06 frawr: hmm, same here though..., when i ask the repl.

15:07 That's odd, it should be in core according to the api on the website.

15:09 S11001001: frawr: is there a way you can build a reduced code sample that would allow others to observe the problem you are having?

15:10 jcromartie: http://clojuredocs.org/search?x=0&y=0&q=realized

15:11 http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/realized?

15:11 clojurebot: http://clojure.org is help

15:11 jcromartie: there's no "realized" in clojure.core

15:14 frawr: it's on github somewhere, 1 sec

15:15 https://github.com/fmsbeekmans/http.async.client/blob/development/src/clj/http/async/client/request.clj

15:15 When I a project that uses this project as a dependency, compiling tells me clojure.lang.Compiler$CompilerException: java.lang.Exception: Unable to resolve symbol: realized? in this context (request.clj:71)clojure.lang.Compiler$CompilerException: java.lang.Exception: Unable to resolve symbol: realized? in this context (request.clj:71)

15:16 TimMc: frawr: You're probably pulling in an old version of Clojure somewhere.

15:16 jcromartie: frawr: OK so it is "realized?" in the code

15:16 frawr: Yeah, when did i say it without?

15:17 jcromartie: hah I thought that was the whole thing

15:17 TimMc: frawr: In your initial message, but only in one place.

15:17 jcromartie: the supposed error message :)

15:17 frawr: Aah, my bad.

15:17 TimMc: frawr: Run this and check for the right Clojure version: lein classpath

15:18 frawr: it gives me a huge list, let me check

15:18 TimMc: ,(-> realized? var meta :added)

15:18 clojurebot: "1.3"

15:19 TimMc: You might also have `lein deps :tree` available to you if you are using the right version of lein.

15:19 frawr: nice feature!

15:21 lein deps :tree doesn't list clojure itself though

15:21 TimMc: That's surprising.

15:21 lynaghk: Is there a clever way I can have any symbols that start with ? not evaluate. Or, alternatively, force evaluation of a form within a quoted form? (Like syntax quote but without prefixing all symbols with full namespaces.)

15:22 TimMc: lynaghk: Macros!

15:22 You can strip namespaces off selectively.

15:23 lynaghk: TimMc: you're thinking something like clojure.walk within a macro?

15:23 TimMc: Yeah.

15:23 ChongLi: you can even convert symbols to strings and do all sorts of regex-fu on them

15:23 though that doesn't sound too robust

15:23 lynaghk: TimMc: yeah, I was hoping I could avoid that but it's probably the only decent way. The issue with clojure.walk is that it loses record types ocassionally.

15:24 mpenet: lynaghk: prewalk-replace makes this easy

15:24 oh records :(

15:24 lynaghk: TimMc: I've already alter-var-root'd clojure.core/empty? to handle records, so maybe I'll be alright.

15:25 frawr: I seem to only have clojure 1.3 on my classpath though i have 1.4 as a dependency

15:26 amalloy: frawr: probably someone is using version ranges

15:27 lynaghk: what does "not evaluate" mean?

15:27 lynaghk: amalloy: I need to replace ?x with '?x

15:27 frawr: amalloy: What's the best way to research if that is the case?

15:28 lynaghk: I think the walk solution will be fine; I just wanted to check if there was a clever thing in tools.macros or something.

15:28 amalloy: frawr: if you're using lein2, you can lein deps :tree

15:28 lynaghk: i'd use flatten and symbol-macrolet

15:28 frawr: amalloy: I did, but none of my dependencies list clojure itself

15:28 amalloy: flatten the input and search for symbols starting with ?, and then symbol-macrolet each of them

15:29 then you don't have to rebuild the input form

15:29 lynaghk: I checked symbol-macrolet, it will lose record types.

15:29 amalloy: wat. you have record types as your source forms?

15:30 lynaghk: The form includes records, yes

15:30 dnolen: lynaghk: is this related to issue that core.logic uses walk?

15:31 lynaghk: dnolen: no, but that's the same problem. I am getting around that by alter-var-rooting clojure.core/empty to return "empty" records.

15:31 llasram: amalloy: Isn't this exactly what clojure.walk/postwalk is for? Or are there unpleasant downsides to it?

15:32 lynaghk: dnolen: doing these logic matches and rewrites is making me thinking about the different kinds of nothingness quite a bit lately =P

15:32 dnolen: lynaghk: heh about alter-var-rooting empty :)

15:32 amalloy: llasram: imo postwalk is a lot better suited to manipulating "data" than "code", insofar as those are actually different

15:33 wingy: I dont quite get how I can programmatically make sense of {"Accept-Language" en-US,en;q=0.8"}

15:33 dnolen: lynaghk: I still up for providing an uninitialized record protocol

15:33 so that people can make it work without resorting to such things.

15:33 lynaghk: dnolen: you mean having a special case that doesn't drop to clojure.walk?

15:34 dnolen: when, e.g., prepping the lvars in an expression?

15:34 wingy: in my app I just have en-US, sv-SE etc .. how can I be sure to get the language/country code combo from the {"Accept-Language" en-US,en;q=0.8"}

15:34 dnolen: lynaghk: yes

15:34 amalloy: eh? you can still use clojure.walk, just not post/prewalk

15:34 oh no, i take it back. the coll? version uses empty

15:35 antares_: wingy: by parsing it to "the best preferred language". There are Ruby and Java parsers for content/language negotiation strings out there, it is not that complex.

15:35 lynaghk: dnolen: yeah, I need to give some more thought to what exactly I need for the stuff I'm doing. We can discuss at strata. I'm getting into NYC Wednesday at 7 a.m.

15:35 dnolen: lynaghk: it's easy enough to check for records

15:35 lynaghk: k

15:35 wingy: antares_: could you give me a link to a good Java parser for content negotiation?

15:37 antares_: wingy: http://stackoverflow.com/questions/6824157/parse-accept-language-header-in-java, although with Jetty you may need a different solution

15:37 frawr: Managed to get realized? recognized. thank you.

15:38 antares_: wingy: http://jetty.codehaus.org/jetty/jetty-6/apidocs/org/mortbay/jetty/Request.html suggests there is getLocale, I think you may be able to combine that with Tower

15:39 wingy: antares_: im new to Jetty .. what is Tower?

15:39 antares_: wingy: how to access raw Jetty request from Compojure or Noir, I am not sure

15:39 wingy: okay

15:39 thx

15:39 antares_: https://github.com/ptaoussanis/tower

15:40 wingy: all you need is access the original Jetty request object and use .getLocale or .getLocales

15:42 julson: ,

15:42 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>

15:42 TimMc: frawr: Which dep was the culprit?

15:47 wingy: antares_: Tower looks nice

15:48 antares_: atm im creating my own lang middle ware .. perhaps just better to use tower

15:48 xeqi: frawr: https://github.com/xeqi/lein-pedantic can help figure it out in the future as well; sometimes lein deps :tree doesn't provide enogh info

15:48 wingy: antares_: if im using Tower I don't have to parse the Accept-Language myself?

15:49 it says that the ring middleware does that

15:50 TimMc: Hmm, one consequence of cloud services is that when a big one goes down, a *ton of websites are affected all at the same time.

15:50 When one company's non-cloud servers go down, it's just them.

15:51 wingy: TimMc: are you talking about Heroku? :)

15:51 TimMc: And Reddit.

15:51 and anyone else in that availability zone.

15:54 antares_: wingy: I am not very familiar with Tower but it should be able to also work with Locale instances. Which is what request.getLocale should return you. Jetty then will do all the hard parsing work.

15:55 wingy: "The request's Accept-Language HTTP header."

15:55 its also allowing language choice based on (get-in request [:session :locale])

15:56 great fit .. lets use it!

15:56 i dont get why certain libs have so few users thoug

15:56 h

16:03 antares_: wingy: because their authors do 0 marketing

16:04 wingy: in node.js we got a TJ

16:04 when he launches one lib it hits 500 users in some weeks

16:04 antares_: and libraries (even the most awesome ones) need some marketing to grow a community

16:04 (good documentation is marketing, by the way)

16:04 wingy: yeah

16:05 devinus: anybody work with Titan in Clojure?

16:06 antares_: devinus: I have a very rough client that is not yet good enough to be published

16:07 devinus: i think clojure + titan would be wicked sick

16:07 antares_: Titan is not hard to use directly but also not trivial to wrap in a more idiomatic API

16:07 Sgeo: What's Titan?

16:07 antares_: Sgeo: http://thinkaurelius.github.com/titan/

16:08 devinus: antares_: here's one wrapper: https://github.com/megakorre/clj-titan/blob/master/src/clj_titan/core.clj

16:08 antares_: devinus: I may have something useful enough to others in about a week

16:08 devinus: antares_: what's your GH?

16:09 antares_: devinus: that looks pretty good. I am michaelklishin but it will be published under github.com/clojurewerkz, like the rest of new clojurewerkz.org projects.

16:09 biscarch: is titan a solid graph db? I was looking at it a while ago.

16:09 devinus: antares_: that would be really awesome

16:09 antares_: devinus: I think you can probably go with clj-titan and not wait. I want Titanium to match the quality of clojurewerkz.org's other DB clients.

16:09 devinus: antares_: i'm writing a website in clojure that's going to use titan

16:10 it's a game changer

16:10 antares_: biscarch: well, Neo4J is solid, too, but has no HA or *backups* (!!!) in the Community edition

16:10 Titan is backed by HBase or Cassandra so it has distribution built-in

16:10 with consistency model you want

16:10 devinus: Neo4j is not distributed at all

16:10 biscarch: antares_: so I've discovered heh

16:10 antares_: devinus: Neo4J Server is

16:11 biscarch: antares_: I like the sound of cassandra/hbase as a backend

16:11 antares_: devinus: master-slave replication with master election on failures

16:11 biscarch: I haven't looked at the storage impl but I guess adding Riak, MongoDB and JDBC backends won't be difficult, too

16:12 I agree that Titan is a game changer in the graph db space

16:12 but it is also not very mature yet

16:13 devinus: there seems to be a lot of Clojure development "groups"

16:13 biscarch: antares_: any glaringly serious problems?

16:14 devinus: i like it

16:14 antares_: devinus: in any case, I will try finishing initial Titanium API and some docs. Now that I see some other folks interested, it will be much easier to motivate myself.

16:14 AntelopeSalad: do you guys use datomic for your non-graph db needs?

16:14 devinus: antares_: yes, i will start using it immediately

16:14 AntelopeSalad: i unfortunately can't use anything that's not open source. IIRC datomic isn't open sourced yet?

16:15 AntelopeSalad: i'm not sure, still new to the clojure scene -- i don't think it's OS though

16:15 antares_: biscarch: no obvious glaring bugs but it's not well documented, bug free or heavily tested by many people. Being based on the Tinkerpop stack means the API is very much fleshed out, though.

16:15 devinus: it never will be open source

16:15 devinus: antares_: thought so

16:15 wingy: antares_: tell me whyyayyy

16:16 devinus: yeah, i can't sell to my boss a completely proprietary db

16:17 S11001001: devinus: would you accept a proprietary db for which you received source & hacking permissions?

16:17 devinus: S11001001: yeah

16:17 technomancy: not if you can't share you hacks

16:17 in which case it's not proprietary

16:17 S11001001: technomancy: good qualifier

16:17 devinus: lol right

16:17 S11001001: technomancy: there's a threshold

16:17 devinus: at which point you might as well just go open source

16:18 pipeline: that's not true devinus

16:18 open source was a long tradition in e.g. proprietary unix

16:18 S11001001: diff doesn't say everything

16:18 devinus: pipeline: oversimplification, i know

16:18 pipeline: they expected to pay your dues, but you could share code with other people past the gate

16:18 devinus: seems weird that datomic doesn't sell itself as "the datomic company" instead, like e.g. basho or datastax

16:18 pipeline: a perpetual license and open-but-nonfree source doesn't sound too bad

16:19 technomancy: disagree; sharing is what makes software worth doing

16:24 S11001001: technomancy: I wouldn't have bothered becoming a programmer without it

16:27 ivan: I have a new appreciation for text editors after trying to implement shift-home/ctrl-shift-a in nrepl.el

16:31 wingy: anyone here having experience with tower?

16:40 seancorfield: ~anyone

16:40 hmm, isn't that something the bot responds to?

16:40 emezeske: ~anybody

16:41 ^ Just a guess :)

16:41 seancorfield: wingy: can you be more specific?

16:41 danlarkin: clojurebot!!!!!!!!!!!11111

16:41 wingy: seancorfield: about tower?

16:41 emezeske: clojurebot's being lazy I guess ;)

16:41 wingy: nvm about tower

16:42 hiredman: looks clojurebot is have ebs issues, like the rest of aws

16:42 cscheid: has anyone seen lein uberjar fail with a ClassCastException and then work if you try it again?

16:43 pelismo: in compojure (or ring) is there a way to block stack traces from leaking out to users when errors occur?

16:43 seancorfield: yeah, aws problems hit us for an hour but we're back up now... although it looks like more aws services are suffering than an hour ago...

16:44 wingy: does anyone know how i can access the Jetty request in compojure?

16:44 technomancy: pelismo: that's the default behaviour

16:44 wingy: i mean ring

16:45 pelismo: technomancy: i'm using lein-ring to use a local dev server - could that be the reason it exposes it out?

16:45 technomancy: pelismo: I don't know; I never got the point of lein-ring. you just need to find whatever is enabling the stacktrace middleware.

16:45 pelismo: ok, thanks

16:45 technomancy: if you're not turning it on in your own code it could be coming from the plugin

16:45 Raynes: technomancy: What do you mean by 'never got the point' of it?

16:46 technomancy: Raynes: I completely fail to see the appeal?

16:46 Raynes: Does not compute.

16:46 technomancy: unless you are working with a company that has a lot of investment in existing war-based deploys

16:46 I don't understand why people use it during development

16:47 Raynes: I'm fond it because I don't have to add server starting code to my apps.

16:47 technomancy: Raynes: you mean a single line invoking run-jetty?

16:48 Raynes: Yes.

16:48 devinus: Raynes: did you get enough to go to the conf?

16:48 Raynes: technomancy: Your forgetting explicitly added dependencies too.

16:48 technomancy: Raynes: lein-ring is an explicitly added dep too though

16:48 Raynes: It makes it easy to deploy and run your code in a variety of ways.

16:48 Yeah, and it does other things and doesn't require additional code.

16:49 technomancy: I would understand that if the variety of ways were somehow better

16:49 Raynes: devinus: Yes.

16:49 * pelismo is very happy to see this channel grow > 500 ppl

16:49 devinus: nice

16:49 Raynes: devinus: Reconsidering now that technomancy has shown his true colors.

16:49 Can't been seen with him.

16:49 technomancy: Raynes: repl uber alles bro

16:51 antares_: More updates to the Concurrency CDS guide today, feedback very welcomed: http://clojure-doc.org/articles/language/concurrency_and_parallelism.html

16:52 ToBeReplaced: technomancy: what is your workflow then... nrepl-jack-in, run jetty, kill it when you need the repl back?

16:52 technomancy: ToBeReplaced: you can do run-jetty with :join? false to start it in the background

16:54 I like the regularity of being able to frame everything in terms of -main entry points

16:55 ToBeReplaced: seems nice... i like the (.stop server) ability

16:56 technomancy: yeah typically I do (def s (-main)) so I can come back to it

16:57 ToBeReplaced: right, sounds good

16:58 cscheid: ok, i figured it out, so here's in case anyone's searching the logs: lein uberjar fails with a less-than-very-helpful error message if you say (defproject ... :main "the.namespace" ...) instead of (defproject ... :main the.namespace ...). complete idiot mistake of mine, but anyway

17:45 jcromartie: is there a fn like (foo [1 1] inc dec) => (2 0)

17:45 egghead: you want to pass as many fns as the length of the seq?

17:45 jcromartie: like, "transform each element in the collection by the matching argument fn"

17:45 yeah

17:45 I can imagine writing it

17:46 emezeske: ,(map #(%1 %2) [inc dec] [1 1])

17:46 jcromartie: not bad

17:46 (defn combobulate [coll & fns] (map #(%1 %2) fns coll))

17:47 egghead: lol, there you go

17:47 metellus: &(map apply [inc dec] [1 1])

17:47 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long

17:47 egghead: I was told today that clojure is not as good as scala because it doesn't have 'final'

17:47 and because of that it's an imperative language

17:48 :3

17:48 jcromartie: sure, you can def all day long

17:48 why not

17:48 egghead: I heard you like to def so I put a def in your def

17:49 jcromartie: (do (def n 0) (loop [] (def n (inc n)) (println n) (if (< n 10) (recur))))

17:49 <3

17:49 procedural clojure is so natural

17:49 amalloy: jcromartie: https://github.com/flatland/useful/blob/develop/src/useful/fn.clj#L94

17:49 jcromartie: amalloy WINS!

17:49 with a neat name and everything

17:50 amalloy: every cool function you want is already in useful, mate

17:50 egghead: flatland

17:50 jcromartie: :) I'll checkit out

17:50 egghead: flatland was a cool book

17:50 jcromartie: never used it

17:50 I keep passing it at the bookstore, should I read it?

17:50 I can get it for free I'm sure

17:51 egghead: certainly wouldn't hurt, it uses a 2d world to explain what a higher dimension might be like

17:51 amalloy: it also spends a lot of time on victorian satire

17:51 short enough to read in an evening, as i recall

17:51 egghead: I've been reading 'to mock a mockingbird' and GEB

17:52 amalloy: oh, my brain. mockingbirds are too hard for me

17:52 wingy: do you think i am ready for joy of clojure? i have been on clojure for 1.5 month now .. knowing the basics

17:52 egghead: yes wingy read it

17:53 amalloy: you were ready before you touched clojure. i don't understand claims that it's too hard

17:53 wingy: lol

17:53 * nDuff is with amalloy on this one.

17:54 tgoossens: I heard a lot of flatland. Read a lot *about it*. But never the actual book

17:54 Funny idea though. it is almost de standard way that scientist try to explain higher dimensions to non-scientists or students

17:55 egghead: I liked sagan's bit on the 4th dimension from the cosmos series

17:55 showing how 3d objects have 2d shadows

17:55 tgoossens: yes

17:55 i saw that one too :)

17:56 egghead: 4th spatial dimension that is

17:56 emezeske: I second amalloy and nDuff in saying that JoC is not too hard (if you're willing to put in some effort)

17:58 scriptor: there's just a few places where it assumes knowledge of something without really explaining it

18:03 emezeske: scriptor: Presumably someone learning Clojure has access to the internet, where they can fill in gaps

18:03 scriptor: Anyway, all books assume a tremendous amount of knowledge (e.g. the English language for example)

18:04 scriptor: I didn't mean that as a criticism, meant that there really are just a few

18:04 wingy: if they have internet they can you google translate along with it

18:04 emezeske: scriptor: Oh :)

18:04 Sgeo: Is Joy of Clojure more about why things are done this way and theoretical abstract concepts than Programming Clojure?

18:04 Because I like theoretical concepts and explanation

18:04 s

18:04 nDuff: Is there a clean way to create an anonymous dynamic var? I want to create a set! target without polluting my namespace.

18:04 scriptor: Sgeo: it definitely has that

18:04 nDuff: Sgeo: Yes, exactly.

18:05 amalloy: &(doc with-local-vars)

18:05 lazybot: ⇒ "Macro ([name-vals-vec & body]); varbinding=> symbol init-expr Executes the exprs in a context in which the symbols are bound to vars with per-thread bindings to the init-exprs. The symbols refer to the var objects themselves, and must be accessed with var-get and var-set"

18:05 nDuff: ...mind you, Programming Clojure at least has _some_ of the why... unlike, say, Clojure in Action (which is almost all "how" and no "why" at all)

18:05 amalloy: nice; thanks!

18:07 AntelopeSalad: someone recommended me SICP once as a general lisp learning tool and to explain functional programming in general

18:08 if you like theory, it's worth checking out ^ Sgeo

18:09 Sgeo: AntelopeSalad, I started SICP a while ago, I should resume it

18:10 AntelopeSalad: i actually stopped about a third of the way through due to time management issues i had (+ it's really difficult with the math if you don't have a decent math background)

18:10 TimMc: Have You Watched Your SICP Today?

18:10 AntelopeSalad: but yeah, i plan to revist it again

18:10 the first few lectures alone will probably change your entire philosophy on programming

18:12 shaungilchrist: I am still trying to read SICM

18:12 egghead: computer machines

18:12 shaungilchrist: every year I pick it up and make it half a chapter further and realize how much more I don't know about physics

18:12 I'd actually be bummed out if it were any other way

18:32 devth_: is there a function to detect if something is a lazy seq?

18:35 brehaut: devth_: a seq or do you want to specifically know about laziness?

18:35 devth_: put another way: i have the result of some (eval foo) - it could be anything. i want to get its string representation: (str (eval foo)). this sometimes returns "clojure.lang.LazySeq" which is very unhelpful.

18:35 tgoossens: i think he wants something like this:

18:35 (lazy? coll)

18:36 texnomancy: maybe you want pr-str

18:36 devth_: ah

18:36 texnomancy: perfect. ty

18:37 emezeske: texnomancy: Are you technomancy's doppelganger? Are you a good doppelganger or a evil one?

18:38 texnomancy: emezeske: I'm using it to weather awsageddon

18:39 emezeske: texnomancy: :)

18:39 zackzackzack: Any ideas about what java.lang.String<> means as a parameter type?

18:40 clojurebot: (2 0)

18:40 zackzackzack: I've tried using a string as a input type but it says that there is no matching method for that call

18:44 amalloy: zackzackzack: doesn't mean anything, so you'll have to provide more context

18:46 tgoossens: well good night everyone (for me atleast :) )

18:49 seancorfield: I had never realized how counter-intuitive core.cache must seem until I tried to explain it on the list today...

18:52 texnomancy: I couldn't figure it out when I briefly tried it

18:52 ended up rolling my own memoize that exposed the atom

18:52 amalloy: texnomancy: hadn't you already done that long before core.cache existed?

18:52 texnomancy: after submitting http://dev.clojure.org/jira/browse/CLJ-804

18:53 amalloy: no, I think that was just complaining about c.c/memoize and not writing anything

18:53 seancorfield: It does seem like it would cause less confusion if core.cache actually wrapped itself in an atom in the first place... unless fogus imagines other uses (which I can too, just not sure they're likely to be common)

18:53 texnomancy: haha "recommend Guava for advanced caching"

18:54 tomoj: is there an easy way to get the requires of a namespace?

18:55 texnomancy: tomoj: slamhound does that

18:56 tomoj: cool, so just need a function to get a filename from an ns

18:56 thanks

18:58 was hoping to avoid reading, but if slamhound takes care of it, great

19:20 zackzackzack: amalloy: took an hour of googling, but I found out what's up

19:20 amalloy: Canonicalizes class names as Clojure symbols. Types can extend to the TypeReference protocol to indicate that they can be unambiguously resolved as a type name. The canonical format requires one non-Java-ish convention: array brackets are <> instead of [] so they can be part of a Clojure symbol.

19:20 http://clojure.github.com/clojure/clojure.reflect-api.html

19:24 I guess the question is now how to create a typed array (or if I even want to).

19:28 acagle: /flush

19:57 ivan: http://awelonblue.wordpress.com/2012/10/21/local-state-is-poison/

20:51 Kowboy: ok, got a tricky one...

20:51 I have a map that I got from a JSON request (trough clj-http)

20:52 it has the following content: {:T.Brady "00-0019596", :J.Tuck "00-0023509", : "0"}

20:52 notice the last key

20:53 it's empty

20:53 if I try to write this out and read it back in, I get a parse error

20:53 tomoj: in cases like that I prefer :as :json-string-keys

20:53 Kowboy: hmmm, I'll try that

20:54 in the original JSON, it is actually :0 with no key

20:54 didn't know that was valid JSON. Maybe it's not

20:54 dnolen: Kowboy: it's not valid

20:55 tomoj: sure it is?

20:55 it's inconvenient

20:56 emezeske: I just typed {"a" : 1, : 2} into my local JS console, and it threw an error. Seems not valid.

20:56 tomoj: luckily anything (I think?) that doesn't work as a keyword is inconvenient for js programmers, so rare

20:56 the json is {"a": 1, "": 2}

20:57 dnolen: tomoj: yes that's different.

20:57 emezeske: Kowboy just said it is :0 with no key. "" is a key.

20:57 tomoj: that's his keywordized version

20:57 the key is (keyword "")

20:57 otherwise cheshire would have blown up

20:57 emezeske: I quote, "in the original JSON, it is actually :0 with no key"

20:57 tomoj: oh

20:58 I don't believe that :)

20:58 emezeske: I mean, maybe Kowboy is writing confusing things, but the way I interpret that is that the JSON is malformed

20:58 tomoj: cheshire blows up

20:58 dnolen: ,{(keyword "") 0}

20:58 clojurebot: {: 0}

20:58 tomoj: maybe it looks like no key if you print it in js

20:59 emezeske: tomoj: Yeah, maybe that's it.

20:59 tomoj: (it does in chrome: "Object {: 4, foo: 3}")

21:00 factual-clojure-driver keywordizes everything even if the keys have spaces and other funny characters, and for some reason :json-string-keys blows it up :(

21:01 oh, I just realized why

21:02 selecting keywordization seems somewhat tricky

21:02 Kowboy: the JSON looks like {:0, T.Brady:00-0019596, J.Tuck:00-0023509}

21:02 tomoj: JSON.stringify it

21:03 (that isn't JSON)

21:03 amalloy: yeah, that looks closer to random characters than to json

21:03 Kowboy: cheshire reads it as {: "0" etc..}

21:03 that doesn't parse when you try to read-string it

21:04 ,(read-string "{: \"0\"}")

21:04 clojurebot: #<RuntimeException java.lang.RuntimeException: Invalid token: :>

21:04 Kowboy: that's the exact error I'm seeing

21:04 tomoj: ..don't pass true to cheshire (i.e. use :as :json-string-keys with clj-http)

21:05 Kowboy: cheshire consumes the JSON just fine, but I can't write it to a file and read-string it later unless I filter it

21:05 tomoj: that or deal with the empty keyword manually

21:05 Kowboy: ok, thanks

21:10 dakrone: that is some crappy json

21:14 amalloy: i don't think we got through to him with the message "That is not JSON. It is random garbage someone decided to tell you is JSON."

21:14 muhoo: http://jsonlint.com/

21:16 Frozenlock: Is there something more recent than clj-units for units dans dimensions stuff? (clojure 1.2!) http://onclojure.com/2010/03/23/computing-with-units-and-dimensions/

21:23 xeqi: Frozenlock: https://github.com/martintrojer/frinj ?

21:31 Frozenlock: xeqi: looks very nice! Thanks for the link.

21:53 Khaoz: Write something like (defn s->k [s] (keyword s)) is just a preference/best pratice, right ?

21:55 like the use of ? to visually tell that a function return a boolean

21:56 amalloy: giving a cryptic new name to a function already in the standard library sounds more like a worst practice

21:59 Khaoz: you think that i'm writing some kind of valid code ? It's just an example. My main point here is the s->k particle.

22:05 anyway, looks like "yes" is the answer to my question :)

22:05 thanks :)

22:09 Licenser: okay here is the question, what was the way to go now to work with EMACS, slime was not the SOTA thing right?

22:15 xeqi: Licenser: nrepl

22:15 Licenser: xeqi thanks!

22:23 Kowboy: ok, so I decided I like keywords better and used clojure.walk to replace the empty keywords

22:23 twas easier than I thought

22:23 in general, which walk function is better on performance?

22:24 prewalk-replace, postwalk-replace, or some other third thing?

22:54 Licenser: gosh uploading to clojars got a lot more complicated :(

22:55 seancorfield: Licenser: I still do `lein do pom, jar` and then scp it manually

22:56 Licenser: hmm that isn't a bad idea

22:57 xeqi: Licenser: how so?

22:57 Licenser: I'm reading the read me of the deploy task and there is stuff in there like registering on some website (other the clojars)

22:57 ah I should have probably looked at the topic

22:59 muhoo: it's pretty insane last I checked, PGP stuff, etc

22:59 i just scp manually too :-) fast and easy

22:59 texnomancy: the only thing worse than signing jars is pulling in jars that are impossible to verify =\

23:00 Licenser: registering on some other site?

23:00 Licenser: yea it was in the maven central section :)

23:01 I didn't see the topic there

23:01 texnomancy: oh, heh

23:01 yeah, luckily clojars is much simpler

23:01 xeqi: I tried to make it as simple as `lein deploy clojars` :p

23:02 Licenser: xeqi yea that gives me a 401 sadly :(

23:02 that would be really cool if it wired so :P

23:02 *ponders* if that might be because he's not owner of the group the jar is in

23:03 xeqi: 401 should be failed login if I remember right

23:03 amalloy: authentication required

23:04 xeqi: unfortunatly aether (the library lein uses for dependency management/pushing) doesn't have a way to produce good errors

23:04 even if a real messsage is sent back from clojars :(

23:05 Licenser: yea but my http credentials are right

23:05 xeqi: group permission problems should end up as a 403 if I remember and am scanning code right

23:05 texnomancy: 401 could be http rather than https too

23:06 Licenser: ah there we go, problem solved. For once I used https now then I changed the group to something I own :)

23:07 ah I've not worked with clojure far to long - bad me

23:08 xeqi: Licenser: lein version ?

23:08 Licenser: got 2.0

23:08 xeqi I really think the problem was that I tried to push to a group that was not mine

23:08 I am fixing a 3rd party library and wanted to put the jar on clojars and did not use my group for that

23:09 xeqi: k, glad to hear its working for your group :)

23:09 Licenser: :D and me

Logging service provided by n01se.net