#clojure log - Apr 21 2012

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

0:34 yoklov: emezeske, you ever see things like "ERROR: JSC_PARSE_ERROR. Parse error. missing }" after running lein cljsbuild auto for a while? It goes away if i stop and do lein cljsbuild clean, auto

0:34 it's referring to the compiled cljs.core file

0:36 and the error seems to be coming from within gclosure. no idea.

0:36 emezeske: yoklov: Never seen that before.

0:37 yoklov: lol, weird

0:38 https://refheap.com/paste/2274

0:38 it claims to succeed compiling

0:38 but it is lying

0:39 emezeske: Makes very little sense to me.

0:39 yoklov: me neither

0:39 i feel like I'm the only one who gets these sorts of errors

0:40 emezeske: I feel like that too :)

0:40 But that doesn't make any sense

0:40 yoklov: i also have to do lein cljsbuild clean very often to make it actually do anything

0:41 especially (or maybe only, now that I think about it) after it something like this happens

0:41 technomancy: hmmmm... so apparently disabling string mutability in emacs lisp doesn't really break very much code.

0:42 if I can make a compelling case for immutability to the Emacs maintainers, it might be possible to get immutability for strings and certain types of lists in elisp, making it a possible clojure compilation target

0:43 I'm having a hard time explaining the benefit just because I take it for granted. It's like explaining why it's good to have GC.

0:43 clojurebot: learning a new runtime is much harder than learning a new language.

0:43 technomancy: "Because anything else is horrible, you know?" / "No... I don't." / "Well it is."

0:44 emezeske: yoklov: Yeah, I dunno, I have not experienced that.

0:44 technomancy: and while I would love to just tell people to read the egal paper, I don't think anyone actually will.

0:46 "you have a chance at writing code that you know will function correctly while run concurrently" is another argument, but he could just say "yeah, but message passing"

0:47 emezeske: technomancy: Are there people who still think strings should be mutable?

0:47 technomancy: emezeske: there are people who don't want to introduce breaking changes to a ~30-year-old codebase =)

0:47 emezeske: technomancy: (in a high level language)

0:47 Hahaha

0:47 Yeah, there are those :)

0:50 technomancy: then again, they added lexical scoping

0:52 thinking about pushing the referential transparency angle, but that's more about pure functions than immutable data structures

0:53 emezeske: People really seem to "get" the benefits of referential transparancy, I think

0:55 technomancy: I think I need to re-read the egal paper mining it for persuasive purposes

0:55 but they're tired of me ranting about it in the #emacs channel

0:57 * emezeske adds this "egal paper" to his TOREAD list.

0:59 technomancy: http://home.pipeline.com/~hbaker1/ObjectIdentity.html

0:59 it's fairly accessible

1:07 emezeske: Thanks

1:19 muhoo: i don't get google appengine's weird database thing. it's taken hours to build indexes on an empty database on a brand-new, just-created, just deployed app

1:20 gozala: can someone help me out with some issue I can't figure out

1:20 https://gist.github.com/2431249

1:20 muhoo: well, not empty, it has 6 tables with 1 or 2 entries per table

1:21 gozala: for some reason line 102 does not seems to be called

1:21 muhoo: gozala: because it's not realized? the seq isn't done yet?

1:22 gozala: muhoo: no it's strange

1:22 muhoo: wait, in line 92 you're telling it to realize, then in line 94 you are saying, execute this only if NOT realized

1:22 gozala: if I comment out 103

1:22 muhoo: it'll never execute

1:22 gozala: it works

1:23 so I have a feeling that observers are cleaned up before map calls a function

1:23 wkmanire: Well a long long time ago, in a galaxy far away Naboo was under an attack.

1:24 gozala: muhoo: yeah so you can realize deferred only once

1:24 if it's already realized subsequent calls are ignored

1:25 noidi: gozala, maybe you want to call doseq instead of map?

1:25 gozala: so line 96 does the work and so does 103

1:25 noidi: ok

1:25 noidi: map is lazy, and you never use the result, so it doesn't do anything

1:26 gozala: noidi: aha I see

1:26 but print does I guess

1:26 I mean if I execute same in repl

1:26 it will try to print result and that is why it's executed

1:27 noidi: yes, print will read the values of the seq causing it to be realized

1:28 muhoo: hmm, the old repl-forces-realization-of-lazy-seqs heisenbug, eh?

1:29 i think google appengine is exactly the wrong tool for a simple little webapp with not much data or traffic

1:30 i should have rewritten it from scratch in clojure and couchdb

1:30 * muhoo mutters and wanders off

1:30 wkmanire: muhoo: Rewritten what?

1:31 muhoo: wkmanire: oh this silly python thing i got tasked with customizing

1:31 runs on appengine. bigtable, small data

1:32 wkmanire: muhoo: At least you get to work with python.

1:33 I particularly like it.

1:33 muhoo: yes, that's the good part. python was my favorite language for like 8 years

1:33 wkmanire: It is my favorite imperative language.

1:33 Because of the syntax.

1:33 I like the way javascript works a little more.

1:33 muhoo: have to agree. i rather like c though too, i have to admit.

1:34 but just for drivers or microcontrollers

1:34 wkmanire: But javascript is ugly.

1:35 I don't personally like C. It gives me too much rope.

1:35 muhoo: what, you don't like segfaults?

1:35 wkmanire: Not in particular.

1:36 If the FP language I've jacked with so far I find clojure to be the most understandable... but its too early to have a favorite yet.

