#clojure log - Mar 26 2013

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

0:01 xeqi: tieTYT2: line 7, ((client/get ...)) will attempt to call the result of (client/get ...) as a function

0:01 tieTYT2: ohhh crap

0:01 thanks

0:01 i wish that bubbled up to tell me "line 7"

0:02 i thought it was deep down in the clojure libraries

0:02 xeqi: usually there is a longer stack trace, sometimes they get eaten, not sure if its lein or a jvm flag bein set

0:02 .. is it (pst) that will print out the last stacktrace?

0:03 tieTYT2: seems to

0:03 that is so weird

0:03 how does it cut off the top?

0:03 that being the case, (pst) is essential. Thanks

0:06 xeqi: tieTYT2: what version of lein are you using?

0:08 tieTYT2: 2.0.0

0:08 xeqi: https://github.com/technomancy/leiningen/issues/1025

0:08 has something you can put in the project.clj at the bottom to fix it eating stacktraces

0:10 tieTYT2: thanks

1:28 why am i getting this error? http://pastebin.com/L9iUfJHX

1:30 oh...

1:30 i think i know why

1:30 java problem, not clojure problem

1:38 anyone know if it's a bad idea to program with a cygwin repl open while you write your real code in the intellij La Clojure library?

2:08 what's a more idiomatic way to write this code in clojure? (defn img-as-file-on-fs [url] (.getAbsolutePath (File/createTempFile "img" (str "." (FilenameUtils/getExtension (.getAbsolutePath (io/file url)))) (io/file "images/"))))

2:10 tomoj: only thing I can suggest is to give names to more things

2:10 tieTYT2: you mean like in a let?

2:10 tomoj: I can't really imagine what kind of idiom you're thinking of..

2:10 right

2:11 tieTYT2: ok i've been doing that in other places, let me try with this

2:11 thanks

2:11 tomoj: took me a while to understand what it was doing because I didn't know File/createTempFile

2:11 but..

2:11 that doesn't mean you should name things

2:11 otherwise you'd have to name everything you ever passed to a function :)

2:12 my first thought was that it is perfectly idiomatic

2:13 tieTYT2: this is my change: (defn img-as-file-on-fs [url]

2:13 (let [extension (str "." (FilenameUtils/getExtension (.getAbsolutePath (io/file url)))) output-dir (io/file "images/")] (.getAbsolutePath (File/createTempFile "img" extension output-dir))))

2:15 i'm surprised it's idomatic. it seems clumsy to me. It took a while to figure out how I was getting class cast exceptiosn

2:16 tomoj: meh https://www.refheap.com/paste/e14264e41cbe02e168f90f6b0

2:16 tieTYT2: here's an idea for a library I just had. Something that merges the functionality of File, FileUtils and FilenameUtils into one protocol. Is that a good idea or is it a solution looking for a problem?

2:17 hrm I need to learn about that -> and ->> thing

2:18 tomoj: you don't mean one defprotocol right?

2:18 tieTYT2: one defprotocol, but File and String would be an impl

2:18 (i've never made a protocol, so I don't remember the exact names

2:19 tomoj: oh, like IFileNamed or something?

2:20 tieTYT2: I suppose. All I know is I don't want to be using any of those static or File methods in there

2:21 tomoj: well you can define wrapper functions, I dunno what protocol would make sense

2:21 tieTYT2: ah true

2:21 so maybe a library full of wrapper functions

2:21 tomoj: I don't have an answer to your actual question "good idea.."

2:22 tieTYT2: that's ok. I'll learn clojure more before I revisit it

2:22 there's this awesome haskell book that's free called Learn You A Haskell. I wish there was one like that for clojure

2:24 tomoj: well, somebody bought the domain

2:26 tieTYT2: not loading in my browser

2:29 arrdem: tomoj: learn you a clojure?

2:29 alejandro gonzlez apparently... learnyouaclojure.com

2:29 tomoj: yeah

2:30 tieTYT2: oh, well different guy wrote the haskell one

2:30 tomoj: cloju.re is also parked

2:31 but not learnyouacloju.re..

2:41 Raynes: tieTYT2: I'm trying. In my not very copious spare time.

3:00 tieTYT2: Raynes: good luck

3:19 jaimef: (get "/hello/:a/:b/:c" "Hello to #{a} and #{b} and #{c}") ;; now that's sinatra like

3:39 tomoj: jaimef: what's that from?

3:39 jaimef: thinatra

3:40 sorry wrong channel

3:40 tomoj: ah, didn't seem very clojuresque :)

3:40 jaimef: it's very non-lisp despite being elisp

5:22 Sonderblade: what's the best clojure library for writing a parser? there are to many to choose from :p

6:49 MikeSeth: type hints for method arguments are only a performance optimization, correct? they're not meant to specify which kind of argument a methond expects?

6:52 tomoj: not sure what you mean by "specify"

6:52 they don't act like argument type preconditions (which would throw an error if the type was wrong at runtime)

6:52 not sure what you mean by "method" either

6:58 ambrosebs: MikeSeth: do you mean adding hints to specify which overload a method should dispatch to?

6:59 I'm not actually sure if it helps with ambiguous methods?

6:59 But it basically helps load a specific method at compile time rather than relying on reflection at runtime.

7:03 tomoj: ambrosebs: btw, is something like core.typed necessary to know as much about the types as the compiler?

7:03 or is all the tag inference the compiler does also represented in jvm.tools.analyzer output?

7:04 ambrosebs: tomoj: core.typed currently just uses the analyzer output. core.typed checks whichever method is loaded by the compiler.

7:05 tomoj: it's a good question whether/how easily we can do better.

7:06 tomoj: hmm, I'm not actually sure what my question is

7:09 oh

7:09 when I looked at some analyzer output before it looked like :tag wasn't useful

7:09 but I think I was just looking at it wrong

7:11 ambrosebs: tomoj: :tag isn't useful beyond pre-loading interop forms.

7:13 tomoj: right, I was considering making it useful for something else

7:13 via a macro that looks an analyzer output

7:13 but I think that doesn't really make any sense unless you just do core.typed

7:15 ambrosebs: tomoj: what for?

7:19 tomoj: do you know applicative functors?

7:22 another way to describe it I think is the problem of determining serious/trivial for a cps transform

7:22 currently I plan to just mark the serious expressions (abusing @ or ~, or creating a new special form inside the macro)

7:23 but I'm wondering if erring towards assuming serious, with some rudimentary type inference (like the compiler's?), could be good enough

7:26 like if something is tagged ^String I don't need to cps there

7:26 ambrosebs: tomoj: I don't know much about either topic.

7:28 tomoj: well, anyway, it looks like the analyzer output has exactly what I thought it should :)

7:29 e.g. in (fn [^String a b] (let [c a] c)), inside the body of the let you can go back up to the param and get the tag

7:30 though :tag is not automatically inferred it seems

7:34 clgv: oh clojure's maps have much better usability than comon lisp's ones...

7:35 (setf (gethash :a ht) 1) is pretty ugly compared to `assoc` ...

7:40 tomoj: I implemented the curry example from the expansion-passing style paper

7:40 https://www.refheap.com/paste/e5e1a4d1c5df0f9ec6c283e4f

7:40 not too happy — 1) do we really need *magroexpanding*? 2) gotta be a better interface?

7:40 clgv: defmagro? :O

7:47 tomoj: hmm, was some nonsense in the docstring :). https://www.refheap.com/paste/50104bba92033ed0889af0ff6

7:47 think it's also buggy, but.. in the end of the EPS paper they mention passing around a syntax table along with the expand fn

7:48 that would bring our arity to 4 since we have the env as well

7:48 maybe pass around a dispatch-map or something..?

