#clojure logs

2012-12-14

00:02RaynesStencil is also much faster, IIRC.
00:08dabdif i call (do (clojure.java.shell/sh some-external-command) (foo result-from-external-command)) how can I assure foo will not be called before the external command terminated?
00:09luciandabd: afaik .../sh will block until the command finishes
00:16dabdlucian: thanks, I will try it
00:45vsyncTimMc: nice meeting you sir
00:54RaynesYou don't know him well enough.
02:13devnhello fellow clojurians
02:13devnRaynes: good day, sir
02:14Raynesdevn: Heyo
02:14devnrbranson: Richard Branson? Do Clojurians get a discount Virgin Air rate?
02:15devnRaynes: whatcha working on?
02:15Raynesdevn: A new html transformation library.
02:15devncool!
02:15RaynesIt even has a cool name, laser.
02:15devnoh man, i love lasers
02:15devnim going to use this library of yours
02:16Rayneslol
02:16devnspeaking of which, there's this logging tool that has a great line on their homepage
02:16devnhttp://graylog2.org/
02:16devn"Manage your logs in the dark and have lasers going and make it look like you're from space."
02:16devnbest tagline ever
02:20RaynesNice.
02:23Raynesdevn: https://github.com/Raynes/laser
02:25benediktIs there a simpler way to write small programs with cljoure than lein? Something that doesn't require a "project"?
02:27RaynesYou usually want a project.
02:28benediktNot me. I think that's more of a personal preference then a technical dependency.
02:28Rayneshttps://github.com/mtyaka/lein-oneoff but it hasn't been updated in quite a while.
02:28RaynesWell, not really.
02:29RaynesAll of the tools in Clojure's eco system are based around projects.
02:29RaynesSo from a technical standpoint, you usually want a project.
02:29benediktNot if i want to write a simple single-purpose program
02:29RaynesYou're missing the point. :p
02:29RaynesI'm just saying that you might find it hard to do things without a project.
02:30RaynesYour reason for doing it may be perfectly valid.
02:30RaynesClojure isn't really suited to one-off scripts like that.
02:30benediktAh
02:30benediktBut if lein manages dependencies system-wide, then whats from stopping me using a clojure process that knows where lein stores its stuff?
02:30RaynesThe JVM has a large startup time, and that's the biggest problem for shell scripty things.
02:32RaynesOneoff is probably what you want, but it hasn't een updated to work with lein 2. :(
02:32benediktYes, and nobody uses Java for scripting.
02:35Raynesdevn: I'll give you a cookie if you actually do use laser.
02:38benediktRaynes: so you mean that the way clojure (and implicitly java/jvm) makes clojure sub-optimal for those "quick and dirty" things anywaysÐ
02:38benedikts/Ð/?
02:39RaynesIf you need it to start up fast, Clojure isn't the right tool for that job.
02:39RaynesWhich is why I hope Clojure implementations on other platforms mature.
02:39RaynesThere is a very immature Ruby implementation with decent startup speed.
02:39RaynesThere is also a Python one, but it is pretty slow to.
02:39benediktI was more thinking like if i were to solve a project euler problem or something of the likes
02:40benediktThere is a python implementation of clojure?
02:40Raynestoo*
02:40Raynes$google clojurepy
02:40lazybot[halgari/clojure-py · GitHub] https://github.com/halgari/clojure-py
02:40benediktwat
02:40RaynesIndeed.
02:40RaynesNot sure if it is still active.
02:40RaynesHah
02:40RaynesLooks like yes
02:40RaynesLast update 4 hours ago
02:40benediktdoes this mean that it has Python interlope and not Java interlope?
02:41RaynesYes.
02:41benediktCurious
02:42benedikt(Sidenote: why are java programs faster to start than clojure? Is it because clojure has to be loaded to a jvm every single time?)
02:42ivanyou just need a fast-starting client to interact with a running JVM
02:42RaynesJava programs don't start much faster.
02:42benediktI havent used Java in a while..
02:42amalloyRaynes: java programs start a lot faster
02:43Raynesamalloy: Any benchmarks?
02:43RaynesIt doesn't surprise me, but I'd be curious to see the numbers.
02:44benediktI wonder if this is a lexer+parser+tac generator
02:44amalloyRaynes: i wrote a demo in java that spins up ten threads that do a thousand additions each - ie, basically nothing. `time java Threaded`: 0.053s
02:44akhudekYou can massively improve the startup time of a large clojure program by AOT compiling the entire thing.
02:44benediktprobably not tac, but python as intermediate language
02:44amalloy`time lein repl < /dev/null`: 8.051s
02:44Rayneslein repl is a horrible command for checking startup time, amalloy.
02:44amalloyyeah yeah
02:44RaynesIt spins up like 20 java processes.
02:45RaynesUse lein version for that sort of thing.
02:45amalloy2.67s
02:45amalloyjava is still fifty times faster
02:45RaynesWell, life sucks.
02:46Raynesivan: Drip-like things are nice but not really a panacea.
02:46RaynesWhat'd be great is to not have to do hacks.
02:46benedikt`time clojure < /dev/null` 2.2s
02:49ivanRaynes: multitenant JVM, assuming it is smart enough to share the JITed code
02:50akhudekamalloy: wait, how is that possible, just running the java binary with no program takes longer than 0.053s
02:51amalloyakhudek: for me, that takes 0.09s. presumably it loads some classes that do i/o or whatever to decide on the version/help output, which aren't loaded for my simple program
02:51echo-areaDoesn't setting up Clojure runtime require at least ~2 secs?
02:51akhudekhuh, amazing. I had no idea Java could start up an actual program that quickly.
02:52echo-areaAt least it requires here.
02:52ivanyou can make Clojure start faster by turning off bytecode verification
02:52Raynesamalloy: Why do people complain about slow jvm startup time then?
02:52ivanand giving Intel more money
02:52akhudekRaynes: oh yes
02:52RaynesIf it is that fast, it looks like the problem is Clojure startup time.
02:54akhudekI'm assuming that amalloy's example was fast because it didn't load the majority of the java library
02:54RaynesWe should just never load anything ever then.
02:54RaynesJust write programs that can only do (+ 1 1) and we should be fine.
02:55amalloyRaynes: 0.05s for a fork is pretty slow, even if we assume all programs start up that quickly. `cat < /dev/null` takes just 0.002s
02:55benediktIf you time "lein version", how are you then timing the perforance of clojure itself? And doesnt the high timings for "lein repl" indicate that it is way too bloated?
02:56RaynesWell, this is how people start Clojure in most situations.
02:56RaynesThat 'clojure' script you've got doesn't have anything to do with Clojure (Clojure doesn't ship with a command-line interface like it or lein).
02:57RaynesWhoever made whatever package you got that from put it in there. That's why everybody tells newbies to not bother with Clojure in their package managers and just get lein instead.
02:57benediktI know. But i think it might be a indicator that "lein repl" needs to be looked at, it might be too bloated.
02:57RaynesBut it is true that since lein does other things there is some overhead, but `lein version` doesn't have much.
02:57benediktThe "clojure" command, comes from the clojure package for ubuntu
02:57RaynesThe reason lein repl is slow is because it starts up subprocesses.
02:58RaynesYeah, those packages are generally useless.
02:59RaynesI wish Clojure packages would just install Leiningen instead and get it over with. :P
02:59RaynesIt's the end result anyways.
03:00benediktlein needs to be packaged for debian/ubuntu/fedora
03:00Raynescemerick: You seriously cannot be up this early.
03:00RaynesIt does indeed.
03:00benediktIt somehow outside of the linux ecosystem, which is a very very very bad thing for ti
03:00benediktit*
03:00RaynesIt's hard to package it, but there are some people working on it IIRC.
03:01cemerickRaynes: Just got home from Boston.
03:01RaynesI thought you lived in Boston?
03:01RaynesYou do have a home, right?
03:02cemerickI live ~2 hours from Boston
03:03Raynescemerick: I did this https://github.com/Raynes/laser
03:03benediktBut i'm rather new at this whole clojure thing so there are probably (good) reasons for all this weirdness
03:06cemerickRaynes: will look; stumbling towards bed
03:06Rayneslol
03:07RaynesObviously too old for that stuff, cemerick.
03:07cemerickhah
03:07cemerickwhatever man, I close parties ;-P
03:40dabdhow do i clean the cache of a core.memoized function?
03:50bbloomdabd: (source memoized) suggests that you can't
03:58ivandabd: perhaps something on (meta your-memoed-func)
03:59ivansource suggests it's :unk on the metadata
04:22echo-areaSo it seems that priority-map can be used as either a priority-queue or a linked-hash-map
04:24echo-areaIs it then not necessary to implement such data structures as PersistentLinkedHashMap in Java?
04:28mindbender1Are there any examples out there or projects that demonstrate strong usage of PersistentQueues
04:31echo-areamindbender1: I recently implemented a task manager, managing tasks as persistent queues. It is not public though. I find a persistent linked hash map or similar is necessary to describe it functionally
04:34mindbender1echo-area: I really need to see something that was done with queues.. any other directions since yours is not public domain
05:27fredyr`Clojure is not a good language for using frameworks`
05:27fredyrwhat's the reasoning behind this?
05:28fredyrit's from the first comment on HN for Moving away from Noir
05:28fredyrhttp://news.ycombinator.com/item?id=4918720
05:32p_lmaybe the author experienced soemthign similar to what CL programmers often feel :D
05:32fredyrhah
05:32fredyrfrom the way he wrote it seemed to me it was some kind of general knowledge in the clojure community
05:33ejacksonfredyr: yes its that. The idea is to use small composable abstractions, rather than monolithic frameworks
05:33ejacksonso something like Rails is not what Clojure aims for, rather its a bunch of small libraries that do one thing well, and that can be combined
05:34ejacksonAFAIK, anyway.
05:34fredyrright, i see the difference
05:34fredyrthanks for the explanation
05:35clgvfredyr: the summarized point is "built clojure libraries not frameworks". I wish I could quote the place where I read that one.
05:36borkdudemake libraries, not frameworks (love, not war)
05:36ejacksonfredyr: exactly as clgz says, I recall RH saying the same thing.
05:36clgvfredyr: libraries can be composed in ways the single library authors did not anticipate nor they needed to anticipate ut
05:36RaynesLibraries are composable. Frameworks are ot.
05:36Raynesnot*
05:36fredyryeah
05:36ejacksonthe problem is the 'cold start' issue, for guys getting going, having a framework makes life easier.... for a while.
05:37clgvframeworks are only extendable limited by what the authors thought one needed to expand ;)
05:37clgv*extend
05:37Rayneshttps://groups.google.com/d/msg/clj-noir/AbAvQuikjGk/xTorXq83WT0J
05:37borkdudemaybe a transition guide from noir to compojure + whatever else you need to do the same would be nice for people now left behind with Noir heritage
05:37nightfly_Noir feels like it's got a good job tough. I love lisps for the raw control and power, but noir really fits when you don't quite need it but want a slick site with a well understood upper bound in development that you know it fits in.
05:37fredyryou mean a web transition framework?
05:37fredyr:D
05:37RaynesLooks like the whole deprecation thing might not last long. Already have someone who apparently wants to take Noir on. Nothing official yet though. Kinda would rather not, but *shrug*. It's open source.
05:38nightfly_s/tough/though/
05:38RaynesAs long as I don't have to bother with it, I guess.
06:20RaynesI heard ejackson lost the ability to say anything other than the word 'cheerio'.
06:20ejacksonwhato, whato !
06:20echo-areaIs it common to use *compile-files* to mimic eval-when-compile?
06:21echo-areaOr, is it idiomatic?
06:22ejacksonRaynes: I'm not a substitute cemerick to pick fights with :p
06:24clgvecho-area: I only used it on the repl when I wanted to investigate the bytecode...
06:26echo-areaclgv: I'm having an issue with our build system, which is not under my control. I'm loading ssh identities with clj-ssh, but somehow the build fails in the system. So I want to disable the evaluation of some top-level code.
06:26echo-areaclgv: BTW, by investigating the bytecode, what do you mean?
06:27clgvecho-area: decompiler oder bytecode viewer
06:27clgv*or
06:27clgvecho-area: *compile-files* set to true will compile all evaluated forms to class files
06:27echo-areaHow do you do that?
06:28clgvecho-area: jd-gui and "dr. garbage bytecode visualizer"
06:28echo-areaclgv: Yes, I see when leiningen compiles projects it invokes `compile', which sets it to true. And I need this trick to make compilation work for the build system I'm using.
06:29echo-areaclgv: Okay, will look into those tools, thanks.
06:29clgvclgv: the second is an eclipse plugin
06:30echo-areaHah, okay
06:31echo-areaI guess using *compile-files* for this purpose won't hurt though
06:33clgvecho-area: since clojure.core/compile does the same thing it should work. can't you use clojure.core/compile yourself?
06:34echo-areaclgv: I'm afraid not, it is part of lein jar
06:34clgv echo-area: no. I explicitely talked of clojure.core/compile
06:35clgvthats part of the clojure.jar ^^
06:35echo-areaI know, you mean I do clojure.core/compile manually instead of doing lein jar?
06:36clgverm what? what exactly is the workflow you want to accomplish? which dependencies are (not) allowed?
06:38echo-areaThe system invokes a script provided by me, and I do `lein jar' in it. Originally, when compiling, some top-level form trying to load ssh identities fails to pass compilation.
06:39clgvecho-area: sounds like a programming error when you load those ssh-identities top-level
06:40echo-areaWhat is the suggested way to fix it?
06:40echo-areaThe ssh identity files on the building host seems incorrect
06:42echo-areaIn fact I didn't do nothing, only calling JSch's declared methods
06:42echo-areaIndirectly through clj-ssh of course
06:54clgvecho-area: why is there any ssh programmlogic executed on compilation?
06:54clgvecho-area: probably you have global variables which would be there error here
06:56echo-areaclgv: Yes, I have a Var there, and I add identities into it at the top-level. My intention is to add identities when the class loads. Is there any better option than top-level forms?
06:58clgvecho-area: if you really need it global, define the var and create an init function that is used before any ssh-operation is done
06:58echo-areaBut that needs to be only done once. I.e. I need a static semantic.
06:59clgvthough I really wonder why the code is executed on compile time....
06:59echo-areaSimilar to a static block in Java
06:59echo-areaclgv: Because these are top-level forms?
07:00clgvyeah but that static block seems to be the problem. since the namespace gets loaded and thus the static block executed
07:00clgvmynamespace$init or such^^
07:00echo-areaOh I see.
07:01clgvecho-area: If I were you I would fix the initilization so that it happens once at runtime and not create a non-standard obscure build process ;)
07:02echo-areaclgv: I see. I'll make such a fix, thanks. Anyway got to go, see you later.
08:01tomojis it a user error if f returns a map in (r/mapcat f)?
08:04joegallotomoj: i suppose that depends on what you want back from mapcat. if you want a lazy-seq of map entries then that would perfectly fine.
08:04joegalloif you want a map, well, then that won't work out very well for you...
08:07tomojI mean clojure.core.reducers/mapcat
08:07tomojso I want a reducer
08:08joegallooh, my bad. i have no idea.
08:14tgoossensI've always found the word "business logic" a bit vague. How would you describe it?
08:17borkdude"A customer can have only one account", "A client can never buy anything if his credits are 0 or below", etc
08:21borkdudeI'm going to attempt converting my noir site to compojure
08:22p_ltgoossens: business logic is the top-level stuff that you're actually trying to accomplish :)
08:22borkdudewhen running the server I get this: https://www.refheap.com/paste/7582
08:23vijaykiranborkdude: do you have lein ring plugin installed in profiles or project.clj ?
08:24borkdudevijaykiran this is my project.clj (I still have to sort out if all of these libs are compatible..) https://www.refheap.com/paste/7583
08:25borkdudevijaykiran shouldn't I specify somewhere that it's supposed to run on jetty?
08:27tgoossensp_l: so you mean that. you want to separate your data from the actions you can do on them (something that OOP combines into one construct: a class) ?
08:27JorejiHello everybody. I have a clojure library that depends on some native libraries, so I figured I'd make a library with the native .so files and deploy it to clojars. But the transfer fails, both over ssh & http. Does anyone know whether there is a there a file size limit for uploads to clojars (the jar is 28mb large)?
08:27p_ltgoossens: Classes are, frankly speaking, orthogonal to OOP ;P
08:27vijaykiranborkdude: hmm - I just pasted your project.clj, and it worked fine for me
08:28vijaykiranborkdude: AFAIK, lein ring server is going to jetty
08:28p_ltgoossens: but in general, business logic means "what the program is going to accomplish + and rules it has to follow", an abstract design
08:28vijaykiranborkdude: could be some missing/messed up maven downloads
08:29tgoossensp_l: can you expand on the orthogonal part ?
08:30tgoossensyou probably mean that OOP is about working with actual objects rather than classes
08:31p_ltgoossens: OOP can be done with normal functions and still be OOP
08:31p_lthough actually the original OOP concepts involved Actors, not classes
08:32borkdudevijaykiran this is the output of lein deps :tree, I see no jetty jar https://www.refheap.com/paste/7584
08:33tgoossensif that all is true, then i got taught OOP in a completely wrong way
08:33vijaykiranborkdude: I think the jetty dep comes from the plugin, not from the project deps
08:33borkdudevijaykiran ah right
08:34vijaykiranborkdude: may be a lein clean and lein ring server again might help ?
08:35borkdudevijaykiran yeah that helped
08:35tgoossensp_l: i was taught that OOP was all about classes, inheritance, mutating etc. Can you give me some references so I can investigate your statements?
08:38tgoossensborkdude: where do you host your website. Where i currently host my websites they don't support for clojure, java
08:38borkdudetgoossens I used Heroku for some experimentation and now have a VPS at directvps.nl
08:38p_ltgoossens: read about Alan Kay's Smalltalk. Kay was one of the coiners of the term "Object Oriented"
08:39borkdudetgoossens Heroku is really easy, but it takes some time to get up on first use (free account)
08:39tgoossensp_l: thanks
08:39borkdudetgoossens I mean deploying is easy
08:39p_ltgoossens: and yes, you were taught a certain, narrow-minded school of programming that calls itself OOP :P
08:40tgoossensp_l: so what i'm taught is a subset of what OOP is about then?
08:40p_ltgoossens: funny thing, Object Management Group so far managed to testify CLOS (Common Lisp Object System) as the one that actually fit all their requirements... or so I recall
08:40p_ltgoossens: or an extension
08:40p_lit intersects with it, definitely :)
08:40tgoossens:)
08:40tgoossensI never heard of the Object Management Group before
08:41vijaykiranOMG :)
08:41p_lfor example, I prefer to use protocols/interfaces/types/whatever-it's-called-in-this-language instead of inheritance, especially if I'm forced into single-inheritance and thus can't compose objects (which is wtf-worthy)
08:42vijaykiranOMG - who brought us CORBA too :)
08:43borkdudeGradually upgrading to compojure: Caused by: java.lang.RuntimeException: Unable to resolve symbol: defpartial in this context :-D
08:44borkdudeI guess the best way to get rid of defpartial or to just use defn?
08:46vijaykiranborkdude: I'm guessing defpartial is from noir ?
08:46tgoossensp_l: but i still can't imagine me going to my professor and saying, "hey that thing you are teaching my isn't OOP actually". Isn't it possible that the meaning of OOP has just evolved to what i'm thought?
08:46p_ltgoossens: more like was compromised and taken over ;)
08:46borkdudevijaykiran yes, I think it's just defn under the hoods
08:47vijaykiranborkdude: oh, yeah https://github.com/noir-clojure/noir/blob/master/src/noir/core.clj#L103
08:47tgoossensp_l: if we continue on that. Then aren't my previous statements true?
08:47vijaykiranborkdude: looks like you can just copy the macro to your project :)
08:47borkdudelol
08:50p_ltgoossens: depends on whether you accept that state :)
08:54borkdudeis it really recommended to use lib-noir, or just go for other ways of session storage after noir?
08:54borkdudeI will first remove every reference to noir and see where I get
08:58borkdudehmm, I do I comment out a giant block of code in Eclipse CCW? I run into all kinds of intteresting questions today =)
09:00josteinkhm
09:00josteinkhttp://blog.raynes.me/blog/2012/12/13/moving-away-from-noir/
09:00josteinkwell I'll be damned
09:00josteinkRaynes: so long and thanks for all the fish, I guess ;)
09:02borkdudejosteink this is just a way to create more consultancy work in clojure world - I'm now trying to become an expert on porting noir to compojure and then hopefully get a paid job :P
09:02josteinkheh
09:35TimMccemerick: Thanks for the book! I can see I'm going to get some good stuff out of it.
09:36TimMccemerick: ...but it just occurred to me: Wouldn't the person in the room who knows the *least* Clojure trivia get the most out of a free book? :-P
09:36solussdis it possible to add metadata to an object that isnt copied when new versions of that object are created (e.g. a map with metadata where an assoc operation yields a new map without the metadata)?
09:37cemerickTimMc: Perhaps, perhaps. That's why the first Q I asked was not Clojure-related!
09:37cemerickI suppose I should start building up a repertoire of appropriate trivial questions for when I'm giving away books :-)
09:45ambrosebsI've put a brief rationale in Typed Clojure's readme (under Rationale). Any comments? https://github.com/frenchy64/typed-clojure
09:50ambrosebsIt's meant to bring ppl who've never heard of Typed Clojure & gradual typing up to speed.
09:50ambrosebs..without reading a dissertation :P
09:51JorejiDoes typed clojure add type hints?
09:53ambrosebsNo. There's currently no way to interface with the compiler.
09:53ambrosebsIt can *infer* type hints, sure.
09:54JorejiToo bad :-(
09:55ambrosebsYes, but I'll be pushing for something to allow that in the coming months. Some cool stuff going on with CLJS compiler.
09:56ambrosebsProbably a long time before we'll see the benefits in Clojure though.
09:56JorejiAh, that's nice to hear!
09:56ambrosebsPerhaps wait for Clojure 2.0
09:56ambrosebs;)
09:56JorejiWill do :-)
09:56borkdudehow do I redirect in compojure?
09:56JorejiFor now, if I want typing, I'll go to scala ^^
09:57ambrosebsA valid choice :)
09:59vijaykiranborkdude: isn't its ring/utils redirect ?
09:59ambrosebsIf you're curious about what TC *could* be, boot up Dr Racket and try some Typed Racket.
09:59ambrosebsincredible stuff.
10:00borkdudevijaykiran ah, tnx
10:10mpenetambrosebs: some would argue that it helps in the design phase, starting from type definitions, signatures, data driven development I think?
10:11mpenetambrosebs: maybe it's not the right term in the clojure context
10:13ambrosebsmpenet: sure. I guess I was after more objective truths. Clojure ppl have done fine without types so far.
10:13ambrosebsCertainly TC allows you to design with types.
10:16ambrosebsIt'll be interesting to see if people actually do.
10:18mpenetI think clojure folks are more after the compile time checks and maybe later optimisations (at least for now), but it is already huge imho. I can't count the hours I wasted on stupid bugs that could have been caught by static typing.
10:20mpenetand the effort is minimal compared to writing tests (not that it replaces it)
10:22ambrosebsYa. Clojure runtime errors suck.
10:22ambrosebs*type errors
10:26cemerickohpauleez, lynaghk: what a tool; disregard the second Q in my email, I didn't look at the subject of the event :-P
10:28ohpauleezTo all - anyone have questions for lynaghk (Kevin Lynagh), myself (Paul deGrandis) or cemerick (Chas "Clojure Godfather" Emerick) -- Mostly Lazy podcast
10:28ohpauleezanything except when vs if
10:28cemericklol
10:28ejacksonHow bout <SPC><SPC> vs <TAB> :)
10:29ohpauleezhaha :)
10:29ambrosebsbbloom: where does cljs-cps fit in with the compilation pipleline?
10:29ambrosebswhen is the AST transformed?
10:29ambrosebsand where does it go?
10:30ohpauleezambrosebs: I believe the idea is to introduce a new optimization phase after the initial AST is produced. I'm not sure if that's the case with bbloom's cps transformer or not
10:32ambrosebsI didn't think there was a way to make such phases.
10:32ambrosebsCould it integrate with normal compilation?
10:33ohpauleezyou mean in the same pass?
10:34ambrosebsI mean, how much can compilation be customised currently?
10:35ohpauleezno idea - but we're hitting a few areas where optimizations could be applied. Making the compilation size even smaller, cps, etc
10:35ohpauleezand I expect more to come
10:36ambrosebsright. AFAICT these are just the optimisation phases, without being integrated into compiler?
10:36ambrosebsWhich is basically what Typed Clojure is currently.
10:37ohpauleezah, I understand what you're saying now
10:38creeseI'm wondering about the Right Way to handle AJAX calls in clojure.
10:38ohpauleezI don't know the implementation details of each specific approach, I'm just reporting on the discussion I've witnessed so far.
10:38ohpauleezcrease: on the server or within CLJS?
10:38creeseon the server
10:40ambrosebsI'm waiting to find out how all these optimisations phases work together.
10:40mpenetcreese: you need to be more specific
10:40ohpauleezcrease: Expose a RESTful interface to the resources you need to continually update in the AJAX call. If you have CLJS on client-side, use EDN as data representation and perform the AJAX call as a Remote
10:44borkdudeto work with a ring session in compojure, I have to do this? (GET "/mypage" {session :session} (…))
10:47cemerickborkdude: as long as you have the session middleware in place, yes
10:47borkdudecemerick yeah have that. I saw somewhere the same thing, but then with [ {session :session} ], so brackets around it… syntax change over time?
10:49creeseohpauleez: why EDN and not JSON?
10:49cemerickborkdude: Hrm, I don't think that would work
10:50cemerickborkdude: yeah, I don't think that'd be valid, https://github.com/weavejester/compojure/wiki/Destructuring-Syntax
10:51ohpauleezcreese: You can capture more kinds of things (richer expression), but it's also extensible into your problem domain, so it's easy to capture domain-specific data too
10:52ohpauleezno need to double parse out special meaning from a JSON structure
10:52ohpauleezand allows you to program Clojure the whole way through
10:52bordatouein clojure is do we have any thing to convert a number to binary strings similar to bin()in python
10:53cemerickborkdude: you mean, base 2?
10:53bordatoueyeah
10:53cemerick,(Long/toString 5 2)
10:53clojurebot"101"
10:54bordatouecemerick: cool, thanks
10:54creeseohpauleez: can you elaborate on the first half of your answer "Expose a RESTful interface..." or point me to tutorial?
10:54cemerickoh, sorry, bordatoue, not bork :-)
10:55cemerickohpauleez: better just call it HTTP lest the RESTifarians schedule a sit-in at your place. :-P
10:55bordatouecemerick: you are fogiven :-)
10:55ohpauleezcemerick: :)
10:56creeseohpauleez: are we talking about a route?
10:56ohpauleezcreese: You just need to expose a URL on your server side, that will take args for a given resource, and return you the snapshot of data you need
10:57ohpauleezit should play nicely with the HTTP 1.1 methods: POST GET PUT DELETE
10:57bordatouecan anyone suggest what would be the best way to implement a client that connects to multiple tcp sockets with different port numbers
10:57bordatoueip address remains the same
10:57ohpauleezif you go the other way (exposing remote calls over http to CLJS), then you can define your resource and API in a Clojure file, and just expose the whole API to CLJS
11:11mindbender1is it possible to change the working dir where a repl started
11:13S11001001mindbender1: depends on what you mean by "working dir"
11:13S11001001if you mean the OS one, JVM doesn't give you this option
11:14S11001001mindbender1: there is a system prop, I forget what, with a *copy* of the cwd in it; setting that prop does nothing but affect other users of that prop
11:14mindbender1What I need is to be able to change what (System/getProperty("user.dir") returns
11:15S11001001mindbender1: you can do that, but that's all you'll change.
11:16mindbender1Won't it affect where load will start searching
11:16S11001001no.
11:16mindbender1Is the only option restarting the repl in the proper dir
11:16S11001001if you want to affect *that*, give up on cwd and look at classloaders
11:17mindbender1how do we work with classloaders from clojure
11:18S11001001mindbender1: with clojure's java interop features
11:18S11001001mindbender1: I've written classloaders in clojure; it's as approachable as the classloader api allows
11:18cemerickmindbender1: what are you actually trying to do?
11:18ChongLichange the cwd of the repl
11:19S11001001ChongLi: I think that was the solution looking for the problem
11:19ChongLiin ghci you can do this with :cd
11:19mindbender1just to have more control of where .repl is located or something
11:20mindbender1it integrates nicely with emacs ecb
11:20mindbender1ChongLi: are you saying cwd will work
11:21mindbender1hw do I execute cwd from the repl for instance
11:21S11001001ghci is a haskell interpreter entirely separate from clojure & jvm, mindbender1
11:21mindbender1oh ok
11:21mindbender1I thouhgt therre was hope
11:22S11001001are you using lein, mindbender1?
11:22mindbender1yes of course, with nrepl mixed in
11:23S11001001are you using C-c C-l to load files?
11:23mindbender1there has to be a way to do this
11:24mindbender1didn't try that.. just (load ...)
11:24S11001001in a clj file, you can press C-c C-l and it will load/reload it, no typing load commands at all
11:24mindbender1S11001001: ok will try that soon enough
11:25gfredericksSo I am doing config via a "config.clj" file on the classpath, with environments managed by just putting a different config file in /resources at deploy-time
11:25gfredericksnow I'm trying to setup automated testing, where I'll want a special test config
11:25cemerickmindbender1: .repl?
11:25gfredericksthis means I want a test-resources directory?
11:25gfrederickslein doesn't seem to pick that up by default. Do I need a test profile?
11:26mindbender1cemerick: yes I believe that controls the working dir
11:26mindbender1or the one it starts in initially
11:27mindbender1I think that used to be the file where repl save its work
11:28mindbender1or am I getting it wrong
11:29cemerickmindbender1: I've never heard of .repl; it's a file?
11:31mindbender1I remember seeing it sometime and thought that repl used it for history
11:31cemerickI'm not aware of it. `lein repl` doesn't seem to create it, either
11:31mindbender1though it doesn't show up now.. I wa assuming
11:32mindbender1cemerick: ok think I mistook it
11:33mindbender1cemerick: any thought on the cwd thing
11:35gfredericksdoes the leiningen :resources-paths vector not specify things in the order they will be searched?
11:35gfredericksI'm trying to make my test-resources/config.clj shadow my resources/config.clj
11:35gfredericksand it doesn't seem to be
11:36gfredericksoh wait
11:36gfredericks:resource-paths instead
11:36cemerickha-ha dynamic typing ;-P
11:38gfredericksoh nice the test task picks up the test profile automatically
12:21solussdanyone using emacs-live w/ clojure and either clojure-jack-in or nrepl-jack-in experience the repl printing dozens of newlines before returning the result of a function call?
12:31firesofmayHi, If I have a huge map with lot of nesting, and I only want to understand the key structure of it. And I dont want to go through the values, what is the best way to do it?
12:32tgoossensanyone here experience with heroku? I'm playing around with it and I'm currently unable to push (permission denied). I'm reading through the documentation. But if anyone knows already what might be wrong that would be helpful
12:32technomancytgoossens: hey
12:32tgoossenstechnomancy: hi!
12:32technomancycan I pm you about it?
12:32tgoossenssure thing!
12:36TimMcfiresofmay: So you want to throw away some, but not all of the values in a nested map?
12:36firesofmayTimMc, I dont want the values. I just want to understand what are the keys and its structure.
12:37TimMcExcept some of the values in the top-level map are also maps you want to inspect, right?
12:37firesofmayTimMc, I can go through it manually, But I was wondering if there is a better way.
12:37firesofmayTimMc, Yeah Its a nested map.
12:37technomancyfiresofmay: tree-seq could get you all the keys, but you'd lose the shape of the map
12:37firesofmaytechnomancy, I see.
12:38firesofmaytechnomancy, no way to retain the structure?
12:38TimMcfiresofmay: If it's just a map of maps... (into {} (for [[k v] my-map] [k (keys v)]))
12:38technomancyfiresofmay: well, not with tree-seq; sure there are ways to do it
12:38firesofmayTimMc, okay.
12:38firesofmaytechnomancy, okay.
12:39TimMc&(into {} (for [[k v] {:a {} :b {:c 1 :d 2}}] [k (keys v)]))
12:39lazybot⇒ {:a nil, :b (:c :d)}
12:42firesofmayTimMc, will this work for clojure.lang.PersistentArrayMap?
12:42TimMcSure, why not?
12:42firesofmayTimMc, Getting "Don't know how to create ISeq from: java.lang.Integer" Error.
12:42TimMcSOunds like an argument order error.
12:43TimMcAre you calling nth anywhere?
12:43firesofmayTimMc, No, I just have a full map, and I replaced it with my-map in the function you gave.
12:43TimMc&(keys 4)
12:43lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
12:44firesofmayTimMc, (into {} (for [[k v] req-sites] [k (keys v)]))
12:44TimMcfiresofmay: My code only works if it's a map of maps.
12:44firesofmayTimMc, What if it has a vector too?
12:44TimMcIt sounds like at least one of your vals is a number.
12:44ohpauleezcemerick: I'm amped
12:44cemerick\m/
12:44cemerickohpauleez: oh, what for? :-P
12:45firesofmayTimMc, some keys have a number as a val.
12:45TimMcfiresofmay: Add a :when clause: ##(into {} (for [[k v] {:a {} :some-number 5 :b {:c 1 :d 2}} :when (map? v)] [k (keys v)]))
12:45lazybot⇒ {:a nil, :b (:c :d)}
12:45ohpauleezcemerick: Mostly Lazy!
12:46cemerick "Dedicated to discussing security issues affecting those building applications with Clojure and its variants." https://groups.google.com/group/clojure-sec
12:47sgeoI _think_ I'd rather have light-weight co-operative threads than heavy-weight pre-emptive threads, although light-weight pre-emptive threads would be best
12:47sgeoI'm not sure though
12:48TimMccemerick: Nice, I hope that draws some folks.
12:48technomancycemerick: can I join and just bitch endlessly about how awful Bouncy Castle is?
12:48sgeoBouncy Castle?
12:48technomancysgeo: a suite of crypto implementations for the JVM
12:49cemericktechnomancy: only if you bone up and produce a clean-room impl in Clojure.
12:49technomancycemerick: pass
12:49cemerickso close
12:50firesofmayTimMc, technomancy thanks.
12:50cemerickTimMc: Me too. It'd be nice if I knew something about security stuff.
13:17mindbender1I have not done cljs for a while. Is cljsbuild still preferred for cljs. The repo seem kinda quiet
13:18dnolenmindbender1: it is still the preferred way. quiet is good :)
13:18duck1123nothing has been broken that needs fixed
13:20mindbender1ok
13:27seangroveIs there any negative to wrapping js api's like this: https://www.refheap.com/paste/7592
13:28seangroveAs far as I can tell, this should work fine with the minifier without any any externs, it won't get munged, and allows me to use the ns like a normal cljs ns from the rest of my program
13:31dnolenseangrove: so "extension" just holds plain functions - not methods?
13:32seangroveWell, singleton-style methods, I believe
13:32seangroveYou'd never instantiate "extension"
13:33dnolenseangrove: it would be a problem if the implementations of those methods use "this"
13:33dnolenseangrove: if they don't than that's ok. using rest args + apply is a perf hit but from the looks of this API I don't think that's much of a concern.
13:34seangroveWell, this is used in fairly tight loops - best to map the args directly?
13:34dnolenseangrove: yes
13:34seangroveGreat, thank you
13:37cemericklast chance for questions/topics for ohpauleez, lynaghk, and myself on Mostly Lazy
13:38borkdudecemerick are you on air right now?
13:38cemerickyup
13:40borkdudecemerick I mean, so we can listen? or just recording and publishing afterwards? either way, just saying I like your podcast very much and enjoy it while running
13:40cemerickyeah, no live broadcasting thing
13:40skyboundI would appreciate any hints on transforming a flat list into a tree (e.g. input like '("a" :push "b" :pop "c") ); got a somewhat working solution - but it ain't pretty :-(
13:40cemerickwe can barely get skype to work :-P
13:41borkdudeon what topics do you expect questions right now?
13:41cemerickwhatever. We're just riffing for an hour.
13:53ChongLimostly lazy?
13:53ChongLioh I see
13:53ChongLinice
13:53cemerickChongLi: mostlylazy.com
13:55ticking_isn't it super frusttrating that there is no clojurish image library?
13:56ticking_every tie I set out to find one I end up holding myself back to not write one
13:56technomancymaybe that's the problem
13:56technomancygive into your urge =)
13:56solussdIs it possible to add metadata to just an instance of an object that isn't copied when operations are performed on the object? E.g. If I have a record and I perform an assoc on it, the new record has the same metadata. Is it possible to make that no so? :)
13:56jkkramershave that yak
13:58ticking_yeah ^^but the time the time
13:58jkkramerthe only image stuff I've needed is read, write, and resize, which I wrote some simple clojure wrappers to handle
14:00ticking_jkkramer: hm, not on your github^^
14:00jkkramerticking_: https://gist.github.com/3959731
14:00jkkramerneed to bundle it into a library sometime...
14:01jkkramerwas waiting until I needed it in more than one project
14:01seangrovecemerick: State of cljs, the ASt, bbloom's cps-transform project, lots of interesting stuff to riff about ;)
14:01ticking_jkkramer: hrhr yeah I thought of using scalr too ^^
14:02ticking_jkkramer: but the stuff I do to the image still requires a bit more functionality, like contrast, grayscaling, binarization
14:03jkkramerticking_: I believe Scalr supports custom image operations, but I didn't dig into it much
14:04ticking_jkkramer: yeah but thats kinda the point, the stuff is there (like imagej) but it's not pretty (like imagej which loads 90% of AWT UI elements)
14:06jkkramerI punted and shelled out to graphics magick for a scala project
14:07ticking_hrhr
14:07dnolentbaldridge: btw, I liked the bytecode core.logic video - can you explain a little more what you're trying to do - the advantage w/ the approach you're taking?
14:08tbaldridgeon a call, give me a few min
14:27tbaldridge@dnolen: the goal with my project is to explore how to rewrite the clojure-py bytecode assembler using core.logic.
14:28dnolentbaldridge: yes I understand that - but what's the benefit? or you're just having fun w/ core.logic? :)
14:29tbaldridgeThe problem with many of the existing designs is that they are basically a hairball of imperative code. For instance, source mappings are basically consist of pairs of two bytes, (delta in bytecode, delta in sourcecode). Writing this sort of thing ends up with code like this:
14:29tbaldridgehttp://code.google.com/p/byteplay/source/browse/trunk/byteplay.py?r=19
14:30tbaldridgeThus far I've found it much easier to express as sets of constraints, then actual actually walking step by step through every bytecode.
14:33dnolentbaldridge: I see, I guess I'd be concerned about performance for this kind of task - but perhaps you haven't found it to be an issue? (related I've been starting to ponder how tom make defne & conde's, etc more efficient if we have ground values)
14:34tbaldridgeOne more example is jump calculation. In an if branch, we can't write the number of bytes to jump, until we emit each branch of the if. so the result starts looking like this: https://gist.github.com/4287938
14:35tbaldridgeYeah, I have no clue about performance yet, so far it's pretty fast, but we'll see. That being said, these functions are normally rather small, 40-200 bytecodes, so we'll see how the performance shakes out.
14:36tbaldridgeWhat also triggered this for me was when Joe Armstrong mentioned that he's been involved in working on some super-secret Erlang on crack language. Apparently it uses gecode internally. Ever since hearing that I've been thinking how I could use core.logic more in clojure-py
14:37dnolentbaldridge: gotcha, well cool stuff - looking forward to some in depth write-ups.
14:37dnolentbaldridge: yes he mentioned he was doing things w/ GeCode at TechMesh, I should have picked his brain some more about that.
14:38dnolentbaldridge: related - support for optional binding into more high performance constraints solvers (GeCode, JaCoP) is definitely worth pursuing.
14:41tbaldridgeagreed.
14:42ticking_jkkramer: btw I would slap apache sanselan on there for importing and exporting it can read most image formats
14:42tbaldridgeI found Joe's talk on the subject: http://www.infoq.com/presentations/Building-Highly-Available-Systems-in-Erlang he's working on making a Erlang VM run specialized hardware. So GeCode is probably being used for FPGA layout or something of that nature.
14:43ticking_jkkramer: you should seriously do that and then release it, I'll certainly contribute as I continue to use it and maybee even add more advanced functionality ^^
14:43dnolentbaldridge: thx for the link
14:45jkkramerticking_: cool, good to know. I'm bundling up the gist as a lib at the moment. will make note to integrate sanselan at some point
14:59jkkramerticking_: https://github.com/jkk/purty
15:00ticking_jkkramer: awesome ^^, I'll send a pull request for sanselan :D
15:01jkkramerticking_: excellent
15:10ravsterhello everyone
15:14TimMcQuick, off the top of your head -- is 36r5e2 > 100?
15:15TimMc(This is a question about Clojure numeric literal syntax.)
15:17ticking_jkkramer: I wonder if we could use some stuff from rinzelight
15:17ticking_jkkramer: it doesn't have an api as nice as purty but it has some functionality
15:17amalloyTimMc: seems like yes?
15:17ravsteris anyone else having nrepl.el issues where it doesn't evaluate code into the correct namespace?
15:18amalloyassuming that it's actually a valid number literal; i don't know what is
15:18technomancyravster: yeah, the heuristic it uses is very broken =(
15:19TimMcamalloy: It's not obvious to me what happend when you combine e-notation with higher radices.
15:20dnolenravster: yep
15:20TimMcalthough yes, radix notation precludes e-notation.
15:20technomancyravster: I tried to talk him out of it and get it to use the same heuristic as slime but it currently doesn't do that
15:21technomancymaybe opening an issue will help get it fixed =)
15:23jkkramerticking_: could be. rinzelight looks pretty elaborate; more than I would ever need. might be nice to have effects like blur, sharpen. and being able to view an image
15:24tickingjkkramer: well, viewing images brings us back to including the entire gui framework ;D
15:24tickingbut yeah
15:25jkkramerwas thinking of viewing as a dev-only, runtime thing
15:26tickingjkkramer: hrhr sure ^^
15:30zerokarmaleftTimMc: man, you can really confuse the reader with literals like that
15:42ravsterCould someone point me to a resource that explains how to organize a clojure project in different files?
15:49TimMcravster: I just start coding, and pull stuff out into additional namespaces as modularity becomes clear.
15:58stuartsierraravster: http://stuartsierra.com/2011/08/08/clojure-namespaces
15:59craigbroheyo
15:59craigbrogot a quick lein2 question
15:59craigbroi hate uer profiles
15:59craigbrouser...
15:59craigbroand want those plugins defined in my project
15:59craigbrospecifically immutant
16:00craigbroI added the immutant plugin to my project.clj, but it's not available as a lein2 command
16:00craigbrowhat stupid mistake did I make?
16:03gfredericksIs there any way to do a DROP DATABASE with clojure.java.jdbc?
16:03gfredericksdo-commands sets up a transaction and postgres won't let you drop DB from a transaction
16:03tcrawleycraigbro: how did you add it to your project.clj?
16:06craigbrotcrawley: in the :plugins var
16:06craigbro:plugins [[lein-cljsbuild "0.2.9"
16:06craigbro lein-immutant "0.14.1"]]
16:06craigbro :hooks [leiningen.cljsbuild]
16:06gfredericksah ha
16:07craigbroin general, I despise the lein2 user profile for plugins
16:07craigbroi want everything in my project
16:07gfrederickscljsbuild and immutatnt are two different plugins
16:07craigbroI understand that
16:07gfredericksso they need to be in two different vectors
16:07craigbrooh, that I didn't 8)
16:07craigbrothanks for headcheck
16:07gfredericks[[lcljs ""] [len-imm ""]]
16:07gfredericksthat sorta thing
16:07tcrawleygfredericks: good catch
16:07jsabeaudryAny idea how I can configure the jetty connector when using noir? (I'd like to change the responseBufferSize )
16:08craigbrogfredericks: makes total sense when I have my brain on
16:09craigbroall good, thanks. I knew lein2 would not force me to put that stuff in user profiles
16:09craigbrojsabeaudry: you can pass in a configurator func
16:10borkdudefinished porting my noir app to compojure now… no use of lib-noir
16:10clojurebotWhy are you asking *him*
16:10RaynesNo no lib noir?
16:10jsabeaudrycraigbro, hmmm I guess I'll look at the code
16:10Raynesborkdude: Something wrong
16:10Raynes?
16:10borkdudeRaynes I didn't know why I needed it =)
16:11Raynesborkdude: Oh, I assumed coming from Noir you already used some of its libraries.
16:11Rayneslib-noir has the session, cookie, response, etc stuff.
16:11borkdudeRaynes I hesitated to use the session stuff from lib-noir, but I went with ring session directly now
16:12craigbrojsabeaudry: http://practice-blog.herokuapp.com/posts/ring-with-ssl-only
16:12RaynesThe session stuff in lib-noir is exactly the same as in noir itself.
16:12craigbrojsabeaudry: that is an example of a configurator that I use to set up ssl
16:12RaynesBut nothing wrong with using ring session directly.
16:12RaynesIn fact, cemerick would probably plant a nice sloppy kiss on you for it.
16:12cemerickheh
16:13jsabeaudrycraigbro, Great, that should be simple enough wiht your example! thanks!
16:13ivanstuartsierra: "At the time, Prismatic had not yet released Graph as open-source." still isn't released, no?
16:13stuartsierraivan: don't know
16:13ivanah, thanks
16:13ivannot on their github, anyway
16:13cemerickThere needs to be a helper fn to make updating the session easier, but it's definitely my preferred route.
16:14cemerickupdate-session! or whatever is *ick* and hard to test and think about
16:14RaynesI think that's ridiculous, but you already know that.
16:14borkdudecemerick Raynes I don't get why ring session stuff is considered more "functional", the session store is still a mutable thing right
16:15cemerickborkdude: past the boundary of the session middleware, ring sessions are purely functional
16:15RaynesYes. But cemerick has a box of excuses for that one too. ;)
16:16cemerickThe point is to try and push the frontier of unrestricted mutability outward as far as possible
16:16RaynesI'm surprised you don't use Haskell.
16:17sgeoI wish that there was some language+environment combination that I really liked
16:17cemerickpage 81 in the book, FWIW: http://twitpic.com/blz6uk
16:18sgeoI like Smalltalk and Factor environments (well, not Factor's lack of ecosystem), a bit iffy on the languages. I love Haskell as a language except for icky macros, but it's not so nice for modifying a running program, and debugging can be tricky
16:18borkdudecemerick it is considered functional because the session map is always an updated version of the previous session map, or smth?
16:18cemerickRaynes: In another life, perhaps.
16:18cemerickGradual typing is more my speed.
16:19cemerickPlus, no tools AFAICT. If I'm paying the static-typing tax all the time, I want killer tools.
16:19cemerickborkdude: because handler functions are referentially transparent. Their results depend solely on their arguments, and they produce no side effects.
16:20cemerickswap!'ing an atom is a side effect, and something you need to compensate for/mock/whatever when composing a fn performing such an action with another in a new way, or testing, etc
16:20RaynesOh God, shut up.
16:20Raynes:P
16:20RaynesGo write a book or something.
16:21cemerickZipped. :-|
16:21RaynesOh wait.
16:21RaynesYou did write a book.
16:21Raynesdsantiago: I require your assistance in telling me whether or not I'm an idiot.
16:21RaynesWhenever you get a chance.
16:22dsantiagoRaynes, I am responding to your issue right now.
16:22TimMccemerick: Whoa, what's the bird?
16:22RaynesGood timing mate.
16:22cemerickTimMc: bird?
16:22TimMcUm... 91 days ago. OK.
16:22Raynescemerick: I'm just kidding, love. We just like to do things differently and my way is better than yours. No biggies. Happens all the time with me.
16:22TimMccemerick: http://twitpic.com/aui76e
16:23tickingTimMc: is that a dead falcon?
16:23cemerickoh, that. A sharp-shinned hawk that committed suicide against my living-room window this summer.
16:23TimMcah
16:23cemerickVery sad. :-(
16:23tickinghow did it taste?
16:23RaynesHahahaha
16:23Raynesticking: Sounds like you're from the south.
16:23tickingyou can't tell me that you wasted a perfectly good hawk
16:24TimMcI can't imagine raptors taste that great, being predators and all.
16:24tickingRaynes: germany to be exact but my grandparents are from louisiana ;D
16:24RaynesHad to get that from somewhere.
16:24tmciverIt's funny to see a pic of cemerick's laughing face next to a dead bird.
16:25TimMc"MUAH HAHAHA
16:25TimMc" <- sorry!
16:25tickingindeed
16:25Raynescemerick: Is that picture meant to look like a trollface?
16:25tmciverTimMc: #clojure needs paredit!
16:25tickingtmciver: agreed
16:26gfredericksI tried to turn it on and it showed me a smiley and said it was an unmatched bracket or quote
16:26borkdudethe only overhead I have now with ring sessions is: destructuring it in the compojure route and exposing it in the response map with the updated values, compared to (session/put! …) and (session/get …) right?
16:26Raynescemerick: http://dc399.4shared.com/img/8w1Rixbl/s3/Asian-Troll-Face.jpg I you invert this picture...
16:27cemerickborkdude: You need to make sure you carry the session from the request (if it exists) into your response if you're going to update it.
16:27dsantiagoThere you go, Raynes.
16:27tickingcemerick: friend of mine picked one out of the wall in his office poor thing had gotten in there through the roof somehow, but he managed to nurse him back to health
16:28borkdudecemerick that carrying is done by (GET "/foo" {session :session}) right?
16:28cemericke.g. (assoc-in ring-response [:session :your-key] "foo") won't work out well if the request session had :your-other-key in it
16:28cemerickno, that's just *accessing* the session
16:28borkdudecemerick I use wrap-session
16:28Raynesdsantiago: Got it. Yeah, I was just experimenting. It didn't occur to me until the end that "Oh wait, some people might actually want it to be unescaped."
16:29TimMcticking: Touchy business, that -- even authorized wildlife rehabilitators have to get special certification to possess raptors.
16:29ivanis anyone here capable of vetting http://dev.clojure.org/jira/browse/CLJ-1076 ? would be nice if 1.5 could build on Windows
16:29cemerickborkdude: yeah, that's fine. My only point is that, if you're updating the session, you need to carry forward the session from the request
16:29cemericke.g. (assoc ring-response :session (assoc (:session ring-request) :your-key "foo"))
16:29tickingTimMc: yeah luckily all he needed was some water and rest took him just a few hours to take of again
16:30TimMcAh, OK.
16:30cemerickticking: that's a bit nuts. I'd worry about getting my eyes ripped out.
16:30cemericki.e. if I had to handle it
16:31borkdudecemerick yes, that's what I did, thanks
16:31tickingcemerick: wan't a hawk the largest city born predator we have is that dude
16:31tickinghttp://en.wikipedia.org/wiki/Common_Kestrel
16:31cemerickborkdude: ok, you're good then
16:32cemerickI used Ring sessions wrong for a solid year before being set right by weavejester
16:32borkdudecemerick so it didn't work for a year?
16:32tickingTimMc: and yeah I know I fished a raven chick out of my universities pond and nursed him over 2 days until giving him to the local wildlive rescue
16:32cemerickborkdude: I never noticed any issues because I was often only storing e.g. one key
16:32tickingTimMc: they didn't have open during the weekend and the vet said he gave him a lower than 50% chance and euthanized him but I could try ^^
16:33cemerickthe middleware doesn't touch the stored session if the response map's :session entry is missing, or just {}
16:33borkdudecemerick it only kills the session when the :session value is nil right?
16:34borkdudecemerick but using an empty session map would cause all session values to be wiped also I guess
16:34cemerickright, right
16:35cemericksee, I still get it wrong :-P
16:35cemerickA couple of helper fns in ring.util.response are needed.
16:36tickingTimMc: I give the healing credit to startrek ;D that bird loved enterpreise http://cl.ly/image/3h470k1c2V3A http://cl.ly/image/3g0A2j0l1w1l
16:36borkdudecemerick whadda you mean?
16:37technomancyKestrel is another name for the K combinator IIRC
16:37technomancyroughly analogous to clojure.core/constantly
16:37hiredmantechnomancy: identity
16:37Raynesdsantiago: Sounds like a great solution. Most people probably want unescaped
16:38dsantiagoRaynes: Yes, I think so.
16:38technomancyhiredman: eh... depends how you map combinators to clojure fns
16:38technomancyor do you mean Kestrel is I rather than K?
16:39hiredmantechnomancy: oh, no I am mistaken
16:39borkdudeOne thing I'm still struggling with is, should I store a "consumer" from clj-oauth object in session, because I need on two pages, or is that considered bad practice?
16:40borkdudea "consumer" object from clj-oauth (wrong order), https://github.com/mattrepl/clj-oauth/blob/master/src/oauth/client.clj
16:41TimMcticking: hah!
16:59RaynesWell, this is horrific: http://danielchoi.com/software/vmail.html
17:00technomancyRaynes: ouch; it complects reading, sending, and fetching, *and* recommends using rvm.
17:01Raynestechnomancy: And it is a Vim plugin.
17:01technomancyand passwords in plaintext
17:01RaynesKill it with fire.
17:01Raynestechnomancy: Also, Ruby + Vim + OS X = BROKE
17:01RaynesIt isn't much better on Linux.
17:02TimMctechnomancy: But it supports contacts autocomplection!
17:02TimMcoh wait, autocompletion.
17:02RaynesI spent way more time that I'm willing to admit on trying to fix broken Ruby vim support.
17:02RaynesI gave up recently and just did the damned thing in Python.
17:02bbloomrvm is an atrocity.
17:02Raynesbbloom: rbenv users unite!
17:04bbloomas long as you don't load rbenv into your shell, and do the "graybeard" setup instructions, you're cool with me
17:04bbloomthe idea that you need a shell function to configure your environment is insane
17:04TimMctechnomancy: The first thing that should horrify you is that it's a mail reader in vim.
17:04bbloomtalk about non-composable
17:05technomancyTimMc: true; all vim users should already be using mutt
17:05TimMcI mean, if you want vmail, just use emacs.
17:06RaynesTimMc: I don't even want it in Emacs, bro.
17:06bbloomyeah, i don't really understand the draw of an email client in your editor
17:06bblooman editor in your email client maybe
17:06bbloombut the other way around?
17:06RaynesI like postbox.
17:06bbloomat least with emacs it makes sense because you have an editor in your email client in your elisp os :-)
17:06RaynesIt gives me mail, I press buttan to send mail. Easy. Don't need elisp.
17:07technomancybbloom: well mutt lets you read in mutt and compose in vim; that makes way more sense
17:08technomancy<textarea> is disgraceful for anything longer than a tweet
17:09bbloomtechnomancy: i don't really like composing prose in vim
17:09bbloomi LOVE THE SHIT out of vim
17:09bbloomand i tried all sorts of word wrap and reformat and all the standard shit
17:09bbloombut i hate writing prose
17:10bbloommy brain is just wired to working with lines
17:10bbloom(when i'm in vim)
17:10technomancyat least for HTML newlines don't affect the output
17:10technomancy(not that I am condoning use of HTML email)
17:10technomancyjust that I find most non-mail prose is HTML our ends up as HTML these days
17:11bbloomi can't recall the last time i wrote HTML directly :-P
17:11bbloomhtml is object code.
17:11technomancyyeah but markdown is the same way
17:11bbloomif i ever write prose with the goal of rendering HTML, i write markdown
17:11technomancyput all the newlines in you want; it won't affect the output
17:11bbloomfair enough, it's just that i find it awkward to write *paragraphs*
17:12bbloomreadmes and stuff are usually fine
17:12bbloomand i write them in vim out of laziness to go else where and copy paste
17:12bbloombut if i need to write a bunch of "realish" paragraphs, i'll open up text edit or something
17:12technomancysure, and I doubt your commitment to sparklemotion^Wvim
17:12technomancy=)
17:14bbloomeh, maybe i just don't do it often enough to hvae mastered the word wrap nonsense
17:15n_bbbloom: Have you tried the markdown.vim plugin
17:16n_bit's kind of funky with wrapping and occasionally I have to do grab a paragraph and do a gq, but on the whole it's sufficient for writing
17:16n_bmuch better than Word, at least
17:18bbloomn_b: yeah i use that plugin
17:18ivanvalue vs. place problem: the city thinks the tree in our front yard belongs to them and should be trimmed, because some other tree was in the same place 10 years ago
17:27TimMcivan: Send them this article, and explain that the tree is the wrong Color: http://ansuz.sooke.bc.ca/entry/23
17:28mpenetI found a small difference between jvm/cljs re-* function handling: in cljs: (re-find #"foo" nil) -> nil - on the jvm NPE. There's probably a bug to be reported on one side or another?
17:29mpenetI guess cljs is wrong to allow that, it doesn't make much sense
17:29mpenetor is it considered platform specific behavior and remains like that
17:30mpenetdnolen: ping
17:30dnolenmpenet: behavior of regexes are platform specific
17:31mpenetalright
17:31dnolenmpenet: though that doesn't mean there's isn't a bug here.
17:31mpenetah
17:33dnolenmpenet: or not, this may just be undefined behavior for CLJS & CLJ
17:33stuartsierrampenet: The JVM is stricter about nils than JS. I think it's platform-specific behavior.
17:33mpenetyeah it's a bit tricky
17:34p_lmpenet: JVM code probably does something different than JS one
17:34mpenetit's something that could be handled in the future by typed clojure hopefully
17:34dnolenmpenet: yes, re-find shouldn't take nil
17:35mpenetso should I create a ticket (and maybe send a patch) or do we just leave it like that
17:36djwonk`lein new app an_app` followed by `lein repl`raises an exception. I'm thinking there may be an underscore / hyphen confusion
17:37dnolenmpenet: a ticket for what? unnecessary runtime validation is not looked highly upon.
17:37mpenetdnolen: fine with me
17:37p_lIMO it should return that there were no results..
17:38djwonkaccording to http://stackoverflow.com/a/2223369/109618 "you musn't use the underscore in namespace names or the hyphen in filenames and wherever you use a hyphen in a namespace name, you must use an underscore in the filename"
17:39dnolenmpenet: there are quite a few annoying differences between CLJ & CLJS regexes - hopefully feature expressions can alleviate the differences for shared code bases.
17:40hyPiRiondjwonk: There is a pull request fixing this on lein newnew
17:40djwonkhyPiRion : thanks. I just saw https://github.com/technomancy/leiningen/issues/865
17:40hyPiRionhttps://github.com/Raynes/lein-newnew/pull/55
17:41djwonkthat's a catchy name
17:42technomancynewnew was the original name of clojure.core/reify
17:42technomancy#historicalfact
17:42mpenetdnolen: Yeah I know, it is not a major annoyance anyway
17:42technomancylemme take a look at that pull
17:42hyPiRionit's the new new.
17:42djwonkwill it be the newnormal?
17:43hyPiRionthen newnew turns stable, I guess.
17:43duck1123"just pushed a new newnew. Please replace your old nenew with the new newnew"
17:43technomancyhead asplode
17:43technomancyRaynes: anything else that should go into newnew 0.3.6?
17:46bbloomdnolen: mpenet: i wonder if for static patterns, a subset of the features could be compiled to platform specific regexes
17:47amalloytechnomancy: wait, was reify really called newnew?
17:47technomancyamalloy: yeah, before it was implemented
17:48dnolen\me remembers
17:49dnolenoops
17:49dnolenhttp://clojure-log.n01se.net/date/2009-07-30.html#13:09a
17:50dnolenglad that one didn't survive
17:51bbloomreify is just a damn good word in general
17:52bbloomif nothing else, clojure has added improved my vocabulary with reify, complect, and simple vs easy
17:53AimHereAlso, clojure hogs all the good function names for keywords, forcing you to use your vocabulary when writing code
17:54technomancykeywords?
17:54clojurebothttp://clojure.org/data_structures#toc8
17:54bbloomAimHere: namespaces, one honking good idea!
17:54technomancythanks clojurebot
17:55AimHereI meant in the sense the word is used in, say, K&R to mean reserved words that the language uses for itself
17:55dnolenAimHere: the number of names you can't override is quite small.
17:55AimHereSee, that's an example right there
17:55amalloyAimHere: wat. clojure has a very small set of "keywords"
17:55mthvedtthink he's talking about syms in clojure.core
17:55AimHereYep
17:55dnolenmthvedt: syms?
17:56mthvedtdef'd
17:56AimHereNames of functions in the core language
17:56amalloythat's totally different. the standard library is not keywords
17:56mthvedttechnical term escapes me
17:56mthvedtinterned?
17:56technomancyAimHere: :refer-clojure :exclude [whatever]
17:56dnolenAimHere: mthvedt: yes this is wrong. You can use your own names.
17:56Sgeotechnomancy, doesn't work for special form names
17:56dnolenSgeo: we already said that twice above.
17:56mthvedtdnolen: i know, just trying to be helpful and/or pedantic
17:56technomancyso what, like six words?
17:56Sgeodnolen, oops
17:57mthvedtpreferably both
17:57technomancymost of which have a * on them
17:58bbloomdnolen: i think that any name you can't override is a bug…. the clojure design wiki mentions namespacing special forms. that's a good idea we should do
17:58S11001001the other is /
17:58S11001001special forms & / that is
17:58amalloy,(let [let +] (let 2 3))
17:58clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: let requires a vector for its binding in sandbox:>
17:58AimHereWell I think it would be pretty bad style to reimplement 'car' and 'cdr' just because you want to use 'first' and 'rest' in your own program
17:58bbloomS11001001: the symbol foo// is fixed in clj 1.5
17:58amalloyaw, really?
17:58AimHere*rename the functions as
17:59dnolenbbloom: it's not something I care about much.
17:59S11001001bbloom: cool, when 1.5 is released I'll forget about it :)
17:59djwonkclojurebot wants to jump in on this convo
17:59bbloomdnolen: it's not a big deal, but it's a bit annoying in cljs/core.clj
18:00bbloomdnolen: when i was exploring some AST changes, i wanted to see what happened if i overrode 'do and it just kinda blew up :-P
18:19tomojwhat trouble would come from extending IDeref and IPending to everything, where the default deref is the identity and the default realized? is (constantly true)
18:20tomojother than breaking some uses of satisfies? out there
18:20Bronsaprint-method wouldn't be happy
18:20technomancyit's sloppy and would shadow genuine mistakes
18:20dnolentomoj: extend Object/default always needs a whopping good rationale.
18:20tomojyeah, so you deref when you don't mean it and never notice
18:21hiredmanderef is half of a monad
18:22dnolentomoj: it's telling that in CLJS the only case of extend default is IHash & IEquiv
18:22hiredmanthe bind operation is basically a protocol for binding names to values
18:22dnolenit used to be the case for ICounted & IIndexed and that was painful.
18:23tomojyeah, I wouldn't really consider extending IDeref/IPending to default, just trying to understand better why it would be bad
18:23tpopeIs there a reasonably simple way to get a list of java classes for tab completion?
18:24tomojmy rationale is silly - I have many functions which may take either an IDeref or a value, and I don't want to write (if (satisfies? IDeref x) ...) in every one
18:24technomancytpope: the clojure-complete library handles that
18:24tpopetechnomancy: can I count on that being available?
18:24dnolentomoj: then you never know if you have a real IDeref or not, and you always have to call realized?, this sounds like the madness of not knowing wether you have a real list in Scheme.
18:25technomancytpope: no, but it's completely reasonable to make completion a no-op when it's not
18:25tpopehmm ok
18:28tomojactually, I can get away without satisfies? if I just extend IDeref to nil. :(
18:29tomojor just check for nil :)
18:37aperiodicbut if you extend it, then you can get nil satisfaction
18:39tomoj(satisfies? ISeq nil)
18:39tomojbut (not (satisfies? ASeq nil))
18:40tomoj..nor (satisfies? ISeqable nil)
18:40tomoj(in cljs)
18:46dnolentomoj: now that's probably an oversight. extending to nil happens on line 381-442 core.cljs
18:47tomojwhich is an oversight, that (satisfies? ISeq nil) is true or that one or both of the others are false?
18:47dnolentomoj: or maybe not
18:48dnolentomoj: I have to say extending to nil is a bit of convenience - not sure it's about semantics. In generally for perf reasons we should probably check for nil in the actually fns. this requires some hammock time from someone.
18:49dnolencheck for nil in the actual fns I mean. like checking for nil in first, and not extending nil to ISeq.
18:49tomojyou're suggesting checking for nil would be faster than extending to nil?
18:49tomojor that we extend to nil now for performance reasons?
18:50dnolentomoj: nil check is cheap, what we're doing now is bound to be slower in the nil case.
18:51dnolenwould probably be cleaner for nil to be extending to nothing - same as in Java
18:51dnolenthis also makes sense from Typed Clojure perspective
18:51dnolennil is not a part of anything
18:51dnolenit's just unioned w/ the various types that fns accepts
18:53tomojseems seq and first already do check for nil
18:53dnolenyep
18:54dnolenbig perf benefit there.
18:54dnolenwhen you hit the end of a seq
18:54dnolenso probably would take a patch that made nil not participate in all those protocols.
18:55dnolenand the required nil checking.
18:55dnolenof course would still want to check that doesn't mess things up somehow or slow things down in some way I don't see at the moment.
18:56dnolenbut I suspect it'll be fine - that's basically how RT.java works.
19:02tomojwhat's the seq typehint for?
19:03tomojoh, I see
19:05tomojI was thinking I wanted a typehint for "not boolean"
19:16TEttingeranyone have an idea how to implement nested commands a la supybot for lazybot?
19:17TEttinger`seen amalloy
19:37amalloyi don't understand the question
19:40amalloyTEttinger: ^
19:40TEttingeramalloy: supybot allows you to do things like (assuming prepend $ )
19:41TEttinger$seen [decide amalloy,TEttinger]
19:41lazybotI have never seen [decide.
19:41TEttingerand it would call decide, take what it WOULD print to the channel and use it as the args to $seen
19:41amalloyi predict this would require a substantial rewrite of lazybot's plugin system
19:42TEttingerI think it would be as simple as a binding thing... if I could figure out binding...
19:42TEttingerah
19:42TEttingerI was going to use a new plugin, preprend twice
19:42TEttingerlike $$
19:43TEttingerdo you know how I could rebind irclj's output like you do for *out* ?
19:46amalloyif you wanted to add it as a special plugin, rather than making it work for existing plugins, it's a much smaller effort
19:46amalloybut i don't know anything about irclj
19:53TEttingerheh, ok.
20:16tomojhmm.. it seems if your Executor for send-via runs the action in the calling thread, you get an error
20:16tomoj'pop without matching push'
20:17tomojof thread bindings
20:18tomojwonder if that's a bug, or if using a synchronous Executor is a user error
20:18tomojExecutor docs say "Executes the given command at some time in the future. The command may execute in a new thread, in a pooled thread, or in the calling thread, at the discretion of the Executor implementation."
20:19hiredmantomoj: sounds like a bug in the binding conveyence code
20:23tomojyes, ((binding-conveyor-fn println)) gives the same error
20:29tomojdon't understand why that would happen
20:30tomojseems like binding-conveyor-fn should be a noop when its return value is called right away
20:31hiredman:(
20:31tomojit just gets the ThreadLocal<Frame> dvals when binding-conveyor-fn is called, then sets dvals to the same Frame when its return value is called
20:31hiredmannasty and unsafe
20:31hiredmanvery yetch, just makes me hate binding conveyence all the more
20:32hiredmanbindig-conveyor-fn makes no effort to reset the frame back to whatever it was
20:32tomojfwiw bound-fn is not broken in this respect, and binding-conveyor-fn is private
20:33hiredmanand cloneThreadBindingFrame doesn't just clone bindings, it truncates the frame, if I recall
20:33tomojah
20:33tomojright, Frame clone only copies bindings, not prev
20:34hiredman*yetch*
20:37tomojso a threadpool executor with callerruns might break agents?
20:38hiredmanany one running agent actions on a thread that may actually have bindings you want to keep is in for a bad time
21:31gfredericksdoes core.logic run in parallel now?
21:33dnolengfredericks: nope, but jamii is giving that another go as well as opt-in fair conjunction
21:33gfredericksit makes all 4 of my cores light up
21:33gfredericksI guess that's just...other stuffs :)
21:48Foxborongfredericks, problem number 165 is "fun" in the sense it tok 8 hours to solve :P
21:51gfredericksto code or to run the code?
21:53hyPiRion185 or 165?
22:10Foxborontoo run.
23:23TEttingerok, 4 hours later... still at the problem. I am trying to have a lazybot plugin call another lazybot plugin, get the output of the second one as a string, and pass it to the original plugin.
23:23TEttingerthe main problem seems to be with the IRC stuff
23:23RaynesYeah, you can't really do that.
23:23TEttingerI am not sure how to... capture the output
23:23technomancyif only plugins were implemented as functions
23:23Raynestechnomancy: They are functions.
23:23TEttingerI have achieved some success though
23:24technomancyin a composable way
23:24technomancy=
23:24TEttingerthey are, yeah there's an :fn internally
23:24Raynestechnomancy: They're just stored in complicated ways.
23:24technomancy)
23:24Raynestechnomancy: You're welcome to fork it and fix my terrible design.
23:24technomancyactually I have been intrigued by http://tools.suckless.org/ii/
23:24technomancyremarkable piece of soft ware
23:24TEttingerRaynes: I reassigned something in the :com , in case you want to see my terrible code
23:25Raynestechnomancy: This composable magic of yours doesn't really work in an IRC context. You output to IRC. You don't just return strings.
23:26RaynesYou can return some data structure telling the plugin system how to output what you want, but then you lose flexibility that some plugins require.
23:26technomancyyou can't just return a map of targets to output?
23:26RaynesNo.
23:26technomancyoh. that's a shame. =\
23:26RaynesIt is.
23:27TEttinger3http://ideone.com/sagF9a
23:27RaynesSome plugins required timed releases of output, no output at all, different kinds of output, output in a thread async. Plugins can be super complex.
23:27TEttinger3the problem has to do with it behaving weirdly regarding [:com :connection :sockout]
23:28TEttinger3ohhh...
23:28technomancyyou could do a lazy seq with a sleep in it
23:28TEttinger3I don't know when it will return
23:28technomancybut that might muck up the control thread
23:30Raynestechnomancy: Also, I'm currently running Windows. I should download leiningen and just scream at you.
23:30TEttinger3heh, what?
23:31RaynesTEttinger: Could you summarize what you're trying to do with @com and what isn't working?
23:31TEttinger3Raynes, sure.
23:32TEttinger3...I admit I am not really sure what :com is or how it works
23:32RaynesTEttinger: I never thought anyone would actually mess with it. :p
23:32TEttinger3my version of lazybot has a TODO: document this for defplugin :-)
23:32technomancyRaynes: praying for your safe recovery
23:33Raynes@com is all the information from irclj. It holds everything irclj mutates and such.
23:33Raynestechnomancy: Just for video games, thankfully.
23:33TEttinger3but I am trying to get the output from irclj into a StringWriter
23:33TEttinger3which could be trouble
23:33RaynesThere is about a -4% chance of that working.
23:33RaynesThere can be 100 things writing to those streams at a time.
23:35TEttinger3Raynes: ...so is "piping" one plugin's printed messages into another plugin impossible with lazybot?
23:35RaynesIt probably is, sadly.
23:35TEttinger3ah. worth a shot...
23:36Raynestechnomancy has a point in that it could potentially be rewritten to be more composable, but I think it would be at the cost of flexibility in plugins. Might be an interesting thing to try sometime though.
23:37technomancyRaynes: return a per-channel vector where strings are emitted and numerics represent a pause?
23:37RaynesThat was just an example.
23:37technomancyprobably a handler/middleware approach a la ring and nrepl
23:38technomancyor something
23:38RaynesUgh
23:38technomancywell probably more like aleph
23:38technomancysince it's async
23:38RaynesThe primary issue would be plugins that do things like notify async. The Github commit plugin, for example.
23:38RaynesIt screams "GIVE ME A QUEUE!" but a queue wont help for composability.
23:39RaynesRegular commands on the other hand might be possible.
23:39RaynesTo do what you say, I mean.
23:39technomancyirclj 2.0.0
23:39RaynesThings that do threads are typically hooks which you wouldn't want to grab anyways.
23:39RaynesThis isn't an irclj thing.
23:39technomancy(says the guy who hasn't released version 2.0.0 of his project)
23:39RaynesIrclj is entirely composable enough.
23:39technomancyoh right
23:40RaynesLazybot is written by me when I was like 14.
23:40technomancyexcellent point
23:40RaynesI've rewritten parts of it over time but have never given it a real shakedown.