1:36 I`ve only honestly done stuff with Elisp and Clojure up until now.

1:36 I failed to learn Haskell once.

1:36 Of the FP languages*

1:36 bleh.

1:36 muhoo: you've been using emacs for a while, IIRC, right?

1:36 wkmanire: My English language is being horrable.

1:36 Yes, I think about 5 years now... so I'm almost not a newb anymore.

1:37 muhoo: emacs is the javascript of lisps

1:37 elisp, sorry

1:38 wkmanire: I actually prototyped some of the address book application I'm working on right now in ELisp the other night.

1:38 muhoo: anyway, i'm done whining. i'm trying to break the habit.

1:38 wkmanire: I'm not sure exactly why I did that, but luckily enough technomancy was there in #emacs to help me out

1:39 muhoo: hehe. i find i understand elisp a lot better now after doing a bit of clojure

1:39 wkmanire: same

1:39 I really want to write a major-mode for VB.Net

1:40 Unfortunately it is my day job language for at least another 6 months.

1:40 Probably more like 1 year.

1:40 And I hate working in visual studio.

1:40 muhoo: i can see why

1:40 wkmanire: But I just don't have the FP skills to get the job done yet.

1:40 seancorfield: wkmanire: don't let ibdknox hear you say that :) he was product manager of it when he worked at microsoft :)

1:40 wkmanire: Hopefully clojure will help me bridge that gap.

1:41 muhoo: that's what i'm doing too

1:41 wkmanire: seancorfield: I knew that :) I'm shameless.

1:41 muhoo: trying to retrain myself to build a shinier world

1:44 seancorfield: I think it's interesting to see how many ppl using Clojure are doing so from a "hobby" perspective, compared to the number of folks doing it for a living. I don't think I've seen that with other languages. I guess Clojure is very tempting to a lot of ppl... but it hasn't gotten mainstream enough to get into many companies...

1:44 wkmanire: seancorfield: Good point. Clojure is approachable in a way that Haskell is not.

1:44 This channel makes a lot of difference too.

1:44 #emacs tends to eat people. I've been eaten there at least twice.

1:45 Clojure also has a very good reputation in some of the other channels such as #python.

1:45 muhoo: wkmanire: omg, you should have seen #debian 10 years ago

1:45 it was like 4chan is now

1:46 wkmanire: muhoo: You know 4chan is not something I was ever a part of.

1:46 muhoo: or some of the rooting-oriented channels (cyanogenmod, android-root, etc)

1:46 wkmanire: IRC is the most social thing I do on the internet.

1:47 muhoo: this is a good group. i'm trying to learn how to fit in with it a bit better.

1:48 like, now i'm going to shut up and go code :-)

1:48 wkmanire: muhoo: In another month I'll be able to field some questions. :) That'll be a good start for me.

1:48 muhoo: You've helped me quite a bit too.

1:48 muhoo: Good luck with your project.

1:49 * wkmanire goes to get a beer while trying to work up the courage try implementing VB.Net mode for the Nth time.

1:51 seancorfield: Mmm, beer sounds good... brb...

1:52 wkmanire: seancorfield: Tastes better than it sounds.

1:52 seancorfield: I have a Shock Top Pumpkin Wheat ale... it tastes really good :)

1:53 wkmanire: seancorfield: Oooh, I like shock top.

1:53 seancorfield: Their regular shock top is a lot like Blue Moon.

1:53 seancorfield: My wife's a big fan of Shock Top - and Blue Moon

1:53 wkmanire: You can even put an orange slice in it for the same effect.

1:53 seancorfield: I like the Pumpkin Wheat better

1:54 wkmanire: I was a new castle drinker for a long time, recently converted to Sam Adams fan.

1:54 But since I've been in Brazil all I've been drinking is this crappy Crystal and Skull.

1:54 "Skull" is pronounced like skoh.

1:55 It makes me want a Coors light.

1:55 seancorfield: Newkie Brown... don't know why folks outside the UK seem to like that so much... I think it's really skanky :(

1:55 wkmanire: Sam Adams is better for sure.

1:56 seancorfield: Some of the Sam Adams brews are OK. Coming from the UK I'm a bit of an ale snob :(

1:56 And living in the SF Bay Area (California) I'm spoiled by all the microbrew pubs...

1:57 wkmanire: Awesome. Microbrews are the best.

1:58 seancorfield: Yeah, it's _almost_ as good as being in the UK :)

1:58 wkmanire: I can't make an argument having never been there.

1:59 seancorfield: So what got you interested in Clojure?

1:59 wkmanire: Ah, an easy question.

1:59 dash from #python.

1:59 He talks (rants) about languages a lot.

1:59 I mentioned trying to learn Haskell to him and he suggested clojure.

2:00 And that idea was gangpiled by a few others.

2:00 So I /join'd my way on over for a spell.

2:00 seancorfield: Interesting... So Pythonistas prefer Clojure to Haskell?

2:01 wkmanire: I think you could mount an argument for that.

2:01 TEttinger: wkmanire, yeah clojure has... much better library support. type system is totally different though, not much comparison possible there

2:01 wkmanire: But I don't know for sur.e

2:01 ibdknox: everyone prefers Clojure to Haskell!

2:01 * ibdknox ducks

2:01 TEttinger: both focus on concurrency, both have good laziness support (clojure has much better non-laziness)

2:01 seancorfield: Python is one of those languages I've always meant to learn but pressures of work have meant it's never made it to the top of my stack... My old boss from macromedia.com went to Linden Labs (Second Life) and if I'd known Python I could have followed her there...

2:02 Or to EventBrite when she moved on to there. Best boss I ever had.

2:02 wkmanire: seancorfield: Its hard to beat Python as far as imperative languages go.

2:02 seancorfield: I feel it's a whole in my education :)

2:03 wkmanire: It's*

2:03 seancorfield: I grew up on C, C++ then Java... Lots of systems programming in the 80's / 90's...

2:03 Hmm, s/whole/hole/ ... that was a weird slip.

2:04 wkmanire: seancorfield: In the 80's I was between 0 and 5. :)

2:04 I started on Qbasic as windows 3.1 was being replaced by windows 95.

2:04 Learned VB 6, then C++ then Java in highschool. Been doing .Net stuff and trying to get out of windows ever since I started my career about 6 years ago.

2:05 seancorfield: Heh... I'm a greybeard :) Graduated university in '83 and spent three years doing PhD research into functional programming language design and implementation :/

2:06 wkmanire: Pretty cool. I've often wondered what it would have been like to go the university route. I'm one of those uneducated self-taughts.

2:06 Did you complete your PhD?

2:06 seancorfield: I've been lucky enough to avoid Windows. I worked at one company where it was the default platform (Windows for Work Groups 3.11) but everywhere else has been primarily *nix

2:07 wkmanire: Windows isn't that bad.

2:07 * wkmanire ducks

2:07 wkmanire: I just like Linux more.

2:07 seancorfield: No, never wrote up my thesis. My supervisor didn't like the direction I was going and refused to support me for a while. Then Prof. Turner (SASL, Miranda) said he liked my work and then they wanted me to write up. Sigh. I went off and got a job writing compilers :)

2:09 But that's why I like Clojure. I've always wanted a functional language to go mainstream. I thought Haskell might do it in the 90's. Boy, was I wrong :(

2:09 wkmanire: There are some pretty strong advocates of Haskell at google

2:10 seancorfield: It's a great language. But my world has been the JVM for 15 years so unless a language runs there and interops well with Java, I can't use it at work. Unless I get a completely different kind of job :)

2:11 wkmanire: seancorfield: Would you use an imperative language to write a serious project?

2:13 seancorfield: Tough question. I have in the past, lots of times. Clojure still doesn't have a mature enough / simple enough solution in the web space to build the sort of web apps I work with from end-to-end... So, right now I'm polyglot...

2:14 ibdknox: seancorfield: what's missing for you?

2:14 seancorfield: At World Singles, we're moving more and more of our back end to Clojure but moving our front end isn't our on roadmap.

2:15 An elegant web templating solution. Nothing I've seen really lights my fire.

2:15 Including my own web framework, FW/1, which I ported from CFML :)

2:15 ibdknox: do you have any thoughts on what such a thing might look like?

2:16 seancorfield: As uncool as it sounds, of all the languages I've used for the web, CFML really is the most pleasant front end language I've used...

2:16 ibdknox: what aspects of it?

2:17 seancorfield: For views / layouts, it's a natural fit with HTML (if you're disciplined). It feels "integrated".

2:17 zii-prime_: Is there a reason that there's no get-and-set! (for atoms)? Like, would it be a bad idea to just grab the AtomicReference and .getAndSet that?

2:17 seancorfield: And these days, the CFML scripting language (not tag-based) is great for web controllers.

2:18 ibdknox: seancorfield: I've been thinking about this stuff for a while but haven't come to a solid conclusion on it yet

2:18 seancorfield: zii-prime_: not swap! ?

2:18 kovasb_: time for some friday night coding

2:18 ibdknox: seancorfield: do you have any particularly cool examples I could learn from?

2:19 wkmanire: seancorfield: From my journeymen's point of view, I've toed the water with a bunch of different technologies for web developement. ASP.Net Forms, .Net MVC, Django in Python, PHP with Smarty templates, PHP with no templates etc... I always get to a point where I feel like there are too many things going on.

2:19 seancorfield: My ideal web environment would have a CFML-like templating markup for views / layouts, a JS-like scripting language for simple web controllers (which is what CFML has), a very simple convention-based MVC framework and then all the heavy lifting in Clojure.

2:19 hiredman: seancorfield: have you played with enlive at all?

2:20 seancorfield: hiredman: yes, my FW/1 port is based on Enlive and Ring.

2:20 and we used Enlive at World Singles for HTML email generation.

2:20 wkmanire: I feel like it is really so simple. I just want the text for the request and I want some helper libraries for forming responses... which are also text.

2:21 seancorfield: wkmanire: yeah, I don't think any tech has really nailed the web template side of the equation

2:21 hiredman: seancorfield: so you like it? prefer CFML (which I know nothing about)?

2:21 seancorfield: I'd like Enlive a lot more if there was more of a templating language embeddable in the HTML, rather than having to write explicit substitutions in code

2:22 Simple conditionals, loops and variable substitutions.

2:22 hiredman: isn't that kind of the exact opposit of enlive?

2:23 zii-prime_: seancorfield: swap! works, but if you're doing something length with the old value - say, here's a bit of my code: (def drawables (atom [])) (defn draw-GL [] (swap! drawables #(do (doseq [f %] (f)) []))) ; the drawables will all be drawn while the lock is held, right? That would delay other threads wanting to add values to drawables.

2:24 hiredman: lock? for an atomic reference?

2:24 zii-prime_: implicit in the swap! ?

2:24 seancorfield: It's a matter of placement of code hiredman - I like some simple controls in the template itself. Easier to read / maintain IMO. Yet still easy for designers to work with.

2:24 charles_r: have you tried noir?

2:25 seancorfield: I've looked at various Noir examples and it feels too... "bitty" for me... with partials and so on...

2:25 charles_r: bitty?

2:25 hiredman: zii-prime_: I would be more concerned with the function being run more than once

2:25 zii-prime_: why not just deref the atom?

2:26 ibdknox: seancorfield: what about mustache then?

2:26 seancorfield: charles_r: bitty, fragmented... it's just not how I like my web applications... :)

2:26 wkmanire: ibdknox: Does mustache have anything to do with the javascript moustache template library?

2:26 hiredman: I found enlive to be a very painful few hours

2:27 zii-prime_: hiredman: like (doseq [f @drawables ] (f)) (aset! drawables []) ? that would drop fns added to drawables

2:27 seancorfield: ibdknox: which moustache?

2:27 ibdknox: wkmanire: mustache is a spec: http://mustache.github.com/

2:27 hiredman: zii-prime_: you're new, yes?

2:27 ibdknox: seancorfield: e.g. stencil in clojure, this: http://mustache.github.com/

2:27 zii-prime_: hiredman: oh um yes... am I doing something wrong?

2:28 hiredman: zii-prime_: yes

2:28 wkmanire: ibdknox: I never realized!

2:29 seancorfield: ibdknox: that links to clostache and based on the examples there, no, that wouldn't suit me either

2:29 it overloads too much syntax to try to cater for all the necessary use cases

2:29 hiredman: but was rather happy with what I ended up with from enlive

2:29 zii-prime_: hiredman: ...what?

2:29 seancorfield: what's wrong with clear, simple 'if', 'loop' constructs?

2:30 hiredman: (but I don't really do web apps)

2:30 seancorfield: so many solutions strive so hard to avoid "logic" in html templates that they make you jump thru hoops to do obvious stuff

2:31 but other solutions go too far the other way and allow arbitrary code in templates which is bad

2:31 hiredman: zii-prime_: there is no such thing as aset!

2:31 wkmanire: seancorfield: I think that comes from overly zealous views of MVC patterns.

2:31 the no logic in templates portion.

2:32 hiredman: zii-prime_: depending on what you are trying to draw you might step back and think of what you are rendering as a report of a recent consistent state of the world, instead of rendering *the* state of the world now

2:32 a reference for that kind of approach might be something like rich's ants demo

2:32 wkmanire: I think there is clear a difference between logically deriving some view from the data context provided to your template and actually implementing core behaviors in your templates.

2:33 seancorfield: ibdknox: fwiw, i also looked at fleet... that's close to what i'd want in a clojure world... hasn't been updated in 6 months tho'...

2:33 https://github.com/Flamefork/fleet

2:33 ibdknox: seancorfield: you want comb

2:33 much, much better

2:34 and beautifully simple

2:35 seancorfield: 'k... link? (to save me googling)

2:35 zii-prime_: hiredman: * shame * I keep forgetting when I rename a var (reset! _really_ doesn't flow for me). And technically, that code is really for events that should be run in the opengl thread as soon as possible; they are not rendered objects. I should've emphasized "would it be a bad idea to just grab the AtomicReference and .getAndSet that?" - I don't get threading well enough to answer that for myself.

2:35 ibdknox: seancorfield: https://github.com/weavejester/comb

2:36 seancorfield: ah, james reeves... should have guessed :)

2:36 hasn't been touched in a year tho'...

2:36 ibdknox: seancorfield: look at it

2:36 hiredman: zii-prime_: have you considered just using a queue?

2:36 ibdknox: it doesn't need to be

2:36 lol

2:36 it's like 60 lines

2:36 very clever :)

2:37 wkmanire: Looks like there are a lot of options for templating libraries.

2:37 zii-prime_: hiredman: oooooo~ I have not. ...that would work better. thanks!

2:37 wkmanire: Does noir make it easy to use any of them or is there one in particular that Noir "likes"?

2:37 seancorfield: ibdknox: but how efficient is it for complex html pages and high traffic?

2:38 ibdknox: seancorfield: compiles down to string concats

2:38 wkmanire: you can use anything :)

2:38 seancorfield: can't be much faster really

2:39 wkmanire: ibdknox: Awesome.

2:39 ibdknox: it produces a function that you then use and that really is just a bunch of string concats. It could be made a bit faster using a single stringbuilder probably

2:39 seancorfield: ibdknox: hmm, looks like if i call (template/eval file bindings) it would re-read the file each time?

2:40 ah, (template/fn ...)

2:40 but then every page of the app has to be compiled in memory to a function and you still need to manage all of that and know when to re-read a changed file

2:41 and you can't save the fns to .class files for management by classloaders etc

2:42 all of that is automatically handled by cfml - caching, automatic recompilation

2:44 charles_r: I accidentally define something over an existing function

2:44 how can I "undefine" it?

2:44 0no

2:45 ibdknox: seancorfield: sure, I'm not sure there'd be that much work to get comb there

2:45 still not convinced it's a great solution either though :)

2:47 _ato: charles_r: (def thing clojure.core/thing) ?

2:47 charles_r: (ns-unmap something something)

2:47 hmmm

2:47 overwrite again

2:48 it doesn't like it

2:52 I tried, (ns-unmap 'clojure.repl 'apply)

2:52 doesn't work

3:01 scottj: is there a ring/compojure/noir library to give a basic http file listing for a tree of directories? I'm trying to make java -jar fileshare.jar that shares the files in the cwd

3:07 emezeske: Haha, awesome, using pr-str/read-string, you can store arbitrary clojure objects in an HTML5 element's data-* attributes! :)

4:07 bolic: http://bit.ly/Jg7m8h shows a way to define the ackermann function in clojure. Using that, I'm getting stack overflow for ack(3,9) already, is there a way to avoid stack explosion using recur or something? In contrast, the simple common lisp program on the same page computes ack(4,2) in a few seconds (using linux / clisp). Thanks for listening.

4:16 AimHere: bolic > You can mitigate it somewhat by replacing the two 'ackermann' instances after (zero? n) and ':else' with recur

4:16 That lets me get ack(3,9)

4:17 (4,2) still overflows, though, because of the call that isn't in the tail position

4:22 Chousuke: I don't think there's any way to get rid of the stack growth

4:22 you can increase the stack size though, with a JVM parameter

4:23 AimHere: There is a Project Euler puzzle to find (ackermann 6 6), so presumably for higher values, you need better algorithms

4:24 bolic: AimHere: Thanks again. I didn't study comp sci, so I wasn't sure whether this was a stupid question

4:36 GeraldMacDuich: bolic, just remove 'ackermann' at the bottom with 'recur'

4:36 That's a tail call

4:37 Also, on the second row

4:37 the ackermann there is also a tail call

4:37 http://pastebin.com/HrETFYjp somethingf like that

4:38 AimHere: Doesn't fix it entirely because the non-tail call to ackermann still junks up your stack

4:38 GeraldMacDuich: Should be rewritabel thyough

4:39 Ehh

4:39 AimHere: Should it?

4:42 portly: Hi (Newbie Question Alert) - I'm still struggling with a good explanaition of when I would use #'foo i.e. (var foo). I've seen it used in compojure as in (run-jetty #'routes {:port (or port 8080) :join? false})) but simply passing routes rather than #'routes did not seem to make any difference.

4:43 GeraldMacDuich: AimHere, or wiat, no, ackermann is not primitively recursive, hmm...

4:44 THe point with clojures loop/recur is that you can't recur to an outer loop. :/

4:44 AimHere: Well I think I got (ackermann 4 2), but what I did to get it was to add a couple lines to the 'cond' to calculate (ack 2 foo) and (ack 3 foo) nonrecursively

4:47 It is 19,729 digits long though

4:54 portly: Hi, anyone able to help with #'foo?

5:59 clojure_newb: how does enclojure compare with emacs+slime+swank ?

6:20 slimefighter: I am trying to setup clojure on emacs. Installed swank-clojure using 'package-list-packages' when I do 'M-x slime' and say 'y' to install clojure jars, it fails with "cannot download clojure jars' what can be the problem?

6:41 neotyk: slimefighter: have you tried clojure-jack-in?

6:42 slimefighter: neotyk, no, what are the steps to install that? do we need ELPA before that?

6:48 neotyk: slimefighter: I use it with emacs24 and install emacs starter kit

6:48 from elpa

6:59 Hali_303: hi! find-doc only works in loaded namespaces, right? how to search in all jars on the classpath? alternatively, how load all namespaces of all jars?

7:13 _KY_: A function must return with the same type?

7:13 Can I return nil in an otherwise numeric function?

7:16 Bronsa: ,(#(#{1 nil "str"} %) (rand-int 2))

7:16 clojurebot: nil

7:16 Bronsa: ,(#(#{1 nil "str"} %) (rand-int 2))

7:16 clojurebot: 1

7:16 Bronsa: yes.

7:23 _KY_: I see...

7:32 How do I trace a function in REPL?

7:33 neotyk: _KY_: https://github.com/clojure/tools.trace that?

7:42 Hali_303: what is the difference between (quote (1 2 3)) and (list 1 2 3) ? I've got a function that only works with the latter

7:43 AimHere: quote just stops the evaluation of anything it refers to

7:43 list creates a list of the arguments

7:43 Chousuke: in that case, there is no difference

7:44 AimHere: There's plenty of difference

7:44 Chousuke: but if you do (quote (a b c)) vs (list a b c) you get different results

7:44 in the stated case there isn't :)

7:44 AimHere: You say that, yet the person saying so has the problem that they ARE different

7:45 Chousuke: ,(= (list 1 2 3) '(1 2 3))

7:45 clojurebot: true

7:45 AimHere: That's just in the repl

7:45 Chousuke: I suspect the real case doesn't have the same values :P

7:46 it's that in the repl but it will be that in a real program too. number literals evaluate to themselves whether quoted or not

7:46 AimHere: In his case, he's probably not putting them in at the command line

7:46 Not true

7:46 oops sorry

7:46 Ignore what I just said

7:46 Chousuke: :P

7:47 Hali_303: anyway, you would have to show us the actual code that causes the error

7:48 if I had to guess I suspect you're doing something like (quote (foo bar)) instead of (list foo bar) and get a list of two symbols instead of a list with the values of foo and bar.

7:54 _KY_: How do I change (1 2 3) into a sequence?

7:54 AimHere: Isn't it already one?

7:55 ,(seq (list 1 2 3))

7:55 clojurebot: (1 2 3)

7:55 AimHere: ,(seq? (list 1 2 3))

7:55 Oops

7:55 clojurebot: true

7:57 _KY_: I see...

8:29 Hali_303: AimHere: Chousuke: Thanks!

8:54 jondot_: hi guys, can anyone help me out and tell me what is this form? https://github.com/ngrunwald/ring-middleware-format/blob/master/src/ring/middleware/format_response.clj#L47

8:54 im not sure if this is an idiom or a clojure thing

8:54 i'm assuming this is some kind of default values for params..?

8:55 weavejester: jondot_: It's using Clojure's destructuring

8:55 jondot_: weavejester: to express something such as default values for parameters?

8:55 weavejester: jondot_: http://clojure.org/special_forms

8:55 jondot_: Take a look at the "let" special form

8:56 jondot_: yep, ok

8:57 weavejester: jondot_: But basically, yes, :or gives you default values when destructuring

9:05 _KY_: If I pass #(something) as an argument, is "something" evaluated first?

9:07 Bronsa: ,((fn [_]) #(println 1))

9:07 clojurebot: nil

9:07 Bronsa: no

9:11 _KY_: Bronsa: what does your code do?

9:12 Bronsa: (fn [_]) <= an anonymous function that takes an argument and returns nil

9:13 _KY_: Why does _ work in this case?

9:13 Bronsa: #(println 2) <= an anonymous function that takes no arguments and prints 2 (short form)

9:13 _KY_: _ is not some special symbol

9:13 you can use _ as you'd use a or b

9:13 _KY_: Ah I see...

9:14 Bronsa: it's just common use to use "_" when you just don't care about some value

9:14 _KY_: Cool... thanks =)

9:39 jondot_: kinda wondering if anyone gotten a bit deeper into ring response formatting. im using ring-middleware-format, and trying to push in JSONP support. anyone done this?

9:40 the bad thing is that i'm hardcoding a callback name (due to the way ring-middleware-format is structured), ideally i'd love to pick it up from a 'callback' query param

9:53 offby1: technomancy: but http://ix.io/2kw repros the problem with slime

9:53 or lein

10:06 pandeiro: anyone know a trick for finding a missing vector for a binding form amongst many open buffers in emacs? b/c it's a reader error i assume, the stacktrace doesn't give me any good hints where it is

10:08 offby1: pandeiro: are you asking about how to search emacs' buffers for a particular string or regexp? That's easy -- M-x multi-occur

10:09 actually ibuffer-do-occur is probably easier

10:10 better yet -- https://gist.github.com/2437224

10:13 pandeiro: offby1: thanks, i know about ibuffer but i guess i'm not sure how to do a regexp search that would reveal a missing binding form

10:31 gah found it... if only i knew elisp well enough to write a fn that searches for a vector after every defn symbol+optional docstring in every open buffer... is that something clojure-mode syntax highlighting could also show i wonder

10:32 not really an issue with clj but with the automatic compilation cljs toolchains the stacktrace doesn't give you any leads

10:48 wkmanire`: Bom dia :)

