#clojure logs

2012-04-21

00:34yoklovemezeske, 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
00:34yoklovit's referring to the compiled cljs.core file
00:36yoklovand the error seems to be coming from within gclosure. no idea.
00:36emezeskeyoklov: Never seen that before.
00:37yoklovlol, weird
00:38yoklovhttps://refheap.com/paste/2274
00:38yoklovit claims to succeed compiling
00:38yoklovbut it is lying
00:39emezeskeMakes very little sense to me.
00:39yoklovme neither
00:39yoklovi feel like I'm the only one who gets these sorts of errors
00:40emezeskeI feel like that too :)
00:40emezeskeBut that doesn't make any sense
00:40yoklovi also have to do lein cljsbuild clean very often to make it actually do anything
00:41yoklovespecially (or maybe only, now that I think about it) after it something like this happens
00:41technomancyhmmmm... so apparently disabling string mutability in emacs lisp doesn't really break very much code.
00:42technomancyif 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
00:43technomancyI'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.
00:43clojurebotlearning a new runtime is much harder than learning a new language.
00:43technomancy"Because anything else is horrible, you know?" / "No... I don't." / "Well it is."
00:44emezeskeyoklov: Yeah, I dunno, I have not experienced that.
00:44technomancyand while I would love to just tell people to read the egal paper, I don't think anyone actually will.
00:46technomancy"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"
00:47emezesketechnomancy: Are there people who still think strings should be mutable?
00:47technomancyemezeske: there are people who don't want to introduce breaking changes to a ~30-year-old codebase =)
00:47emezesketechnomancy: (in a high level language)
00:47emezeskeHahaha
00:47emezeskeYeah, there are those :)
00:50technomancythen again, they added lexical scoping
00:52technomancythinking about pushing the referential transparency angle, but that's more about pure functions than immutable data structures
00:53emezeskePeople really seem to "get" the benefits of referential transparancy, I think
00:55technomancyI think I need to re-read the egal paper mining it for persuasive purposes
00:55technomancybut they're tired of me ranting about it in the #emacs channel
00:59technomancyhttp://home.pipeline.com/~hbaker1/ObjectIdentity.html
00:59technomancyit's fairly accessible
01:07emezeskeThanks
01:19muhooi 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
01:20gozalacan someone help me out with some issue I can't figure out
01:20gozalahttps://gist.github.com/2431249
01:20muhoowell, not empty, it has 6 tables with 1 or 2 entries per table
01:21gozalafor some reason line 102 does not seems to be called
01:21muhoogozala: because it's not realized? the seq isn't done yet?
01:22gozalamuhoo: no it's strange
01:22muhoowait, in line 92 you're telling it to realize, then in line 94 you are saying, execute this only if NOT realized
01:22gozalaif I comment out 103
01:22muhooit'll never execute
01:22gozalait works
01:23gozalaso I have a feeling that observers are cleaned up before map calls a function
01:23wkmanireWell a long long time ago, in a galaxy far away Naboo was under an attack.
01:24gozalamuhoo: yeah so you can realize deferred only once
01:24gozalaif it's already realized subsequent calls are ignored
01:25noidigozala, maybe you want to call doseq instead of map?
01:25gozalaso line 96 does the work and so does 103
01:25gozalanoidi: ok
01:25noidimap is lazy, and you never use the result, so it doesn't do anything
01:26gozalanoidi: aha I see
01:26gozalabut print does I guess
01:26gozalaI mean if I execute same in repl
01:26gozalait will try to print result and that is why it's executed
01:27noidiyes, print will read the values of the seq causing it to be realized
01:28muhoohmm, the old repl-forces-realization-of-lazy-seqs heisenbug, eh?
01:29muhooi think google appengine is exactly the wrong tool for a simple little webapp with not much data or traffic
01:30muhooi should have rewritten it from scratch in clojure and couchdb
01:30wkmaniremuhoo: Rewritten what?
01:31muhoowkmanire: oh this silly python thing i got tasked with customizing
01:31muhooruns on appengine. bigtable, small data
01:32wkmaniremuhoo: At least you get to work with python.
01:33wkmanireI particularly like it.
01:33muhooyes, that's the good part. python was my favorite language for like 8 years
01:33wkmanireIt is my favorite imperative language.
01:33wkmanireBecause of the syntax.
01:33wkmanireI like the way javascript works a little more.
01:33muhoohave to agree. i rather like c though too, i have to admit.
01:34muhoobut just for drivers or microcontrollers
01:34wkmanireBut javascript is ugly.
01:35wkmanireI don't personally like C. It gives me too much rope.
01:35muhoowhat, you don't like segfaults?
01:35wkmanireNot in particular.
01:36wkmanireIf 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.
01:36wkmanireI`ve only honestly done stuff with Elisp and Clojure up until now.
01:36wkmanireI failed to learn Haskell once.
01:36wkmanireOf the FP languages*
01:36wkmanirebleh.
01:36muhooyou've been using emacs for a while, IIRC, right?
01:36wkmanireMy English language is being horrable.
01:36wkmanireYes, I think about 5 years now... so I'm almost not a newb anymore.
01:37muhooemacs is the javascript of lisps
01:37muhooelisp, sorry
01:38wkmanireI actually prototyped some of the address book application I'm working on right now in ELisp the other night.
01:38muhooanyway, i'm done whining. i'm trying to break the habit.
01:38wkmanireI'm not sure exactly why I did that, but luckily enough technomancy was there in #emacs to help me out
01:39muhoohehe. i find i understand elisp a lot better now after doing a bit of clojure
01:39wkmaniresame
01:39wkmanireI really want to write a major-mode for VB.Net
01:40wkmanireUnfortunately it is my day job language for at least another 6 months.
01:40wkmanireProbably more like 1 year.
01:40wkmanireAnd I hate working in visual studio.
01:40muhooi can see why
01:40wkmanireBut I just don't have the FP skills to get the job done yet.
01:40seancorfieldwkmanire: don't let ibdknox hear you say that :) he was product manager of it when he worked at microsoft :)
01:40wkmanireHopefully clojure will help me bridge that gap.
01:41muhoothat's what i'm doing too
01:41wkmanireseancorfield: I knew that :) I'm shameless.
01:41muhootrying to retrain myself to build a shinier world
01:44seancorfieldI 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...
01:44wkmanireseancorfield: Good point. Clojure is approachable in a way that Haskell is not.
01:44wkmanireThis channel makes a lot of difference too.
01:44wkmanire#emacs tends to eat people. I've been eaten there at least twice.
01:45wkmanireClojure also has a very good reputation in some of the other channels such as #python.
01:45muhoowkmanire: omg, you should have seen #debian 10 years ago
01:45muhooit was like 4chan is now
01:46wkmaniremuhoo: You know 4chan is not something I was ever a part of.
01:46muhooor some of the rooting-oriented channels (cyanogenmod, android-root, etc)
01:46wkmanireIRC is the most social thing I do on the internet.
01:47muhoothis is a good group. i'm trying to learn how to fit in with it a bit better.
01:48muhoolike, now i'm going to shut up and go code :-)
01:48wkmaniremuhoo: In another month I'll be able to field some questions. :) That'll be a good start for me.
01:48wkmaniremuhoo: You've helped me quite a bit too.
01:48wkmaniremuhoo: Good luck with your project.
01:51seancorfieldMmm, beer sounds good... brb...
01:52wkmanireseancorfield: Tastes better than it sounds.
01:52seancorfieldI have a Shock Top Pumpkin Wheat ale... it tastes really good :)
01:53wkmanireseancorfield: Oooh, I like shock top.
01:53wkmanireseancorfield: Their regular shock top is a lot like Blue Moon.
01:53seancorfieldMy wife's a big fan of Shock Top - and Blue Moon
01:53wkmanireYou can even put an orange slice in it for the same effect.
01:53seancorfieldI like the Pumpkin Wheat better
01:54wkmanireI was a new castle drinker for a long time, recently converted to Sam Adams fan.
01:54wkmanireBut since I've been in Brazil all I've been drinking is this crappy Crystal and Skull.
01:54wkmanire"Skull" is pronounced like skoh.
01:55wkmanireIt makes me want a Coors light.
01:55seancorfieldNewkie Brown... don't know why folks outside the UK seem to like that so much... I think it's really skanky :(
01:55wkmanireSam Adams is better for sure.
01:56seancorfieldSome of the Sam Adams brews are OK. Coming from the UK I'm a bit of an ale snob :(
01:56seancorfieldAnd living in the SF Bay Area (California) I'm spoiled by all the microbrew pubs...
01:57wkmanireAwesome. Microbrews are the best.
01:58seancorfieldYeah, it's _almost_ as good as being in the UK :)
01:58wkmanireI can't make an argument having never been there.
01:59seancorfieldSo what got you interested in Clojure?
01:59wkmanireAh, an easy question.
01:59wkmaniredash from #python.
01:59wkmanireHe talks (rants) about languages a lot.
01:59wkmanireI mentioned trying to learn Haskell to him and he suggested clojure.
02:00wkmanireAnd that idea was gangpiled by a few others.
02:00wkmanireSo I /join'd my way on over for a spell.
02:00seancorfieldInteresting... So Pythonistas prefer Clojure to Haskell?
02:01wkmanireI think you could mount an argument for that.
02:01TEttingerwkmanire, yeah clojure has... much better library support. type system is totally different though, not much comparison possible there
02:01wkmanireBut I don't know for sur.e
02:01ibdknoxeveryone prefers Clojure to Haskell!
02:01TEttingerboth focus on concurrency, both have good laziness support (clojure has much better non-laziness)
02:01seancorfieldPython 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...
02:02seancorfieldOr to EventBrite when she moved on to there. Best boss I ever had.
02:02wkmanireseancorfield: Its hard to beat Python as far as imperative languages go.
02:02seancorfieldI feel it's a whole in my education :)
02:03wkmanireIt's*
02:03seancorfieldI grew up on C, C++ then Java... Lots of systems programming in the 80's / 90's...
02:03seancorfieldHmm, s/whole/hole/ ... that was a weird slip.
02:04wkmanireseancorfield: In the 80's I was between 0 and 5. :)
02:04wkmanireI started on Qbasic as windows 3.1 was being replaced by windows 95.
02:04wkmanireLearned 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.
02:05seancorfieldHeh... I'm a greybeard :) Graduated university in '83 and spent three years doing PhD research into functional programming language design and implementation :/
02:06wkmanirePretty cool. I've often wondered what it would have been like to go the university route. I'm one of those uneducated self-taughts.
02:06wkmanireDid you complete your PhD?
02:06seancorfieldI'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
02:07wkmanireWindows isn't that bad.
02:07wkmanireI just like Linux more.
02:07seancorfieldNo, 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 :)
02:09seancorfieldBut 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 :(
02:09wkmanireThere are some pretty strong advocates of Haskell at google
02:10seancorfieldIt'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 :)
02:11wkmanireseancorfield: Would you use an imperative language to write a serious project?
02:13seancorfieldTough 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...
02:14ibdknoxseancorfield: what's missing for you?
02:14seancorfieldAt World Singles, we're moving more and more of our back end to Clojure but moving our front end isn't our on roadmap.
02:15seancorfieldAn elegant web templating solution. Nothing I've seen really lights my fire.
02:15seancorfieldIncluding my own web framework, FW/1, which I ported from CFML :)
02:15ibdknoxdo you have any thoughts on what such a thing might look like?
02:16seancorfieldAs 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...
02:16ibdknoxwhat aspects of it?
02:17seancorfieldFor views / layouts, it's a natural fit with HTML (if you're disciplined). It feels "integrated".
02:17zii-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?
02:17seancorfieldAnd these days, the CFML scripting language (not tag-based) is great for web controllers.
02:18ibdknoxseancorfield: I've been thinking about this stuff for a while but haven't come to a solid conclusion on it yet
02:18seancorfieldzii-prime_: not swap! ?
02:18kovasb_time for some friday night coding
02:18ibdknoxseancorfield: do you have any particularly cool examples I could learn from?
02:19wkmanireseancorfield: 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.
02:19seancorfieldMy 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.
02:19hiredmanseancorfield: have you played with enlive at all?
02:20seancorfieldhiredman: yes, my FW/1 port is based on Enlive and Ring.
02:20seancorfieldand we used Enlive at World Singles for HTML email generation.
02:20wkmanireI 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.
02:21seancorfieldwkmanire: yeah, I don't think any tech has really nailed the web template side of the equation
02:21hiredmanseancorfield: so you like it? prefer CFML (which I know nothing about)?
02:21seancorfieldI'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
02:22seancorfieldSimple conditionals, loops and variable substitutions.
02:22hiredmanisn't that kind of the exact opposit of enlive?
02:23zii-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.
02:24hiredmanlock? for an atomic reference?
02:24zii-prime_implicit in the swap! ?
02:24seancorfieldIt'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.
02:24charles_rhave you tried noir?
02:25seancorfieldI've looked at various Noir examples and it feels too... "bitty" for me... with partials and so on...
02:25charles_rbitty?
02:25hiredmanzii-prime_: I would be more concerned with the function being run more than once
02:25hiredmanzii-prime_: why not just deref the atom?
02:26ibdknoxseancorfield: what about mustache then?
02:26seancorfieldcharles_r: bitty, fragmented... it's just not how I like my web applications... :)
02:26wkmanireibdknox: Does mustache have anything to do with the javascript moustache template library?
02:26hiredmanI found enlive to be a very painful few hours
02:27zii-prime_hiredman: like (doseq [f @drawables ] (f)) (aset! drawables []) ? that would drop fns added to drawables
02:27seancorfieldibdknox: which moustache?
02:27ibdknoxwkmanire: mustache is a spec: http://mustache.github.com/
02:27hiredmanzii-prime_: you're new, yes?
02:27ibdknoxseancorfield: e.g. stencil in clojure, this: http://mustache.github.com/
02:27zii-prime_hiredman: oh um yes... am I doing something wrong?
02:28hiredmanzii-prime_: yes
02:28wkmanireibdknox: I never realized!
02:29seancorfieldibdknox: that links to clostache and based on the examples there, no, that wouldn't suit me either
02:29seancorfieldit overloads too much syntax to try to cater for all the necessary use cases
02:29hiredmanbut was rather happy with what I ended up with from enlive
02:29zii-prime_hiredman: ...what?
02:29seancorfieldwhat's wrong with clear, simple 'if', 'loop' constructs?
02:30hiredman(but I don't really do web apps)
02:30seancorfieldso many solutions strive so hard to avoid "logic" in html templates that they make you jump thru hoops to do obvious stuff
02:31seancorfieldbut other solutions go too far the other way and allow arbitrary code in templates which is bad
02:31hiredmanzii-prime_: there is no such thing as aset!
02:31wkmanireseancorfield: I think that comes from overly zealous views of MVC patterns.
02:31wkmanirethe no logic in templates portion.
02:32hiredmanzii-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
02:32hiredmana reference for that kind of approach might be something like rich's ants demo
02:32wkmanireI 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.
02:33seancorfieldibdknox: 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'...
02:33seancorfieldhttps://github.com/Flamefork/fleet
02:33ibdknoxseancorfield: you want comb
02:33ibdknoxmuch, much better
02:34ibdknoxand beautifully simple
02:35seancorfield'k... link? (to save me googling)
02:35zii-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.
02:35ibdknoxseancorfield: https://github.com/weavejester/comb
02:36seancorfieldah, james reeves... should have guessed :)
02:36seancorfieldhasn't been touched in a year tho'...
02:36ibdknoxseancorfield: look at it
02:36hiredmanzii-prime_: have you considered just using a queue?
02:36ibdknoxit doesn't need to be
02:36ibdknoxlol
02:36ibdknoxit's like 60 lines
02:36ibdknoxvery clever :)
02:37wkmanireLooks like there are a lot of options for templating libraries.
02:37zii-prime_hiredman: oooooo~ I have not. ...that would work better. thanks!
02:37wkmanireDoes noir make it easy to use any of them or is there one in particular that Noir "likes"?
02:37seancorfieldibdknox: but how efficient is it for complex html pages and high traffic?
02:38ibdknoxseancorfield: compiles down to string concats
02:38ibdknoxwkmanire: you can use anything :)
02:38ibdknoxseancorfield: can't be much faster really
02:39wkmanireibdknox: Awesome.
02:39ibdknoxit 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
02:39seancorfieldibdknox: hmm, looks like if i call (template/eval file bindings) it would re-read the file each time?
02:40seancorfieldah, (template/fn ...)
02:40seancorfieldbut 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
02:41seancorfieldand you can't save the fns to .class files for management by classloaders etc
02:42seancorfieldall of that is automatically handled by cfml - caching, automatic recompilation
02:44charles_rI accidentally define something over an existing function
02:44charles_rhow can I "undefine" it?
02:44charles_r0no
02:45ibdknoxseancorfield: sure, I'm not sure there'd be that much work to get comb there
02:45ibdknoxstill not convinced it's a great solution either though :)
02:47_atocharles_r: (def thing clojure.core/thing) ?
02:47charles_r(ns-unmap something something)
02:47charles_rhmmm
02:47charles_roverwrite again
02:48charles_rit doesn't like it
02:52charles_rI tried, (ns-unmap 'clojure.repl 'apply)
02:52charles_rdoesn't work
03:01scottjis 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
03:07emezeskeHaha, awesome, using pr-str/read-string, you can store arbitrary clojure objects in an HTML5 element's data-* attributes! :)
04:07bolichttp://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.
04:16AimHerebolic > You can mitigate it somewhat by replacing the two 'ackermann' instances after (zero? n) and ':else' with recur
04:16AimHereThat lets me get ack(3,9)
04:17AimHere(4,2) still overflows, though, because of the call that isn't in the tail position
04:22ChousukeI don't think there's any way to get rid of the stack growth
04:22Chousukeyou can increase the stack size though, with a JVM parameter
04:23AimHereThere is a Project Euler puzzle to find (ackermann 6 6), so presumably for higher values, you need better algorithms
04:24bolicAimHere: Thanks again. I didn't study comp sci, so I wasn't sure whether this was a stupid question
04:36GeraldMacDuichbolic, just remove 'ackermann' at the bottom with 'recur'
04:36GeraldMacDuichThat's a tail call
04:37GeraldMacDuichAlso, on the second row
04:37GeraldMacDuichthe ackermann there is also a tail call
04:37GeraldMacDuichhttp://pastebin.com/HrETFYjp somethingf like that
04:38AimHereDoesn't fix it entirely because the non-tail call to ackermann still junks up your stack
04:38GeraldMacDuichShould be rewritabel thyough
04:39GeraldMacDuichEhh
04:39AimHereShould it?
04:42portlyHi (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.
04:43GeraldMacDuichAimHere, or wiat, no, ackermann is not primitively recursive, hmm...
04:44GeraldMacDuichTHe point with clojures loop/recur is that you can't recur to an outer loop. :/
04:44AimHereWell 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
04:47AimHereIt is 19,729 digits long though
04:54portlyHi, anyone able to help with #'foo?
05:59clojure_newbhow does enclojure compare with emacs+slime+swank ?
06:20slimefighterI 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?
06:41neotykslimefighter: have you tried clojure-jack-in?
06:42slimefighterneotyk, no, what are the steps to install that? do we need ELPA before that?
06:48neotykslimefighter: I use it with emacs24 and install emacs starter kit
06:48neotyk from elpa
06:59Hali_303hi! 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?
07:13_KY_A function must return with the same type?
07:13_KY_Can I return nil in an otherwise numeric function?
07:16Bronsa,(#(#{1 nil "str"} %) (rand-int 2))
07:16clojurebotnil
07:16Bronsa,(#(#{1 nil "str"} %) (rand-int 2))
07:16clojurebot1
07:16Bronsayes.
07:23_KY_I see...
07:32_KY_How do I trace a function in REPL?
07:33neotyk_KY_: https://github.com/clojure/tools.trace that?
07:42Hali_303what is the difference between (quote (1 2 3)) and (list 1 2 3) ? I've got a function that only works with the latter
07:43AimHerequote just stops the evaluation of anything it refers to
07:43AimHerelist creates a list of the arguments
07:43Chousukein that case, there is no difference
07:44AimHereThere's plenty of difference
07:44Chousukebut if you do (quote (a b c)) vs (list a b c) you get different results
07:44Chousukein the stated case there isn't :)
07:44AimHereYou say that, yet the person saying so has the problem that they ARE different
07:45Chousuke,(= (list 1 2 3) '(1 2 3))
07:45clojurebottrue
07:45AimHereThat's just in the repl
07:45ChousukeI suspect the real case doesn't have the same values :P
07:46Chousukeit's that in the repl but it will be that in a real program too. number literals evaluate to themselves whether quoted or not
07:46AimHereIn his case, he's probably not putting them in at the command line
07:46AimHereNot true
07:46AimHereoops sorry
07:46AimHereIgnore what I just said
07:46Chousuke:P
07:47ChousukeHali_303: anyway, you would have to show us the actual code that causes the error
07:48Chousukeif 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.
07:54_KY_How do I change (1 2 3) into a sequence?
07:54AimHereIsn't it already one?
07:55AimHere,(seq (list 1 2 3))
07:55clojurebot(1 2 3)
07:55AimHere,(seq? (list 1 2 3))
07:55AimHereOops
07:55clojurebottrue
07:57_KY_I see...
08:29Hali_303AimHere: Chousuke: Thanks!
08:54jondot_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
08:54jondot_im not sure if this is an idiom or a clojure thing
08:54jondot_i'm assuming this is some kind of default values for params..?
08:55weavejesterjondot_: It's using Clojure's destructuring
08:55jondot_weavejester: to express something such as default values for parameters?
08:55weavejesterjondot_: http://clojure.org/special_forms
08:55weavejesterjondot_: Take a look at the "let" special form
08:56jondot_yep, ok
08:57weavejesterjondot_: But basically, yes, :or gives you default values when destructuring
09:05_KY_If I pass #(something) as an argument, is "something" evaluated first?
09:07Bronsa,((fn [_]) #(println 1))
09:07clojurebotnil
09:07Bronsano
09:11_KY_Bronsa: what does your code do?
09:12Bronsa(fn [_]) <= an anonymous function that takes an argument and returns nil
09:13_KY_Why does _ work in this case?
09:13Bronsa#(println 2) <= an anonymous function that takes no arguments and prints 2 (short form)
09:13Bronsa_KY_: _ is not some special symbol
09:13Bronsayou can use _ as you'd use a or b
09:13_KY_Ah I see...
09:14Bronsait's just common use to use "_" when you just don't care about some value
09:14_KY_Cool... thanks =)
09:39jondot_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?
09:40jondot_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
09:53offby1technomancy: but http://ix.io/2kw repros the problem with slime
09:53offby1or lein
10:06pandeiroanyone 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:08offby1pandeiro: are you asking about how to search emacs' buffers for a particular string or regexp? That's easy -- M-x multi-occur
10:09offby1actually ibuffer-do-occur is probably easier
10:10offby1better yet -- https://gist.github.com/2437224
10:13pandeirooffby1: 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:31pandeirogah 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:32pandeironot really an issue with clj but with the automatic compilation cljs toolchains the stacktrace doesn't give you any leads
10:48wkmanire`Bom dia :)
10:52angermanwhat 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:53dnolenneotyk: ping
11:19yoklovi think the lein-cljsbuild bugs I'm running into might be because of using cljs head
12:05technomancyoffby1: aha... the problem is it's not flushing
12:05technomancyadd a call to flush inside the binding block
12:05technomancythat's annoying =(
12:07technomancyoffby1: apparently *flush-on-newline* is respected for *err* in 1.4.0 though
12:13angermanis there a function to walk a hiccup html struct? or do I have to write one myself?
12:17yoklovin cljs should (get my-record :foo) be about as fast as (.-foo my-record)
12:22offby1technomancy: since when is stderr buffered?! Kids today ...
12:22mmarczykyoklov: 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:23yoklovokay
12:23yoklovhm
12:23yoklovso yeah slower
12:23yoklovbut not by much
12:23mmarczykjust looked up the code -- that's how it works
12:23mmarczykyeah.
12:39neotykdnolen: thanks for cljs-35 and cljs-161! I love your
12:39neotykresponsiveness
12:40dnolenneotyk: np, thx for patches - those are long outstanding improvements
12:40dnolenmmarczyk: ping
12:40mmarczykdnolen: hi
12:40dnolenmmarczyk: CLJS-189 looks cool
12:41mmarczykdnolen: great
12:41dnolenmmarczyk: what do you mean by int bounds?
12:41mmarczykdnolen: actually I think I take that back
12:41mmarczykdnolen: hmmm, well
12:41dnolenmmarczyk: in JS you have 53bit integer
12:42mmarczykdnolen: ok, good
12:42mmarczykdnolen: the current value is the max integer representable as double, I think
12:42mmarczykdnolen: unless I've mixed up magic constants
12:42mmarczykdnolen: max positive integer, rather
12:43mmarczykdnolen: fits in 53, so no problem
12:43dnolenmmarczyk: cool, I'll apply that now then.
12:43mmarczykdnolen: great, thanks!
12:46neotykdnolen: are reader literals planed for cljs?
12:46gfrederickshow do you run midge tests?
12:46gfredericks`lein test` seems to pretend that no tests were run
12:46neotykdnolen: and would it be very hard task to do?
12:46gfredericksI bet the midge readme would mention this why am I asking.
12:47dnolenneotyk: yep as soon as someone submits a patch.
12:47dnolenneotyk: I don't think so
12:47dnolenneotyk: just need to fix cljs.reader
12:48neotykdnolen: there is no ticket for it yet
12:48pandeirois there anywhere one can install the heroku client from source? (for non-apt distros)
12:48dnolenneotyk: feel free to make one
12:48neotykdnolen: I will try to understand how clj does it
12:48offby1pandeiro: technomancy should know
12:49dnolenneotyk: thx
12:49dnolenmmarczyk: applied to master
12:49pandeironm didn't realize they had it on github
12:50mmarczykdnolen: thanks!
12:50neotykwould clojure.browser.net now be able to enable websocket stuff,
12:50neotyklatest official gclosure already has it
12:55dnolenneotyk: it could w/ a patch ;)
12:58mmarczykdnolen: any chance you could have a look at CLJS-188 ? (fixes HashCollisionNode for PHM)
12:58hcumberdale(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:58mmarczykI'd like to build the test patch / transient patch on top of that
13:00dnolenmmarczyk: looking now
13:00angerman,(string? "foo")
13:00clojurebottrue
13:00angerman,(type "foo")
13:00clojurebotjava.lang.String
13:00dnolenmmarczyk: applied
13:00mmarczykdnolen: great, thanks!
13:04hcumberdaledid anyone discover the same issue?
13:05hcumberdale,(println *clojure-version*)
13:05clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier master}
13:06hcumberdale#(println *clojure-version*)
13:07AimHerehcumberdale, 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:08AimHereIf the behaviour is different for different arguments, you'll have to be more specific
13:15dnolenmmarczyk: one thing - be sure to run the repl when testing your patches
13:15dnolenmmarczyk: you're using key & val before they are declared.
13:15dnolenmmarczyk: I'll fix
13:17mmarczykdnolen: whoa, sorry for that, I'll pay more attention next time
13:36dabdif a function has signature f [x & args] how do I make a recursive call to it (apply recur x args)?
13:37dabdobv does not work bc recur is not a function
13:38dnolendabd: you can just (recur x args)
13:38dabdok
13:38dabddnolen: thanks
13:38AimHerednolen, that won't work will it?
13:38dnolenAimHere: it will
13:38dnolenAimHere: rest args are a convenient fiction
13:38AimHereWon't it try to pass along args as a vector the second time around?
13:43RickInGAdabd: you could try this https://refheap.com/paste/2275
13:49gfredericksAimHere: it's conceivable that last-argument-as-seq is the only way that recur behaves in the presence of rest args
13:53yoklovis there any overhead for protocols in cljs?
13:53dnolenyoklov: yes there is, around 1.5X in Chrome, closer to 2X in other browsers.
13:54yoklovhm, okay
13:54dnolenyoklov: to avoid the overhead you can always implement Object
13:54yoklovoh, and then just attach arbitrary methods to it?
13:54dnolenyoklov: yup.
13:55dnolenyoklov: internal PHM nodes do this and it works out nicely.
13:58ibdknoxjust need to add CLJS file discovery and eval and I think I'll be able to just edit light table from within itself :)
13:58RickInGAthat is pretty cool
13:58neotykwhat is #' ?
13:59dnolenibdknox: was wondering how long it would take to get to that point :)
13:59ibdknoxneotyk: short-hand for var
13:59ibdknoxdnolen: probably another couple of days is all :)
13:59neotykibdknox: thanks
13:59ibdknoxdnolen: to be moderately productive in it
14:00ibdknoxI've been futzing around with the command system for the past little bit
14:00ibdknoxcontext sensitive command system = hard lol
14:11yoklovdnolen: do I need to use the -method syntax that's used in cljs.core if I do that?
14:13yoklovactually no, nevermind, it looks like the Object methods dont do that.
14:19dnolenyoklov: you don't need - ever with methods, it's just a convention
14:19dnolenyoklov: only .- mean anything.
14:19dnolenmeans
14:19yoklovhm, okay
14:32derridahey 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:32derridadied the same way as before). This is the backtrace: http://sprunge.us/BbAV . I'm a bit stumped, any suggestions?
14:36offby1I tend to pester technomancy with my swank questions
14:45seancorfieldderrida: which version of leiningen and are you doing jack-in whilst editing a .clj file in a leiningen project?
15:02LauJensenGood evening gents
15:18derridaseancorfield: lein 1.7.1 on Java 1.7.0_01
15:19derridaseancorfield: 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:28danlarkin,(= #"foo" #"foo")
15:28clojurebotfalse
15:28danlarkinwat?
15:28clojurebotFor Jswat: start clojure with -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8888
15:29danlarkinregexes not being equal just bit me in the most annoying-to-debug way
15:29danlarkinI am using them as keys in a hashmap
15:29danlarkinwhich one should not do, apparently, since assoc will not replace the original, but instead just add a new one
15:31dnolendanlarkin: Patterns are Java objects, so blame Java.
15:32danlarkinnumbers are java opjects and = works with those
15:32danlarkinthis is not java's fault, it's clojure's
15:32xeqijava
15:32xeqijava's Pattern doesn't implement equals for it either
15:33danlarkinman. what? why would they avoid that I wonder
15:34jconnollyrelevant: http://stackoverflow.com/questions/10055034/java-comparing-two-pattern-objects
15:34AimHereWell regexes are funny things, they're compiled on the fly in any environment smart enough to do so
15:35danlarkinunfortunately assoc and friends won't allow me to extend their behavior to call .pattern on Patterns to fix this
15:36danlarkinor will they?!
15:41jconnollyI was wondering how meta-programmy clojure gets. I'm new to it, have not plunged into the language that deeply yet.
15:45AimHerejconnolly, high up on the scale, but not quite as high as, say, Common Lisp
15:48jconnollyAimHere: yeah, I'm digging through it a bit now. Not as high as say Ruby either. metaprogramming abounds with Ruby.
15:48angermanwhat do I do about stuff like: [WARNING] POM for 'xerces:xercesImpl:pom:2.9.1:compile' is invalid.
15:51amalloydanlarkin: you could probably do that in clojurescript, though i doubt it'd be a recommended practice
15:53dnolendanlarkin: = does not work you need ==
15:53dnolen,(= 1 1.0)
15:53clojurebotfalse
15:53dnolen,(== 1 1.0)
15:53clojurebottrue
15:53amalloyjconnolly: clojure has loads of metaprogramming; it's of a different nature than ruby's, so you're not seeing it yet
15:53danlarkinwhat I really need is for assoc to do the right thing :(
15:53amalloydanlarkin: you can fake it with a sorted-map, i bet
15:54amalloy&(let [m (sorted-map-by str)] (-> m (assoc #"foo" 1) (assoc #"foo" 2)))
15:54lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
15:54amalloywell, okay, with a comparator that compares regexes by calling str on them
15:56amalloy&(let [m (sorted-map-by (fn [r s] (compare (str r) (str s))))] (-> m (assoc #"foo" 1) (assoc #"foo" 2))) ;; danlarkin
15:56lazybot⇒ {#"foo" 2}
15:56dnolenjconnolly: the level of metaprogramming capability in Clojure far exceeds that offer by Ruby IMO.
15:56dnolenoffered
15:56danlarkinamalloy: ugh
15:56mmarczykdnolen: finally got TransientHM fully working & tested
15:57amalloysorry, dude
15:57dnolenmmarczyk: sweet!!!
15:58danlarkinamalloy: I'll probably use that, though, thanks
15:58danlarkineven though it makes me sad that I have to
15:58mmarczykdnolen: 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:59dnolenmmarczyk: so is that two patches on CLJS-181?
16:00mmarczykdnolen: yeah, I thought it makes more sense to have a separate patch with the tests
16:00mmarczykdnolen: since they are meant for both PHM and THM really
16:00mmarczykdnolen: not quite part of the first patch conceptually
16:02dnolenmmarczyk: applying now
16:02mmarczykdnolen: fantastic! thanks :-)
16:03dnolendone!
16:03mmarczykgreat :-)
16:05mmarczykdnolen: 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:13BorkdudeI'm trying out the leiningen plugin for Eclipse.
16:14BorkdudeThese are the steps I've taken: create a clojure project, added a project.clj manually, turned on leiningen support
16:14BorkdudeI hoped that "update dependencies" would work now, but nothing happens
16:31yoklovhuh.
16:32yoklovgot a new sort of weird error from the cljs compiler, but this one is from within clojure: https://refheap.com/paste/2277
16:33yoklovI feel like I must have messed up my setup at some point because i'm the only one who sees these errors :/
16:40emezeskedanlarkin: Could you just key the map on &(.pattern #"foo") ?
16:42pellebHi guys, is there a way of defining a var where the name is the output of a function without getting into macros?
16:42pellebeg. (def (symbol "FOO") "BAR")
16:42mmarczykyoklov: did you try cleaning out all build artifacts and repackaging cljs?
16:43danlarkinemezeske: yes, but that's not what I want to do
16:43danlarkinI want the Pattern objects to be the keys
16:43emezeskepelleb: (eval `(def ~(symbol "FOO") "BAR"))
16:43yoklovmmarczyk: 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:43Iceland_jackpelleb: That's probably not what you want to do
16:43emezeskepelleb: Although there's nothing to be afraid of with macros :)
16:44pellebI know. I tried solving my problem with macro's and I'm stumped on something there as well.
16:44clojure_newbdoes counterclockwise have an irc channel?
16:45mmarczykyoklov: well, lein clean wouldn't help for cljs, but anyway
16:45mmarczykyoklov: how are you running the compiler when this happens?
16:46yoklovmmarczyk: lein cljsbuild auto, and I do lein clean, cljsbuild clean when i do clean
16:47yoklovI usually have to do lein clean, cljsbuild auto when I do auto too, otherwise nothing might happen
16:47mmarczykyoklov: where do you get the clojurescript jar from though?
16:47yoklovI'm using a clone of cljs head which I add to the extra-classpath-dirs
16:48pellebI guess I should not be scared of eval. Years of working with non lispy languages make me scared of even touching it.
16:49amalloypelleb: ##(doc intern)
16:49lazybotjava.lang.SecurityException: You tripped the alarm! intern is bad!
16:49amalloya hundred times better than (eval `(def ...))
16:50pellebamalloy: Nice that will probably do what I need
16:51amalloythough really, it's pretty unlikely you should be creating vars whose names you don't know at compile time
16:52mmarczykyoklov: that's weird :-(
16:52yoklovhaha, yup
16:52mmarczykyoklov: shooting in the dark -- any stale .class files lying around?
16:53yoklovhm
16:53yoklovnope, not that I can tell at least
16:53emezeskeyoklov: Have you tried building the clojurescript jar from HEAD, and adding that to your project.clj as a :dependency?
16:53yoklovemezeske, no, I havent
16:53emezeskeyoklov: Not ideal, but it might rule out any weird classpath issues with just using HEAD as a checkout
16:54mmarczykthat's what I tend to do, never ran into any issues
16:54yoklovso I build just with lein jar?
16:54mmarczykI haven't got around to figuring out how to prevent the jar from being copied to ~/.m2
16:54mmarczykyoklov: script/build
16:54yoklovoh
16:55mmarczykyoklov: which uses mvn -- cljs doesn't use lein
16:55yoklovyeah right cljs doesn't use lein
16:56yoklovokay, now how do I add the new folder as a dependency?
16:59emezeskeyoklov: New folder?
16:59yoklovnew folder with a jar
16:59yoklovinside of it
16:59dnolenyoklov: that seems like a very weird error, what triggered it?
17:00dnolenyoklov: is this something you're seeing during auto builds?
17:00emezeskeyoklov: I don't know how to do that; I just install things to ~/.m2
17:00yoklovdnolen: yes
17:00yoklovemezeske: i would do that by… copying the folder in?
17:00dnolenyoklov: what OS, what JVM?
17:01yoklovmac os x 10.7.3, Java 1.6.0_26
17:01emezeskeyoklov: Heh, I have only done "lein install", I have no idea how to work with maven directly :(
17:01yoklovemezeske, ah, so do lein install on the jar?
17:02dnolenyoklov: in your Java Preference are you defaulting to 64bit or 32bit?
17:02dnolenPreferences I mean.
17:02yoklovdnolen: 64 bit
17:03mmarczykyoklov: if you run script/build
17:03mmarczykyoklov: it'll install the jar for you
17:03yoklovoh, does it?
17:04dnolenyoklov: it does. but your error still sounds weird.
17:04mmarczykyoklov: note the version number (printed out by mvn at some point) and use that in your project.clj
17:04dnolenyoklov: what happens when you restart the lein cljsbuild auto process?
17:06yoklovit 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:06dnolenyoklov: 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:07yoklovhm
17:07dnolenyoklov: I've never used lein cljsbuild for really long periods of time, so you're probably experiencing a real bug.
17:07emezeskeI dunno, I frequently have auto running for 8-10 hours at a time
17:07dnolenyoklov: are you compiling with :whitespace optimizations only?
17:08yoklovdnolen: yeah
17:08dnolenemezeske: huh
17:08yoklovdnolen: whitespace, pretty print, and static-fns
17:09yoklovemezeske: maybe a difference in OSes or java versions is contributing somehow?
17:10dnolenyoklov: how long before the problem kicks in? an hour?
17:10yoklovyeah, about.
17:10yoklovsometimes sooner
17:10emezeskeyoklov: Could be. I am running Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
17:11JulioBarrosanyone 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:11yoklovif it makes any difference, the compiler starts slowing down before running out of memory usually
17:13emezeskeyoklov: This is a closed-source project, right?
17:13yoklovthat i'm working on right now?
17:13yoklovno
17:13emezeskeIs it up on github somewhere?
17:13yoklovhttps://github.com/thomcc/ld23
17:14emezeskeOh, nice, I can clone that and run a script to touch a cljs file every second
17:15yoklovemzeske: 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:15emezeskeyoklov: cool thanks
17:16emezeskeyoklov: does this project not compile except against a very new clojurescript version?
17:16yoklovemezeske: that is very possible
17:17emezeskeyoklov: kk
17:17emezeskeOkay, I'll get this stress test going
17:18emezeskeBTW, what does static-fns do?
17:18amalloythat's the one that avoids going through IFn.call when the thing is known to be a real js function, i think?
17:19emezeskeAh, cool, thanks
17:19coffchow can I apply a list of functions to an object and collect the results into a list?
17:19emezeskeyoklov: 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:20emezeske&(doc juxt)
17:20lazybot⇒ ------------------------- 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:20emezeskecoffc ^
17:20amalloy&((juxt + -) 5 2)
17:21lazybot⇒ [7 3]
17:21emezeskeyoklov: Oh, I think I see the problem
17:21yoklovemezeske, cool, though I'll be somewhat shocked if it's somehow my project
17:21emezeskeyoklov: So do you run "lein cljsbuild auto" exactly?
17:21yoklovlein cljsbuild auto dev
17:21coffcemezeske: will that work for native interop?
17:21emezeskeyoklov: Okay nevermind then
17:22yoklovusually lein cljsbuild clean, cljsbuild auto dev
17:22coffclike if I want to call several instance methods of an object
17:22emezeskeyoklov: Could you try "lein cljsbuild auto dev" and then my little script above?
17:23amalloycoffc: make them functions
17:23yoklovemezeske, yeah
17:24emezeskeyoklov: It's compiled several hundred times for me so far
17:24amalloy&((juxt (memfn length) (memfn toUpperCase)) "a string")
17:24lazybot⇒ [8 "A STRING"]
17:25Iceland_jackhttp://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:25yoklovemezeske: yeah, I dunno. I'll let you know how long it lasts.
17:25Iceland_jackIs there a clean way of doing something akin to Python's comparison of tuples?
17:26Iceland_jackWhere (1, 2, 3) < (1, 2, 4) would return False
17:26yoklovits been running for about a minute and a half now and crashed
17:26gfredericksamalloy: do you know why memfn is even necessary? i.e., would there be any downside to .foo having the semantics of (memfn foo)?
17:26emezeskeyoklov: Cool. I'll leave mine running in the background while I do other things
17:26amalloyanyway, 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:26amalloygfredericks: hiredman was talking about doing that. i dunno if he actually did, but i think he convinced me it's totally viable
17:27gfredericksamalloy: okay cool, just curious
17:27yoklovyeah it got through 16 compilations before crashing, and that seems pretty standard for me
17:27emezeskeyoklov: I'm at like 500 now
17:27gfredericksI would've guessed there would be performance concerns
17:27amalloyIceland_jack: those vectors are the same size, so i don't see how your two questions are related?
17:27yoklovactually it's usually 16
17:28amalloygfredericks: no more than memfn has
17:28Iceland_jackamalloy: compare doesn't look at the content
17:28emezeskeyoklov: Weird, it's 16 in the refheap you posted too
17:28amalloyIceland_jack: of course it does
17:28yoklovyeah, the last 5 have crashed after 16
17:28amalloy&(compare [1 2 4] [1 2 3])
17:28lazybot⇒ 1
17:28yoklovand potentially more
17:28amalloy&(compare [1 2 3] [1 2 4])
17:28lazybot⇒ -1
17:28emezeskeyoklov: Uh... that is *weird*
17:29Iceland_jackWhat about vectors of different length
17:29amalloythen it compares by length only
17:29yoklovemezeske: it certainly seems weird.
17:29Iceland_jackAnd is there any way of achieving Python's comparison functionality
17:30emezeskeyoklov: I'm gonna wait some time to see if mine crashes (like an hour). I'll report back.
17:30amalloy*shrug* just implement strcmp
17:30TimMcIceland_jack: https://github.com/timmc/handy/blob/master/src/org/timmc/handy.clj#L6
17:30yoklovk
17:30Iceland_jackTimMc: Thank you :) very helpful
17:31coffcamalloy: ok great, thanks
17:31amalloy&((fn [a b] (or (first (remove zero? (map compare a b))) 0)) [1 2 3] [2 3])
17:31lazybot⇒ -1
17:31amalloy&((fn [a b] (or (first (remove zero? (map compare a b))) 0)) [4 2 3] [2 3])
17:31lazybot⇒ 1
17:32amalloyi guess mine is incorrect
17:32Iceland_jackAh, so you'd have to implement it
17:33amalloy&((fn [a b] (compare (seq a) (seq b))) [1 2 3] [2 3]))
17:33lazybotjava.lang.ClassCastException: clojure.lang.PersistentVector$ChunkedSeq cannot be cast to java.lang.Comparable
17:33amalloyfeh
17:33Iceland_jackNo problem :)
17:35TimMcIceland_jack: Are you comparing version numbers, by any chance?
17:36Iceland_jackI'm actually not, I was using Python and wondered whether there was some equivalent function on Clojure that's all
17:36TimMcok
17:40Iceland_jackgood guess though :)
17:40mdeboarddoes python just compare hash values there?
17:40mdeboardor is it comparing each individual value
17:41mdeboard1 < 1 2 < 2 3 < 4
17:41mdeboardguess the latter
17:42TimMcCan't compare hashes.
17:42Iceland_jackWell except equal or not :D
17:42TimMcright
17:42TimMcThey wouldn't be very good hashes otherwise.
17:42Iceland_jackheh
17:43mdeboardpython's stdlib hash() you can do just that :P hash("a") < hash((1,2,3)) == True
17:43mdeboard(Python's stdlib hash() isn't very good hash)
17:43mdeboardI proclaim us both correct
17:44TimMcmdeboard: You can't *meaningfully* compare hashes.
17:44Iceland_jackmdeboard: how is it a bad hash?
17:44Iceland_jackHash functions come in all shapes and sizes
17:45mdeboardThis 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:46Iceland_jackI see...
17:47mdeboardsomething something referential transparency
17:47TimMcHmm, I see Python doesn't have perl's random-seeded hashing.
17:47seancorfieldhmm, nsfw... No Such Framework... my first reaction was "Not Safe For Work?"...
17:47Iceland_jackhaha
18:02kab3wmI'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:04TimMckab3wm: What happens if you call (.read (io/input-stream ...)) on it?
18:05TimMcJust to verify that you can indeed read from it.
18:07TimMckab3wm: Just remember that readers deal in characters, streams deal in bytes. So you'll definitely want the latter.
18:08kab3wmTimMc: 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:09TimMcSure, you're passing the return value of .read to .close. But at least you are reading.
18:09TimMcWait, 255... that's suspicious...
18:13kab3wmcurrently, without the .read in there, the value for that key in the db is set as: java.io.BufferedInputStream@3eae3da8
18:13TimMcSure, you or something else is calling str (and therefore .toString) on it.
18:13TimMcYou can't reasonably stringify an input stream. :-)
18:14clojure_newbwtf does slamhound do?
18:14clojure_newbdoes it automatically look at your source code and infer what refer/requires you need?
18:15kab3wmTimMc: 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:15kab3wmTimMc: thanks for the help
18:15TimMckab3wm: You need to read from the stream and insert that data instead.
18:16amalloyclojure_newb: that's the idea
18:16TimMckab3wm: I don't know how to do that in a simple fashion in Clojure, but in Java I use Apache's IO utils.
18:16clojure_newbamalloy: 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:18smokerI 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:19clojure_newbis "Cigarette Smokers Problem" a famous concurrency problem, like the 5 diners problem?
18:20smokerclojure_newb, yes
18:20smokerhttp://en.wikipedia.org/wiki/Cigarette_smokers_problem
18:22clojure_newbso this person created this problem
18:22clojure_newbspecifically to prove Dijkstras wrong?
18:23smokerbrb
18:25smokerclojure_newb, well tried i guess, but proved partially untrye
18:25smoker*untrue
18:56mmarczykdnolen: PersistentTreeMap + tests ready, CLJS-187
18:59mmarczykdnolen: ahhhhhh wait, I take that back -- found a glaring omission
19:11dnolenmmarczyk: cool! will take a look when you're done.
19:12emezeskeyoklov: ping
19:12yoklovemezeske: hey
19:13emezeskeyoklov: So, after a few hundred compiles, things are slowing down a lot
19:13emezeskeyoklov: The last one took 1158 seconds :)
19:13yoklovwow
19:13emezeskeyoklov: I don't know why it's not crashing for me, maybe just because I have gobs of ram
19:13emezeskeBut obviously something is wrong
19:13yoklovyeah, i have 4 gigs
19:14emezeskeHm, I only have 8 actually
19:15yoklovhrm. Still though, thats... unacceptably slow. Maybe your java has a bigger heap?
19:15emezeskeThat's my guess; I don't know how to easily check
19:15emezeskeAnyway, I'm going to fiddle with things to try to isolate the problem
19:17yoklovgood luck
19:17emezeskeThanks! I'll ping you when I find somthing
19:17yoklovsounds good
19:33mmarczykdnolen: 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:34mmarczykdnolen: 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:35dnolenmmarczyk: ah yes because Clojure throws.
19:35mmarczykdnolen: 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:37dnolenmmarczyk: we have type, (if (identical? (type x) (type y)) (garray/defaulCompare) (throw ...))
19:37mmarczykdnolen: Clojure happily compares against nil
19:38dnolenmmarczyk: and returns what?
19:38mmarczyk&(compare nil 1)
19:38lazybot⇒ -1
19:38mmarczyk&(compare 1 nil)
19:38lazybot⇒ 1
19:39mmarczykdnolen: I suppose we could live with comparisons against nil incurring an extra check though?
19:39mmarczykor two.
19:40dnolenmmarczyk: we should do whatever Clojure does.
19:40dnolenmmarczyk: identical? + calls to type are cheap
19:40dnolenso are nil checks
19:40mmarczyk(cond (identical? (type x) (type y)) (garray/defaultCompare x y) (nil? x) -1 (nil? y) 1 :else (throw ...))
19:41dnolenmmarczyk: looks good.
19:41mmarczykcool, I'll use that then
19:41dnolenmmarczyk: great
19:42mmarczykdnolen: ah, but do you think this should replace compare or just the default comparator for PTM?
19:42dnolenmmarczyk: replace compare
19:42mmarczykk
19:43dnolenmmarczyk: I'm thinking IComparable is probably useful, but we can add that later.
19:46mmarczykdnolen: ah yes; PTM will probably be able to use it automagically once it's in place
19:58mmarczykdnolen: done, http://dev.clojure.org/jira/browse/CLJS-191
19:58emezeskeyoklov, dnolen: Okay, I've reproduced the "compiler eating all memory and grinding to a halt" problem without lein-cljsbuild
19:59yoklovemezeske: huh.
19:59emezeskepaste incoming
20:00emezeskeyoklov, dnolen: I changed clojurescript/bin/cljsc.clj like this: https://refheap.com/paste/2284
20:00emezeskeThen I added [fs "1.1.2"] to the classpath
20:00the-kenny"(let [[a b] [1]] b) => undefined", is this desired behavior?
20:00emezeskeAnd then I ran this: ./checkouts/clojurescript/bin/cljsc src/ "{:optimizations :whitespace :pretty-print true :static-fns true :output-to \"public/js/main.js\"}"
20:00the-kennyIt breaks all kinds of things, like (= :foo b)
20:01the-kenny(= b :foo) works fine, thoughh
20:01yoklovthe-kenny: clj or cljs?
20:01the-kennyyoklov: cljs
20:01the-kennyb should be nil/null, not undefined
20:01yoklovthats odd, i could swear I have code which depends on that
20:01yoklovyeah you're right
20:02dnolenemezeske: wait so what's problem exactly?
20:02the-kennyHaven'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:02emezeskednolen: The compiler will eventually use up all memory and grind to a halt (I'm guessing due to gc time)
20:03emezeskednolen: Or, in yoklov's case, it will crash
20:03dnolenemezeske: what I'm saying is, what did you change?
20:03dnolenthe-kenny: hmm nil? check is coercive on undefined, why is this causing you a problem?
20:03emezeskednolen: I just call closure/build over and over
20:03yoklovthe-kenny: that works in my version of cljs, which version are you using?
20:04dnolenemezeske: why do you need the dependency (I'm asking for some context here)
20:04dnolen?
20:05emezeskednolen: Ah, because you need to delete the temporary files in the "out" dir to make the compiler actually do work
20:05yoklovthekenny: (= (let [[a b] [1]] b) nil) returns true in my latest-ish version
20:05dnolenemezeske: k, I'll take a fix that doesn't require a depedency.
20:05emezeskednolen: I didn't fix anything
20:05emezeskednolen: https://refheap.com/paste/2284 is just a repro
20:05the-kennydnolen. yoklov: Hmm. My test case is too simple :/ Sorry. I have to investigate some more
20:06dnolenemezeske: oh I see, so you have or haven't isolated the issue?
20:06emezeskednolen: I proved that it's not in lein-cljsbuild, that's all
20:07dnolenemezeske: 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:07the-kennyI do some strange destructuring which causes (= :foo a) to fail while (= a :foo) works fine
20:07the-kenny(I'll reproduce it tomorrow)
20:08dnolenmmarczyk: will take a look.
20:08emezeskednolen: I wish I could isolate the problem, but I hardly know where to begin :/
20:08the-kennydnolen: Btw: Thanks for merging my patch. My first baby step in contributing to Clojurescript :)
20:08emezeskednolen: I'm not that familiar with gc in java to begin with, much less clojure on top of it
20:08mmarczykdnolen: thanks! I'll have the new PTM patch up in a second too
20:10emezeskednolen: 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:11dnolenemezeske: ah so you think this problem did not always exist?
20:11emezeskednolen: I'm not certain, but I think I should have seen it with my 8-10 hour auto sessions
20:11emezeskednolen: It could be, though, that I'm not tickling the right part of the compiler
20:11mmarczykdnolen: done
20:12dnolenemezeske: bisection is worth pursuing - I know some things changed around closure.clj so you could be right.
20:12mmarczykdnolen: oh, thanks for applying
20:12emezeskednolen: Roger that. I'll report back later with findings.
20:14dnolenthe-kenny: np!
20:16dnolenmmarczyk: PTM patch applied to master
20:16mmarczykdnolen: great! :-)
20:35gfredericksit's hard to reuse the code from ring middlewares when working with aleph :(
20:37ferdI 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:39gfredericksferd: lazybot has a function that I think does that
20:39gfredericks$findfn 1 1 2
20:39lazybot[clojure.core/+ clojure.core/unchecked-add clojure.core/+' clojure.core/unchecked-add-int clojure.core/bit-shift-left]
20:39yoklovhm, what's the function to get the index of a value in a vector? is there one?
20:39gfredericksso if yours has anything to offer over that, they might be interested in integrating it
20:39ferdah, cool didn't now it existed already :-)
20:40mdeboardbasically everything already exists
20:40gfredericksyoklov: 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:40lazybot⇒ ------------------------- 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:41yoklovhrm
20:41gfredericks&(.indexOf [3 4 28 3] 28)
20:41lazybot⇒ 2
20:41gfrederickswell there's that too
20:41gfredericks&(.indexOf '(3 4 29 4) 4)
20:41lazybot⇒ 1
20:42yoklovthat probably wont work in cljs
20:42yoklov:(
20:42yoklovbut yeah i'llfigure something out
20:42gfredericksisn't that a JS function on arrays? _maybe_ they included it ... :/
20:48mdeboardWhat do you guys make in CLJS?
20:49mdeboardI don't actually do much in javascript, it's always little presentation-layer things
20:50dnolengfredericks: 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:51dnolenmdeboard: anything you would do in JS
20:51dnolenmdeboard: also thanks to the works of folks like mmarczyk we're making progress on C-in-C.
20:54emezeskednolen: Okay, here's the commit that causes the memory leak: https://github.com/clojure/clojurescript/commit/3173f1adc4d6d0a5b37d71e1b471f1c1f70404ef
20:55emezeskednolen: The leak does not happen before that commit.
20:55emezeskeSo, git bisect is freaking cool
20:57S11001001when it works
20:57dnolenemezeske: sadly can't address that tonight, but creating a ticket for it now.
20:57emezeskednolen: I might take a pass at it if I have time.
20:57emezeskeS11001001: Well technically git bisect always works, it's just not applicable to all problems
20:58S11001001emezeske: I've, twice, had to manually bisect when git bisect marked revs overeagerly as good or bad
20:58dnolenemezeske: http://dev.clojure.org/jira/browse/CLJS-192
20:58emezeskednolen: Thanks!
20:59emezeskeS11001001: Are you claiming that git bisect is buggy?
20:59S11001001bisection is solvable for all dags, but git-bisect doesn't support all dags
20:59S11001001so if bisect is meant to work only on strictly linear history, then it's fine
21:00emezeskeYeah, AFAIK it is only supposed to work on linear history.
21:00dnolenemezeske: nothing pops out at me from that commit ... but it's probably something simple.
21:01dnolenemezeske: actually, it might be because we hold onto the init-expr in defs for fns.
21:02dnolenemezeske: init-expr is the entire AST, which could be massive.
21:02emezeskednolen: Not sure if it's relevant, but I did trim the repro down to compiling a 5 line cljs file
21:03dnolenemezeske: what's that look like?
21:04emezeskednolen: (ns ld23.main) (defn hello [] "Hello")
21:05dnolenemezeske: sucks. k if you could take a look into it that would super awesome. otherwise I'll takea look tomorrow.
21:06dnolengotta run, sorry about that yoklov
21:06yoklovhm?
21:06dnolenyoklov: compiler memory leak bug.
21:06emezeskednolen: I'll poke around, will add notes to the ticket if I find anything
21:06yoklovhaha, don't worry about it
21:06dnolenemezeske: thx
21:08emezeskeyoklov: Unfortunately, the last non-memory-leaking commit is missing features that your project requires
21:08charles_rI'm getting an error on code that should work: Don't know how to create ISeq from: java.lang.Long
21:08charles_rhas anyone seen this before?
21:08yoklovemezeske, just out of curiosity what are they?
21:09emezeskeyoklov: I think variadic aget
21:09yoklovemzeske: ah. yeah thats nice but really I wouldn't want to go without PHMs
21:09emezeskecharles_r: I've seen that when I wrote wrong code
21:09yoklovcharles_r: are your arguments to nth or something reversed?
21:10charles_rI copied it right out of Clojure in Action
21:10charles_rdo you have that? if not I can copy it in a PM
21:10yoklovwhat's the code look like?
21:11yoklovif it's long: https://refheap.com/paste
21:11charles_rnot long
21:11charles_r(defn basic-item-total [price quantity]
21:11charles_r (* price quantity))
21:11S11001001oh that
21:11S11001001take out apply
21:11charles_rwhy?
21:11clojurebotwhy is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone
21:12S11001001it was wrong
21:12charles_rwasn't in the errata
21:12clojurebotPardon?
21:12mmarczykdnolen: 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:12S11001001popped up here
21:13charles_rso its just (f price quantity) ?
21:13S11001001yes
21:13charles_rI guess that makes sense
21:13charles_rthanks
21:13charles_r*crosses out apply*
21:42dnolenemezeske: still around?
21:42emezeskednolen: yep!
21:42emezeskefg
21:42dnolenemezeske: if you are I have a possible patch for CLJS-192, mind testing?
21:42emezeskeoops, irc is not a terminal
21:42emezeskednolen: Don't mind at all
21:44dnolenemezeske: thx!
21:45mmarczykdnolen: not sure if I missed you earlier, but there's a bug in PTM -- fix @ CLJS-193
21:45dnolenmmarczyk: yep I see it.
21:46mmarczykok
21:50emezeskednolen: No such luck :(
21:51emezeskednolen: Same results with the patch.
21:51dnolenemezeske: k don't have time to look more closely, I don't see anything else suspicious in that commit
21:52emezeskednolen: I think it must be the namespaces atom that's growing
21:52dnolenemezeske: we probably need to use a profiler, my change is the only obvious spot where memory might grow
21:52emezeskednolen: I'll keep poking around
21:53dnolenemezeske: yeah that's what I'm suspecting but I'm not sure where
21:55dnolenemezeske: k thanks, out for real now.
22:21dnolenemezeske: new patch on ticket, mind trying?
22:22emezeskednolen: Works like a charm
22:22emezeskednolen: 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:22dnolenemezeske: man excellent
22:23emezeskednolen: Actually, hold up
22:23emezeskednolen: May have spoke too soon
22:23dnolenemezeske: darn
22:25emezeskednolen: The new patch prevents the :defs from growing in my 'main namespace
22:25emezeskednolen: I'm trying to figure out what is still growing
22:26gtrak /join #java
22:27emezeskednolen: Okay, it is definitely the [:info :methods] that is growing
22:27emezeskednolen: So you're on the right track
22:28dnolenemezeske: hmm, so that's still growing?
22:28emezeskednolen: yeah, if I comment things out so the :methods key is not added, no memory leak
22:29dnolenemezeske: that's strange I'm only extracting :params
22:31emezeskednolen: very weird
22:32emezeskednolen: Maybe it's not the :methods that is growing; but it's existence causes growth elsewhere?
22:33dnolenemezeske: now that I think about it is does create an explosion of maps in memory.
22:33dnolenemezeske: got a better idea one second
22:38dnolenemezeske: patch updated
22:38dnolenemezeske: more deep nesting of maps, keeping things flat
22:38dnolenno more
22:39emezeskednolen: applying & testing
22:39dnolenemezeske: thx
22:41emezeskednolen: still unhappy
22:42dnolenemezeske: is there some specific what that namespaces is growing that your seeing?
22:43emezeskednolen: I can try to find that out
22:43dnolenspecific way I mean.
22:43madsyStupid question. I manually installed clojure from svn, but what kind of symlink/script name do editors and IDEs expect when invoking clojure?
22:43dnolenemezeske: when I run a simple analyze expression over and over I don't see anything.
22:43emezeskednolen: the weird thing is that, unpatched, the 'main namespace grows like mad
22:43emezeskednolen: but with your patch, it doesn't grow at all
22:43emezeskednolen: I need to look at the other namespaces
22:45dnolenemezeske: I wonder if the simple solution here is just to reset namespaces when build is called?
22:45emezeskednolen: That would definitely work
22:46emezeskednolen: I wonder if that might be a good idea for other reasons as well
22:46dnolenemezeske: yeah
22:46emezeskednolen: namespaces could have leftover defs and stuff that no longer exist in the source files
22:47dnolenemezeske: adding that now
22:47emezeskednolen: K
22:48dnolenemezeske: newer patch, please try
22:50emezeskednolen: test running, seems happy so far. I'll let it run for a few minutes
22:51dnolenmadsy: installed clojure from svn? sounds like you found some ancient instructions
22:52emezeskednolen: Okay, it's gotten through 200 builds so far without slowing down at all
22:52emezeskednolen: Before this last patch, it would get to about 40 and grind to a halt
22:52dnolenemezeske: excellent, k going to push this then.
22:52emezeskednolen: Sounds good!
22:53dnolenemezeske: still a bit mysterious honestly
22:53emezeskednolen: Yeah.. I wonder if the problem will affect REPLs
22:54dnolenemezeske: but not resetting namespaces for every build seems dubious.
22:54dnolenemezeske: we'll see when we get there - when REPLs start analyzing on the fly might have to dig deeper.
22:54emezeskednolen: Yeah, I agree that should be done regardless
22:54emezeskednolen: Ah, right, I forgot they didn't do that yet
22:55ibdknoxdnolen: what's this? I'm doing lots of analyzing - is there something I should know?
22:55dnolenemezeske: in anycase, these are some necessary optimizations
22:55dnolenibdknox: memory leaks with lein cljsbuild auto
22:56ibdknoxah
22:56dnolenibdknox: you might want to play around with master to make sure this isn't affecting you, are you already?
22:57ibdknoxnot on this stuff, but I should be
22:57dnolenibdknox: yeah, it would be helpful for the people really pushing CLJS to try out master periodically.
22:58ibdknoxI'll figure that out tomorrow and start running on it all the time
22:58ibdknoxdoes checkouts just work?
22:58ibdknoxI feel like it should
22:58emezeskeibdknox: No
22:58ibdknoxdarn
22:58emezeskeibdknox: Because clojurescript isn't a lein project
22:58ibdknoxoh right.. I forgot I added that
22:59ibdknoxlol
22:59ibdknoxjust add it to the classpath then?
22:59dnolenyoklov: try CLJS master, memory issues should be fixed now.
22:59emezeskeibdknox: https://github.com/emezeske/lein-cljsbuild/issues/58#issuecomment-5255206
22:59yoklovoh
22:59emezeskeibdknox: That's what I'm doing, you can probably do something similar
22:59yoklovawesome!
22:59ibdknoxemezeske: thanks :)
23:00dnolenyoklov: I couldn't let a memory leak let your ludum dare weekend slow down :)
23:01emezeskealright, I've gotta grab some dinner, later people!
23:01dnolenemezeske: thanks a million
23:02dnolenmmarczyk: is PTS ready to go?
23:02mmarczykdnolen: definitely should be
23:03yoklovdnolen; haha, thanks :)
23:03mmarczykdnolen: patch on the ticket, the tests pass and apparently actually test something, since they caught the PTM issue
23:04madsydnolen: Yeah, I thought the version was a bit off. Thanks, I got the right one :)
23:04dnolenmmarczyk: merged master
23:04mmarczykdnolen: oh great :-)
23:05dnolenk I'm really done, good day for CLJS :)
23:06dnolenlater all
23:12kovasbanyone have cljs problem - implementing protocols where function has multiple arity definitions
23:12kovasb(defprotocol test
23:12kovasb (foo [a] [a b])
23:12kovasb )
23:12kovasbget "ERROR: JSC_PARSE_ERROR."
23:14ivanis there something that can make Clojure automatically compile .java files in my CLASSPATH?
23:16kovasbivan: clojure doesn't compile raw java files, thats javac's job
23:16kovasbivan: but lein has hooks to compile the java in your project
23:17ivanyep. I want to figure out some way to do it without lein
23:18kovasbthere might be some other projects on github or something. buts its not really a clojure-specific problem
23:18ivanthanks
23:18kovasbsure theres plenty of things out there to automate java compiling :)
23:23amalloykovasb: (defprotocol test (foo ([a] [a b]))), right?
23:23kovasbamalloy: yeah, and when I implement the protocol in a deftype, it blows up
23:26kovasbit looks as if the compiler is inserting clojure literals in the js, where it should not
23:27mmarczykkovasb: you wouldn't by any chance be doing this in a single-segment namespace?
23:28mmarczykkovasb: i.e. (ns foo ...) ..., as opposed to (ns foo.core ...) ...
23:28kovasbmmarczyk: what do you mean by "single-segment"?
23:28mmarczykkovasb: no dot in the name
23:28kovasbmmarczyk: there are dots
23:29mmarczykkovasb: ok. which version of cljs?
23:29kovasbis function ([a],1){ … } valid javascript?
23:30mmarczykkovasb: I sort of recall fixing this sort of thing a while back
23:30kovasblooks like 971
23:30kovasbok, will try a newer version
23:32mmarczykkovasb: 2e1f9023de, 239b136f, 7cee8abe should fix this issue
23:32mmarczykkovasb: although apparently not all is well :-( -- http://dev.clojure.org/jira/browse/CLJS-174
23:32kovasbupgrading to 1011 gives a different error..
23:32kovasbthanks!
23:33mmarczyknp
23:33mmarczykwhat's the error now?
23:33kovasb"Exception Unsupported binding form: 1 clojure.core/destructure/pb--4421 (core.clj:3951)"
23:34kovasbthe 1 is from my trivial implementation of foo
23:34kovasbdo those commits corresponds to anything on clojars?
23:34mmarczykprobably not
23:35mmarczykyou could build latest master -- git clone git://github.com/clojure/clojurescript.git then in the repo run script/build
23:36kovasbyeah, I've been using noir-cljs to auto build for me
23:36mmarczyka .jar will be installed in ~/.m2 -- Maven prints out the name
23:36kovasboh ok
23:36kovasbsweet
23:36kovasbwill try that
23:37mmarczykcool
23:37mmarczykif the problem's still there, any chance of a paste?
23:37mmarczykI'd try to reproduce
23:37kovasbbuilding now. if its still there will extract an example
23:37mmarczykok
23:38mmarczykbrb
23:42kovasbmmarczyk: same error about binding form
23:42kovasbwill see if i can reproduce at repl with minimal input..
23:50kovasbmmarczyk: https://refheap.com/paste/2287
23:55kovasbthough this breaks at the normal clojure repl also. must be missing something about the syntax here
23:58mmarczykkovasb: (deftype test [] foo (bar [a] 1) (bar [a b] 2))
23:59kovasbthat breaks at the jvm clojure repl
23:59kovasbClassCastException clojure.lang.Var cannot be cast to java.lang.Class clojure.lang.Namespace.referenceClass (Namespace.java:129)
23:59mmarczykkovasb: name clash
23:59mmarczykkovasb: try (deftype test2 ...)