8:12 kalasjohnny2000: I have a $lein trampoline cljsbuild repl-listen up and running, and my ns looks like (ns something.else (:use [one.dispatch :only [react-to delete-reaction fire]]) but still can't (fire :hello) in my cljs-repl.

8:13 (one.dispatch/fire :hello) works, though. And other imports seems to work as well.

8:14 or no, they don't, not in the repl.

8:14 I go to the namespace with (in-ns 'something.else)

8:27 tomoj: kalasjohnny2000: that used to happen to me

8:27 it recently started working

8:27 I thought I remembered some change somewhere that caused it to start working, but can't find it now

8:28 I don't use cljsbuild's repl-listen, though, I use `lein repl` with piggieback

8:28 but I can't reproduce your problem with repl-listen either

8:28 (I'm on clojurescript master, but dunno if that's why)

9:13 TimMc: Where's a good channel to bug people about monads? I'm working through some tutorials.

9:16 borkdude: TimMc maybe #haskell?

9:20 TimMc: They'll throw random symbols at me!

9:21 Iceland_jack: TimMc: I can answer some questions, but the monads themselves are probably more impressive than what monads are

9:24 Anderkent: technomancy: any way to silence lein output when using `lein run` ? I.e. stuff like 'Retrieving lib-name.pom from clojars'

9:28 TimMc: ,(for [[s v] (ns-publics 'clojure.core) :let [d (:doc (meta v))] :when (and d (re-find #"DEPRECATED" d))] s)

9:28 clojurebot: (add-classpath replicate agent-errors clear-agent-errors)

9:35 TimMc: Iceland_jack: Basically, my only question is: Isn't a monad really more like a quesadilla?

9:35 (I think I've actually confused myself enough for today, and should let this stuff churn in the back of my mind for a bit.)

9:36 Iceland_jack: If you have real questions feel free to ask me in PM.

9:36 borkdude: Monad is more like plumbing things together, so instead of passing water in and out of functions you return the hose

9:37 Here is a photograph of a programmer working on some monadic stuff: http://en.wikipedia.org/wiki/File:Plumber_at_work.jpg

9:39 TimMc: Iceland_jack: Thanks, I appreciate it.

9:45 Oh, possible insight: I should not be trying to understand a given domonad form as composition of domonad + some monad, but instead as a monolithic form. E.g. clojure.core/for instead of domonad + sequence-m.

9:46 jweiss: I'm trying to write when-some-let. It's like when-let, but the condition is when *any* of the bindings evaluate to logical true, the body is executed with the bindings. i'd like to have destructuring work too, but looks like calling destructure directly will not work. (for example it binds the whole map to a gensym behind the scenes)

9:47 i thought of just walking all the left hand side expressions to extract symbols, but i don't see any functions available that will traverse inside maps.

9:49 TimMc: jweiss: You can introduce intermediate bindings and rely on let to do the magic.

9:50 jweiss: TimMc: sorry i'm not sure i follow

9:50 TimMc: https://github.com/clojure/clojure/blob/clojure-1.5.1/src/clj/clojure/core.clj#L1684

9:50 Each binding in your when-some-let becomes two bindings.

9:52 (when-some-let [a 1, [b] [5 6]] ...) => (let [t0 1, a t0, t1 [5 6], [b] t1] (when (and t0 t1) ...))

9:53 t0 and t1 would be gensyms, here.

9:54 jweiss: TimMc: ah, but what I really want is for the condition to be (or a b). that's different than (or t0 t1)

9:54 IOW i want to or all the bound symbols

9:54 borkdude: could it be that java.lang.Integer was the default before instead of Longs for int literals?

9:54 TimMc: Er, right. (or t0 t1)

9:54 jweiss: b is not the same as t1

9:55 borkdude: or I have never really evaluated the code that's here in front of me

9:55 TimMc: jweiss: Oh, so you want something different from how when-let works, I see.

9:57 jweiss: i'd want (when-some-let [{:keys [a b]} {:c 1}] [a b]) to return nil

9:58 ,(when-let [{:keys [a b]} {:c 1}] [a b])

9:58 clojurebot: [nil nil]

9:59 jweiss: only way i can think to do this is walk the LHS expressions to extract symbols, but i can't even find a way to descend into {:keys [a b]} without rolling my own

9:59 flatten and postwalk won't do it

10:00 TimMc: You just want all symbols in an expression?

10:01 jweiss: TimMc: yeah i think so

10:02 TimMc: ,(filter symbol? (tree-seq coll? identity '{:keys [a b [c]]}))

10:02 clojurebot: (a b c)

10:02 jweiss: ah right, tree-seq :)

10:02 TimMc: That's a quick and dirty approach, but it might be all you need.

10:02 jweiss: (inc TimMc)

10:02 lazybot: ⇒ 36

10:02 borkdude: can someone explain what the var "unquote" is about? can you use it instead of ~?

10:02 jweiss: yeah, i think for my purposes that will work fine, thanks!

10:03 ,(let [x 1] `(unquote x))

10:03 clojurebot: (clojure.core/unquote sandbox/x)

10:04 jweiss: ,(let [x 1] `(~x))

10:04 clojurebot: (1)

10:04 jweiss: hm that is not quite the same

10:04 ,(let [x 1] `((unquote x)))

10:04 clojurebot: ((clojure.core/unquote sandbox/x))

10:07 jjttjj`: is there any particular reason it's a bad idea in laser to use its select function to select a subset of the html document you want to transform, like you can in enlive? so you can create multiple templates from multiple html files?

10:11 borkdude: is ~ better explained as evaluation or substitution?

10:12 TimMc: borkdude: Substitution. It's not so much evaluation as exemption from *not* being evaluated.

10:12 Or perhaps injection.

10:13 ,'~x

10:13 clojurebot: (clojure.core/unquote x)

10:20 tyler: brain asplode today: code as data is neat, but the real benefit i find myself having is that coding with data naturally comes from that paradigm

10:21 jtoy: I found that one library, cld messes with my logging, it hides it all or something, normally if i dont include thts library i see all of stdout in my repl. is there a way i can fix this?

10:29 borkdude: Is it safe to say that the primary reason for sexps being used is macro support?

10:34 scottj: borkdude: sexps predate macros

10:34 borkdude: scottj ok, so it is not safe to say.

10:34 scottj: borkdude: idk :)

10:36 tbaldridge: scottj: read up on fexprs, they existed before macros, and are more flexible, normally at a performance cost

10:37 scottk: fexprs are basically macros that run at run-time.

10:37 they were discontinued in the 70's and macros were invented. http://en.wikipedia.org/wiki/Fexpr

10:42 borkdude: what part of clojure does macroexpansion, the reader or the compiler?

10:42 dnolen: borkdude: compiler

10:43 borkdude: though macroexpansion is after read and before actual compilation

10:43 scottj: tbaldridge: interesting

10:43 borkdude: tbaldridge indeed interesting, tnx for bringing that up

10:43 dnolen tnx

10:44 hyPiRion: tbaldridge: Hmm, that's fancy. I know Paul Graham wanted runtime macros for Arc, but didn't know they were studied and "out in the wild".

10:46 tbaldridge: hyPirRion: yeah, fexprs really don't work well with compiled lisps (like Clojure). I do wonder sometimes if a tracing JIT (like PyPy) couldn't make these viable again. But I haven't found a "must have" use case for fexprs yet.

10:47 pjstadig: fexprs are a bad idea, and were abandoned for a reason

10:47 supposedly John Shutt has reconceived them in the kernel language to make the viable, but not everyone is on board with his work

10:48 hyPiRion: One "concern" would be that people would overuse fexps, but I can see places where they could be useful

10:48 jweiss: any nrepl.el users know how to do the equivalent of slime-eval-last-expression in the repl? C-x C-e does it in a source file but not in the repl.

10:48 pjstadig: one of the big problems with fexprs was dynamic scoping, which isn't really an issue anymore, but there were other problems

10:48 hyPiRion: not sure if the pros outweight the cons though, I haven't really thought much about it

10:49 number36: can someone tell me

10:49 what could this mean ?

10:49 java.lang.RuntimeException: Unmatched delimiter: )

10:49 i am solving 4clojure problems

10:49 if it help

10:49 pjstadig: number36: you have an extra closing paren somewhere

10:49 number36: pjstadig thank you

10:50 jweiss: ok wow, could it be as simple as just binding nrepl-eval-last-expression? wonder why that isn't the default

10:52 jcromartie: I am trying to get out of OOP mode

10:53 I keep thinking in terms of superclasses

10:53 like, oh I should be able to inherit this-or-that

10:53 and then override

10:53 Ember-: composition over inheritance my friend :)

10:53 even in the oop world

10:53 jcromartie: indeed, but I'm still getting the hang of it

10:53 like, I am working on a data model

10:53 I implemented one model namespace

10:54 now when I go to implement another I find it's just copy/paste and find/replace

10:54 I think I'll allow that to happen *once* but then it's time to abstract

10:54 TimMc: scottj: Nonsense, macros predate upon sexps! (Oh, it's a homonym. :-P)

10:55 This is what happens when you're married to a biologist.

10:55 jcromartie: so I'm thinking I need *something* that provides basic CRUD on a collection with a validator function right?

10:56 either way. I should just make it work first, add tests, then refactor

11:03 multimethods to the rescue?

11:13 jtoy: I have a fn in a namespace defined as: (defn is_american? [json] (eval (user_json_query "(is_american? json)" "find_all_americans"))) when i test it, it says is_american? cant be found, which makes me think it is using the namespace from the repl instead of from the namespace the code is in

11:13 is there a way I can make this read form the namespace of the file it is in instead of the repl?

11:19 jcromartie: jtoy: your repl has a current namespace too… by default it's 'user, so either change it with in-ns or require or use your namespace

11:20 that is, change it with "in-ns", or else import your namespace with "require" or "use"

11:20 corecode: is there a way to send an expression/buffer to nrepl, so that expression and result appear there?

11:25 DaReaper5: i am having an issue with clj-time

11:26 .toDate seems to be off by 1 day

11:26 (.toDate (clj-time.format/parse (clj-time.format/formatters :year-month-day) "2012-01-01")

11:26 how do i use the clj bot?

11:28 hello?

11:28 clojurebot: BUENOS DING DONG DIDDLY DIOS, fRaUline DaReaper5

11:28 DaReaper5: hu clojurebot

11:28 hi*

11:28 how do i use you

11:28 -help

11:28 :P

11:28 bbloom: ,(+ 5 10)

11:28 nDuff: ,(.toDate (clj-time.format/parse (clj-time.format/formatters :year-month-day) "2012-01-01")

11:28 clojurebot: 15

11:28 #<RuntimeException java.lang.RuntimeException: EOF while reading>

11:28 nDuff: ,(.toDate (clj-time.format/parse (clj-time.format/formatters :year-month-day) "2012-01-01"))

11:28 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clj-time.format>

11:28 bbloom: &(- 20 3)

11:28 lazybot: ⇒ 17

11:29 DaReaper5: dam

11:29 so i cant use the bot

11:31 nDuff: Hrm. With clj-time being a wrapper around JODATime, I'd be surprised if its logic were actually broken.

11:31 Less surprised if it had some unintuitive behaviors relating to time zones and such.

11:32 Ember-: I'm 99.9% certain that clj-time isn't broken due the reasons nDuff just said

11:32 DaReaper5: oh god im wrong

11:32 its something weirder

11:32 Ember-: joda-time is way too production proved

11:33 DaReaper5: map2(java.util.HashMap. {"date" (.toDate (clj-time.format/parse (clj-time.format/formatters :year-month-day) "2012-01-01"))})

11:33 that causes the issue

11:33 nDuff: DaReaper5: ...also, that first code gives me back #inst "2012-01-01T00:00:00.000-00:00", which is what I'd expect.

11:33 DaReaper5: yes

11:34 {"date" (.toDate (clj-time.format/parse (clj-time.format/formatters :year-month-day) "2012-01-01"))}

11:34 Ember-: I'd look at that map2 function whatever it does

11:34 nDuff: {"date" #inst "2012-01-01T00:00:00.000-00:00"} <- also looks normal.

11:34 DaReaper5: and the resulting HashMap have different date values

11:34 nDuff: What's map2?

11:34 DaReaper5: map2 is the issue

11:34 its a hashmap

11:34 do you get an issue with java.util.HashMap. ?

11:34 nDuff: DaReaper5: Can you provide a reproducer?

11:34 Ember-: why not just use hash-map ?

11:35 DaReaper5: map2(java.util.HashMap. map1) is my current way of converting to a hashmap that java can use

11:35 Ember-: using java.util.HashMap is kinda dangerous in clojure anyway since it is mutable

11:36 oh, java interop

11:36 DaReaper5: ya interop

11:36 nDuff: DaReaper5: This "map2" is not a standard library function.

11:36 DaReaper5: Where do you get it from?

11:36 DaReaper5: nDuff sorry map2 is a variable name

11:36 in a let

11:36 Ember-: but doesn't java take clojure maps just fine?

11:36 imho clojure maps implement java.util.Map

11:37 nDuff: DaReaper5: (java.util.HashMap. (hash-map "date" (.toDate (clj-time.format/parse (clj-time.format/formatters :year-month-day) "2012-01-01")))) <- looks fine to me.

11:37 Ember-: and due to that you can just pass clojure maps for java code

11:37 nDuff: DaReaper5: ...also, what Ember said. Unless you're using a Java library that _really_ requires a mutable map...

11:37 Ember-: if your java side of things takes java.util.HashMap as parameter then it's time to change it to accept java.util.Map

11:38 there is absolutely no reason to force HashMap as parameter

11:38 DaReaper5: but why would it be changing the value?

11:38 nDuff: Ember-: ...I _could_ see a sufficiently evil, poorly-designed API mutating maps that it's given rather than only using them as input.

11:39 DaReaper5: Have you demonstrated that "changing the value" in a way that anyone other than you can reproduce?

11:39 Ember-: nDuff: yeah, but there is still no _reasonable_ reason for that :)

11:39 nDuff: DaReaper5: A standalone, self-contained reproducer would be helpful here.

11:39 Ember-: that's just plain ugly

11:39 DaReaper5: what date is returned for you when you execute this:

11:39 map2(java.util.HashMap. {"date" (.toDate (clj-time.format/parse (clj-time.format/formatters :year-month-day) "2012-01-01"))})

11:40 that reporduces it for me

11:40 Ember-: and what is the implementation of map2

11:40 nDuff: DaReaper5: that isn't code that can be run standing alone!

11:40 DaReaper5: It requires an enclosing let, if nothing else.

11:40 DaReaper5: (println (java.util.HashMap. {"date" (.toDate (clj-time.format/parse (clj-time.format/formatters :year-month-day) "2012-01-01"))}) )

11:40 Ember-: if map2 uses map internally then you should be aware that map returns a lazy sequence

11:40 nDuff: Ahh. Now I'm seeing it. #<HashMap {date=Sat Dec 31 18:00:00 CST 2011}>

11:40 DaReaper5: ya

11:40 nDuff: ...yup, calling this a time zone issue.

11:40 DaReaper5: wierd

11:41 nDuff: When it's being generated by the Clojure printer, it's UTC

11:41 here it's being printed in CST

11:41 Ember-: ah true

11:41 nDuff: so it's exactly the same time, just represented two different ways.

11:41 DaReaper5: haha

11:41 so i have to specify the tiem zone some how?

11:41 Ember-: LocalDateTime in joda time

11:41 has no time zone information in it

11:42 in clj-time I think the function is local-date-time (duh)

11:42 nDuff: DaReaper5: ...only if you really want to. I mean, the outputs are unambiguous as they are.

11:42 DaReaper5: nDuff used in an sql query it does not take into consideration the time zone it hink

11:42 think*

11:42 nDuff: DaReaper5: By the way, you can reproduce this without using clj-time at all.

11:42 Ember-: makes life easier when you don't have to take time zones into account but they are there for a reason

11:43 nDuff: ,(println (java.util.HashMap. {"date" #inst "2012-01-01"}))

11:43 clojurebot: #<SecurityException java.lang.SecurityException: denied>

11:43 Ember-: aww

11:43 nDuff: &(println (java.util.HashMap. {"date" #inst "2012-01-01"}))

11:43 lazybot: ⇒ #<HashMap {date=Sat Dec 31 16:00:00 PST 2011}> nil

11:43 DaReaper5: ha

11:44 tbaldridge: lazybot: you are less secure it seems

11:44 DaReaper5: hmmm so how should i go about this

11:45 nDuff: DaReaper5: ...so, JDBC actually _does_ specify behavior around timezones.

11:46 DaReaper5: ...see the javadoc at http://docs.oracle.com/javase/7/docs/api/java/sql/PreparedStatement.html#setTimestamp%28int,%20java.sql.Timestamp,%20java.util.Calendar%29

11:46 DaReaper5: actually it might be displaying right

11:46 used right***

11:46 in sql

11:46 but it is displaying wrong in my report

11:47 should i do time zone compensation on my display side?

11:47 (i am building a report from the data)

11:48 ... i guess i need to write some java code to do it on the reporting side

11:48 nDuff: DaReaper5: clj-time gives you helpers to specify the timezone to use.

11:49 DaReaper5: even if i do not specify it, shouldnt it be consistent?

11:50 nDuff: DaReaper5: Sure.

11:50 DaReaper5: but its not

11:50 nDuff: DaReaper5: ...Sure it is, within each printer.

11:50 DaReaper5: my printer is showing 2 different values

11:51 depending on the data structure it is in

11:51 nDuff: Right, because the HashMap thing doesn't delegate to the Clojure printer

11:51 but does its own thing.

11:51 ...but why would that matter for reporting?

11:51 You're not going to put a HashMap's representation into a report, or at least I'd hope not.

11:51 DaReaper5: my report says today's date is the 31st when i wanted the 1st

11:52 the hash map provides parameters to a jasper report

11:52 one of those parameters is the day of the request

11:52 jcromartie: why does the compiler choke on this code: (throw (Exception. "cannot save invalid object"))

11:52 if I run that in the REPL it works fine

11:52 nDuff: Okay. Then you need to look into how Jasper handles times.

11:52 DaReaper5: ya

11:52 nDuff: That's not a printer thing at all.

11:52 DaReaper5: gah

11:52 nDuff: ...and Jasper is presumably going to do the default Java thing

11:52 Sonderblade: what emacs mode(s) do you use when coding in clojure? currently using nrepl but it is very flaky

11:52 nDuff: ...and default to the local timezone

11:52 (which isn't UTC, hence, the 31st)

11:53 err, isn't UTC in your case.

11:53 DaReaper5: so i should specify in my parse that i want the local time zone

11:53 ... possibly

11:53 jcromartie: Sonderblade: I have kind of given up on nREPL mode for now… just use clojure-mode and a lein repl most of the time

11:53 along with midje autotest

11:53 ppppaul: jcromartie, why why why?

11:54 DaReaper5: nDuff do you know how do do a parse of "2012-01-21", specifying time zone?

11:54 ppppaul: what is flaky about nrepl Sonderblade

11:54 nDuff: DaReaper5: ...it's only right there in the clj-time README.

11:54 jcromartie: ppppaul: well for one, I can't disable the broken color output from midje autotest.

11:55 ppppaul: oh, i've never used midje

11:55 nDuff: DaReaper5: ...What's the actual business logic? Are your reports _really_ supposed to be operating on UTC, or on local time?

11:55 jcromartie: ppppaul: and the problems with output from other threads that make getting output from Jetty rather a pain

11:55 nDuff: DaReaper5: ie. should something happening at 11:00PM UTC on that day be included in that year's report, or the next one?

11:55 Sonderblade: ppppaul: the longer the nrepl buffer the slower it goes, if you add a dependency you need to restart emacs otherwise nrepl won't see the change

11:55 jcromartie: i.e. in any other context, (println ….) works, but not in a compojure/Jetty handler in nREPL in Emacs

11:56 ppppaul: jcromartie, if logging is an issue you may be interested in https://github.com/hoytech/Log-Defer

11:56 DaReaper5: nDuff: date range is provides for the search, as well as todays date. Those values are used int he sql query and also displayed

11:56 they are displayng wrong

11:56 nDuff: DaReaper5: Wrong -- they're displayed correctly.

11:56 DaReaper5: i have not checked if the data is wrong

11:56 jcromartie: Sonderblade: you can use nrepl-restart to get the (preumably Leiningen) dependency

11:56 nDuff: DaReaper5: ...rather, they're displayed correctly _for local time_

11:56 ppppaul: jcromartie, i used spyscope for debug printing in emacs

11:56 nDuff: DaReaper5: ...so, they accurately reflect (in local time) what your database is including in its search.

11:57 DaReaper5: nDuff then i need to make sure that clj-time is parsing in local time

11:57 nDuff: DaReaper5: Exactly! And the clj-time readme discusses that.

11:58 Sonderblade: jcromartie: yes but that leaves the old jvm running so after a few restarts i still need to kill all dangling jvms and restart emacs

11:58 jcromartie: Sonderblade: dang, didn't notice that

11:58 that's pretty bad

11:58 what about nrepl-quit first?

11:58 Sonderblade: this is on windows

11:59 nDuff: DaReaper5: (clj-time.local/to-local-date-time "2012-01-01")

12:00 Sonderblade: haven't tried it yet, but at this point i'd rather have something more mature than nREPL

12:00 DaReaper5: nDuff yupp testing that now

12:01 i did not realize before that clj-time.local/to-local-date-time could be used to parse a string

12:01 thanks again nDuff

12:02 i think my report is near ready for production now

12:02 tgoossens: I'm preparing a talk on "why clojure was created". How would you respond to the question: "Isn't programming in clojure a step backwards towards procedural programming ?"

12:02 *scratch towards :p

12:04 nDuff: tgoossens: My first attempt might be something like this: "Programming in Clojure is _less_ procedural than most other languages; the use of lazy, functional idioms lets you focus on your data, not on operations done to it. [Examples here]"

12:05 ystael: tgoossens: The dogma of object orientation is a misguided dream which pulls us relentlessly away from simple expressions of computation, and by chaining operations to objects, imprisons us forever in the shackles of mutable state.

12:05 jcromartie: seems like defprotocol and deftype result in a lot less code than multimethods

12:05 ystael: </purple>

12:06 borkdude: another thing that comes up often: why does clojure promote programming with naked/basic datastructures instead of your own datatypes? if this works better, why aren't people passing hashmaps instead of objects in java?

12:07 jcromartie: borkdude: obviously because that doesn't always work better

12:07 ystael: borkdude: Alan Perlis had a good aphorism about this: "It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures."

12:08 tgoossens: who is alan perlis?

12:08 borkdude: tgoossens you have this quote in your presentation ;)

12:08 tgoossens: borkdude: i know. And i like the quote. But i"m trying to find out more about the guy himself

12:09 and why it would be legitimate to put it into my talk :)

12:09 borkdude: jcromartie can you name an example where it doesn't fit?

12:09 ppppaul: Sonderblade, i don't add dependencies much. i clear the buffer when it gets slow. i don't see how these are really big issues. i'm interested in knowing about your workarounds or solutions.

12:09 tgoossens: borkdude: java is a statically typed language. Maybe that is one part of the puzzle

12:10 bbloom: tgoossens: surely the wikipedia article is a good starting point for that question :-)

12:10 jcromartie: tgoossens: the fact is that in Clojure you have the *option* of usng the great datastructure-oriented facilities (map/reduce/filter, the seq abstraction, destructuring, etc.)

12:10 tgoossens: bbloom: obiously, but maybe you know some anekdotes ;)

12:11 jcromartie: tgoossens: OR using things like powerful ad-hoc inheritance (multimethods) or hiding the data structure entirely (deftype)

12:11 tgoossens: (i'm going to play the role of the guy who asked the question)

12:11 * nDuff wouldn't have thought of some of those as questions that would even come up -- too much time in a world where everyone knows / is accustomed to Python, Ruby, &c.

12:12 tgoossens: But i want to encapsulate irrelevant information, maps don't allow me to do that

12:12 jcromartie: oops

12:12 that was borkdude

12:12 tgoossens: encapsulate for who? whose sake?

12:12 i.e. if you hide it or don't, who cares?

12:13 and if you do care, then use deftype

12:14 tgoossens: "doesn't that pollute my interface? And what if i want to change the underlying representation. Without getters i cannot do that" (i'm still playing the role of the questioner)

12:14 Sonderblade: ppppaul: for me, 2 screenfuls is enough to cause nrepl to lag alot

12:14 borkdude: (doc deftype) ;;=>

12:14 clojurebot: "([name [& fields] & opts+specs]); Alpha - subject to change (deftype name [fields*] options* specs*) Currently there are no options. Each spec consists of a protocol or interface name followed by zero or more method bodies: protocol-or-interface-or-Object (methodName [args*] body)* Dynamically generates compiled bytecode for class with the given name, in a package with the same name as the current namespace, the give

12:14 jcromartie: :) got it

12:14 borkdude: (deftype name [fields*] options* specs*)

12:14 Currently there are no options.

12:14 lol

12:14 ppppaul: Sonderblade, what platform?

12:15 Sonderblade, i can handle 10-30 before i need to clear the buffer

12:15 nDuff: tgoossens: "The conventional approach in Clojure is to provide functions that operate on your data -- the role is very much akin to that of getters in Java"

12:15 borkdude: tgoossens you are playing devil's advocate, which is good, because I get the same questions from colleagues who frown upon clojure because it's not OO

12:16 tgoossens: "Because making maps is like making my fields public. And then what if I choose a wrong representation. Then everyone who is dependent on my structure will not be compatible anymore"

12:16 borkude : i'm actually asking questions that people ask me as well yes

12:16 borkdude: tgoossens what if you expose a getter that was wrong

12:16 nDuff: tgoossens: "If someone is dependent on your structure, instead of dependent on your function interface, either you or they are Doing It Wrong"

12:16 Sonderblade: ppppaul: windows 8

12:17 nDuff: tgoossens: "If you want to describe your maps as 'private', use namespaced keys; this expresses that they're implementation details, able to be changed, and that others shouldn't rely on them directly"

12:17 tgoossens: borkude: what do you mean with wrong is this situation?

12:17 borkdude: nDuff I don't get it. If I use Ring, I expect a request map to have certain things, for example?

12:17 tgoossens subject to change wrong

12:17 nDuff: tgoossens: "This works well in the Python world, where no private variables exist, but it's an understood social contract that members and methods starting with underscores aren't available for public access"

12:17 borkdude: Sure -- in that case, they're part of the public interface.

12:18 ppppaul: i'm on ubuntu with a custom kernel... emacs on windows may be less preformant

12:18 nDuff: borkdude: If someone wants to have members that _aren't_ part of the public interface, but hidden behind a layer of abstraction, that's available (by convention) as well.

12:18 tgoossens: borkdude: i could introduce a new getter that does the right thing. And everyone using my old getter will still be able to

12:18 ppppaul: i've never used windows to develop, cept with eclipse and MS stuff

12:18 nDuff: s/your maps/members of your maps/

12:19 tbaldridge: tgoossens: I would also say that this sort of thing happens less often in Clojure.

12:19 borkdude: tgoossens the same would be the case in clojure: you would have to provide the old key-value for backward compatibiltiy?

12:19 tgoossens: nduff: "with function interface. Do you mean like the public interface of a class?"

12:20 modulus: Hi there. So is there a canonical way to make a websocket client on clojure?

12:20 tbaldridge: in OOP it's super easy to get a class hierarchy wrong, with data, it happens less often, and when it does, it's normally just a renaming of a few keys, or the data in a assoc-in vector

12:20 borkdude: I like the analogy of webservices though: if big systems are supposed to talk to each other via immutable basic data, why not apply this on a smaller scale as well

12:21 tgoossens: tbaldridge: "Can't i solve this by composition instead of inheritance in an OOP language?"

12:21 nDuff: tgoossens: "It's very much a similar concept -- also, like Java interfaces, a set of functions isn't tightly coupled to a specific object type, so protocols or multimethods can be used to provide different implementations to be used with different types of data"

12:23 pbostrom: modulus: personally, I just use direct js interop, you could also consider putting a wrapper around the js interface, there's only a few functions, I don't think there is a canonical websocket library at the moment

12:23 ppppaul: multimethods can come in very handy

12:24 i've only used them in-place of if/switch statements

12:24 tgoossens: nDuff: "but how can a map ensure robust software if you don't obligate a certain interface like a java interface? If you have really large maps, does't this become a problem?"

12:24 jcromartie: ppppaul: I'm using them in my data layer

12:24 ppppaul: e.g. a repository is just a map with a :db :collection and :validator

12:25 and the repository operations dispatch on the collection name

12:25 modulus: pbostrom: javascript interop? not sure i get this. i want to run clojure on jvm and use it as ws client. is it possible to use javascript from there?

12:25 ppppaul: tgoossens, i've done work with xml-seq where my maps were so big they would crash emacs.... but so long as i didn't print them out operations on them were fast.

12:25 pbostrom: modulus: sorry, I misread, ignore what I said

12:26 tbaldridge: tgoossens: that's what tests are for. If you have proper tests, you can change the map representation, and then run tests to make sure it works.

12:26 tgoossens: pppaul: its not the performance now. I'm wondering whether it is still do-able because maps don't obligate a certain form??

12:26 lazybot: tgoossens: Definitely not.

12:26 borkdude: ppppaul you might want to (set! *print-level* …) and/or *print-length*

12:26 tbaldridge: lazybot: what are you talking about?

12:26 lazybot: It's AWWWW RIGHT!

12:27 ppppaul: borkdude, i would reduce the map to something small before printing.... printing out an xml-seq isn't so useful anyway

12:27 tgoossens: "In java for a person i would make an IPerson interface. And there can be different representations of it. How is that not good? (for robustness, extendabillity)"

12:28 mpenet: ambrosebs: is `untyped-ann` something you plan to add in the near future? (I have no idea how difficult it is to implement)

12:30 tbaldridge: tgoossens: IPerson is fine, but the problem is when you get to more complex interfaces. Think for instance of IBachelor...

12:30 ambrosebs: mpenet: It seems like an important feature. It should probably be added before 0.2.0

12:30 nDuff: tgoossens: "If you're providing a function interface as the only supported and documented means of access, and using namespaced keys to explicitly declare map contents private, you _are_ obligating its use -- any reasonable code review of a component which uses someone else's namespaced keys contrary to documentation will reject it out-of-hand"

12:30 tbaldridge: IBachelor should have "putBeerInFridge", and perhaps "goFindADate"...

12:30 mpenet: ambrosebs: great

12:31 tgoossens: nduff: "so what you are saying is, that the representation of the map here doesn't matter. The functions you use just have to be able to use it?"

12:31 tbaldridge: So in this type system, what is a monk (doesn't find dates) or a Mormon (doesn't drink beer)?

12:31 With data you don't have to worry about that, based on certain criteria you can modify the data at will. You're free to mix and match, and compose operations.

12:32 tgoossens: have you seen the talk "simple vs easy" by Rich?

12:32 borkdude: tbaldridge NotImplementedException :P

12:32 tgoossens: tbaldrige: yes. i've seen them all (remember i'm still kinda impersonating/acting + putting in my own uncertainties)

12:33 pbostrom: modulus: I think Jetty has a websocket client

12:33 tbaldridge: well in that case I'll give you the completely arrogant answer: it sounds like it's a problem, until you try it and realize it's not.

12:33 tgoossens: hehe

12:33 belak: Are there any good IRC bots written in Clojure? Or, what would be a good project to start with?

12:34 modulus: hmm, i thought jetty was a webserver

12:34 tgoossens: now a real question of my own

12:34 why did we invent syntax anyway then (if it is really that great) ?

12:34 tbaldridge: just like dynamic typing. People say "I'll never know if my program works", but spend 4 months in the language and you'll say "what was I thinking this is awesome".

12:34 modulus: belak: a good proejct would be a websocket client library ;-)

12:34 tgoossens: Why are we where we are now

12:34 kursion2: Jetty is a middlewar

12:34 belak: modulus: sorry, I meant a good project t start learning with

12:35 borkdude: Don't know this, but doesn't Pedestal support websocket things maybe?

12:35 belak: *to

12:35 modulus: pedestal? hmm, will check.

12:36 tbaldridge: Pedestal supports SSE (server sent events). They are only one direction (server->client) but they are better than long-polling. Web sockets are not yet implemented.

12:37 danielglauser: tbaldridge: What's the best way to find out how SSEs work?

12:37 tgoossens: ok thanks guys for the discussion :)

12:37 pbostrom: modulus: http://download.eclipse.org/jetty/stable-7/apidocs/org/eclipse/jetty/websocket/WebSocketClient.html

12:37 borkdude: tgoossens syntax because if familiarity (infix math instead of prefix, etc) I think

12:38 modulus: pbostrom: thanks, i was hoping not to have to go to java, but i guess that's life.

12:38 tbaldridge: danielglauser: the implementation is only about 145 lines of Clojure: https://github.com/pedestal/pedestal/blob/master/service/src/io/pedestal/service/http/sse.clj

12:39 The idea is that you keep the socket open, then send event: eventid \n data: <data> \n\n so each message is separated via a CRLF.

12:40 that's all there is to it, the rest of that file is magic to keep the socket from closing, and to allow any thread to send data

12:41 pbostrom: modulus: yeah, I hear you, in my limited experience using websockets for a hobby project, the web ecosystem in general has been slow to adopt, see for example ngnix only added support for websockets a month ago

12:41 mpenet: Long Polling has an advantage still, it passes proxies and other weird server configs out there. No that I like it better, I do not.

12:41 tbaldridge: https://github.com/pedestal/samples/blob/master/server-sent-events/src/server_sent_events/service.clj this file shows an example that sends a message from a random thread, printing the thread-id

12:41 that's the nice thing about SSE, it is long polling

12:42 modulus: pbostrom: unfortunately i need ws because the API that i need to use from the server uses it ... otherwise i'd probably try something else

12:42 mpenet: ah, it seemed to me it was based on response streaming

12:42 tbaldridge: eh....you're right. my bad

12:42 mpenet: :)

12:43 tbaldridge: it's long response time, so I suppose the proxy could cut off the connection because it sees there's little data being sent.

12:43 I hate proxies/firewalls that think they know better about your connection than you.

12:43 mpenet: long polling costs more in resources (constant restart of hanging request), that's one downside

12:44 ppppaul: tgoossens, syntax is a layer over the AST... it is useful, but has many limitations and people who use lisp usually don't like these limitations.

12:44 mpenet: but it's supported by pretty much everything, always good to have a fallback on this

12:48 tbaldridge: not only long response time, but also some config will just drop anything past the first chunk for instance

12:51 biomunky: hi all, i've cloned the cascalog project from github. When i start the tutorial i get a classnotfound exception for hadoop.fs.FileSystem (i have followed the instructions in the README) - anyone got a suggestions for fixing this

12:53 ambrosebs: mpenet: I've created an issue FWIW http://dev.clojure.org/jira/browse/CTYP-25

12:54 mpenet: thanks!

12:55 ambrosebs: just a thought, "instead of tc-ignore" does that mean it will go away? I think both can be usefull

12:56 ambrosebs: mpenet: tc-ignore will be staying for a few more versions yet.

12:56 mpenet: ok

13:05 duncanm: hello all

13:14 danneu: Is there a better way to specify that a symbol represents a collection of one? (def word "apple"); (intersection (set [word]) #{"apple" "chair" "house"})

13:17 bbloom: like a collection wrapped apple?

13:17 i like: wrapple :-)

13:21 danneu: after typing that out i realize it's saying exactly what i want it to.

13:21 ie this is a coll of strings, not a coll of chars.

13:25 gaverhae: Hi all. I'm blocked by something that should be trivial : what's the easiest way to set *assert* to false using leiningen ?

13:26 borkdude: gaverhae what is assert for?

13:27 gaverhae my guess (set! *assert* false)

13:27 gaverhae: *assert* is the global var that controls pre- and post-conditions during compilation

13:28 borkdude: pre- and postconditions are checked at compile time?

13:28 gaverhae: So I basically need a way to ask leiningen to execute (set! *assert* false) before compilation, in the compilation thread

13:28 *assert* is checked at compile time to enable/disable pre/post conditions

13:28 borkdude: gaverhae you can put this in your :init settings in profiles.clj

13:29 gaverhae: Thanks !

13:29 borkdude: gaverhae or in some other profile, project specific

13:29 gaverhae: Is it possible to get that via the commandline instead of putting it into project.clj, so it can be more selective ?

13:30 ppppaul: anyone here have experience using jclouds?

13:30 hiredman: yeah, it hurt

13:30 borkdude: gaverhae I don't know, try in #leiningen

13:35 hyPiRion: gaverhae: humm, that should be doable, let me check it out

13:35 duncanm: danneu: i thought you can use a set as an IFn

13:36 hmm, maybe i don't understand, nevermind

13:43 ebaxt: Is there a url-rewrite middleware for ring? Something like rack-rewrite maybe?

13:47 Suppose I can use a servlet filter http://tuckey.org/urlrewrite/

13:49 hyPiRion: ebaxt: well, there's the wrap-base-url in hiccup-middleware, you may want to look a bit on that one

13:50 ebaxt: hyPiRion: Thx, I'll have a look

13:50 hyPiRion: It's not what you want, but making a rewriter out of it should be rather simple (assuming it's not very large)

13:50 not exactly *

14:02 grebus: anyone know if there's the equivalent of memfn for field access in clojurescript? I can't find it

14:02 dnolen: grebus: doesn't exist

14:04 grebus: dnolen: oh, thanks. looks easy to write, is there some gotcha I should look out for if implementing it myself, such that it didn't make it to clojurescript core?

14:05 dnolen: grebus: does memfn work for fields & methods? I never use it.

14:07 amalloy: dnolen: it should work for fields in jvm-clojure, but in cljs it has to generate .-member instead so it won't work

14:08 grebus: dnolen, amalloy: yeah, memfn doesn't seem to work for fields

14:08 dnolen: amalloy: yeah that's why I asked, so grebus - I don't see how it could work.

14:08 grebus: oh hmm

14:08 grebus: dnolen: #(.-bla %) is the equivalent, right?

14:09 n_b: ,(doc memfn)

14:09 clojurebot: "([name & args]); Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn. name may be type-hinted with the method receiver's type in order to avoid reflective calls."

14:09 Glenjamin: is there a way to get leiningen to tell me which checkout dependencies it's using?

14:09 TimMc: ,((memfn indexOf s f) "memfn" "m" 1)

14:09 clojurebot: 2

14:09 technomancy: Glenjamin: `ls checkouts`

14:10 Glenjamin: the app is acting like it's not using it :S

14:10 technomancy: Glenjamin: you could try `lein checkouts`

14:10 err

14:10 `lein classpath`

14:11 borkdude: technomancy ls checkouts? I've never seen a checkout directory in a lein project

14:11 Glenjamin: bingo, that's handy

14:11 thanks technomancy

14:11 borkdude: ah wait, checkout dependencies

14:16 arrdem: is there a way to make fnparse not die if there are remaining tokens?

14:17 Raynes: Decide to maintain it and take over project ownership.

14:17 dnolen: grebus: yes

14:17 duncanm: hey, dnolen

14:17 hyPiRion: Raynes: That's the correct way to do it.

14:17 dnolen: duncanm: hullo

14:17 duncanm: dnolen: did you see that some guy on fonc found the paper alan mentioned before? the one about control structures

14:19 dnolen: duncanm: hep, downloaded :)

14:19 s/hep/yep

14:19 duncanm: yeah, me too

14:19 dnolen: are you working on clojurescript much these days?

14:22 dnolen: duncanm: yes

14:22 duncanm: dnolen: i've been trying out typescript, but i have a question that also concerns clojurescript -

14:22 dnolen: duncanm: what's up?

14:23 duncanm: dnolen: with all these APIs defined in CPS style, i find it really hard to start working from the REPL

14:23 dnolen: duncanm: JS apis?

14:23 duncanm: yeah

14:23 dnolen: duncanm: right, Clojure people are coming w/ various solutions for that

14:24 duncanm: oh, i'm interested in finding out what ideas they have

14:24 dnolen: also, i was writing a little server that deals with git repos, so i was using the fs module

14:24 dnolen: duncanm: lots of stuff to look at, FRP, Javelin, Chris Grangers's stuff, Kevin Lynagh's stuff etc

14:25 duncanm: dnolen: i actually don't know how it fits together, but i was looking for some way to do fluid variables, so that i can bind process.cwd() within some scope

14:25 dnolen: duncanm: are you doing node stuff?

14:25 duncanm: dnolen: yeah

14:25 dnolen: so far, i've used a lot of async.js (with typescript)

14:25 dnolen: duncanm: yeah, there's a lot less CLJS activity there though Bodil is forging ahead

14:26 duncanm: dnolen: and there were these ideas i have (from working with lisps in the past), and i realized the clojurescript people are the only ones who'd know what i'm talking about

14:27 things like fluid variables, or using the REPL to incrementally build things up -- the JS people don't really know these habits/techniques

14:28 i'm a bit rusty with clojure/cljs, but would with-open work correctly if the body is a bunch of async calls?

14:28 malyn: duncanm: Bodil's Red Lobster looks pretty great for working with Node.js-style async APIs -- https://github.com/bodil/redlobster

14:29 duncanm: malyn: ahh, indeed

14:30 neat

14:30 dnolen: thanks for the referecnes

14:30 dnolen: i'm interested in rxjs too, which is kinda in the same space

14:30 dnolen: duncanm: np, take a look around people are working on fun stuff these days

14:31 tomoj: hmm are cells not places?

14:31 dnolen: duncanm: CLJS is still rough around the edges but we're making progress

14:31 duncanm: dnolen: typescript is quite interesting, and they're about to make a big release in a few weeks

14:33 dnolen: duncanm: I find it theoretically interesting but it doesn't really solve any of the problems I actually have JS (types are really low on my own list of important things)

14:33 duncanm: dnolen: i've been using it to learn the APIs, for that it's pretty handy

14:35 dnolen: duncanm: makes sense, is TypeScript able to infer types for all of the Node.js API or something?

14:35 or do they ship w/ that

14:35 ?

14:35 duncanm: dnolen: they have these foo.d.js files which include 'typings'

14:35 clojurebot: No entiendo

14:36 duncanm: dnolen: and they're adding more to the type system, so soon you can write something like this

14:36 dnolen: duncanm: yeah, so do they ships w/ types for Node.js, I've Underscore.js & jQuery (though the types are so broad it doesn't seem that helpful)

14:36 duncanm: interface Document {

14:36 createElement(tagName: string): HTMLElement;

14:36 dnolen: I've seen types for Underscore.js & jQuery I mean

14:36 duncanm: createElement(tagName: 'canvas'): HTMLCanvasElement; }

14:36 which is kinda neat

14:36 dnolen: yeah, there are github repos where people collect these typings

14:36 dnolen: the types will get tighter once they put in generics

14:37 http://blogs.msdn.com/b/typescript/archive/2013/03/25/working-on-typescript-0-9-generics-overload-on-constants-and-compiler-performance.aspx

14:37 dnolen: duncanm: ah nice - one can hope Typed Clojure can do something like that for people who want that when they need it.

14:37 duncanm: dnolen: right

14:37 dnolen: cljs might(?!?) be able to get there via typed clojure

14:37 anyhow

14:38 dnolen: duncanm: yes, ClojureScript is probably simpler to type than CLJS even given lack of subtyping around protocols but Ambrose probably has more to say about that.

14:39 CLJS simple than CLJ I mean of course.

14:42 duncanm: still, TypeScript is really interesting, I've been trying to keep up w/ it and Dart as well.

14:50 duncanm: that said the fact people are writing 100KLOC codebases w/ TypeScript doesn't bode well for the semantics of the language IMHO :P sounds like they're bringing worst practices to JS runtimes.

14:50 tbaldridge: dnolen: but it's typed, that means you can hire any dev off the street and he can't produce bad code!

14:50 :-P

14:51 I said it before TypedScript came out, and I'll say it again. MS hates dynamic languages. That's all the thought process that went into TypedScript, imo.

14:51 duncanm: dnolen: yeah, i haven't had time to look into dart

14:52 tbaldridge: but what about VS and IDispatch? ;-P

14:52 eek, i mean, VB

14:52 TimMc: ,((memfn get [x y]) {[1 2] 42} [1 2 3 4]) ;; hyPiRion, a new abomination for you

14:52 clojurebot: 42

14:52 dnolen: duncanm: TypeScript & Dart both feel like lighter weight Javas to me. So it's hard for me muster much excitement beyond compiler / type nerdery.

14:52 TimMc: Or maybe that's an old one.

14:53 hyPiRion: ,(doc memfn)

14:53 clojurebot: "([name & args]); Expands into code that creates a fn that expects to be passed an object and any args and calls the named instance method on the object passing the args. Use when you want to treat a Java method as a first-class fn. name may be type-hinted with the method receiver's type in order to avoid reflective calls."

14:53 duncanm: dnolen: how do you feel about programming in javascript?

14:54 hyPiRion: ,(macroexpand-1 '(memfn hello [x y]))

14:54 clojurebot: (clojure.core/fn [target190 [x y]] (. target190 (hello [x y])))

14:54 dnolen: tbaldridge: btw, your LLVM talk was rocking!

14:54 duncanm: dnolen: i've been trying to learn JS, and embrace it - and i find TS to offer some nice additions, while not deviating too much from JS

14:54 i haven't done any serious JS programming before this

14:54 hyPiRion: TimMc: Well, that's a new one for me, at least.

14:54 I knew about the funny things you could do with memoize though

14:55 dnolen: tbaldridge: basically covered the same ground as an EDSL in Haskell talk I saw at TechMesh, but a bit more impressive IMO

14:55 ivan: TodoMVC needs a time slider

14:55 hyPiRion: ,(let [mem-conj (memoize conj)] [(mem-conj '(1) 2) (mem-conj [1] 2)])

14:55 clojurebot: [(2 1) (2 1)]

14:55 dnolen: duncanm: been doing for 7 years, it's fine I don't hate it or love it.

14:55 TimMc: hyPiRion: Oh yeah, that's a "good" one for sure.

14:55 duncanm: dnolen: ah

14:56 TimMc: hyPiRion: Good times arguing about what, exactly, is broken there.

14:56 hyPiRion: yeah

14:57 tbaldridge: dnolen: thanks! I had a blast giving the talk.

14:57 konr_6: in which library is '-?>>'?

14:57 Bronsa: core.incubator

14:57 ivan: core.equality

14:57 Bronsa: wat

14:57 konr_6: thanks!

14:57 ivan: I was making a joke about an earlier thing ;)

14:57 Bronsa: oh, ok

14:59 hyPiRion: Ahh, I was sad when I saw that Clojure + LLVM was presented at Clojure/West. I soo wanted to watch that one.

15:02 mikerod: It seems to me that `defmethod` does not ensure that the the `fn-tail` argument given to it has the correct number of arguments. The correct number being the number of arguments of the dispatch function defined with `defmulti`. Is this a correct observation?

15:03 avishai: hi

15:03 amalloy: mikerod: the dispatch function can take any number of arguments, so it would not be possible to ensure what you're talking about

15:04 avishai: i need a little help with require

15:04 amalloy: (defmulti counter [& args] (count args)) (defmethod counter 0 [] "called with nothing!") (defmethod counter 1 [x] "called with one arg")

15:04 avishai: when i use the repl i can 'require my clj file

15:05 but when running a clojure file it doesn't work

15:07 mikerod: amalloy: So in the case of variadic args on the defmulti I see your point. However, It seems to me, from your example, I could have (defmethod counter 10 [x y] "I can't be called")

15:08 It would take 10 args for the dispatch fn to match, but when this method is dispatched upon, it will throw an arity exception.

15:12 amalloy: mikerod: sure, and when you've solved the halting problem you can start work on analyzing every dispatch function to see what kinds of fntails are valid

15:12 but until then, there's not really much we can do

15:14 grebus: I can't get the clojurescript browser-repl to recognize my macros, is that normal?

15:15 mikerod: amalloy: I understand it is probably difficult. I was just verifying that I understood that the number of arguments must match in this sort of scenario. I appreciate the insight!

15:15 amalloy: yep, they have to match, and the compiler can't check it for you

15:28 dnolen: grebus: you need to make sure they are loaded by eval'ing the ns form

15:36 grebus: dnolen: thanks, I tried that, in line with your advice at http://stackoverflow.com/questions/12337509/how-can-macros-be-evaluated-using-the-clojurescript-repl, but when I try evaluating the ns form from the browser repl I get "Could not locate <namespace with macros>.__init.class or <namespace with macros>.clj on classpath" … I'm using clojurescript-mode in emacs, if that's of any significance.

15:53 TimMc: This Pedestal thing... is it going to fulfil my lifelong dream of having a single-page app that can generate its HTML either on the client or on the server, and either as a whole page or in as-needed fragments?

15:54 avishai: is there a macro that returns a lazy sequence of nested function calls? like (x f(x) f(f(x) ...)

15:54 hyPiRion: avishai: reductions

15:54 avishai: 10

15:54 10x

15:54 TimMc: avishai: repeatedly, and it's a fn

15:54 hyPiRion: no wait, iterate

15:54 TimMc: Oh, no, iterate

15:54 hyPiRion: ,(take 10 (iterate inc 1))

15:54 clojurebot: (1 2 3 4 5 ...)

15:54 TimMc: convergence!

15:54 avishai: cool

15:55 hyPiRion: ,(take 10 (reductions + (range)))

15:55 clojurebot: (0 1 3 6 10 ...)

15:56 dyreshark: ,(take 4 (range))

15:56 clojurebot: (0 1 2 3)

15:56 TimMc: ,(reductions (fn [_ r] r) (iterate inc 0))

15:56 clojurebot: (0 1 2 3 4 ...)

15:58 hyPiRion: TimMc: well, that is also one way to write (map identity ...)

16:02 TimMc: ,(reductions (comp peek vector) (iterate inc 0))

16:02 clojurebot: (0 1 2 3 4 ...)

16:02 hyPiRion: ,(binding [*print-length* 10] (pr (reductions #(- %2 %1) (reductions + (range)))))

16:02 clojurebot: (0 1 2 4 6 9 12 16 20 25 ...)

16:10 TimMc: That's a neat sequence.

16:10 tomoj: &(let [q clojure.lang.PersistentQueue/EMPTY] (identical? q (pop q)))

16:10 lazybot: ⇒ true

16:10 tomoj: &(pop [])

16:10 lazybot: java.lang.IllegalStateException: Can't pop empty vector

16:10 bbloom: tomoj: i was just grumbling about that yesterday :-P

16:11 tomoj: which one? :)

16:12 bbloom: i guess an exception is reasonable sometimes? i dunno. i hate exceptions :-P

16:12 but i really just want (pop vector ::not-found)

16:12 well not really

16:12 i guess that's peek

16:13 and i guess peek does return nil

16:13 tomoj: (first nil ::not-found) ? O_o

16:13 bbloom: no, it's last

16:13 tomoj: yeah, I mean for seqs

16:13 bbloom: but i want vectors

16:13 last is linear time

16:13 pop is constant time last for vectors

16:14 enquora: yogthos: is clj-pdf a straight-up port of cl-pdf?

16:14 tomoj: well, sure, (peek nil ::not-found) for vectors - by analogy, then, (first nil ::not-found) for seqs?

16:14 bbloom: oh, yeah maybe

16:14 but there is 'or

16:14 which isn't quite the same

16:15 (or (first s) ::not-found) will be incorrect on '(nil)

16:15 and substitute ::not-found with ::empty

16:15 tomoj: I guess you can do (if (seq coll) (peek coll) ::not-found)

16:16 which is particularly idiomatic for seqs/first

16:16 bbloom: yeah, i tend to do that sort of thing somewhat regularly

16:16 tomoj: whereas for ILookup that doesn't work, nor nthnext, so they both get not-found args

16:17 er

16:17 hmm why did I think nthnext had a not-found

16:18 oh it's nth

16:19 yogthos: enquora: I haven't actually heard of cl-pdf :)

16:19 enquora: guess it isn't then

16:19 TimMc: ,(nth [] 0 :nope)

16:19 clojurebot: :nope

16:19 yogthos: enquora: it's a wrapper around iText inspired by hiccup syntax

16:19 enquora: and, I see a reference to itext

16:19 :-)

16:19 :-( that should be

16:20 yogthos: I needed to make reports at work and after looking at the options decided to roll my own :P

16:20 enquora: http://www.fractalconcept.com/asp/cl-pdf

16:20 yogthos: itext is kind of painful on its own :)

16:20 bbloom: tomoj: TimMc: yeah, i think i want a not-found for first and peek :-)

16:20 enquora: we need to generate pdfs from the same codebase on server, in browser and iOS

16:21 was hoping to find a clojurescript pdf library

16:21 cl-pdf isnt'it

16:21 bosie: is there a quicker way than doing #(not (nil? %))

16:21 yogthos: enquora: I did make this :) http://instantpdf.herokuapp.com/

16:21 enquora: https://github.com/yogthos/instant-pdf

16:21 it's a rest service that accepts json and returns a pdf back

16:21 enquora: nice

16:21 yogthos: so you could call it from js pretty easily :)

16:22 it wraps the clj-pdf inside

16:22 enquora: with no http? ;-)

16:22 by browser, I mean offline

16:22 yogthos: ahh

16:22 yeah won't be much good without network connection :)

16:22 enquora: scientific/engineering reports with very dense layouts

16:22 yogthos: sounds like fun :)

16:22 enquora: back to working with raw pdf primitives

16:23 yogthos: shiver

16:23 enquora: not so bad in lisp :-)

16:23 yogthos: true true :)

16:23 tieTYT2: i've been told new clojure devs go overboard with macros and protocols. What about with ->?

16:23 enquora: it isn't working with the pdf primitives that's the problem

16:23 it's generating tables using css like layout directives, crossing pages

16:23 yogthos: tieTYT2: -> is very handy

16:24 tieTYT2: yogthos: yeah it seems pretty cool

16:24 bosie: a not-nil? built-in that is

16:24 yogthos: enquora: yeah these things get tricky fast

16:25 tieTYT2: basically it flattens out your nested expressions and helps readability a lot in my opinion

16:25 enquora: haven't started yet, but it seems to me we can create a PDF-analogous data structure in clojure, and reify it when we're done

16:25 tieTYT2: ok then i'll start incorporating it

16:25 what about ->>? That one seemed like it required more thought to me

16:25 papachan: hi

16:25 technomancy: does anyone override the :base profile in Leiningen (or even know how that works to begin with)?

16:25 yogthos: tieTYT2: its just whether you want your argument to be first or last

16:26 tieTYT2: oh so it is

16:26 i didn't notice that

16:26 papachan: if i compile my script in clojure into Jar. i can add it to my android project, or any java project?

16:27 yogthos: papachan: you can add them to java projects, but you have to expose a Java compatible api using gen-class

16:27 tieTYT2: so (-> arg form) is the same as (->> arg form) as long as form has only one argument?

16:27 yogthos: papachan: good tutorial here http://kotka.de/blog/2010/02/gen-class_how_it_works_and_how_to_use_it.html

16:28 tieTYT2: yup

16:28 papachan: yogthos: thank you. i take a look a this so

16:29 tieTYT2: k

16:31 Rich_Morin_: Looking at http://dev.clojure.org/display/community/Project+Ideas, I don't see a way to add entries. Help?

16:32 hyPiRion: Rich_Morin_: " If you don't have Confluence access please submit your idea, following this template to the clojure mailing list with the subject prefix [GSoC Idea]."

16:32 tieTYT2: what a cool page

16:32 hyPiRion: I would try to register on dev.clojure.org first and check out if I could edit the entry.

16:33 Rich_Morin_: That's the funny thing; it has me logged in.

16:33 hyPiRion: Rich_Morin_: Have you signed the CA?

16:34 Rich_Morin_: I filled in and mailed a Clojure CA to RH months ago.

16:35 and I seem to be listed on http://clojure.org/contributing

16:35 Owell, I'll just use email.

16:35 hyPiRion: Rich_Morin_: yeah, saw you there. Ask on the clojure-dev mailing list for Confluence access

16:36 tieTYT2: yogthos: can you think of any other things like -> that I should know to write more idiomatic code?

16:36 amalloy: tieTYT2: for-comprehensions. the more experienced i get, the more of them i use

16:36 tieTYT2: amalloy: is that related to haskell list comprehensions?

16:37 amalloy: meh

16:38 tieTYT2: this? http://clojuredocs.org/clojure_core/clojure.core/for

16:39 amalloy: yes

16:39 tieTYT2: ok

16:39 thanks

16:43 arrdem: gah... is clojure-doc making any attempt to provide clojuredocs' namespace-pathed URLs?

16:47 aand that's a no.

16:52 hugod: I'm trying to get titanium to connect to cassandra, and keep getting "NoAvailableHostsException: [host=None(, latency=0(0), attempts=0] No hosts to borrow from com.netflix.astyanax.connectionpool.impl.RoundRobinExecuteWithFailover.<init>" - I've no idea what's wrong...

16:54 nickmbailey: looks like astyanax is trying to connect to, try setting your rpc_address to an actual ip instead of

16:55 but i've never set up titan or used titanium fwiw

16:57 hugod: oh, in the cassandra config? I'll give that a go

16:58 akhudek: I'm trying to write a deftype that extends ISeq but end up getting AbstractMethodError clojure.lang.RT.seqFrom

16:58 Not sure what I'm doing wrong, have first, next, and more implemented correctly.

17:02 squidz: I just read about being able to program C/C++ and compile to javascript with very good speeds using llvm bitcode with firefoxs asm.js. It made me wonder how hard it would be to convert clojure to llvm bitcode and what kind of advantages that might have.

17:03 akhudek: squidz: very hard, though I think the clojurepy guys are trying it so that they can target native code and python better

17:05 squidz: so they would first go from bitcode then to python? I dont really know anything about bitcode so forgive my ignorance

17:05 yogthos: tieTYT2: this is worth looking at https://github.com/bbatsov/clojure-style-guide

17:05 akhudek: squidz: I'm not that clear on the details. If you are interested, take a look at their mailing list.

17:06 yogthos: tieTYT2: and yeah for macro is very handy

17:06 dobladez: anybody here attended Stuart Sierra's session at ClojureWest? (title "Clojure in the Large" ) ?

17:07 squidz: akhudek: if you could easily go from llvm bitcode to other languages that would be pretty useful. Not just for compiling to javascript

17:07 dobladez: I got good ideas from it, but I'm still looking for ways to organize module dependencies better... I guess I missed something

17:08 akhudek: squidz: yes, it would, though it's a big undertaking

17:08 * nDuff signs up for Lambda Jam

17:09 nDuff: ...most of the schedule still up in the air, but it looks like they have some good keynotes lined up.

17:10 (Also, an excuse to escape Austin in early July will be welcome).

17:10 dobladez: I liked the idea of having a System object, and manage components' lifecycle from there. However, I don't see myself passing the system object (or subcomponents) around as arguments all over the place

17:12 hugod: nickmbailey: thanks - that seems to have got me further

17:18 amalloy: hah, i just found ([] {}) in my code. it's like a whirlwind tour of clojure's syntax

17:20 stuartsierra: dobladez: You don't have to pass the system object everywhere.

17:20 AimHere: The main trouble with clojure's syntax is that it doesn't use angle brackets enough

17:20 dobladez: stuartsierra: do you know of any opensource project to draw ideas from?

17:21 amalloy: &(let [<> {}] (<> {} []))

17:21 lazybot: ⇒ []

17:21 stuartsierra: dobladez: not totally. You can see some of these ideas at work in Pedestal.

17:22 akhudek: Hm, so looking at clojure.lang.RT it seems that simply implementing ISeq isn't enough?

17:22 dobladez: stuartsierra: Thanks. For the example of supporting multiple DB impls... at System creation time I instantiate my DB impl, and then I currently "set-db!" into a var on a 'db' namespace

17:22 TimMc: AimHere: Let me introduce you to the swiss arrows project...

17:23 stuartsierra: dobladez: That works.

17:23 dobladez: then, the db namespace is my db api that the rest of the app uses, "hiding" the actual impl. Otherwise, all application code somehow needs to obtain a reference to the db impl instance

17:24 stuartsierra: Yes, I prefer to do that via arguments or closing over the necessary values when I create the system.

17:24 But sometimes tooling (e.g. Servlets) makes that harder.

17:25 dobladez: I'll continue experimenting... and pushing the idea of using arguments a bit further

17:25 thanks again

17:25 stuartsierra: You're welcome.

17:26 avishai: hi

17:26 i'm going through the euler exersices

17:26 asteve: euler RULES!

17:26 pl6306: I interacting with an existing swing app from clojure. Basically I call a load method which loads something in swing async. In java I would wait for a property to added to a swing control before continuing. How best should achieve this clojure?

17:27 avishai: and while doing number 4 i get java.lang.StackOverflowError

17:27 pl6306: In java I would do thread.sleep while polling for a property

17:27 Is there an idiomatic way to do this in clojure?

17:28 avishai: took the brute force approach

17:28 technomancy: pl6306: deref a promise

17:29 avishai: but why stackoverflow?

17:29 grebus: still having lots of trouble with macros in a bREPL… I'm eval'ing the ns form with its :use-macro's and such from the bREPL, but I'm throwing a java.io.FileNotFoundException to the effect that the clj files defining the macros aren't on the classpath. They were on the classpath enough to compile the cljs… what other classpath should they be on?

17:30 dobladez: pl6306: may be look at promises and futures

17:31 amalloy: akhudek: yes, pieces of clojure.lang assume that any IPersistentCollection also implements the related j.u.collections interfaces, even though the clojure.lang interfaces don't actually extend them

17:32 akhudek: amalloy: I just figured it out, I needed to also implement seq on the seqable class and declare it as Sequential

17:33 https://www.refheap.com/paste/2b5587dcaea9b72fa0954d015

17:34 amalloy: akhudek: why do you even have a protocol for this?

17:34 dobladez: pl6306: also, in case you haven't seen it: https://github.com/daveray/seesaw. Looks really good

17:36 anthonyu: what is the syntax i should use so that this macro (https://gist.github.com/anthonyu/636b13b5d13f4520711d) could handle an arbitrary number of columns?

17:36 akhudek: amalloy: you mean why not use bit-set built in?

17:36 amalloy: no, i mean why does next-bit exist as a protocol?

17:36 akhudek: amalloy: oh, probably because of a poor design on my part

17:36 amalloy: just implement first/next/more and use your bitsetseq like an ordinary seq

17:37 akhudek: oh, I see, yes, I can just implement it all in BitSet

17:40 pl6306: I saw seesaw however this an app that has already been built by another team. I sort of get the promise concept however where do I call thread.sleep while waiting for the UI to finish loading?

17:40 In the function that will populate the promise?

17:40 technomancy: pl6306: if you deref the promise it will block until the promise is delivered

17:40 no sleeping required

17:40 dobladez: pl6306: the idea of use a promise is to avoid sleeping

17:41 pl6306: I need something to poll the UI thread to see if the work is done

17:41 how can I block until something like a label is loaded?

17:41 nDuff: pl6306: Do you want to _poll_, or do you want to _block_?

17:42 pl6306: If you want to _block_, just use deref.

17:42 pl6306: Both I want to block execute until (polling) the UI has finished loading

17:42 dobladez: so, one thread blocks on a promise, then the thread doing the work delivers the promise

17:42 nDuff: ...

17:42 *sigh*.

17:42 pl6306: I know

17:42 nDuff: pl6306: Why do you want to block by polling?

17:42 pl6306: Why don't you let deref handle the blocking for you?

17:43 pl6306: That way there's no polling involved -- just a notification when the promise is delivered.

17:43 dobladez: gotta go

17:43 pl6306: I get the part of deref blocking on a promise.

17:59 anthonyu: how does one pass arbitrary arguments and a body to a macro?

18:00 jeremyheiler: anthonyu: Pass in the arguments in a collection? Pass in the body in a (do ...)?

18:01 nDuff: anthonyu: typically, the same [... & args] approach used for normal variadic functions

18:02 technomancy: anthonyu: you can do something like this: (eval (apply #'clojure.core/defn () {} 'myfn []))

18:02 but it's really not a good idea

18:03 anthonyu: ok, which part is the bad idea? the '(eval (apply' or the rest?

18:03 technomancy: (sorry, assuming you don't control the macro that is)

18:03 if you control the macro just take & args

18:04 tomoj: anthonyu: why?

18:05 anthonyu: tomoj: i am making a macro that creates a test table with an arbitrary number of columns, then runs the body, then drops the table

18:06 here is the gist: https://gist.github.com/anthonyu/636b13b5d13f4520711d

18:06 that one works, but only with exactly two columns

18:09 thm_prover: are clojure futures guaranteed to execute? for example, I have a bunch of code (mostly gui update code), that I want to be certain that will be executed asap in an async fashion

18:10 my current idea is to throw them to an agent, but I'd prefer to not have agents around

18:10 so can I just stick them in futures, and will they edecute, even if I never deref the future?

18:10 jeremyheiler: anthonyu: I would just pass in the cols as a vector.

18:10 arrdem: yes, futures will be evaluated eventually with or without derefs.

18:10 thm_prover: arrdem: how soon is "eventually" ?

18:11 arrdem: thm_prover: depends on how many futures exist at once...

18:11 tomoj: anthonyu: that won't work

18:11 you need some way to tell where the cols stop and the body starts

18:11 anthonyu: i see

18:12 tomoj: perhaps (with-test-table [table cols & body]), and cols is a vector of cols?

18:12 arrdem: thm_prover: it's async, but futures are executed from an eager worker queue so more or less as hardare threads become available.

18:12 anthonyu: tomoj: thanks, that worked

18:13 rdfi: is anyone using ClojureCLR?

18:14 thm_prover: arrdem: do agents or futures have higher priority, or are they the same worker queue?

18:15 jeremyheiler: thm_prover: Are you using Swing? If so, I'd be careful using multiple threads.

18:15 bosie: could someone please tell me how i have to rewrite (defn run ...) so i dont need to flatten so very often? https://www.refheap.com/paste/01f1e9fbddc589cdb322f8145

18:15 technomancy: rdfi: very few

18:15 thm_prover: jeremyheiler: I'm using SWT. I'm using (. display asyncExec ... ) so I'm safe for those updates. However, I do have updates taht involve calculations before talking tot eh SWT thread.

18:15 jeremyheiler: thm_prover: Cool

18:19 rdfi: technomancy: do you know if it is still being actively developed?

18:20 technomancy: rdfi: I vaguely believe so

18:20 doesn't strike me as particularly practical though

18:28 chessguy: is there some obvious way to get a quick frequency count of all the items in a vector? i can imagine several ways to write it, i'm just wondering if there's support for it in clojure.core

18:29 technomancy: chessguy: freq<TAB>?

18:30 nDuff: ,(doc frequencies)

18:30 clojurebot: "([coll]); Returns a map from distinct items in coll to the number of times they appear."

18:31 nDuff: chessguy: find-doc is your friend.

18:32 chessguy: wow, i didn't think it would actually be called that

18:32 nlew: The worst part of writing clojure is the constant nagging feeling that there's a more concise core function to do what you need

18:34 technomancy: nlew: read through core.clj a couple times; it should help =)

18:35 nlew: technomancy: It's mostly the functions that *aren't* in core that are the worst. "There must be something, right? Right?" and then I scour the web. :)

18:35 To no avail!

18:35 technomancy: yeah, and in that case findfn won't help you =)

18:36 chessguy: or if you don't think of a good name for what you're looking for until you ask for it, and then you look like a moron...

18:36 Raynes: technomancy: Technically findfn works for any namespaces, it's just that we can't put all namespaces ever made on the classpath for it. :p

18:36 And the more you add the slower it is and it is already pretty slow.

18:36 technomancy: Raynes: right; search time constraints

18:36 nlew: Raynes: It still can't find functions that don't exist though. :P

18:37 Raynes: This is true.

18:37 technomancy: it would be cool to write a findfn that could accept an arbitrary :dependencies set loaded up via pomegranate

18:37 chessguy: wow. core.clj is nearly 7k lines...

18:37 i'll be in my bunk...

18:38 technomancy: heh

18:39 bosie: how would i recursively compute a list of lists without having to flatten lists?

18:40 hiredman: for, or more generally mapcat

18:41 bosie: hiredman: hm

18:42 hyPiRion: Raynes: http://www.youtube.com/watch?v=5Q9x16uIsKA#t=1156s <- That for Clojure would be a nice replacement for $findfn

18:42 I can put it up as an issue for lazybot for you

18:42 bosie: hiredman: https://www.refheap.com/paste/01f1e9fbddc589cdb322f8145 line 33 gets a list (p) and runs map on it. in the map i call the method again

18:42 hiredman: i tried mapcat there but that didn't work

18:43 hiredman: bosie: that is pretty gross

18:44 bosie: hiredman: i know

18:44 hiredman: so stop doing it gross

18:44 bosie: would love to, hence i ask

18:45 sturner: Is there a way to recompile java source files after specifying :java-source-paths ["src/java"] via the repl?

18:45 hiredman: https://github.com/hiredman/datalog/blob/master/src/datalog/core.clj uses concat and for to return the results of a depth first search as a list

18:46 bosie: hiredman: search-with-rules?

18:47 hiredman: no, all of it, the structure

18:47 tieTYT2: what's the point of defining using a let at the top level?

18:47 err

18:47 what's the point of using a let at the top level

18:48 bosie: hiredman: i dont follow

18:48 hiredman: everything returns a list(lazy sequence), and you concatenate results together

18:48 bosie: hiredman: most functions i see are not recursive there though?

18:49 tieTYT2: this is from a library Raynes wrote: http://pastebin.com/xssDhumH

18:49 i don't understand why he put the let on the outside there

18:49 nDuff: ...

18:49 tieTYT2: instead of nested under the defn

18:49 nDuff: you quote Raynes' code, but you don't use Raynes' pastebin to do it?

18:49 Raynes: Hahaha

18:49 It's fine, it's fine.

18:49 tieTYT2: he has a pastebin?

18:50 nDuff: tieTYT2: refheap.com

18:50 arrdem: refheap.com

18:50 hyPiRion: ~refheap

18:50 clojurebot: refheap is gist

18:50 amalloy: (inc clojurebot)

18:50 lazybot: ⇒ 20

18:50 wink: it's not called a pastebin, that's the flaw

18:50 nDuff: tieTYT2: ...which, unlike pastebin.com, isn't a hive of annoying animated ads.

18:50 tieTYT2: k i'll use that in the future

18:50 hiredman: bosie: search is called at the top of the stack, and most things called by search also call search

18:50 Raynes: tieTYT2: Really though, no worries.

18:50 tieTYT2: https://www.refheap.com/paste/3f500be5d06f34745a39e332c

18:50 arrdem: the downside is that Raynes reads pastes and will mock you in channel if you post something horific...

18:51 nDuff: tieTYT2: ...so, what that's doing is closing over the let

18:51 amalloy: clojurebot: nDuff is <reply> Please don't use pastebin.com: there are lots of annoying animated ads

18:51 clojurebot: Roger.

18:51 nDuff: Heh.

18:51 * drewc runs a paste bin site, but it has to do mostly with lisp so not relevant :P

18:51 Glenjamin: is there an advantage of having the let outside like that?

18:51 Raynes: tieTYT2: I could have put the let in the inside, but if you look I'm using 'homedir' in two places. Furthermore, "user.home" never changes. If I put the let on the inside then I'm doing unnecessary (albeit trivial) computation every time.

18:51 tieTYT2: what does closing over the let mean?

18:51 Glenjamin: oh right, for both variants of the function

18:51 nDuff: tieTYT2: Inheriting its value from an outer context, roughly.

18:52 bosie: hiredman: ok, looking at psearch then

18:52 chessguy: tieTYT2: i feel like there was just a discussion about that issue on the clojure mailing list the other day. did you see that?

18:52 tieTYT2: chessguy: nope

18:52 chessguy: let me see if i can dig it up

18:52 hiredman: bosie: psearch calls search, search calls other things, other things call search, etc

18:52 Raynes: tieTYT2: Putting the let on the outside means that those two pieces of code are only evaluated once ever, whereas if I put them on the inside they would be recalculated on every single call to this function.

18:53 Glenjamin: isn't that the sort of thing the JIT should be worrying about?

18:53 nDuff: Glenjamin: ...no?

18:53 Glenjamin: although i suppose they're not pure

18:53 so that doesn't hold

18:53 nDuff: *nod*.

18:53 hyPiRion: Glenjamin: That's more of a compiler issue. It has no knowledge whether the function is pure or not. If it were pure, then perhaps

18:53 chessguy: tieTYT2: https://groups.google.com/d/msg/clojure/tTCZuzmz_6M/Ke7iKcDxpZQJ

18:54 tieTYT2: chessguy: thanks

18:54 Raynes: won't it only be computed once because it either uses the 0 param or the 1 param option, but not both?

18:55 Glenjamin: tieTYT2: subsequent calls

18:55 tieTYT2: oh

18:55 Glenjamin: [(home) (home)]

18:56 Raynes: tieTYT2: I'm not really sure what you mean. The let is on the outside, so those things are evaluated first when Clojure reads and evaluates this code. Next, the function is created and it closes over those values, so that when you call the function again those values are reused and not recalculated.

18:56 tieTYT2: now as an api user (client) all I see is the home function, right? This doesn't change anything about how I call it

18:56 Raynes: No.

18:56 It's the same.

18:56 tieTYT2: i see, cool

18:56 ok i think i get it

18:59 Glenjamin: it does mean if you add a user, you'd have to restart the app :p

18:59 tieTYT2: weird thing, I was actually thinking about writing a library just like this last night

19:00 bosie: hiredman: honestly, thats hard to penetrate for me

19:00 chessguy: hm. i feel like reading core.clj just leaves me with more questions

19:00 technomancy: chessguy: most of the answers are "because the necessary macro hasn't been defined yet" I bet

19:01 it's not idiomatic code at all

19:01 chessguy: technomancy: oh, it doesn't define its macros?

19:01 technomancy: it does, but later down in the file

19:01 chessguy: like (def list (. clojure.lang.PersistentList creator)), i can't find a definition for creator

19:01 technomancy: oh, well . is a macro that's hard-coded into the compiler

19:02 so creator doesn't have to resolve

19:02 chessguy: oh, i mis-read it. never mind

19:02 hiredman: bosie: you can think of it as avoiding flatten because the responsibility for ensuring a particular result is wrapped in whatever the correct number of lists (0 to whatever) belongs to whoever adds the item to the result

19:03 chessguy: i thought it was (.clojure.lang.PersistentList creator)

19:04 hiredman: if function F recursively calls itself, and F returns a flat list, if I append {} to the result of calling F, the result will never have {} wrapped in an extra list

19:05 bosie: hiredman: thats my problem actually

19:05 hiredman: F returns a list of lists because of the map

19:06 hiredman: which is fine, cos the end result is a list of lists

19:06 hiredman: bosie: you need to get serious about your base cases, make sure they all result in a flat list, because if you mapcat a function over a list of flat lists, unless that function produces nested lists, you will get flat lists

19:07 bosie: hiredman: the recursion stops and returns [[1] [2] [3]]. i can't return a flat list

19:08 hiredman: bosie: yeah, but you can call that a X and a list of X's is your flat list

19:08 Glenjamin: hrm, why does the #record[a b] form only allow fully qualified names?

19:09 bosie: hiredman: ok

19:09 hiredman: so is [[1] [2] [3]] a result or a collection of results?

19:09 bosie: hiredman: thats one result

19:10 hiredman: so it needs to be returned as [[[1] [2] [3]]] or (list [[1] [2] [3]])

19:10 bosie: hiredman: the end result (i.e. what run should return) should be [[[1] [2] [3]] [[5] [6]]]

19:10 hiredman: so your functions should always return results at a consistent level of nesting

19:10 bosie: hm

19:11 hiredman: if the final result is a collection of results, and intermediate results should be too

19:11 bosie: gotcha

19:15 geraldo: 1st time in a clojure pub. good night ppl

19:28 shriphani: hi everyone. I see a bunch of csv libs around. Is there anything you recommend? Anything to do an append (I only see 'read' and 'write' and would rather not fseek myself.

19:28 Glenjamin: arohner: yo, did you get a chance to look over the pull request for bond?

19:28 arohner: Glenjamin, not yet, sorry

19:29 Glenjamin: no worries

19:33 Raynes: To whoever pasted https://www.refheap.com/paste/12977 if present in this room: there is a sql language option.

19:34 Also, wee almost 13k pastes.

19:35 Glenjamin: hrm

19:35 it's non-obvious how to get a new paste when viewing a paste

19:35 to me, at least

19:35 i guessed "click the name of the site"

19:36 bosie: hiredman: dude. you were right

19:37 hiredman: thanks a lot. i never would have thought about the same nestedness of the function

19:37 hiredman: s/function/return value

19:57 arrdem: is there some way that I can find out what namespace a generated function resides in?

19:58 so if I have an error that I can localize to the invocation of "$fn_375" can I figure out which fn that is?

19:59 technomancy: for unknown reasons the compiler does not attach metadata to anonymous functions

19:59 amalloy: arrdem: $fn_375 isn't a function name that i can imagine the compiler ever generating

19:59 seanms: I have a question about nrepl about its classpath

20:00 I am trying to figure out how nrepl determines the path, I'm trying to modify an internal build tool to be able to use nrepl w/o lein

20:00 arrdem: amalloy: I'm looking at a stacktrace here which shows an invocation of fn_375 it seems in algo.monads

20:01 amalloy: so paste a stacktrace

20:01 seanms: I found a stackoverflow question stating that nrepl uses lein for classpath resolution, but havent been able to find the connection between the two

20:01 technomancy: seanms: nrepl doesn't determine the classpath at all

20:02 seanms: and setting the java classpath does not seem to have an effect

20:03 arrdem: https://www.refheap.com/paste/12981

20:03 technomancy: seanms: that's almost certainly not right; the classpath you provide to the java command should be the only thing that matters unless you're instantiating dynamic classloaders.

20:04 arrdem: https://github.com/clojure/algo.monads/blob/master/src/main/clojure/clojure/algo/monads.clj#L578 it seems

20:04 seanms: technomancy: thanks, I'll look into it further

20:07 Sgeo: Are there nice Spring MVC guides for people used to sane languages?

20:07 My job is going to involve Spring MVC :/

20:07 Although it's not as bad as I feared

20:08 I think

20:12 amalloy: arrdem: my point was that you can't figure anything out from "$fn__375", but "clojure.algo.monads$state_t$m_bind_state_t__373$fn__374$fn__375" tells you everything you need to know

20:13 arrdem: amalloy: ok thanks then.

20:14 I think I'm going to be able to show that this is either a bug in fnparse or monads but we shall see...

20:17 bloody...

20:17 brehaut: arrdem: its much more likely to be in fnparse than contrib.monads, unless you are using monad transformers

20:17 arrdem: well not sure what it is but I found a fix...

20:18 amalloy: brehaut: his link was to state-t, so...

20:20 brehaut: fwiw then, i ran into some trouble writing generic lifted accessors that worked nicely with both (state-t maybe-m) and (state-t seq-m)

20:21 but the basic state and maybe/list operations worked correctly

20:21 arrdem: here yall go

20:21 https://www.refheap.com/paste/12982

20:22 it comes down to user error... if a fnparse matcher yields non-nil it is assumed to be a success state and treated as a monad.

20:23 I had code in the tail position which didn't return nil..

20:23 so it was trying to treat junk values as a monad and bad things were happening.

20:23 hiredman: fnparse :(

20:23 supersym: sigh ... chrome, what a project :S

20:23 brehaut: hiredman: what particularly about it?

20:23 arrdem: I haven't had real issues with fnparse yet.. but that was a friggin waste of an hour.

20:24 hiredman: brehaut: is there an up to date fork?

20:24 brehaut: hiredman: factual seem to have taken over

20:24 https://github.com/factual/fnparse/

20:25 hiredman: that is kind of neat

20:25 arrdem: my only complaint about the factual fork is that they didn't do the docs too

20:25 brehaut: arrdem: but the docs have always been a bit rubbish, so thats not really a loss

20:25 arrdem: truth.

20:25 hiredman: anyone, the guy kept rewriting it and changing it

20:25 arrdem: but good docs still.

20:25 hiredman: who knows if want I have remotely matches whatever factual's fork is based on

20:26 brehaut: hiredman: it looks like they are sticking with approximately whatever the 2.x series was

20:26 arrdem: brehaut: doing good APIs is hard... and a skill I haven't learned yet.

20:26 hiredman: yeah, I think mine is pre 2.x

20:26 arrdem: yeah the last api Choi documented is almost exactly correct

20:27 there's one thing but I don't remember what it is.

20:27 hiredman: I'll just run that part of clojurebot on clojrue 1.2.1 forever

20:28 brehaut: lol

20:29 arrdem: w00t my parsers no longer explode!

20:29 brehaut: haha i love that the fnparse docs still list java -cp… as the right way to get fnparse into your project

20:29 hiredman: oh, wait, 2.2.4 maybe I can update some time

20:29 brehaut: and by love i mean :'(

20:30 arrdem: hiredman: if I could figure out your codebase updating it shouldn't be too bad..

20:30 brehaut: ~arrows

20:30 clojurebot: arrows is http://ro-che.info/ccc/12.html

20:31 hiredman: http://1.bp.blogspot.com/-3sd5vm2YSoA/T8LXHbyyVjI/AAAAAAAABQo/PttNNJhp__8/s1600/Arrowed.JPG

20:31 brehaut: PANASIAN CUISINE

20:53 chessguy: hm. this doesn't work? (defn foo [c] (new c 0 0))

20:58 brehaut: chessguy: new is a special form. its first argument is not evaluated

20:58 lsoa: chessguy: shouldn't that be a macro

20:59 brehaut: chessguy: if you want to runtime instantiation of unknown classes, you probably want to look at .newInstance on the Class class

21:00 or perhaps some reflection

21:00 chessguy: fair enough

21:00 thanks

21:11 jcromartie: is defstruct dead?

21:11 pretty much right

21:13 arrdem: I think so...

21:13 there just isn't a compelling reason for it. either use a raw map or define protocols and a type.

21:13 amalloy: if not, ask someone to hand you a hammer and a stake

21:14 arrdem: ~hammer

21:14 clojurebot: Pardon?

21:14 arrdem: ~stake

21:14 clojurebot: I don't understand.

21:14 amalloy: he's very polite about it though

21:14 arrdem: this much is true.

21:19 gfredericks: apparently rich doesn't like removing things

21:19 (like defstruct)

21:20 TimMc: or taking things out of alpha

21:20 gfredericks: haha

21:21 TimMc: ,(binding [*print-length* 25] (pr (for [[s v] (ns-publics 'clojure.core) :let [d (:doc (meta v))] :when (and d (re-find #"(?i)alpha" d))] s)))

21:21 clojurebot: (add-watch promise pop! deliver assoc! defrecord remove-watch conj! transient ex-info dissoc! deftype persistent! *print-readably* *compiler-options* ex-data disj!)

21:22 gfredericks: woah man

21:22 promises are pretty old

21:22 TimMc: *print-readably* is spurious ("alphanumeric")

21:23 and transients, and defrecord...

21:23 "transients: may be transient"

21:24 thm_prover: http://hpaste.org/84699 <-- why does "good" work yet 'bad" ends up not working? it gives me an error of "nable to resolve symbol: ocr-4638 in this context, compiling:(main.clj:112:3) class clojure.lang.Compiler$CompilerException"

21:25 jeremyheiler: thm_prover: What is match?

21:25 thm_prover: clojure.core.match

21:28 thoradam: Hello everyone, I just started with Clojure, writing it feels fun but alien, looking for comments, is this fairly idiomatic? https://www.refheap.com/paste/12984

21:30 arrdem: thoradam: well it isn't correct.. shouldn't your base case be (not (zero? depth))

21:30 ,(not (zero? 1))

21:30 clojurebot: true

21:30 arrdem: ,(not (zero? 0))

21:30 clojurebot: false

21:30 dnolen: thm_prover: hrm, it maybe the case that you can't match classes with core.match. I know there's no test case for something like that.

21:31 thm_prover: dnolen: I bet you can't patch this in < 5 minutes. </reverse-psychology>

21:31 dnolen: as a hack, should I do a match on (string (type 20)) and match vs "java.lang.Long" ?

21:31 dnolen: thm_prover: that should probably work

21:32 arrdem: thoradam: other that that, this looks fine.

21:32 one could use (inc n) and (dec n) rather than +1 and -1...

21:33 not sure if using the set #{\( \)} and contains? is "better" than your (or)

21:33 thoradam: arrdem: Hmm, you mean as opposed to (neg? depth), it seems to work. Thanks for the inc dec tip.

21:34 tieTYT2: i need to write a function that checks if a string contains a bunch of substrings in it. I'd like to write something that's like (not-any? (contains s "x") (contains s "y"))... is there a convenient way to write this?

21:39 thm_prover: dnolen: actually, on second thought

21:39 dnolen: could you help me patch match ? I'd like to learn more about pattern matching

21:39 dnolen: and you seem to be afmiliar with the codebase

21:39 dnolen: thm_prover: well I wrote most of it

21:40 thm_prover: dnolen: looks like I win the IRC lottery for today

21:41 arrdem: Ok my turn. Now that I've resolved my fnparse issues, what do you guys think of this?

21:41 https://github.com/arrdem/sad

21:42 I'm especially concerned about the way I'm structuring the rule name stack in runtime.stack

21:44 thm_prover: dnolen: is the problem with "LiteralPattern" in match.clj ?

21:50 TimMc: Someone posed this question at work: Is there a *nice* way of getting the map constructor from a defrecord's class object?

21:51 (An example of not nice: demunging the fully qualified classname into namespace and record name.)

21:52 leifp: tieTYT2, (not-any? #(.contains s %) ["x" "y" ...])

21:52 amalloy: TimMc: i don't think so. i'm leaning towards the opinion that it might be impossible to have such a feature, but i'm not sure about that

21:52 TimMc: There doesn't even seem to be a good way of getting the order of the fields, which would make the positional constructor useable.

21:53 amalloy: How so? There could be a static field with the ns-qualified symbol.

21:53 amalloy: i suppose that's true. i was imagining only bad ways to do it

21:54 that has some problems, though, still: an old version of a redefined defrecord would still seem to have a valid constructor function, but it would construct a different class

21:54 TimMc: That's true anyhow.

21:55 Getting the constructor for the original classloader... I have no idea how difficult that might be.

22:00 dnolen: thm_prover: that's possible

22:02 akhudek: is there another interface other than Counted for implementing a faster but not constant time count operation?

22:03 dnolen: akhudek: don't think so

22:05 akhudek: hm, that's too bad

22:07 dnolen: akhudek: probably not a big deal to implement it anyway, people call count on seqs.

22:07 chessguy: what's considered idiomatic about sync/dosync and alter? should they always be used in the same function? or is it ok for a function to open a transaction and somehow pass in a function which does the alter?

22:08 akhudek: dnolen: was just worried that it might break the complexity of some standard algorithms

22:08 though I guess it will be faster than iterated count!

22:20 supersym: thats enough learning clojure for one night, it can be overwhelming to say the least

22:20 gfredericks: (inc clojure)

22:20 lazybot: ⇒ 10

22:21 thm_prover: dnolen: sorry, I got disconnected, if ou said anything about match, can you please repeat it?

22:21 chessguy: supersym: i feel your pain. i've been drinking from a fire hose for the last week or two trying to learn it

22:22 supersym: anyone who can recommend a good resource on actually the process of crafting nested functions? I've never been fullbread functional programmer before

22:22 yeah... I get along nicely with lists, but it feels like I'm years behind

22:23 gfredericks: supersym: by "nested functions" do you mean just generally working with higher-order-functions?

22:23 chessguy: i'm fortunate in that i spent a few years dabbling in haskell

22:23 supersym: yeah

22:23 heh... yeah I have xmonad running now so I can learn a bit there as well

22:23 but I already made peace with the fact that this is gonna be a tough cookie the next year :)

22:23 chessguy: i've always wanted to play with xmonad, but never managed to get it running

22:24 supersym: ooh, i can make a recommendation

22:24 hang on, let me find it

22:24 the sicp videos: http://groups.csail.mit.edu/mac/classes/6.001/abelson-sussman-lectures/

22:24 they're scheme-based, but still largely appropriate for clojure

22:26 amalloy: i prefer the book to the lectures, personally, but both are good; use whichever one suits your preference

22:27 chessguy: agreed, both are good. i tend to learn more from watching videos

22:28 supersym: sweet - thanks

22:28 i've been trying to mix lispels a bit already to get a better learning effect :)

22:29 chessguy: hm. be careful with that, it sounds like it could get confusing fast

22:31 supersym: perhaps yes, its not like I am going really deep in emacs at the moment, or scheme - but you are probably right with the details of how the languages are implemented

22:31 amalloy: lispels?

22:31 gfredericks: surely it is the plural of lisp

22:31 supersym: :D

22:32 amalloy: i dunno, i would say a lispel is a list: the fundamental construct that makes up a lisp, in the same was a pixel makes up a pixture

22:32 gfredericks: a lispel is a single paren

22:34 danielglauser: gfredericks: please balance that paren

22:35 brehaut:

22:35 gfredericks: I shall not.

22:36 brehaut: that one balances nicely by itself

22:36 gfredericks: "lispel": a left paren; "lisple": a right paren

22:36 supersym: ahhh.. i got it

22:37 silly me i forgot all about closures ><

22:38 amalloy: don't feel bad. for a long time, so did emacs

22:38 chessguy: haha

22:38 supersym: well i dont know the plural of lisp, lisps I'd say but I'm a n00b... in our language it resembles speaking in a hardly understandable fashion

22:39 chessguy: i'd say lisps too

22:39 supersym: so I figured my attempts are like stuttering

22:39 yup

22:40 I work in LT fulltime tho when chrome works

22:40 I got overtone's emacs-live running

22:40 but teh insta-repl is such a great feedback/learning tool

22:41 chessguy: Light Table is nice. i've been using it a lot, too. i can't help but feel like i'm not quite using it right, though

22:41 like i know Chris has said he pretty much works on Light Table purely within Light Table now, and I can't imagine using LT for anything big the way I use it

22:44 amalloy: chessguy: ibdknox could probably do it with just a pencil

22:44 chessguy: haha, true

22:44 that guy's ridiculous

22:44 bbloom: pencil? psha. i code in pen.

22:44 but only b/c sharpies are expensive when you write as much code as i do

22:45 (disclaimer: i make a ton of mistakes and write and rewrite about a billion times. pencil isn't even remotely malleable enough to handle the number of errors i make. please ignore everything i say)

22:46 shriphani: hello does anyone have experience with incanter ? I am trying to use time-series-plot and I get this: No matching method found: add for class org.jfree.data.xy.XYSeries and I don't invoke add anywhere….

22:48 bbloom: shriphani: use (pst) to print a stack trace & look for your code in the stack

22:51 supersym: down the rabbit hole

22:53 I physically feel nausea sometimes ... endless possibilities. And looong ago since I had actually had to do some hard work/math

22:54 chessguy: yeah with Chris, I bet he has tweaked tons of fun parts of the IDE...from what I've seen with that game they were developing

22:54 I assume you could create extra windows, buttons and what not if you know what to call

22:55 but since there isnt much documentation,... I haven't snooped around much and don't know enough about reflection to poke around

22:56 but i also feel something as infinitly flexible as clojure, you can do with notepad even in a great and fun way once you master the language

23:06 danielglauser: supersym: I'm far from a master but I find the tools *really* help

23:48 supersym: (assoc [2 4 5] 6 7)

23:51 hyPiRion: Uh.

23:51 "Caused by: java.lang.ClassFormatError: Invalid method Code length 69270" <- ?

23:53 Is that some sort of upper limit for Clojure?

23:54 amalloy: hyPiRion: yes. you have a macro expanding to a very large single function, or are AOTing a very large data structure

23:54 xeqi: hyPiRion: https://groups.google.com/forum/?fromgroups=#!topic/clojure/tlAxjnJE1pA

23:55 hyPiRion: meh

23:55 Oh well.

23:57 It's not aot'd though, but oh well.

23:58 ivan: I think it is time to picket Oracle to raise the method size limit

23:59 hyPiRion: Well, it's just... a very long backquote, that's all

Logging service provided by n01se.net