10:52 angerman: what can I do about: Unable to resolve artifact: Unable to get dependency information: Unable to read the metadata file for artifact 'commons-codec:commons-codec:jar': Cannot find parent: org.apache.commons:commons-parent for project: commons-codec:commons-codec:jar:1.4 for project commons-codec:commons-codec:jar:1.4

10:53 dnolen: neotyk: ping

11:19 yoklov: i think the lein-cljsbuild bugs I'm running into might be because of using cljs head

12:05 technomancy: offby1: aha... the problem is it's not flushing

12:05 add a call to flush inside the binding block

12:05 that's annoying =(

12:07 offby1: apparently *flush-on-newline* is respected for *err* in 1.4.0 though

12:13 angerman: is there a function to walk a hiccup html struct? or do I have to write one myself?

12:17 yoklov: in cljs should (get my-record :foo) be about as fast as (.-foo my-record)

12:22 offby1: technomancy: since when is stderr buffered?! Kids today ...

12:22 mmarczyk: yoklov: iirc -lookup on records matches the key against field names one by one, then does a -lookup on the extmap if there's no match

12:23 yoklov: okay

12:23 hm

12:23 so yeah slower

12:23 but not by much

12:23 mmarczyk: just looked up the code -- that's how it works

12:23 yeah.

12:39 neotyk: dnolen: thanks for cljs-35 and cljs-161! I love your

12:39 responsiveness

12:40 dnolen: neotyk: np, thx for patches - those are long outstanding improvements

12:40 mmarczyk: ping

12:40 mmarczyk: dnolen: hi

12:40 dnolen: mmarczyk: CLJS-189 looks cool

12:41 mmarczyk: dnolen: great

12:41 dnolen: mmarczyk: what do you mean by int bounds?

12:41 mmarczyk: dnolen: actually I think I take that back

12:41 dnolen: hmmm, well

12:41 dnolen: mmarczyk: in JS you have 53bit integer

12:42 mmarczyk: dnolen: ok, good

12:42 dnolen: the current value is the max integer representable as double, I think

12:42 dnolen: unless I've mixed up magic constants

12:42 dnolen: max positive integer, rather

12:43 dnolen: fits in 53, so no problem

12:43 dnolen: mmarczyk: cool, I'll apply that now then.

12:43 mmarczyk: dnolen: great, thanks!

12:46 neotyk: dnolen: are reader literals planed for cljs?

12:46 gfredericks: how do you run midge tests?

12:46 `lein test` seems to pretend that no tests were run

12:46 neotyk: dnolen: and would it be very hard task to do?

12:46 gfredericks: I bet the midge readme would mention this why am I asking.

12:47 dnolen: neotyk: yep as soon as someone submits a patch.

12:47 neotyk: I don't think so

12:47 neotyk: just need to fix cljs.reader

12:48 neotyk: dnolen: there is no ticket for it yet

12:48 pandeiro: is there anywhere one can install the heroku client from source? (for non-apt distros)

12:48 dnolen: neotyk: feel free to make one

12:48 neotyk: dnolen: I will try to understand how clj does it

12:48 offby1: pandeiro: technomancy should know

12:49 dnolen: neotyk: thx

12:49 mmarczyk: applied to master

12:49 pandeiro: nm didn't realize they had it on github

12:50 mmarczyk: dnolen: thanks!

12:50 neotyk: would clojure.browser.net now be able to enable websocket stuff,

12:50 latest official gclosure already has it

12:55 dnolen: neotyk: it could w/ a patch ;)

12:58 mmarczyk: dnolen: any chance you could have a look at CLJS-188 ? (fixes HashCollisionNode for PHM)

12:58 hcumberdale: (defn ser [data] (str (binding [*print-dup* true] (prn-str data)))) << does lead to different results in clojure 1.3 and clojure 1.4

12:58 mmarczyk: I'd like to build the test patch / transient patch on top of that

13:00 dnolen: mmarczyk: looking now

13:00 angerman: ,(string? "foo")

13:00 clojurebot: true

13:00 angerman: ,(type "foo")

13:00 clojurebot: java.lang.String

13:00 dnolen: mmarczyk: applied

13:00 mmarczyk: dnolen: great, thanks!

13:04 hcumberdale: did anyone discover the same issue?

13:05 ,(println *clojure-version*)

13:05 clojurebot: {:interim true, :major 1, :minor 4, :incremental 0, :qualifier master}

13:06 hcumberdale: #(println *clojure-version*)

13:07 AimHere: hcumberdale, Trying it in 1.3 and the git snapshot I cloned yesterday seems to give the same results, a function 'ser' that turns the argument into a string

13:08 If the behaviour is different for different arguments, you'll have to be more specific

13:15 dnolen: mmarczyk: one thing - be sure to run the repl when testing your patches

13:15 mmarczyk: you're using key & val before they are declared.

13:15 mmarczyk: I'll fix

13:17 mmarczyk: dnolen: whoa, sorry for that, I'll pay more attention next time

13:36 dabd: if a function has signature f [x & args] how do I make a recursive call to it (apply recur x args)?

13:37 obv does not work bc recur is not a function

13:38 dnolen: dabd: you can just (recur x args)

13:38 dabd: ok

13:38 dnolen: thanks

13:38 AimHere: dnolen, that won't work will it?

13:38 dnolen: AimHere: it will

13:38 AimHere: rest args are a convenient fiction

13:38 AimHere: Won't it try to pass along args as a vector the second time around?

13:43 RickInGA: dabd: you could try this https://refheap.com/paste/2275

13:49 gfredericks: AimHere: it's conceivable that last-argument-as-seq is the only way that recur behaves in the presence of rest args

13:53 yoklov: is there any overhead for protocols in cljs?

13:53 dnolen: yoklov: yes there is, around 1.5X in Chrome, closer to 2X in other browsers.

13:54 yoklov: hm, okay

13:54 dnolen: yoklov: to avoid the overhead you can always implement Object

13:54 yoklov: oh, and then just attach arbitrary methods to it?

13:54 dnolen: yoklov: yup.

13:55 yoklov: internal PHM nodes do this and it works out nicely.

13:58 ibdknox: just need to add CLJS file discovery and eval and I think I'll be able to just edit light table from within itself :)

13:58 RickInGA: that is pretty cool

13:58 neotyk: what is #' ?

13:59 dnolen: ibdknox: was wondering how long it would take to get to that point :)

13:59 ibdknox: neotyk: short-hand for var

13:59 dnolen: probably another couple of days is all :)

13:59 neotyk: ibdknox: thanks

13:59 ibdknox: dnolen: to be moderately productive in it

14:00 I've been futzing around with the command system for the past little bit

14:00 context sensitive command system = hard lol

14:11 yoklov: dnolen: do I need to use the -method syntax that's used in cljs.core if I do that?

14:13 actually no, nevermind, it looks like the Object methods dont do that.

14:19 dnolen: yoklov: you don't need - ever with methods, it's just a convention

14:19 yoklov: only .- mean anything.

14:19 means

14:19 yoklov: hm, okay

14:32 derrida: hey guys, i'm having a strange issue with using clojure + swank. When I jack-in to a project, the connection is lost almost immediately. Even trying to enter a form like: (+ 10 10) kills the connection. I couldn't see any helpful output in my emacs buffers so I started a manual `lein swank` and then connected with M-x slime-connect and this time I was able to see a backtrace at the repl (connection still

14:32 died the same way as before). This is the backtrace: http://sprunge.us/BbAV . I'm a bit stumped, any suggestions?

14:36 offby1: I tend to pester technomancy with my swank questions

14:45 seancorfield: derrida: which version of leiningen and are you doing jack-in whilst editing a .clj file in a leiningen project?

15:02 LauJensen: Good evening gents

15:18 derrida: seancorfield: lein 1.7.1 on Java 1.7.0_01

15:19 seancorfield: yes, i am editing a file in the project when i jack-in, and i can even actually C-c C-k once (and have it work) before the repl dies if I'm quick.

15:28 danlarkin: ,(= #"foo" #"foo")

15:28 clojurebot: false

15:28 danlarkin: wat?

15:28 clojurebot: For Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888

15:29 danlarkin: regexes not being equal just bit me in the most annoying-to-debug way

15:29 I am using them as keys in a hashmap

15:29 which one should not do, apparently, since assoc will not replace the original, but instead just add a new one

15:31 dnolen: danlarkin: Patterns are Java objects, so blame Java.

15:32 danlarkin: numbers are java opjects and = works with those

15:32 this is not java's fault, it's clojure's

15:32 xeqi: java

15:32 java's Pattern doesn't implement equals for it either

15:33 danlarkin: man. what? why would they avoid that I wonder

15:34 jconnolly: relevant: http://stackoverflow.com/questions/10055034/java-comparing-two-pattern-objects

15:34 AimHere: Well regexes are funny things, they're compiled on the fly in any environment smart enough to do so

15:35 danlarkin: unfortunately assoc and friends won't allow me to extend their behavior to call .pattern on Patterns to fix this

15:36 or will they?!

15:41 jconnolly: I was wondering how meta-programmy clojure gets. I'm new to it, have not plunged into the language that deeply yet.

15:45 AimHere: jconnolly, high up on the scale, but not quite as high as, say, Common Lisp

15:48 jconnolly: AimHere: yeah, I'm digging through it a bit now. Not as high as say Ruby either. metaprogramming abounds with Ruby.

15:48 angerman: what do I do about stuff like: [WARNING] POM for 'xerces:xercesImpl:pom:2.9.1:compile' is invalid.

15:51 amalloy: danlarkin: you could probably do that in clojurescript, though i doubt it'd be a recommended practice

15:53 dnolen: danlarkin: = does not work you need ==

15:53 ,(= 1 1.0)

15:53 clojurebot: false

15:53 dnolen: ,(== 1 1.0)

15:53 clojurebot: true

15:53 amalloy: jconnolly: clojure has loads of metaprogramming; it's of a different nature than ruby's, so you're not seeing it yet

15:53 danlarkin: what I really need is for assoc to do the right thing :(

15:53 amalloy: danlarkin: you can fake it with a sorted-map, i bet

15:54 &(let [m (sorted-map-by str)] (-> m (assoc #"foo" 1) (assoc #"foo" 2)))

15:54 lazybot: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number

15:54 amalloy: well, okay, with a comparator that compares regexes by calling str on them

15:56 &(let [m (sorted-map-by (fn [r s] (compare (str r) (str s))))] (-> m (assoc #"foo" 1) (assoc #"foo" 2))) ;; danlarkin

15:56 lazybot: ⇒ {#"foo" 2}

15:56 dnolen: jconnolly: the level of metaprogramming capability in Clojure far exceeds that offer by Ruby IMO.

15:56 offered

15:56 danlarkin: amalloy: ugh

15:56 mmarczyk: dnolen: finally got TransientHM fully working & tested

15:57 amalloy: sorry, dude

15:57 dnolen: mmarczyk: sweet!!!

15:58 danlarkin: amalloy: I'll probably use that, though, thanks

15:58 even though it makes me sad that I have to

15:58 mmarczyk: dnolen: I'll bring the PersistentTreeMap patch up to date with master sometime soon now -- in particular I need to use hash-imap there too -- then create a separate dependent ticket for PersistentTreeSet

15:59 dnolen: mmarczyk: so is that two patches on CLJS-181?

16:00 mmarczyk: dnolen: yeah, I thought it makes more sense to have a separate patch with the tests

16:00 dnolen: since they are meant for both PHM and THM really

16:00 dnolen: not quite part of the first patch conceptually

16:02 dnolen: mmarczyk: applying now

16:02 mmarczyk: dnolen: fantastic! thanks :-)

16:03 dnolen: done!

16:03 mmarczyk: great :-)

16:05 dnolen: also in the pipeline with high priority -- the ObjMap issue -- I'll make a better patch taking advantage of THM during conversion, then do the access tests properly.

16:13 Borkdude: I'm trying out the leiningen plugin for Eclipse.

16:14 These are the steps I've taken: create a clojure project, added a project.clj manually, turned on leiningen support

16:14 I hoped that "update dependencies" would work now, but nothing happens

16:31 yoklov: huh.

16:32 got a new sort of weird error from the cljs compiler, but this one is from within clojure: https://refheap.com/paste/2277

16:33 I feel like I must have messed up my setup at some point because i'm the only one who sees these errors :/

16:40 emezeske: danlarkin: Could you just key the map on &(.pattern #"foo") ?

16:42 pelleb: Hi guys, is there a way of defining a var where the name is the output of a function without getting into macros?

16:42 eg. (def (symbol "FOO") "BAR")

16:42 mmarczyk: yoklov: did you try cleaning out all build artifacts and repackaging cljs?

16:43 danlarkin: emezeske: yes, but that's not what I want to do

16:43 I want the Pattern objects to be the keys

16:43 emezeske: pelleb: (eval `(def ~(symbol "FOO") "BAR"))

16:43 yoklov: mmarczyk: probably? i've been getting these weird errors for a while on several different clones of the clojurescript. i've certainly done lein clean many times, as for repackagaing I don't know.

16:43 Iceland_jack: pelleb: That's probably not what you want to do

16:43 emezeske: pelleb: Although there's nothing to be afraid of with macros :)

16:44 pelleb: I know. I tried solving my problem with macro's and I'm stumped on something there as well.

16:44 clojure_newb: does counterclockwise have an irc channel?

16:45 mmarczyk: yoklov: well, lein clean wouldn't help for cljs, but anyway

16:45 yoklov: how are you running the compiler when this happens?

16:46 yoklov: mmarczyk: lein cljsbuild auto, and I do lein clean, cljsbuild clean when i do clean

16:47 I usually have to do lein clean, cljsbuild auto when I do auto too, otherwise nothing might happen

16:47 mmarczyk: yoklov: where do you get the clojurescript jar from though?

16:47 yoklov: I'm using a clone of cljs head which I add to the extra-classpath-dirs

16:48 pelleb: I guess I should not be scared of eval. Years of working with non lispy languages make me scared of even touching it.

16:49 amalloy: pelleb: ##(doc intern)

16:49 lazybot: java.lang.SecurityException: You tripped the alarm! intern is bad!

16:49 amalloy: a hundred times better than (eval `(def ...))

16:50 pelleb: amalloy: Nice that will probably do what I need

16:51 amalloy: though really, it's pretty unlikely you should be creating vars whose names you don't know at compile time

16:52 mmarczyk: yoklov: that's weird :-(

16:52 yoklov: haha, yup

16:52 mmarczyk: yoklov: shooting in the dark -- any stale .class files lying around?

16:53 yoklov: hm

16:53 nope, not that I can tell at least

16:53 emezeske: yoklov: Have you tried building the clojurescript jar from HEAD, and adding that to your project.clj as a :dependency?

16:53 yoklov: emezeske, no, I havent

16:53 emezeske: yoklov: Not ideal, but it might rule out any weird classpath issues with just using HEAD as a checkout

16:54 mmarczyk: that's what I tend to do, never ran into any issues

16:54 yoklov: so I build just with lein jar?

16:54 mmarczyk: I haven't got around to figuring out how to prevent the jar from being copied to ~/.m2

16:54 yoklov: script/build

16:54 yoklov: oh

16:55 mmarczyk: yoklov: which uses mvn -- cljs doesn't use lein

16:55 yoklov: yeah right cljs doesn't use lein

16:56 okay, now how do I add the new folder as a dependency?

16:59 emezeske: yoklov: New folder?

16:59 yoklov: new folder with a jar

16:59 inside of it

16:59 dnolen: yoklov: that seems like a very weird error, what triggered it?

17:00 yoklov: is this something you're seeing during auto builds?

17:00 emezeske: yoklov: I don't know how to do that; I just install things to ~/.m2

17:00 yoklov: dnolen: yes

17:00 emezeske: i would do that by… copying the folder in?

17:00 dnolen: yoklov: what OS, what JVM?

17:01 yoklov: mac os x 10.7.3, Java 1.6.0_26

17:01 emezeske: yoklov: Heh, I have only done "lein install", I have no idea how to work with maven directly :(

17:01 yoklov: emezeske, ah, so do lein install on the jar?

17:02 dnolen: yoklov: in your Java Preference are you defaulting to 64bit or 32bit?

17:02 Preferences I mean.

17:02 yoklov: dnolen: 64 bit

17:03 mmarczyk: yoklov: if you run script/build

17:03 yoklov: it'll install the jar for you

17:03 yoklov: oh, does it?

17:04 dnolen: yoklov: it does. but your error still sounds weird.

17:04 mmarczyk: yoklov: note the version number (printed out by mvn at some point) and use that in your project.clj

17:04 dnolen: yoklov: what happens when you restart the lein cljsbuild auto process?

17:06 yoklov: it says compiling clojurescript and stops (because it thinks the compiled files are up to date, i guess). if I do lein cljsbuild clean, cljsbuild auto it goes back to running like normal

17:06 dnolen: yoklov: this sounds like a bug with lein cljsbuild auto, your mention of OOM exceptions make me suspect there's a memory leak in cljsbuild

17:07 yoklov: hm

17:07 dnolen: yoklov: I've never used lein cljsbuild for really long periods of time, so you're probably experiencing a real bug.

17:07 emezeske: I dunno, I frequently have auto running for 8-10 hours at a time

17:07 dnolen: yoklov: are you compiling with :whitespace optimizations only?

17:08 yoklov: dnolen: yeah

17:08 dnolen: emezeske: huh

17:08 yoklov: dnolen: whitespace, pretty print, and static-fns

17:09 emezeske: maybe a difference in OSes or java versions is contributing somehow?

17:10 dnolen: yoklov: how long before the problem kicks in? an hour?

17:10 yoklov: yeah, about.

17:10 sometimes sooner

17:10 emezeske: yoklov: Could be. I am running Java(TM) SE Runtime Environment (build 1.6.0_29-b11)

17:11 JulioBarros: anyone have a blog post or package on handling config information in a clojure/noir web app? Something that outlines best practices for handling passwords and api keys for dev vs production would be great.

17:11 yoklov: if it makes any difference, the compiler starts slowing down before running out of memory usually

17:13 emezeske: yoklov: This is a closed-source project, right?

17:13 yoklov: that i'm working on right now?

17:13 no

17:13 emezeske: Is it up on github somewhere?

17:13 yoklov: https://github.com/thomcc/ld23

17:14 emezeske: Oh, nice, I can clone that and run a script to touch a cljs file every second

17:15 yoklov: emzeske: this is a stacktrace which shows where from cljsbuild it crashes (and the slowing-down behavior) https://refheap.com/paste/2281 though that might be obviously the place where it occurs

17:15 emezeske: yoklov: cool thanks

17:16 yoklov: does this project not compile except against a very new clojurescript version?

17:16 yoklov: emezeske: that is very possible

17:17 emezeske: yoklov: kk

17:17 Okay, I'll get this stress test going

17:18 BTW, what does static-fns do?

17:18 amalloy: that's the one that avoids going through IFn.call when the thing is known to be a real js function, i think?

17:19 emezeske: Ah, cool, thanks

17:19 coffc: how can I apply a list of functions to an object and collect the results into a list?

17:19 emezeske: yoklov: Okay, I have the "lein cljsbuild auto" running, and in another terminal I ran "while /bin/true; do touch src/ld23/main.cljs && sleep 1; done"

17:20 &(doc juxt)

17:20 lazybot: ⇒ ------------------------- clojure.core/juxt ([f] [f g] [f g h] [f g h & fs]) Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of apply... https://refheap.com/paste/2282

17:20 emezeske: coffc ^

17:20 amalloy: &((juxt + -) 5 2)

17:21 lazybot: ⇒ [7 3]

17:21 emezeske: yoklov: Oh, I think I see the problem

17:21 yoklov: emezeske, cool, though I'll be somewhat shocked if it's somehow my project

17:21 emezeske: yoklov: So do you run "lein cljsbuild auto" exactly?

17:21 yoklov: lein cljsbuild auto dev

17:21 coffc: emezeske: will that work for native interop?

17:21 emezeske: yoklov: Okay nevermind then

17:22 yoklov: usually lein cljsbuild clean, cljsbuild auto dev

17:22 coffc: like if I want to call several instance methods of an object

17:22 emezeske: yoklov: Could you try "lein cljsbuild auto dev" and then my little script above?

17:23 amalloy: coffc: make them functions

17:23 yoklov: emezeske, yeah

17:24 emezeske: yoklov: It's compiled several hundred times for me so far

17:24 amalloy: &((juxt (memfn length) (memfn toUpperCase)) "a string")

17:24 lazybot: ⇒ [8 "A STRING"]

17:25 Iceland_jack: http://clojuredocs.org/clojure_core/clojure.core/compare mentions that “comparing vectors of different sizes does not work as you may expect”, i.e. that a longer vector is always greater regardless of contents

17:25 yoklov: emezeske: yeah, I dunno. I'll let you know how long it lasts.

17:25 Iceland_jack: Is there a clean way of doing something akin to Python's comparison of tuples?

17:26 Where (1, 2, 3) < (1, 2, 4) would return False

17:26 yoklov: its been running for about a minute and a half now and crashed

17:26 gfredericks: amalloy: do you know why memfn is even necessary? i.e., would there be any downside to .foo having the semantics of (memfn foo)?

17:26 emezeske: yoklov: Cool. I'll leave mine running in the background while I do other things

17:26 amalloy: anyway, the point is that functions are first-class and methods aren't. if you wanna do something "cool" with methods, reduce to functions first

17:26 gfredericks: hiredman was talking about doing that. i dunno if he actually did, but i think he convinced me it's totally viable

17:27 gfredericks: amalloy: okay cool, just curious

17:27 yoklov: yeah it got through 16 compilations before crashing, and that seems pretty standard for me

17:27 emezeske: yoklov: I'm at like 500 now

17:27 gfredericks: I would've guessed there would be performance concerns

17:27 amalloy: Iceland_jack: those vectors are the same size, so i don't see how your two questions are related?

17:27 yoklov: actually it's usually 16

17:28 amalloy: gfredericks: no more than memfn has

17:28 Iceland_jack: amalloy: compare doesn't look at the content

17:28 emezeske: yoklov: Weird, it's 16 in the refheap you posted too

17:28 amalloy: Iceland_jack: of course it does

17:28 yoklov: yeah, the last 5 have crashed after 16

17:28 amalloy: &(compare [1 2 4] [1 2 3])

17:28 lazybot: ⇒ 1

17:28 yoklov: and potentially more

17:28 amalloy: &(compare [1 2 3] [1 2 4])

17:28 lazybot: ⇒ -1

17:28 emezeske: yoklov: Uh... that is *weird*

17:29 Iceland_jack: What about vectors of different length

17:29 amalloy: then it compares by length only

17:29 yoklov: emezeske: it certainly seems weird.

17:29 Iceland_jack: And is there any way of achieving Python's comparison functionality

17:30 emezeske: yoklov: I'm gonna wait some time to see if mine crashes (like an hour). I'll report back.

17:30 amalloy: *shrug* just implement strcmp

17:30 TimMc: Iceland_jack: https://github.com/timmc/handy/blob/master/src/org/timmc/handy.clj#L6

17:30 yoklov: k

17:30 Iceland_jack: TimMc: Thank you :) very helpful

17:31 coffc: amalloy: ok great, thanks

17:31 amalloy: &((fn [a b] (or (first (remove zero? (map compare a b))) 0)) [1 2 3] [2 3])

17:31 lazybot: ⇒ -1

17:31 amalloy: &((fn [a b] (or (first (remove zero? (map compare a b))) 0)) [4 2 3] [2 3])

17:31 lazybot: ⇒ 1

17:32 amalloy: i guess mine is incorrect

17:32 Iceland_jack: Ah, so you'd have to implement it

17:33 amalloy: &((fn [a b] (compare (seq a) (seq b))) [1 2 3] [2 3]))

17:33 lazybot: java.lang.ClassCastException: clojure.lang.PersistentVector$ChunkedSeq cannot be cast to java.lang.Comparable

17:33 amalloy: feh

17:33 Iceland_jack: No problem :)

17:35 TimMc: Iceland_jack: Are you comparing version numbers, by any chance?

17:36 Iceland_jack: I'm actually not, I was using Python and wondered whether there was some equivalent function on Clojure that's all

17:36 TimMc: ok

17:40 Iceland_jack: good guess though :)

17:40 mdeboard: does python just compare hash values there?

17:40 or is it comparing each individual value

17:41 1 < 1 2 < 2 3 < 4

17:41 guess the latter

17:42 TimMc: Can't compare hashes.

17:42 Iceland_jack: Well except equal or not :D

17:42 TimMc: right

17:42 They wouldn't be very good hashes otherwise.

17:42 Iceland_jack: heh

17:43 mdeboard: python's stdlib hash() you can do just that :P hash("a") < hash((1,2,3)) == True

17:43 (Python's stdlib hash() isn't very good hash)

17:43 I proclaim us both correct

17:44 TimMc: mdeboard: You can't *meaningfully* compare hashes.

17:44 Iceland_jack: mdeboard: how is it a bad hash?

17:44 Hash functions come in all shapes and sizes

17:45 mdeboard: This is one of those things where I read long ago an explanation of that particular function and decided it was bad then discarded the reasons why

17:46 Iceland_jack: I see...

17:47 mdeboard: something something referential transparency

17:47 TimMc: Hmm, I see Python doesn't have perl's random-seeded hashing.

17:47 seancorfield: hmm, nsfw... No Such Framework... my first reaction was "Not Safe For Work?"...

17:47 Iceland_jack: haha

18:02 kab3wm: I'm new to clojure, trying to figure out how to open a binary file ( an image in this case ) and put it into a database. I've tried io/input-strean, file, reader, etc. Nothing seems to work. Here's my function - https://gist.github.com/2439812 - I saw some mentions of using to-byte-array from conrib on google, but they were doing more complex things than I am. Is there any easy way to do this?

18:04 TimMc: kab3wm: What happens if you call (.read (io/input-stream ...)) on it?

18:05 Just to verify that you can indeed read from it.

18:07 kab3wm: Just remember that readers deal in characters, streams deal in bytes. So you'll definitely want the latter.

18:08 kab3wm: TimMc: hrmm, the key gets created with a value of "255" and I get an error about - No matching field found: close for class java.lang.Long

18:09 TimMc: Sure, you're passing the return value of .read to .close. But at least you are reading.

18:09 Wait, 255... that's suspicious...

18:13 kab3wm: currently, without the .read in there, the value for that key in the db is set as: java.io.BufferedInputStream@3eae3da8

18:13 TimMc: Sure, you or something else is calling str (and therefore .toString) on it.

18:13 You can't reasonably stringify an input stream. :-)

18:14 clojure_newb: wtf does slamhound do?

18:14 does it automatically look at your source code and infer what refer/requires you need?

18:15 kab3wm: TimMc: hrmm, I will have to look at the redis lib I'm using. I'm not coercing it in any way before trying to insert it.

18:15 TimMc: thanks for the help

18:15 TimMc: kab3wm: You need to read from the stream and insert that data instead.

18:16 amalloy: clojure_newb: that's the idea

18:16 TimMc: kab3wm: I don't know how to do that in a simple fashion in Clojure, but in Java I use Apache's IO utils.

18:16 clojure_newb: amalloy: I like it. It does break my flow to have to look up what namespace this function I want / what java.io.blah to include

18:18 smoker: I am trying my hands on concurrency in clojure and trying to solve Cigarette smokers problem, anyone up to have a discussion on what is the best way to model agents/refs etc ?

18:19 clojure_newb: is "Cigarette Smokers Problem" a famous concurrency problem, like the 5 diners problem?

18:20 smoker: clojure_newb, yes

18:20 http://en.wikipedia.org/wiki/Cigarette_smokers_problem

18:22 clojure_newb: so this person created this problem

18:22 specifically to prove Dijkstras wrong?

18:23 smoker: brb

18:25 clojure_newb, well tried i guess, but proved partially untrye

18:25 *untrue

18:56 mmarczyk: dnolen: PersistentTreeMap + tests ready, CLJS-187

18:59 dnolen: ahhhhhh wait, I take that back -- found a glaring omission

19:11 dnolen: mmarczyk: cool! will take a look when you're done.

19:12 emezeske: yoklov: ping

19:12 yoklov: emezeske: hey

19:13 emezeske: yoklov: So, after a few hundred compiles, things are slowing down a lot

19:13 yoklov: The last one took 1158 seconds :)

19:13 yoklov: wow

19:13 emezeske: yoklov: I don't know why it's not crashing for me, maybe just because I have gobs of ram

19:13 But obviously something is wrong

19:13 yoklov: yeah, i have 4 gigs

19:14 emezeske: Hm, I only have 8 actually

19:15 yoklov: hrm. Still though, thats... unacceptably slow. Maybe your java has a bigger heap?

19:15 emezeske: That's my guess; I don't know how to easily check

19:15 Anyway, I'm going to fiddle with things to try to isolate the problem

19:17 yoklov: good luck

19:17 emezeske: Thanks! I'll ping you when I find somthing

19:17 yoklov: sounds good

19:33 mmarczyk: dnolen: ok, the problem is with compare -- (compare nil :foo) is 0 etc.; basically whenever neither x < y nor x > y, (compare x y) is 0

19:34 dnolen: not necessarily a problem of tree map, since Clojure's tree map refuses to cooperate when keys cannot be compared meaningfully (clearly a good idea), but here there's no warning -- just quiet corruption

19:35 dnolen: mmarczyk: ah yes because Clojure throws.

19:35 mmarczyk: dnolen: do you think a cljs.core/compare which would complain about nonsensical comparisons is in order, with the original left under the name of unchecked-compare, say, or shall I implement a guarded-compare and use that in PTM?

19:37 dnolen: mmarczyk: we have type, (if (identical? (type x) (type y)) (garray/defaulCompare) (throw ...))

19:37 mmarczyk: dnolen: Clojure happily compares against nil

19:38 dnolen: mmarczyk: and returns what?

19:38 mmarczyk: &(compare nil 1)

19:38 lazybot: ⇒ -1

19:38 mmarczyk: &(compare 1 nil)

19:38 lazybot: ⇒ 1

19:39 mmarczyk: dnolen: I suppose we could live with comparisons against nil incurring an extra check though?

19:39 or two.

19:40 dnolen: mmarczyk: we should do whatever Clojure does.

19:40 mmarczyk: identical? + calls to type are cheap

19:40 so are nil checks

19:40 mmarczyk: (cond (identical? (type x) (type y)) (garray/defaultCompare x y) (nil? x) -1 (nil? y) 1 :else (throw ...))

19:41 dnolen: mmarczyk: looks good.

19:41 mmarczyk: cool, I'll use that then

19:41 dnolen: mmarczyk: great

19:42 mmarczyk: dnolen: ah, but do you think this should replace compare or just the default comparator for PTM?

19:42 dnolen: mmarczyk: replace compare

19:42 mmarczyk: k

19:43 dnolen: mmarczyk: I'm thinking IComparable is probably useful, but we can add that later.

19:46 mmarczyk: dnolen: ah yes; PTM will probably be able to use it automagically once it's in place

19:58 dnolen: done, http://dev.clojure.org/jira/browse/CLJS-191

19:58 emezeske: yoklov, dnolen: Okay, I've reproduced the "compiler eating all memory and grinding to a halt" problem without lein-cljsbuild

19:59 yoklov: emezeske: huh.

19:59 emezeske: paste incoming

20:00 yoklov, dnolen: I changed clojurescript/bin/cljsc.clj like this: https://refheap.com/paste/2284

20:00 Then I added [fs "1.1.2"] to the classpath

20:00 the-kenny: "(let [[a b] [1]] b) => undefined", is this desired behavior?

20:00 emezeske: And then I ran this: ./checkouts/clojurescript/bin/cljsc src/ "{:optimizations :whitespace :pretty-print true :static-fns true :output-to \"public/js/main.js\"}"

20:00 the-kenny: It breaks all kinds of things, like (= :foo b)

20:01 (= b :foo) works fine, thoughh

20:01 yoklov: the-kenny: clj or cljs?

20:01 the-kenny: yoklov: cljs

20:01 b should be nil/null, not undefined

20:01 yoklov: thats odd, i could swear I have code which depends on that

20:01 yeah you're right

20:02 dnolen: emezeske: wait so what's problem exactly?

20:02 the-kenny: Haven't had a look at the generated code yet (it's too late for that here), but this has bitten me twice in the last two hours

20:02 emezeske: dnolen: The compiler will eventually use up all memory and grind to a halt (I'm guessing due to gc time)

20:03 dnolen: Or, in yoklov's case, it will crash

20:03 dnolen: emezeske: what I'm saying is, what did you change?

20:03 the-kenny: hmm nil? check is coercive on undefined, why is this causing you a problem?

20:03 emezeske: dnolen: I just call closure/build over and over

20:03 yoklov: the-kenny: that works in my version of cljs, which version are you using?

20:04 dnolen: emezeske: why do you need the dependency (I'm asking for some context here)

20:04 ?

20:05 emezeske: dnolen: Ah, because you need to delete the temporary files in the "out" dir to make the compiler actually do work

20:05 yoklov: thekenny: (= (let [[a b] [1]] b) nil) returns true in my latest-ish version

20:05 dnolen: emezeske: k, I'll take a fix that doesn't require a depedency.

20:05 emezeske: dnolen: I didn't fix anything

20:05 dnolen: https://refheap.com/paste/2284 is just a repro

20:05 the-kenny: dnolen. yoklov: Hmm. My test case is too simple :/ Sorry. I have to investigate some more

20:06 dnolen: emezeske: oh I see, so you have or haven't isolated the issue?

20:06 emezeske: dnolen: I proved that it's not in lein-cljsbuild, that's all

20:07 dnolen: emezeske: k I understand, yeah there may be some assumptions in the compiler that don't account for auto. I'm happy to fix it!

20:07 the-kenny: I do some strange destructuring which causes (= :foo a) to fail while (= a :foo) works fine

20:07 (I'll reproduce it tomorrow)

20:08 dnolen: mmarczyk: will take a look.

20:08 emezeske: dnolen: I wish I could isolate the problem, but I hardly know where to begin :/

20:08 the-kenny: dnolen: Btw: Thanks for merging my patch. My first baby step in contributing to Clojurescript :)

20:08 emezeske: dnolen: I'm not that familiar with gc in java to begin with, much less clojure on top of it

20:08 mmarczyk: dnolen: thanks! I'll have the new PTM patch up in a second too

20:10 emezeske: dnolen: Actually, I think I'll try to do a bisection. (provided that I can find a version that does not suffer from the problem)

20:11 dnolen: emezeske: ah so you think this problem did not always exist?

20:11 emezeske: dnolen: I'm not certain, but I think I should have seen it with my 8-10 hour auto sessions

20:11 dnolen: It could be, though, that I'm not tickling the right part of the compiler

20:11 mmarczyk: dnolen: done

20:12 dnolen: emezeske: bisection is worth pursuing - I know some things changed around closure.clj so you could be right.

20:12 mmarczyk: dnolen: oh, thanks for applying

20:12 emezeske: dnolen: Roger that. I'll report back later with findings.

20:14 dnolen: the-kenny: np!

20:16 mmarczyk: PTM patch applied to master

20:16 mmarczyk: dnolen: great! :-)

20:35 gfredericks: it's hard to reuse the code from ring middlewares when working with aleph :(

20:37 ferd: I wrote a function that given arbitrary input values and expected output, it returns which Clojure function (from the std library) satisfies.... Any interest in my sharing it ?

20:39 gfredericks: ferd: lazybot has a function that I think does that

20:39 $findfn 1 1 2

20:39 lazybot: [clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int clojure.core/bit-shift-left]

20:39 yoklov: hm, what's the function to get the index of a value in a vector? is there one?

20:39 gfredericks: so if yours has anything to offer over that, they might be interested in integrating it

20:39 ferd: ah, cool didn't now it existed already :-)

20:40 mdeboard: basically everything already exists

20:40 gfredericks: yoklov: may as well generalize to any seq, I imagine; not sure there's anything built in but ##(doc keep-indexed) should do something related

20:40 lazybot: ⇒ ------------------------- clojure.core/keep-indexed ([f coll]) Returns a lazy sequence of the non-nil results of (f index item). Note, this means false return values will be included. f must be free of side-effects. nil

20:41 yoklov: hrm

20:41 gfredericks: &(.indexOf [3 4 28 3] 28)

20:41 lazybot: ⇒ 2

20:41 gfredericks: well there's that too

20:41 &(.indexOf '(3 4 29 4) 4)

20:41 lazybot: ⇒ 1

20:42 yoklov: that probably wont work in cljs

20:42 :(

20:42 but yeah i'llfigure something out

20:42 gfredericks: isn't that a JS function on arrays? _maybe_ they included it ... :/

20:48 mdeboard: What do you guys make in CLJS?

20:49 I don't actually do much in javascript, it's always little presentation-layer things

20:50 dnolen: gfredericks: hmm it not a bad idea for CLJS collections to support the usual JS collection operations, the same way that CLJS collections support standard Java collection interfaces.

20:51 mdeboard: anything you would do in JS

20:51 mdeboard: also thanks to the works of folks like mmarczyk we're making progress on C-in-C.

20:54 emezeske: dnolen: Okay, here's the commit that causes the memory leak: https://github.com/clojure/clojurescript/commit/3173f1adc4d6d0a5b37d71e1b471f1c1f70404ef

20:55 dnolen: The leak does not happen before that commit.

20:55 So, git bisect is freaking cool

20:57 S11001001: when it works

20:57 dnolen: emezeske: sadly can't address that tonight, but creating a ticket for it now.

20:57 emezeske: dnolen: I might take a pass at it if I have time.

20:57 S11001001: Well technically git bisect always works, it's just not applicable to all problems

20:58 S11001001: emezeske: I've, twice, had to manually bisect when git bisect marked revs overeagerly as good or bad

20:58 dnolen: emezeske: http://dev.clojure.org/jira/browse/CLJS-192

20:58 emezeske: dnolen: Thanks!

20:59 S11001001: Are you claiming that git bisect is buggy?

20:59 S11001001: bisection is solvable for all dags, but git-bisect doesn't support all dags

20:59 so if bisect is meant to work only on strictly linear history, then it's fine

21:00 emezeske: Yeah, AFAIK it is only supposed to work on linear history.

21:00 dnolen: emezeske: nothing pops out at me from that commit ... but it's probably something simple.

21:01 emezeske: actually, it might be because we hold onto the init-expr in defs for fns.

21:02 emezeske: init-expr is the entire AST, which could be massive.

21:02 emezeske: dnolen: Not sure if it's relevant, but I did trim the repro down to compiling a 5 line cljs file

21:03 dnolen: emezeske: what's that look like?

21:04 emezeske: dnolen: (ns ld23.main) (defn hello [] "Hello")

21:05 dnolen: emezeske: sucks. k if you could take a look into it that would super awesome. otherwise I'll takea look tomorrow.

21:06 gotta run, sorry about that yoklov

21:06 yoklov: hm?

21:06 dnolen: yoklov: compiler memory leak bug.

21:06 emezeske: dnolen: I'll poke around, will add notes to the ticket if I find anything

21:06 yoklov: haha, don't worry about it

21:06 dnolen: emezeske: thx

21:08 emezeske: yoklov: Unfortunately, the last non-memory-leaking commit is missing features that your project requires

21:08 charles_r: I'm getting an error on code that should work: Don't know how to create ISeq from: java.lang.Long

21:08 has anyone seen this before?

21:08 yoklov: emezeske, just out of curiosity what are they?

21:09 emezeske: yoklov: I think variadic aget

21:09 yoklov: emzeske: ah. yeah thats nice but really I wouldn't want to go without PHMs

21:09 emezeske: charles_r: I've seen that when I wrote wrong code

21:09 yoklov: charles_r: are your arguments to nth or something reversed?

21:10 charles_r: I copied it right out of Clojure in Action

21:10 do you have that? if not I can copy it in a PM

21:10 yoklov: what's the code look like?

21:11 if it's long: https://refheap.com/paste

21:11 charles_r: not long

21:11 (defn basic-item-total [price quantity]

21:11 (* price quantity))

21:11 S11001001: oh that

21:11 take out apply

21:11 charles_r: why?

21:11 clojurebot: why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone

21:12 S11001001: it was wrong

21:12 charles_r: wasn't in the errata

21:12 clojurebot: Pardon?

21:12 mmarczyk: dnolen: just caught a bug in PTM, http://dev.clojure.org/jira/browse/CLJS-193 -- and here's PersistentTreeSet: http://dev.clojure.org/jira/browse/CLJS-194

21:12 S11001001: popped up here

21:13 charles_r: so its just (f price quantity) ?

21:13 S11001001: yes

21:13 charles_r: I guess that makes sense

21:13 thanks

21:13 *crosses out apply*

21:42 dnolen: emezeske: still around?

21:42 emezeske: dnolen: yep!

21:42 fg

21:42 dnolen: emezeske: if you are I have a possible patch for CLJS-192, mind testing?

21:42 emezeske: oops, irc is not a terminal

21:42 dnolen: Don't mind at all

21:44 dnolen: emezeske: thx!

21:45 mmarczyk: dnolen: not sure if I missed you earlier, but there's a bug in PTM -- fix @ CLJS-193

21:45 dnolen: mmarczyk: yep I see it.

21:46 mmarczyk: ok

21:50 emezeske: dnolen: No such luck :(

21:51 dnolen: Same results with the patch.

21:51 dnolen: emezeske: k don't have time to look more closely, I don't see anything else suspicious in that commit

21:52 emezeske: dnolen: I think it must be the namespaces atom that's growing

21:52 dnolen: emezeske: we probably need to use a profiler, my change is the only obvious spot where memory might grow

21:52 emezeske: dnolen: I'll keep poking around

21:53 dnolen: emezeske: yeah that's what I'm suspecting but I'm not sure where

21:55 emezeske: k thanks, out for real now.

22:21 emezeske: new patch on ticket, mind trying?

22:22 emezeske: dnolen: Works like a charm

22:22 dnolen: The :defs were growing like mad before, with that new patch they get set once and then stay the same upon each new compile

22:22 dnolen: emezeske: man excellent

22:23 emezeske: dnolen: Actually, hold up

22:23 dnolen: May have spoke too soon

22:23 dnolen: emezeske: darn

22:25 emezeske: dnolen: The new patch prevents the :defs from growing in my 'main namespace

22:25 dnolen: I'm trying to figure out what is still growing

22:26 gtrak: /join #java

22:27 emezeske: dnolen: Okay, it is definitely the [:info :methods] that is growing

22:27 dnolen: So you're on the right track

22:28 dnolen: emezeske: hmm, so that's still growing?

22:28 emezeske: dnolen: yeah, if I comment things out so the :methods key is not added, no memory leak

22:29 dnolen: emezeske: that's strange I'm only extracting :params

22:31 emezeske: dnolen: very weird

22:32 dnolen: Maybe it's not the :methods that is growing; but it's existence causes growth elsewhere?

22:33 dnolen: emezeske: now that I think about it is does create an explosion of maps in memory.

22:33 emezeske: got a better idea one second

22:38 emezeske: patch updated

22:38 emezeske: more deep nesting of maps, keeping things flat

22:38 no more

22:39 emezeske: dnolen: applying & testing

22:39 dnolen: emezeske: thx

22:41 emezeske: dnolen: still unhappy

22:42 dnolen: emezeske: is there some specific what that namespaces is growing that your seeing?

22:43 emezeske: dnolen: I can try to find that out

22:43 dnolen: specific way I mean.

22:43 madsy: Stupid question. I manually installed clojure from svn, but what kind of symlink/script name do editors and IDEs expect when invoking clojure?

22:43 dnolen: emezeske: when I run a simple analyze expression over and over I don't see anything.

22:43 emezeske: dnolen: the weird thing is that, unpatched, the 'main namespace grows like mad

22:43 dnolen: but with your patch, it doesn't grow at all

22:43 dnolen: I need to look at the other namespaces

22:45 dnolen: emezeske: I wonder if the simple solution here is just to reset namespaces when build is called?

22:45 emezeske: dnolen: That would definitely work

22:46 dnolen: I wonder if that might be a good idea for other reasons as well

22:46 dnolen: emezeske: yeah

22:46 emezeske: dnolen: namespaces could have leftover defs and stuff that no longer exist in the source files

22:47 dnolen: emezeske: adding that now

22:47 emezeske: dnolen: K

22:48 dnolen: emezeske: newer patch, please try

22:50 emezeske: dnolen: test running, seems happy so far. I'll let it run for a few minutes

22:51 dnolen: madsy: installed clojure from svn? sounds like you found some ancient instructions

22:52 emezeske: dnolen: Okay, it's gotten through 200 builds so far without slowing down at all

22:52 dnolen: Before this last patch, it would get to about 40 and grind to a halt

22:52 dnolen: emezeske: excellent, k going to push this then.

22:52 emezeske: dnolen: Sounds good!

22:53 dnolen: emezeske: still a bit mysterious honestly

22:53 emezeske: dnolen: Yeah.. I wonder if the problem will affect REPLs

22:54 dnolen: emezeske: but not resetting namespaces for every build seems dubious.

22:54 emezeske: we'll see when we get there - when REPLs start analyzing on the fly might have to dig deeper.

22:54 emezeske: dnolen: Yeah, I agree that should be done regardless

22:54 dnolen: Ah, right, I forgot they didn't do that yet

22:55 ibdknox: dnolen: what's this? I'm doing lots of analyzing - is there something I should know?

22:55 dnolen: emezeske: in anycase, these are some necessary optimizations

22:55 ibdknox: memory leaks with lein cljsbuild auto

22:56 ibdknox: ah

22:56 dnolen: ibdknox: you might want to play around with master to make sure this isn't affecting you, are you already?

22:57 ibdknox: not on this stuff, but I should be

22:57 dnolen: ibdknox: yeah, it would be helpful for the people really pushing CLJS to try out master periodically.

22:58 ibdknox: I'll figure that out tomorrow and start running on it all the time

22:58 does checkouts just work?

22:58 I feel like it should

22:58 emezeske: ibdknox: No

22:58 ibdknox: darn

22:58 emezeske: ibdknox: Because clojurescript isn't a lein project

22:58 ibdknox: oh right.. I forgot I added that

22:59 lol

22:59 just add it to the classpath then?

22:59 dnolen: yoklov: try CLJS master, memory issues should be fixed now.

22:59 emezeske: ibdknox: https://github.com/emezeske/lein-cljsbuild/issues/58#issuecomment-5255206

22:59 yoklov: oh

22:59 emezeske: ibdknox: That's what I'm doing, you can probably do something similar

22:59 yoklov: awesome!

22:59 ibdknox: emezeske: thanks :)

23:00 dnolen: yoklov: I couldn't let a memory leak let your ludum dare weekend slow down :)

23:01 emezeske: alright, I've gotta grab some dinner, later people!

23:01 dnolen: emezeske: thanks a million

23:02 mmarczyk: is PTS ready to go?

23:02 mmarczyk: dnolen: definitely should be

23:03 yoklov: dnolen; haha, thanks :)

23:03 mmarczyk: dnolen: patch on the ticket, the tests pass and apparently actually test something, since they caught the PTM issue

23:04 madsy: dnolen: Yeah, I thought the version was a bit off. Thanks, I got the right one :)

23:04 dnolen: mmarczyk: merged master

23:04 mmarczyk: dnolen: oh great :-)

23:05 dnolen: k I'm really done, good day for CLJS :)

23:06 later all

23:12 kovasb: anyone have cljs problem - implementing protocols where function has multiple arity definitions

23:12 (defprotocol test

23:12 (foo [a] [a b])

23:12 )


23:14 ivan: is there something that can make Clojure automatically compile .java files in my CLASSPATH?

23:16 kovasb: ivan: clojure doesn't compile raw java files, thats javac's job

23:16 ivan: but lein has hooks to compile the java in your project

23:17 ivan: yep. I want to figure out some way to do it without lein

23:18 kovasb: there might be some other projects on github or something. buts its not really a clojure-specific problem

23:18 ivan: thanks

23:18 kovasb: sure theres plenty of things out there to automate java compiling :)

23:23 amalloy: kovasb: (defprotocol test (foo ([a] [a b]))), right?

23:23 kovasb: amalloy: yeah, and when I implement the protocol in a deftype, it blows up

23:26 it looks as if the compiler is inserting clojure literals in the js, where it should not

23:27 mmarczyk: kovasb: you wouldn't by any chance be doing this in a single-segment namespace?

23:28 kovasb: i.e. (ns foo ...) ..., as opposed to (ns foo.core ...) ...

23:28 kovasb: mmarczyk: what do you mean by "single-segment"?

23:28 mmarczyk: kovasb: no dot in the name

23:28 kovasb: mmarczyk: there are dots

23:29 mmarczyk: kovasb: ok. which version of cljs?

23:29 kovasb: is function ([a],1){ … } valid javascript?

23:30 mmarczyk: kovasb: I sort of recall fixing this sort of thing a while back

23:30 kovasb: looks like 971

23:30 ok, will try a newer version

23:32 mmarczyk: kovasb: 2e1f9023de, 239b136f, 7cee8abe should fix this issue

23:32 kovasb: although apparently not all is well :-( -- http://dev.clojure.org/jira/browse/CLJS-174

23:32 kovasb: upgrading to 1011 gives a different error..

23:32 thanks!

23:33 mmarczyk: np

23:33 what's the error now?

23:33 kovasb: "Exception Unsupported binding form: 1 clojure.core/destructure/pb--4421 (core.clj:3951)"

23:34 the 1 is from my trivial implementation of foo

23:34 do those commits corresponds to anything on clojars?

23:34 mmarczyk: probably not

23:35 you could build latest master -- git clone git://github.com/clojure/clojurescript.git then in the repo run script/build

23:36 kovasb: yeah, I've been using noir-cljs to auto build for me

23:36 mmarczyk: a .jar will be installed in ~/.m2 -- Maven prints out the name

23:36 kovasb: oh ok

23:36 sweet

23:36 will try that

23:37 mmarczyk: cool

23:37 if the problem's still there, any chance of a paste?

23:37 I'd try to reproduce

23:37 kovasb: building now. if its still there will extract an example

23:37 mmarczyk: ok

23:38 brb

23:42 kovasb: mmarczyk: same error about binding form

23:42 will see if i can reproduce at repl with minimal input..

23:50 mmarczyk: https://refheap.com/paste/2287

23:55 though this breaks at the normal clojure repl also. must be missing something about the syntax here

23:58 mmarczyk: kovasb: (deftype test [] foo (bar [a] 1) (bar [a b] 2))

23:59 kovasb: that breaks at the jvm clojure repl

23:59 ClassCastException clojure.lang.Var cannot be cast to java.lang.Class clojure.lang.Namespace.referenceClass (Namespace.java:129)

23:59 mmarczyk: kovasb: name clash

23:59 kovasb: try (deftype test2 ...)

Logging service provided by n01se.net