#clojure logs

2012-12-06

00:07devthno way to partially apply a fn's args in any order but left-to-right without wrapping it in your own fn, correct?
00:10Raynesdevth: Sounds like you want a flip function. I think useful might have one.
00:10devthRaynes: cool, i'll take a look.
00:11RaynesI might be wrong.
00:11RaynesWe at least considered putting it in there.
00:11devthno luck with ack.
00:11devthbut yeah, i could see a lib doing this. was curious I was missing anything in core.
00:12Raynesdevth: (defn flip [f] #(apply f (reverse %&)))
00:12RaynesThat's a simple version. amalloy_ has a complex version that does shit I don't even understand.
00:13devthnice. so that's what %& is for
00:13jonasenI'm trying to wrap my head around core.logic's constrained logic vars, but I can't get even the simplest constraint to work: https://www.refheap.com/paste/7336
00:13jonasenI'm probably doing something silly..
00:47ohpauleeztpope: Thanks looking into the issues - much appreciated
01:02elephantTechnoyo. I'm extremely new to clojure and I have a problem : using lein to compile then run a program is extremely slow (several seconds) which is inappropriate for someone who has a very vague notion of clojure's syntax. How can I 1) run the main function of a program using the REPL 2) running a specific function using the REPL ? Teach me how to use the REPL ! thanks.
01:11nightfly_Say your projects is "cows" and you're using the lein app templete to run main would just me (cows.core/-main)
01:12nightfly_Any arbitary function can be called just how you would in your code
01:24technomancyelephantTechno: if you don't have editor integration figured out yet it's easy enough to just paste into the repl
01:24technomancybut eventually you'll want to have it set up so you can send stuff straight from your editor with a single command
01:32elephantTechnothank you techomancy. I'm using sublime text (again I'm quite new to it, i previously used text mate). But for now i'll just use the repl from a separate terminal.
03:12Raynesibdknox: Why didn't you put my tomorrow night theme in there? It's the only theme I care to use.
03:27josteinkelephantTechno: you may want to look into "drip"
03:27josteinkelephantTechno: unless you are running windows, because AFAIK drip does not work on windows ;)
03:27josteinkhttps://github.com/flatland/drip
04:34dsevillaguys, do you know of any list of core.logic resources?
04:34dsevillafrom documentation to learning projects to projects that just use it
04:34dsevillapresentations, videos, etc.
04:40fredyrdsevilla: http://blip.tv/clojure/dan-friedman-and-william-byrd-minikanren-5936333
04:40fredyrsorry, missed that ur looking for a list of resources
04:43dsevillafredyr: thanks, I think there's no such compilation, so maybe I'll start it
04:44dsevillaI'm very interested in it. I think core.logic is not used as much as it could be used for many things
04:44fredyrsure thats a good idea
04:45fredyrthe resources i keep seeing is reasoned schemer and will byrds thesis
04:46dsevillafredyr: yes, this is where to start, I think, but there are some good presentations too, and some applications of it that worth taking a look at
04:46dsevillafor instance, there's an implementation of the 99 logic problems in core.logic
04:46fredyroh
04:47fredyrlet me know when you've compiled the links that you've got so far
04:47dsevillafredyr: OK :)
04:48dsevillafredyr: damn I cannot find the 99 problems in core.logic, but I have them somewhere
04:48dsevillathat's why the compilation :)
04:49fredyr:D
04:53RaynesI got 99 problems but core.logic ain't one.
04:59dsevillaRaynes: hahaha, you know, it was 99 logic problems IN core.logic :)
06:21dsevillatdfjadlfjasdfa
06:22Raynesihuhgb
06:22dsevillaups, sorry
06:22dsevillamy gnome-shell went nuts
06:22Raynes:p
06:34berdarioHello, does someone use ritz-nrepl here?
06:59berdariogosh, I'm starting to get really discouraged right now
06:59llasramberdario: I know people do use it. hugod himself is on here frequently
06:59berdarioaside from my issue, there's this one: https://github.com/pallet/ritz/issues/58 and I can't find documentation on the lein plugin :/
07:00berdariollasram: what do you use for debugging? (I don't really care about ritz-nrepl, I just want something that worksa)
07:00llasramI'm not sure where you are in the world, but it's before 7am EST and 4am PST, which means a big chunk of Clojure users are asleep right now
07:00berdarioI'm UTC+1
07:01cemerickIt's interesting that Europe generally isn't on irc.
07:01cemerickHere, anyway.
07:01cemerickInteresting that that fellow says that nrepl.el is "unusable".
07:01llasramThere are people from Europe, but things do seem most active during EST-PST core hours
07:01cemerickAmerican slackers.
07:01berdarioeh, I was awake until 3.30 UTC, btw... but I got tired, and I hoped that I would find someone else now :)
07:02berdariocemerick: what do you use for debugging?
07:02cemerickberdario: I do all my Clojure-ing in Eclipse + Counterclockwise.
07:02berdariocemerick: no CLI, then?
07:02cshellcemerick: How's the debugging support in that?
07:03llasramberdario: And I use Emacs but I have to confess I've never been a big fan of debuggers for managed languages. Just never gotten it into my workflow
07:03cemerickberdario: You mean, a REPL in the shell? Hardly ever.
07:03cshellcemerick: Do you use the REPL in CCW?
07:03cemerickI use lein from the command line, obviously; though Laurent is working on making that less necessary.
07:03cemerickcshell: ccw benefits from the eclipse debugger, which is quite good
07:04cemerickcshell: I built the REPL in ccw. ;-)
07:04berdariollasram: I use emacs as well, can I ask you what is the current debugger that you have installed?
07:04berdario(emacs 24 btw)
07:04cshellcemerick: Awesome, I'm just finishing up the lein 2 dependency management integration into the IDEA leiningen plugin
07:04llasramberdario: For Clojure? Mental reflection and (prn) calls
07:05cemerickAh-ha! Just last night, talios was asking about the status of La Clojure.
07:05cshellcemerick: I eventually want to get the clojure support to be as good as the java support in IDEA
07:05cemerickIt's seemed dead on and off for a while.
07:05berdariollasram: is that a joke answer?
07:05cshellcemerick: yeah, those guys are very sporadic - I am going to start contributing to it though after I get the leiningen support complete
07:06berdarioI mean, I can't find any "mental reflection" thing for clojure
07:06cshellberdario: I haven't used the IDEA debugger, but Relevance and cemerick support counter clockwise, so I'd give that a try first
07:07berdarioyou said that you're not a fan of debuggers, but yet... you said you "use emacs", hence I inferred that you had an emacs debugger installed (even if you seldom use it)
07:07berdariocshell: yes, but I'd prefer something minimal
07:07llasramberdario: Ohhh, I'm sorry for the confusion. I meant I use Emacs for Clojure development, but don't use a debugger
07:07berdariocshell: not for the sake of it, but just because I just want something to help me understand the code and step up and down the stack
07:08berdariollasram: ok, thanks anyhow :)
07:08cshellcshell: that's what the eclipse debugger should do - it should let you move up and down the stack
07:09berdariocshell: do you know somebody here who worked with the clojurescript sources? (I know I'll have to wait some hours for people to wake up, but still...)
07:09cemerickberdario: If you're aiming to use a debugger to aid your understanding of Clojure code, etc., I'd suggest that that's unlikely to be of much help.
07:10berdariocemerick: I have a static function in a clojure module/packages (sorry, my terminology is quite confused)... but apparently it's shipped in a different file
07:10berdariocemerick: how can I understand where it's coming from, without a debugger?
07:11cemerickyou mean, you are trying to determine from where a Clojure namespace is being loaded?
07:12berdarioI'm in the .clj file that defines this namespace, but it's requiring things from somewhere else, and I assume some of these things are compiled .jars
07:13berdariocemerick: so, yes... I'm trying to determine from where they're loaded
07:13llasram&((juxt :file :line) (meta #'require))
07:13lazybot⇒ ["clojure/core.clj" 5319]
07:13cemerickRight, there's that, and also:
07:13cemerick,(clojure.java.io/resource "clojure/core.clj")
07:13clojurebotnil
07:13cemerickoh jeez
07:14cemerick&(clojure.java.io/resource "clojure/core.clj")
07:14lazybot⇒ nil
07:14llasramSilly bots
07:14llasramDon't remember where they came from
07:14cemerickberdario: the bots have that blacklisted, but you can use a call like the above to determine where a particular file is being loaded from within the classpath
07:15cshellberdario: there are a lot of people that know cljs in here - if you search the clojure log file at http://clojure-log.n01se.net you can find particulars
07:16Foxboroncemerick, you one of the guys that wrote Clojure Programming?
07:17cemerickFoxboron: yes
07:18Foxboroncemerick, love the book ^^
07:19cemerickFoxboron: Glad you're enjoying it. :-) If you think it's worthwhile, please do leave your review @ http://amzn.to/clojurebook ;-)
07:20FoxboronI do miss small tasks or something along those lines, but thats rather a minor flaw in my opinion.
07:20Foxboroncemerick, will do when i have read through it all.
07:20cemericksmall tasks?
07:21berdariollasram, cemerick thanks... clojure.java.io/resource seems to always return nil, but meta says that what I'm looking for is at line 277
07:21cemerickberdario: how are you calling `resource`?
07:22cshellDoes anyone use Clojure as a Python/Ruby scripting replacement?
07:22berdario(clojure.java.io/resource "closure/-compile") or (clojure.java.io/resource "closure") or (clojure.java.io/resource "-compile")
07:22cshellor scripting replacement in general?
07:23Foxboroncemerick, like at the end of a chapter you add a little page with possible tasks to further understaing the chapter. Things to code etc.
07:23berdariobtw, now I have the namespace and the line number... but still I have to find out what's the exact file
07:23cemerickberdario: resource needs a path, e.g. "clojure/core.clj" if you want to see where the clojure.core ns was loaded from, etc.
07:23cemerickIt doesn't know anything about functions
07:23cemerickFoxboron: ah, homework :-)
07:23berdariocemerick: ah, I did (require '[cljs.closure :as closure])
07:24cemerickthen, "cljs/closure.clj"
07:24berdarioso, "closure" is no good, but "cljs/closure" is what I'm looking for
07:24berdario?
07:24berdariook, thanks
07:24cemerickbut, that's just over here: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/closure.clj
07:24berdario(ah, I forgot the .clj)
07:24berdariocemerick: yes, I'm into closure.clj
07:24berdariobut some things are missing
07:25Foxboroncemerick, yeah if you wanna call it that :)
07:25berdariook, it's a jar file: clojurescript-0.0-1534.jar
07:26berdarioafk: (I'll have a slice of pizza)
07:27cshellIs let considered imperative as it affects program state?
07:47fredyrcshell: no i wouldn't say it does
07:48cshellDoes haskell have a let concept?
07:50squidzafter Ive created an executable clojure script with lein uberjar, can anybody tell me how I can pipe from the linux shell?. My script takes a file and outputs a line. I want to read in a directory of files and spit the output into a single file.
07:50berdariook, I realized that the .jar file wasn't really relevant (it was probably brought in by leiningen... but the contents are the exact same .clj files that I'm reading)
07:51cemericksquidz: just read from *in*
07:51berdarioand that -compile is indeed in the same closure.clj... I assumed that the protocol was defined there, but the implementation was done in java
07:51fredyrcshell: i believe haskell does have a let construct yeah
07:51squidzcemerick: How? im not experienced in working with scripts in the shell
07:51berdariofredyr: is has bot a "let" and a "where"
07:52berdarios/is has bot/it has both/
07:52cshellfredyr: Interesting, it(wikipedia) says imperative programming allows for mutation of programming state and that in FP there is no manipulation of state (in theory i realize) but rather a chaining of functions together
07:52squidzmy script works fine, it is just running the function on multiple files and outputting their results into a new single file
07:53ambrosebsA Practical Optional Type System for Clojure - Final version https://github.com/downloads/frenchy64/papers/ambrose-honours.pdf
07:53cshellit seems when I use let i'm affecting the state of the program as I'm affecting what's in scope
07:53fredyrit's really not the issue of program state
07:54fredyrbut mutating between states
07:54fredyrlet is creating a local binding in your lexical scope
07:54clojurebotc'est bon!
07:54fredyrthat binding never mutates in any way
07:55cshellah, okay, thanks fredyr :)
07:55fredyrnp
07:55fredyri'd recommend you to look into some resources about functional programming
07:55cemerickambrosebs: Congratulations! :-D
07:56ambrosebscemerick: woo!
07:56squidzcemerick: do you know what i mean?
07:57cemericksquidz: not particularly? Your script has a -main, you have access to the command-line args. If you want to read from stdin, *in* is what you want.
07:58cemerickambrosebs: No news yet on moves, etc? We're all waiting to see you more regularly. ;-)
07:59squidzcemerick: yes, i have no problem running my script in the command line with one argument my problem is more bash related. I'm not sure how to do something like a map in bash where i apply my clojure script to a list of files in bash
08:00cemerickAh. Don't ask me about bash. :-)
08:01ambrosebscemerick: I will finish my honours degree around June.
08:01ambrosebsAnd hopefully publish at least one paper by then
08:01ambrosebsThat much is certain :P
08:15berdariosquidz: have you solved it yet? I think it may be better to do it from clojure side... but maybe, what you want can simply be accomplished by "ls | xargs -n1 yourcljapp > outputfile"
08:16squidzberdario: I havent solved it yet let me try your option out
08:19squidzberdario: its running, ill tell you if it worked as soon as its done
08:23squidzhm still running, i think it might be stuck
08:24squidzalright, i may just do it in clojure. I though doing it in the shell would be easier
08:33berdariosquidz: uhm, it should work though... have you tried on a subset of the files?
08:34berdariols foo* | xargs -n1 app
08:34lazybotdev lib media mnt proc srv tmp var
08:35berdariobut if it's launching a new clojure for each file, I guess that may partly explain the slowness of it
08:39squidzberdario: it's okay, i may have been using the wrong approach, I have to rethink what i'm doing. I'm not sure I even need to run my clojure programm multiple times then
08:57echo-areaIs there simpler ways to use a dynamically bound value inside an anonymous function, besides finding it via `get-thread-bindings'?
08:58echo-area*a simpler way
08:58llasramecho-area: As in, have the function preserve the bindings active at the time it is defined, vs use the bindings active when called?
08:59echo-areallasram: I want to use the dynamic value.
08:59echo-areaHow to evaluate something here?
08:59echo-areaHow to invoke clojurebot?
08:59llasram&(println "example")
08:59lazybot⇒ example nil
09:00echo-areaOh, thanks
09:00echo-area&(do (def *v* 7) (binding [*v* 7] (map (fn [x] (list* *v* [x])) [*v*])))
09:00lazybotjava.lang.SecurityException: You tripped the alarm! pop-thread-bindings is bad!
09:00echo-areaHmm
09:00echo-area&(def ^:dynamic *v* 7)
09:00lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
09:01llasramHeh, yeah. Sandbox
09:01Raptum&(ns test.foo) (def bar "baz")
09:01lazybotjava.lang.SecurityException: You tripped the alarm! class clojure.lang.Compiler is bad!
09:02echo-areaYou see, the result of the above binding form is ((nil 7))
09:02llasramSo the issue is that you want to get the bound value of *v*, but seq laziness means that by the time your fn is run, you may be back outside of the lexical scope of the `binding` call?
09:02echo-areaYes
09:02echo-areaOh I see
09:02Raptum&(let [foo "bar"] (print foo))
09:02lazybot⇒ barnil
09:02Raptumah ok good
09:02echo-areallasram: Thank for the remind
09:02llasramOh, np :-)
09:02echo-areaI see why
09:03llasramIf you want to let the seq stay lazy and not eval inside the `binding`
09:03llasramyou can use `bound-fn`/`bound-fn*`
09:04llasramOr you can decide dynamic vars are bad news and stay away from them :-)
09:06echo-areallasram: I was not aware of the laziness (again :(), but I can't stay away from dynamic vars. I can create a solution now, thank you
10:03squidzafter learning the fundamentals of clojure by reading clojure in action, what can I go to next to learn more about building APIs/Libraries with clojure? I guess it should be more from an abstract level than the technical level of learning the language mechanics
10:05ohpauleezsquidz: Read through the source of Ring, Leiningen, and ClojureScript. Pickup and read Joy of Clojure,
10:05nDuffHmm. You've actually fond In Action to be a good intro to fundamentals?
10:06nDuffsquidz: ...anyhow -- Clojure Programming is a fair mix of practice (including a lot of coverage of the ecosystem) and theory, where's Joy of Clojure is still the best thing available on theory/rationale.
10:06squidzreally why not?
10:07squidzwhat was wrong with clojure in action for you?
10:07nDuffsquidz: Practice is useless to me unless I grok the theory first, and Clojure In Action taught no theory.
10:08nDuff...and it was really very limited on ecosystem coverage on the practice side, too, if compared to Clojure Programming (which, granted, is a much newer book)
10:08squidzah okay. Yeah the practical side of it was useful I guess to get up to speed with the very basics, but now i'm wanting to learn more higher level stuff with clojure
10:11squidznDuff: I dont really want to spend too much time figuring out the technicalities of how a library works or syntax that I already know/can easily figure out later. I want to learn how to design with clojure. Which book goes more in that direction?
10:12nDuffJoC
10:13squidzokay thanks! Ill look into it.
10:27rkzsqlkorma is another really good codebase to look at
10:28nDuffUgh.
10:28nDuff...as something that's supposed to be giving an idea of good API design? Please, please no.
10:28nDuffkorma is horrible -- chock full of macros and consequently difficult to compose.
10:29rkzI needed to make some changes and found it quite easy to figure out where/how to do it
10:30nDuffrkz: I'm not saying it's hard to read or change, but that most of it isn't amenable to use with HOFs
10:30squidzI took a look at korma because the library looked useful. But I so far have stayed away from writing macros. I'm sure the time will come when it will be the perfect solution, but until then I will try to avoid them
10:31rkzthat might be true, I haven't used it in anger, just to introspect a db rather than using it for reading or writing
10:31rkzwhat do you use for db access? jdbc direct?
10:32nDuffBuilt my own, more composeable layer on top of clojure.java.jdbc
11:05marcellu`I'm trying to use clojure.java.shell/sh to create a function to execute any command as a different user like 'sudo -u test-user mkdir test-dir'. But it seems like sh only takes named argument pairs? https://www.refheap.com/paste/7342 that's what I have right now. Do I basically need a macro to make this work?
11:10llasrammarcellu`: Outside of Clojure, this approach is problematic. Why can't you just allow the system `sudo` configuration to pertain, allowing the user your program runs as to use `sudo` w/o a password for the relevant commands if desired?
11:13marcellu`llasram: I'm specifically trying to allow multiple users to execute arbitrary command on the system
11:19llasrammarcellu`: As a general rule, feeding a password to a program means there's a better approach. In this case, you can configure `sudo` to allow all users in a group to run arbitrary commands as root w/ no password
11:20llasramThen your program can just run `sudo` without worrying about feeding a password in
11:20marcellu`Gotcha, makes sense, thanks!
11:29brainproxywhat caching/proxy servers do you like to put in front of your ring/jetty based apps -- varnish, nginx, other? if one goes the immutant route, is there a java-based solution that can be baked into the stack?
11:34jcrossley3brainproxy: for immutant, mod_cluster is recommended. or on openshift, haproxy is used.
11:37jcrossley3brainproxy: i should clarify that on OS, haproxy is configured for you when you create a "scaled" app. there's nothing further you need to configure for load-balanced web requests.
11:37brainproxyjcrossley3: os looks cool, but I need a localized option
11:38brainproxywill admit, I really haven't experimented w/ immutant yet, though have been reading about it
11:39dimovichhey guys, I'm using enlive to fetch a web page with charset=windows-1251, but I get mangled output... due to wrong charset...
11:39dimovichhow can I fix this?
11:39jcrossley3brainproxy: i would remiss if i didn't point you to this: https://openshift.redhat.com/community/blogs/announcing-openshift-enterprise-paas-from-redhat (but it's brand new and i know bupkis about it) :)
11:39jcrossley3be*
11:40brainproxyjcrossley3: it's got to run under Windows :-/
11:40brainproxybut thanks, bookmarked, and good to know about
11:40jcrossley3brainproxy: :)
11:52dimovich(how to load html from a string as opposed to html-resource which loads from a url)?
11:52dimovich(with enlive that is...)
12:13qerubdimovich: Maybe you can wrap the string with StringReader?
12:14dimovichyeah... found the solution here https://groups.google.com/forum/?fromgroups=#!searchin/enlive-clj/string/enlive-clj/x4UT745nWU0/JQ3RqDk6U9UJ
12:15dimovich(-> string java.io.StringReader html-resource)
12:15dimovich:)
12:15dimovich(-> string java.io.StringReader. html-resource)
12:51pandeirois there a way to turn a set of characters into a regular expression?
12:57sahadevhello, is this the right place for a clojure newbie to ask for code review? I am currently working through Project Euler problems, while I am learning clojure. I managed to finish a few problems, but the program I came up with for a problem leaves me quite unsatisfied. I would like to know how my code can be improved.
12:57madsysahadev: This place is as good as any :-)
12:58sahadevmadsy: thanks. the program is at https://gist.github.com/4226416, if you care to look at.
12:58madsysahadev: If you give us a pastebin link, I'm sure someone will take a look sooner or later
12:58madsyI'm not proficient enough in the language to be of service I'm afraid
12:59sahadevmadsy: no worries. if you do feel like looking at it, and comment, i welcome it.
13:01madsysahadev: Looks good to me.
13:01madsyExcept your month-firsts can probably be done without recursion :)
13:03sahadevmadsy: do you mean not using loop/recur?
13:03madsyyep
13:05hyPiRionlooks like you could utilize reductions or something
13:35borkdudecan I ask a stupid question? OO applications usually refer to something as the "domain model", classes with a lot of associations with other classes…. is this total bullshit? In most Clojure apps I've seen the data that is used is persisted mostly directly into the database?
13:40llasramsahadev: I have two main suggestions: (a) Leverage sequences and sequence operations. A reduction over a lazy sequence will generally result in more readable code than manual loop/recur
13:41jgermanis there a clojure idiomatic way to handle configurations (such as db connections) or is just using java Properties the common method?
13:41borkdudejgerman some apps use maps (leiningen), others use property files
13:41sahadevllasram: thanks for the suggestion. what's the second one?
13:41llasramTrying to think how to phrase it :-)
13:42technomancyproperty files are not idiomatic for pure clojure applications
13:42jgermancool, I'll look there for ideas, thanks
13:42borkdudeclojure isn't pure
13:42borkdude:P
13:43technomancyjgerman: I recommend https://github.com/sonian/carica
13:43technomancyunless you are trying to hide the fact that it's implemented in clojure, you should use clojure for your config files
13:44jgermanI'm definitely not hiding it, I'll check into that as well, thanks for the guidance, trying to get clojure into our organization
13:44borkdudetechnomancy looking good, that lib
13:45borkdudetechnomancy does leiningen use it too, or just map reading from a file there?
13:45technomancyborkdude: disclaimer: I wrote the first version of it, but I don't know if any of my code survives in recent versions =)
13:46technomancyborkdude: Leiningen uses load-file since it needs more than just a raw map
13:46borkdudejgerman for property file approach: https://github.com/trptcolin/versioneer/blob/master/src/trptcolin/versioneer/core.clj <- example
13:47jgermanswesome, glad I dropped in and asked
13:47technomancyjgerman: there is also environ which uses environment variables, but I prefer files
13:47borkdudetechnomancy jgerman the example in versioneer uses both
13:47jgermanfiles definitely are the way to go for us
13:47borkdude or can handle both
13:48technomancyborkdude: that's not application config though; it's just taking advantage of the fact that Leiningen emits a .properties file for compatibility with Maven
13:48llasramsahadev: Hmm. Yeah, actually, I'd say just sequences :-). Like with `month-first-days` you get a sequence of the day ordinal of the first of each month in a year. If you extended that to be a sequence over the entire time range, you could just count those sundays and be done
13:49borkdudetechnomancy true, but the idea is almost the same: get-version reads the version from an env var or from the properties file
13:50sahadevllasram: sounds good. i will play with that approach.
13:50llasramsahadev: But there's some other implications here. Like you have count-sundays, which counts sundays over a specific range. If you just had a sunday? function, you could just say (count (map sunday? days)).
13:52sahadevdays would be the sequence of all days numbered sequentially for whole time range?
13:52borkdudetechnomancy just some ingredients to get jgerman started, not that's it currently functions as config
13:52technomancysure; it's an option
13:52technomancyit's just that limiting yourself to strings can be constricting
13:53llasramsahadev: Something like that. I'm getting at more of a philosophical point. Your code is broken into functions mostly at steps in a linear process instead of at boundaries of re-composable functionality
13:53borkdudetechnomancy you mean, just one level deep? yes, thats the nature of property files and env vars
13:53technomancyborkdude: yeah, plus you have to have special handling for things like "false" -> false
13:53technomancyand numbers
13:54borkdudetechnomancy true
13:55llasramsahadev: For comparison, here's the solution I wrote when I when I was doing the Euler things: https://gist.github.com/4227022
13:58sahadevllasram: thanks for your time. i see some new functions (constantly and juxt). i'll look them up.
13:58borkdudejuxt is always the answer
14:15pjstadig~juxt
14:15clojurebotjuxt is a little hard to grok but it's the best thing ever
14:39gfrederickspostgres compatible clojure library for db migrations?
14:40technomancygfredericks: https://github.com/heroku/buildkits/blob/master/src/buildkits/db/migrate.clj
14:43llasram*brain explodes*
14:43llasramSo slick
14:43technomancyit doesn't handle downward migrations
14:43llasramEh, who needs 'em
14:43technomancybut in my experience those never work anyway since they never get tested
14:44technomancythe main problem is that you don't get syntax highlighting on the SQL, which is horrible
14:52kaoD_is there any way to print strings escaping characters? e.g. with "\x01" I don't want to print the ASCII char 1, but "\x01" (or \u0001, I don't really care)
14:52kaoD_just like what happens when console.logging objects
14:52kaoD_woops
14:53kaoD_wrong channel sorry haha
15:05hyPiRion,(str (char 1))
15:05clojurebot""
15:06hyPiRion,(.replaceAll (str "foo " (char 1) " bar") "\\p{C}" "?")
15:06clojurebot"foo ? bar"
15:09hyPiRionSome hack with re-matcher and re-find, and you should be up there.
15:10gfredericksare there any good lein plugins for deploying executable jars to servers?
15:11seangroveFeels like I'll be shaving some yaks today, want to get on the new release of cljs and get browser repl working
15:12technomancygfredericks: I recall someone using `lein deploy` on uberjars, which is a bit weird but technically feasible
15:13technomancyerr--not using `lein deploy` directly, but maybe writing a plugin that used the same underlying mechanism?
15:13gfredericksah hm.
15:13gfredericksokay.
15:13tmarbletechnomancy: what does the lein search result with annotation :classifier "sources" mean?
15:13gfredericksmaybe bash/ruby then :) thanks
15:14technomancygfredericks: `lein do test, tar && s3cmd put target/whatevs.tar s3://whatevs/`
15:14gfrederickstechnomancy: do plugins have to exist in their own project?
15:14technomancytmarble: java libraries typically ship source code in a separate jar file, so IDEs typically pull these in for browsing
15:14gfredericksit looks like just adding a src/leiningen/foo.clj doesn't give me a foo task
15:15technomancygfredericks: yeah, it's possible to piggyback on an existing project but way better to do a proper plugin
15:15tmarbletechnomancy: cool, thx
15:15gfrederickswhat's the best approach for project-specific ops code?
15:15technomancygfredericks: pallet?
15:16gfredericksso when you say it's possible to piggyback, why might it be that foo didn't show up as a task?
15:16technomancygfredericks: it's very hard to come up with a legitimate use case for code that needs to run in Leiningen's process but wouldn't benefit from being reusable in other projects
15:16gfredericksI have a (ns leiningen.foo) (defn foo [] ...)
15:16technomancygfredericks: src/ isn't on Leiningen's classpath
15:16technomancyyou have to add a .lein-classpath file to your project
15:17gfredericksanything else have to be included in there?
15:17technomancyecho "tasks" > .lein-classpath
15:17lazybot"tasks" > .lein-classpath
15:17technomancythanks lazybot
15:17gfrederickstechnomancy: we're starting a high-profile pilot use of clojure here, and I'm trying to make it low-hassle
15:17RaynesHahaha
15:17Raynesamalloy: ^ score
15:17gfrederickswriting plugins just to get a jar running on a server seems a bit much at this point
15:18gfrederickss/plugins/separate plugin projects/
15:18technomancygfredericks: yeah I mean I guess the use case is "I don't have time to do it properly" in which case go for it =)
15:18gfredericksw00p
15:18gfredericksthanks for the tips
15:18technomancyit does strike me as weird that there's no scp plugin
15:19Raynestechnomancy: Sure there is. It's called (conch.sh/with-programs [scp] (scp args))
15:19technomancyI recommend uploading a tarball or uberjar to s3 as the last step of your CI process
15:19technomancyRaynes: oh snap
15:19technomancyexcept I said plugin
15:19gfredericksS3 is again rather heavyweight
15:19RaynesPut that in (ns leiningen.scp) then, asshole.
15:19Raynes;)
15:19technomancygfredericks: really?
15:20technomancyRaynes: I already have a pretty good way of deploying apps; thanks =D
15:20gfrederickswell we're not using it otherwise
15:20technomancyoh, so you'd have to hook up billing and stuff like that
15:20gfrederickswell not quite that far
15:21gfredericksjust auth/config stuff
15:21technomancyweird; I didn't think it was possible to write nontrivial clojure apps that didn't already have an AWS account
15:21seangroveIs there an easy way from lein to print out a list of dependencies? I'd like to know what version of clojurescript I'm using
15:21seangrovelein deps doesn't output anything
15:21technomancyseangrove: `lein deps :tree` will do it
15:21seangrovetechnomancy: Ah, great, thank you
15:26hyPiRion,(let [s (apply str (map char (range 0 0xA0)))] (clojure.string/replace s #"\p{C}" #(format "\\\\x%02x" (int (first %)))))
15:26clojurebot"\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\x09\\x0a\\x0b\\x0c\\x0d\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7f\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\...
15:27hyPiRionhuh, learning something every day I suppose.
15:30qubit[01]lein ring server, ring is not a task, what do I use to install ring ?
15:30seangroveDamn, I was really hoping this bug was fixed in cljs 1513
15:31seangroveIn a cljsbuild project, if I edit main.cljs, the app will load in the browser fine. If I edit any other cljs file in the project, it'll auto-rebuild it, but the js produced is broken, and I get 'Uncaught Error: Namespace "goog.debug.Error" already declared.'
15:32seangroveIf I touch main.cljs, it'll be rebuilt, and load properly
15:36bbloomseangrove: can you put together a minimal project to reproduce that?
15:36seangroveI'll see if I can, yes
15:37bbloomseems like that message comes from multiple calls to goog.provide
15:40seangrovebbloom: Yeah, I thought it was this problem https://github.com/unnali/cljs-sscce
15:40seangroveBut I think that's been fixed in cljs 1513
15:41seangroveI also often get Java heap space errors on compilation if I've been auto-compiling for too long, in case that's not a known issue
15:41seangroveNot a big deal, and no easily repo'able, but just mentioning it in case someone else comes across it as well
15:42DhilipSivaHi anybody there ?
15:42scriptoryes
15:42bbloomSSCCE? Short, Self Contained, Correct (Compilable), Example
15:42bbloomabsurd acronym.
15:42DhilipSivaHi, I am new to clojure
15:43seangroveHeh, I didn't make it, I just helped test the fix for it
15:43DhilipSivaHow do I setup a dev-env on windows7?
15:43DhilipSivacan you guys point me to any good resource?
15:44bbloom~lein
15:44clojurebotlein is not clojure
15:44bbloom~leiningen
15:44clojurebothttp://github.com/technomancy/leiningen
15:45bbloomDhilipSiva: use leiningen ^^ it has windows instructions
15:47bbloomseangrove: so you're saying that cljs-sscce project was is fixed?
15:47seangrovebbloom: Yes, I believe that specific problem was fixed by dnolen a week or two ago
15:48seangroveI actually thought that was the problem I'm having, but I don't think so
15:48seangroveI think I have an idea of how to repro it though, will test
15:50qubit[01]for json encoding/decoding, is this a good library ?
15:50qubit[01]https://github.com/dakrone/cheshire
15:51bbloomqubit[01]: I think that's the most popular one, yes
15:52dakronequbit[01]: yes? but I might be biased
15:53Raynesqubit[01]: The best.
15:54bbloomseangrove: https://github.com/clojure/clojurescript/commit/79bc1a9b91699ea0c2745ab5a048aba6375d3303 is that the fix you're thinking of?
15:54bbloomseangrove: http://dev.clojure.org/jira/browse/CLJS-282
15:55seangroveI think so, yes
15:56seangroveHas that patch been released, or is it post 0.0-1513?
15:57bbloomseangrove: I alway use the master branch, so i have no idea what is in what release
15:57qubit[01]how can I start a repl that will pick up my compojure project changes without redeploying ?
15:57bbloomseangrove: https://github.com/clojure/clojurescript/commits/r1513
15:57seangroveOk, I'd like to try that after I see if I can repo this bug
15:57seangroveOr maybe I should switch to master and see if it's fixed there
15:57bbloomseems like not
15:57bbloommaster occasionally breaks, but is fixed very quickly
15:58seangroveWell, I'm feeling a little bit boxed in with the current version, so I'm happy to give it a try and see if I can learn more about the inanards
15:59seangrovePresumably, I can check it out to a directory, and use :resource-paths in my lein-2 project.clj?
16:00seangroveis there a function in cljs I can use to get its current version?
16:01seangrovecljs.core.__version or something
16:01seangroveI'd like to be able to tell whether or not project.cljs is picking the appropriate clojurescript version up
16:01bbloomseangrove: https://github.com/emezeske/lein-cljsbuild/wiki/Using-a-Git-Checkout-of-the-ClojureScript-Compiler
16:02seangroveWow, awesome, thanks!
16:02gfrederickswhat does it take to be able to run the -main method in a namespace using `lein -m foo.bar`?
16:02gfredericksI'm getting a classnotfound foo.bar
16:02gfrederickssorry `lein run -m foo.bar`
16:04gfredericksI bet the ns being compileable is an important first step
16:09seangroveheh, sounds like it could be
16:10seangroveAh, damn. Seems like the bug is still there on master
16:10seangroveWill try to put together a repro case later
16:11hiredmangfredericks: it depends
16:11hiredmanlein actually does a number of fall backs and bad error handling
16:12hiredmanit will try to load the namespace and run the -main function, and if it cannot find that it will try the class and the static main method
16:16seangrovecljs repl is at least working on master with piggieback, so made some progress there
16:18bbloomseangrove: hm.. .that's this piggieback thing about?
16:18seangroveI think it's broken with the version of clojurescript that cljsbuild 0.2.9 depends on
16:20bbloomwhat's it for exactly?
16:21qubit[01]is there a cleaner way to get elements out of a map than this (:title (:glossary body))
16:21seangroveNice way of connecting the browser to nrepl, so the browser is the evaluation env
16:23seangroveI've been running into more and more situations where the cycle of update-file, cljsbuild-recompile, touch main.cljs, cljsbuild-recompile, browser-refresh, test change is too slow (even though it's only ~6-7s)
16:23seangroveSo I figured getting the repl back would help alleviate that a bit
16:23bbloomseangrove: that fix dnolen made seems to read and re-analyze every file :-/
16:24bbloomseems to eliminate HALF of the benefit of an incremental build
16:24bbloomwe need to do some serious work on improving the compiler infrastructure for tool usage
16:24seangroveYeah, definitely some rough edges
16:25seangroveHopefully I'll be able to contribute some more help beyond just testing soon
16:30brehauthuh. core.logic is over two years old
16:36gfrederickswhat's the next paradigm after logic?
16:36gfredericksgotta stay current.
16:37technomancyit's going to wrap back around to assembly
16:37bbloomgfredericks: i've been exploring concatonative :-)
16:37gfredericksqubit[01]: there is get-in
16:37bbloomwww.factorcode.org
16:38bbloomside effects go from left to right, so it's sorta like technomancy said: wrapping back around to assembly
16:38bbloom:-)
16:38bbloomgotta run
16:39gfredericksqubit[01]: also (-> body :glossary :title)
16:39hiredmanis logic not the ultimate paradigm? are we not just mucking around in other paradigms due to the impedance mismatch of turing machines vs. logic?
16:40mthvedtlogic isn't deep enough… i do all my programming in zermelo-frankel set theory
16:41gfrederickswith or without choice?
16:41mthvedti'm having a hard time deciding
16:41gfredericks~rimshot
16:41clojurebotBadum, *tish*
16:42hiredmanmthvedt: well you are doing it wrong, you should be using category theory
16:42brehautwe need a dependantly typed logic monad
16:42jkkramerI want core.dwim
16:43mthvedti prefer the category of category theories… implemented over zf sets of course
16:43hiredmanhttp://en.wikipedia.org/wiki/Abstract_nonsense comedy gold
16:45technomancy«Note that referring to an argument as "abstract nonsense" is not supposed to be a derogatory expression, and is actually often a compliment regarding the sophistication of the argument.»
16:45hiredmanso good
16:46brehautoh man diagram chasing. im having flashbacks to post grad
16:55AWizzArdBest way to group elements of a seq into n-tuples? Example 1: (tuple 2 [1 2 3 4 5 6 7 8]) ==> ((1 2) (2 3) (3 4) (4 5) (5 6) (6 7) (7 8)). Another one: (tuple 3 [1 2 3 4 5 6 7 8]) ==> ((1 2 3) (2 3 4) (3 4 5) (4 5 6) (5 6 7) (6 7 8))
16:56brehaut,(partition tuple 2 [1 2 3 4 5 6 7 8]) ; may want partition-all depending on remainders
16:56clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: tuple in this context, compiling:(NO_SOURCE_PATH:0)>
16:56brehaut,(partition 2 [1 2 3 4 5 6 7 8])
16:56clojurebot((1 2) (3 4) (5 6) (7 8))
16:57brehautblast. and i still missed the step
16:57AWizzArdYes, currently I work with partition and nthrest.
16:57metellus,(partition 2 1 '(1 2 3 4))
16:57AWizzArdWith partition-all
16:57clojurebot((1 2) (2 3) (3 4))
16:57brehaut,(partition 2 1 [1 2 3 4 5 6 7 8])
16:57clojurebot((1 2) (2 3) (3 4) (4 5) (5 6) ...)
16:59AWizzArdOkay, the step is a good idea.
17:00AWizzArdHmm no, the step also doesn’t help.
17:00brehautoccasionally i like to do (map … s (rest s)) for 2-tuple things where theres an obvious operation to perform on the tuple
17:01amalloyAWizzArd: (partition n 1 coll) does what you asked for
17:01AWizzArd,(partition 3 1 [1 2 3 4 5 6 7 8])
17:01clojurebot((1 2 3) (2 3 4) (3 4 5) (4 5 6) (5 6 7) ...)
17:02AWizzArdExcellent.
17:02AWizzArdI missed that.
17:04gphilipphi
17:05Raptumwhat is the opposite of `dec`?
17:05Bronsainc
17:06Raptum*brain-fart* thanks
17:06RaynesHahaha
17:06qubit[01]gfredericks, cool thx
17:07gfrederickswoah
17:07gfredericks(sql-only (select foos (where {:name "Bob"})))
17:08gfredericksthat works fine
17:08gfredericksmeanwhile
17:08gfredericks(->> {:name "Bob"} where (select foos) sql-only)
17:08gfredericksgives a compiler exception
17:08gfredericks(wrong number of args passed to where)
17:08gfrederickswhy on earth are they not equivalent?
17:09amalloy&(clojure.tools.macro/mexpand-all '(->> {:name "Bob"} where (select foos) sql-only))
17:09lazybot⇒ (sql-only (select foos (where {:name "Bob"})))
17:09amalloyi'll go out on a limb and say they're equivalent
17:11gfredericksamalloy: so no other guesses about the behavior I'm seeing?
17:12ivaraasennDuff: what would you suggest using instead of korma?
17:12brehautgfredericks: a subatomic php partical radiating out from a near by start up passed through your computer at macro expansion time
17:12Bronsa
17:13technomancyivaraasen: I think it's pretty clear that the correct abstractions don't exist yet
17:13amalloygfredericks: i suspect that you are incorrectly placing the blame on the difference between these two expressions, when it's in fact somewhere else :P
17:13technomancyso you can either use the wrong abstractions or no abstractions
17:14hiredmanor build a sql parser and emitter around a clojure datastructure representation of sql
17:14gfrederickshuh; I get the same issue when calling macroexpand-all on the expression
17:15technomancyhiredman has the correct answer as usual, if you can pull it off =)
17:15hiredmanfirst someone needs to write and maintain a parsing library for clojure
17:15technomancy=(
17:16hiredmanwhich is apparently impossible
17:16amalloyhah
17:16brehaut:'(
17:17technomancyhow important is the parser though? seems like the compiler is the main problem.
17:17technomancythat is, I don't see a bidirectional requirement for practical purposes
17:18hiredman*shrug* I dunno
17:18Raptumoh yeah, what is the function that takes an arg and replicates it into a sequence consisting of `n` replications of the other argument
17:18amalloy$findfn 5 'a '[a a a a a]
17:18Raptummucho gracias
17:18lazybot[]
17:18macdonagHi - I have a quick question. I can use -> to thread a value through a series of functions: e.g. (-> 5 inc inc) = 7. Is there a way to do the same thing, but by providing a seq of functions? E.g. (def l (inc inc)) (list-thread l) = 7?
17:19gfredericksmacdonag: you could reduce over the sequence
17:19gfredericksor pass it to apply comp first
17:19amalloywait, really? what did i do wrong there? should be repeat and replicate
17:19amalloyRaynes: ????
17:19Raynesamalloy: You did it backwards.
17:19Raynes$findfn '[a a a a a] 5 'a
17:19amalloyno way
17:19lazybot[]
17:20metellus$findfn 5 'a '(a a a a a)
17:20pjstadiglazybot can't run programs backwards? tsk. tsk.
17:20lazybot[]
17:20ToxicFrog$findfn '(a a a a a) 5 'a
17:20lazybot[]
17:20Raynes*shrug*
17:20amalloy$findfn 7 8
17:20macdonaggfredericks: Hmmm, I'll look into that - thanks for the tip.
17:20Raynes$help findfn
17:20lazybotRaynes: Finds the clojure fns which, given your input, produce your output.
17:21lazybot[clojure.core/unchecked-inc-int clojure.core/unchecked-inc clojure.core/inc clojure.core/inc']
17:21RaynesUgh, thanks lazybitch.
17:21amalloy&(repeat 5 'a)
17:21lazybot⇒ (a a a a a)
17:21gfredericksamalloy: I'm starting to think the ->> ends up expanding contained macros differently
17:21amalloygfredericks: nope
17:21Raptumamalloy: tyvm
17:21ToxicFrog&(doc findfn)
17:21lazybotjava.lang.RuntimeException: Unable to resolve var: findfn in this context
17:21technomancygfredericks: should be easy to prove
17:22ToxicFrogdammit lazybot
17:22brehautToxicFrog: findfn isnt a function; its a magical lazybot command
17:22ToxicFrog$findfn [5 'a] '(a a a a a)
17:22technomancybegs the question as to why there's a difference
17:22ToxicFrog^
17:22lazybot[]
17:23pjstadigtechnomancy: ITYM "raises the question"
17:23technomancyoops
17:23technomancydang it
17:23pjstadigenglish is hard
17:23brehauti spend ages reading http://twitter.com/yourinamerica last night. so good
17:23Raynesamalloy: http://findfn.herokuapp.com/ doesn't work here either. :\
17:23technomancypjstadig: nice job beating joegallo to the punch on that one
17:23RaynesI don't know what is going on dude.
17:23brehauts/spend/spent/
17:23Raptum>your in america<
17:24Raynesur
17:24Raynesur in america
17:24joegalloheh
17:24technomancybrehaut: I wish he favourited the best replies like stealthmountain does
17:24brehautthat would be great
17:24gfredericksamalloy: yeah I think so. Because sql-only is a macro
17:25gfredericksit gets passed (clojure.core/->> (clojure.core/->> {:name "Bob"} (where)) (select foos))
17:25technomancyhttps://twitter.com/andersen_xo/status/270724516290895872
17:25gfredericksinstead of (select foos (where {:name "Bob"}))
17:25brehauttechnomancy: thats strongly worded!
17:25ivaraasentechnomancy: nice one
17:26amalloyah, yes indeed. if more macros inside get in the way those two won't be equivalent
17:26technomancyI like this one since it uses "whom" properly: https://twitter.com/_therealjuke/status/254800487784804352
17:26gfredericksphew I'm not crazy
17:26joegallowhomever is one word
17:26joegalloa swing and a miss
17:27brehauttechnomancy, joegallo: gold
17:27amalloyso is whoever, but who ever is fine too
17:27joegallonope, you only get full credit for "whomever", it's in the grading rubric.
17:28joegallo:D
17:28gfredericksso should that be a bug?
17:28gfredericksI'm not sure that the docs would cause me to expect that mismatch
17:28brehautjoegallo: please never follow me on twitter or read my blog
17:29amalloyor listen to him in irc
17:29brehautoh yeah. add me to your ignore list
17:29pjstadigbrehaut: i think you mean "you're"
17:29amalloya bug in what, gfredericks?
17:29ivaraasenisn't whom considered somewhat formal or archaic?
17:30gfredericksamalloy: in ->>
17:30pjstadigit's considered the objective form of who
17:30brehautpjstadig: how do you rage quit this things‽
17:30joegallobrehaut: i'm a nice guy, this is all jk jk
17:30amalloyindeed, it has a different meaning than who, and is considered archaic or formal because people think english is hard
17:30gfredericksamalloy: because it could be implemented differently so as to be less surprising, right?
17:31joegalloivaraasen: yeah, it's got a specific meaning, and that meaning is great, but if you really speak that way, most people think you sound funny.
17:31amalloythat's true, gfredericks. maybe not so crazy after all to file it as a bug
17:32amalloyof course
17:32joegallofor instance, consider "where are you coming from?" -- ot
17:32joegallooops.
17:32matthaveneris there a clojure function that does some kind of recursive merge of two maps? like (some-fn {:a 1 :b {:c 2} } {:b {:d 3}}) -> {:a 1 :b {:c 2 :d 3}}
17:32joegalloit's very normal english. but there are people who hate it, as you're ending a sentence with a preposition and all.
17:33technomancyjoegallo: "from whence are you coming" is obviously superior
17:33joegallobut "from where are you coming?", i mean, nobody talks like that!
17:33joegallowhence includes the from.
17:33technomancyoh dear
17:33ivaraasenjoegallo: yeah, the preposition rule is quite funny
17:33joegalloi think you mean "whence comest thou?"
17:33amalloywhence come ye, matey?
17:33joegalloLOL
17:34gfredericksamalloy: okay, I'll report it this evening
17:35amalloyi wonder if @ShakespeareanPirate is available
17:35Apage43matthavener: (defn recursive-merge [& maps] (apply merge-with recursive-merge maps))
17:36Apage43(recursive-merge {:a 1 :b {:c 2 :f {:a 1}}} {:b {:f {:b 2} :d 3}}) => {:a 1, :b {:d 3, :c 2, :f {:b 2, :a 1}}}
17:38matthavenerApage43: wow, awesome
17:38matthavenerfor some reason i didn't think calling merge-with recursive would work..
17:40nightfly_Which thread will a watcher on a ref likely be called in, the thread where the watch was set or the thread that altered the ref?
17:42nightfly_My intuition says where altered, but not sure if I'm right.
17:42Apage43the thread doing the altering, most probably
17:47amalloythe docs say the watch function is called synchronously
17:47amalloyie, on the thread doing the changing
17:50jballancugh...I feel like an idiot, but I'm not remembering keys destructuring
17:51jballanc(defn full-name [{:keys [first-name last-name] :as name-parts}] ...
17:51jballancI want name-parts to only contain the "first-name" and "last-name" key/value pairs
17:51jballancbut if I pass a map with more than that, the entire map is bound to "name-parts"
17:51jballancI thought there was a way to do this?
17:53amalloyno
17:55jballancah well...
18:13seangroveWow, it's a different world when you have a nicely working nrepl for cljs
18:13seangroveWith source maps, this could be crazy nice
18:14ohpauleezseangrove: Via piggieback?
18:15seangroveYeah
18:15seangroveReally warming up to it
18:16tpopeohpauleez: belated cheers
18:17ohpauleez:)
18:17tpopeohpauleez: try running :!lein check
18:17tpopeyou know I actually saw you at last month's portland clojure meetup
18:19ohpauleeztpope: No way! How did I not put that together? You're definitely on my list of "People I need to meet in person"
18:19ohpauleeztpope: The hard exec ala ! works
18:19tpopeI was visiting a friend who wanted to go
18:20tpopeso I started reading the Clojure Book on the plane
18:20ohpauleezAhh, crazy. I was just about to ask if you were still in town
18:20ohpauleezWell, welcome to the community!
18:20tpope:)
18:21ohpauleezI was in the middle of finishing the nREPL support for VimClojure - so your plugin has been a HUGE save for me. Thank you
18:22tpopecool
18:22tpopeI don't know what's going on with this :make thing
18:22tpopeall I do is literally :set makeprg=lein
18:22tpopeand it works for me
18:22ohpauleezyeah, neither do I. I poked at it for a bit
18:23cemerickseangrove: now if we can get the ritz completion middleware standardized upon, with a corresponding impl for cljs...
18:24seangroveAh, yes, that would be very nice indeed
18:25tpopeohpauleez: anything weird in the mix like drip?
18:26ohpauleeztpope: it is, but even with the short-circuit it still does the same thing
18:26tpopeshort circuit?
18:26technomancycemerick: what do you think about bret-victor-style live-tracing as an nrepl middleware?
18:26hiredmanneed compiler hooks
18:26clojurebotyour response: "Hooks that can be temporary would definitely be neat, but at some point I wonder if the additional complexity is just overwhelming. It can already be bewildering to try and sort through the differences between profiles, hooks, and middlewares as it is. If there's demand for this we can pursue it, but let's not rush into it for completeness sake.
18:27ohpauleeztpope: LEIN_JAVA_CMD= $HOME/bin/lein
18:27hiredmanclojurebot: shut it
18:27clojurebotHuh?
18:27tpopeohpauleez: just found https://github.com/flatland/drip/issues/46
18:27ohpauleezahh
18:27cemerickhiredman: well, you wouldn't be able to trace intrinsics, but other stuff can be instrumented without a problem, no?
18:28technomancyguzheng or some such
18:28cemericktechnomancy: in general, I think it's a totally reasonable vector
18:29technomancyjust need to agree upon a representation and way to specify input values
18:29cemerickthe bret-victor-style visualization may or may not be the right target w.r.t. modeling the data involved, but sure
18:30technomancyoh yeah; I don't necessarily mean fancy graphics; just showing values for locals
18:30ohpauleeztpope: after I kill all drip JVMs, the short-circuit works - thanks. I'll update the ticket
18:30qubit[01]silly question, to set add key/value in my map, should I use assoc , or update-in ?
18:30cemerickI'm still not sold on the whole pervasive-tracing thing
18:31cemerickBut I know some people are, so...whack away :-)
18:31technomancyI'm thinking of something you could toggle on a per-defn basis
18:31technomancyparameters and return value alone would be easy to do with alter-var-root
18:31technomancylet locals would be hard
18:32cemerickIf you've got sources, you could macro yourself out of that hole
18:32technomancyquite true
18:33ieureHuh, there's no (atom?) predicate in Clojure?
18:33ieureIs there a predicate to tell if something is dereffable?
18:33ieureOther than I guess (instance? IDeref blah)
18:33technomancypartial instance? IDeref etc
18:33amalloy(partial instance? clojure.lang.IDeref)
18:33ieurePretty whack
18:33bbloomi agreed, there's no boolean? predicate either
18:34bbloomthose all belong in core, if for no other reason than the cljs class/protocol names are slightly different
18:34technomancybetter to have too few built-in predicates than too many
18:34tgoossensI've always had difficulties with seeing "robust" & "dynamic language" together. Is it correct to say that in clojure this is not really an issue because you don't invent a new type every time you want to represent somthing (in contrast to java where you would create a new class)
18:34technomancybut oh wait, we already have a list? predicate
18:35cemerick"X is slightly different in ClojureScript", for some nontrivial value of X :-P
18:35technomancytgoossens: partly that and partly the fact that most dynamic languages don't make referential transparency easy/possible
18:35bbloomcemerick: I'm slowly trying to close the gap :-)
18:35cemerickbbloom: much appreciated
18:35bbloomtechnomancy: I understand the desire to have too-few, but you think atom?, boolean?, and a few others are too many?
18:35cemerickbbloom: where are you working these days?
18:35technomancytgoossens: and most dynamic languages run on homegrown runtimes
18:36tgoossenstechnomancy: what do you mean exactly with "referential transparency " ?
18:36technomancybbloom: no, I think boolean? makes sense, but list? is terrible
18:36tgoossensseq?
18:36clojurebotseq is What
18:37bbloomtechnomancy: yeaaaah, list? is interesting....
18:37technomancytgoossens: referential transparency is a property of functions that will always return the same value given the same arguments
18:37bbloomtechnomancy: especially because Sequential is an emtpy marker interface…
18:37tgoossensoh ok in that sense
18:37technomancybbloom: seq? doesn't mean sequential
18:38bbloomi know
18:38technomancytgoossens: if you haven't read Out of the Tarpit yet I highly recommend it
18:38tgoossensi added it to my "to read" list :)
18:38qubit[01]is there anything builtin that will iterate over a list running a function on each element in parallel ?
18:38bbloomtechnomancy: referential transparency is a property of *expressions*, of which functions are a subset :-)
18:38technomancyoh snap
18:38SegFaultAXqubit[01]: Like pmap?
18:39tgoossensso you mean that
18:39technomancybbloom: I'm going to go with the "I was assuming the context of lambda calculus" excuse where everything is a function
18:39tgoossensin for example python
18:39bbloomtechnomancy: ok, you win :-)
18:39tgoossensyou are never quite sure what it is going to return
18:39tgoossensisn't that also true for clojure then?
18:39qubit[01]SegFaultAX, yes thats it :)
18:40technomancytgoossens: it's relatively easy to tell when a clojure function is referentially transparent
18:40SegFaultAXqubit[01]: Make sure pmap is actually warranted before using it. You have been warned. :)
18:40technomancytgoossens: and it's much easier to quarantine everything that's not into a handful of namespaces
18:41qubit[01]SegFaultAX, oh ? Its slow , or ?
18:41bbloomtpope: so vim-foreplay is a v1 attempt at a more complete repl thing?
18:41SegFaultAXqubit[01]: Well the synchronization overhead can make it a lot worse for trivial operations on small datasets.
18:42SegFaultAX,(time (do (map (partial + 1) (range 10000)) nil))
18:42clojurebot"Elapsed time: 0.067383 msecs"
18:42SegFaultAX,(time (do (pmap (partial + 1) (range 10000)) nil))
18:42clojurebot#<SecurityException java.lang.SecurityException: no threads please>
18:42SegFaultAXOh, boo.
18:42amalloy,(send (agent 1) inc)
18:42clojurebot#<Agent@3f74b62e: 1>
18:42SegFaultAXAnyway, run that in a repl and you'll see what I mean.
18:42qubit[01]ok
18:42amalloySegFaultAX: i doubt he'll see any such thing, since those both return in zero time
18:43qubit[01]wow
18:43SegFaultAXamalloy: Not on mine they don't.
18:43qubit[01]"Elapsed time: 0.045447 msecs" / "Elapsed time: 1.207862 msecs"
18:43SegFaultAXamalloy: pmap takes considerably longer.
18:43amalloywell. my point is they don't perform any additions
18:43SegFaultAXOh, right.
18:43brehautSegFaultAX: did you really mean to time the creation of an unrealized sequence?
18:44amalloyso the regular map does literally no work at all, and pmap pays for starting up some threads
18:44SegFaultAX(time (do (doseq [n (pmap (partial + 1) (range 10000))]) nil))
18:45SegFaultAXqubit[01]: ^
18:45SegFaultAXThe outer do becomes useless, but anyway.
18:45SegFaultAXThe point is make sure pmap is actually worthwhile in your case.
18:45qubit[01]gotcha ;)
18:46SegFaultAXamalloy: Good catch, thanks. ;)
18:47SegFaultAXamalloy: Switching back from Python, I have to remember that I get laziness back.
18:47tpopebbloom: s/more complete/less finnicky/
18:49bbloomtpope: just tried K
18:49bbloomtpope: so happy.
18:49bbloomso very happy.
18:49tpopeyes
18:49SegFaultAXK?
18:49clojurebotThanks! Can I have chocolate next time
18:50bbloomvim :help K
18:50bbloom Run a program to lookup the keyword under the cursor.
18:51tpopeI felt like K and jump to source were essential if I was going to learn this clojure thing
18:51ohpauleezbbloom: you never did \lw in vimclojure?
18:51ivaraasenI thought bbloom was talking about ketamine
18:51llasramivaraasen: You are not alone
18:51bbloomohpauleez: i had an absurd number of issues with vimclojure, so i just kinda ignored the nailgun and all those other things
18:51tpopeyeah that's where I was
18:52tpopetook forever to get working, and I was constantly having to babysit it
18:52bbloomohpauleez: i have a large scratch file i use with tmux pastetext
18:52ivaraasenllasram: an essential part of every dev kit, relly
18:52ivaraasenreally*
18:52ohpauleezbbloom: yes, vimclojure was indeed a beast
18:52technomancyI highly recommend the approach of keeping the static stuff separate from the repl interaction functionality
18:52tpopetechnomancy: YES
18:52tpopeI wish VimClojure separated them :/
18:52bbloomtpope: so apparently you always search for an 'ns form before evaluating?
18:52technomancythe static stuff being coloring, indentation, and paredit
18:53tpopeif only so I didn't have to explain to people why I depend on the tool I
18:53tpope'm replacing
18:53technomancytpope: just say "I'm decomplecting" and everyone will understand
18:53tpopethe static stuff can ship with Vim itself
18:53bbloomtpope: there is a vim clojure mailing list and iirc, the author is pretty responsive
18:53tpopeyeah I never reached out :/
18:53bbloomtpope: what technomancy said :-)
18:53tpopethe stuff I wanted to accomplish basically necessitated starting from scratch anyways
18:54tpopeI googled decomplecting and got a blog post about rails
18:56bbloomtpope: http://www.infoq.com/presentations/Simple-Made-Easy
18:56SegFaultAXI was just going to ask if he'd seen Simple Made Easy.
18:56bbloomtpope: "complect" is discussed in the first few minutes
18:56bbloomtpope: so, i use a scratch file *a lot* when doing REPL development
18:57bbloomthere is no 'ns form in there
18:57tpopeit should fall back to the user ns, no?
18:58tpopeas long as your scratch buffer isn't in the classpath
18:58tpopeactually it sounds like it's in the classpath
18:58bbloomtpope: my scratch file is in the root of my project
18:58bbloomscratch.clj, next to project.clj
18:58tpopewell then it shouldn't be in the classpath
18:58bbloomi have scratch.* in my global git ignore
18:58tpope:echo foreplay#ns()
18:59bbloomtpope: no output
18:59tpopeerr, I don't think I ever gathered what your problem actually is
19:00bbloomso i have a src/proj/core.clj file
19:00bbloomin there K works
19:00bbloomin ./scratch.clj i get "nREPL: namespace not found"
19:00tpopeoh hrmm
19:01tpopemy intent was for it to fall back to user
19:01tpopeyeah, please open a bug, I have to run an errand
19:01tpopeshould be a simple fix
19:05bbloomtpope: ok #9 opened
19:05bbloomthanks!
19:17seangroveHmm, nrepl gives me a blank nrepl-error-buffer popup everytime I try to auto-complete in a cljs buffer (just force of habit) - how can I suppress it?
19:18seangroveI have nrepl-popup-stacktraces set to nil in my ~/.emacs
19:34gfredericksha; cannot define -> in terms of reduce because it comes first
19:38amalloyyou run into that problem a lot in clojure.core
19:38gfrederickslet apparently doesn't have destructuring at line 1500 either
19:39bbloomit's also pretty tricky to order things
19:39bbloomsometimes a forward declare may work, sometimes ot
19:39bbloomnot*
19:42amalloygfredericks: you should try changing code that's before concat is defined. you can't even use `
19:42gfredericksaaaah!
19:43bbloomamalloy: odd… seems like macros should be able to use *any* feature, once you have the compiler boostrapped
19:44amalloy&'`(inc x)
19:44lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/inc)) (clojure.core/list (quote clojure.core/x))))
19:44bbloomamalloy: i guess cljs has the jvm clojure to bootstrap it
19:45bbloomno sense going back to rewrite the early parts of core
19:45amalloybbloom: i haven't mentioned macros at all so far, so i'm not sure what you're getting at
19:45bbloom` is pretty rare to be used outside of macros
19:46bbloombut syntax-quote is bootstrapped by line 697, so that's pretty good i'd say
19:47bbloombut the point i'm making is that cond is defined prior to syntax quote, because it is used before concat is defined. it has to be that way because macro expansion happens in the same environment as normal runtime stuff
19:47bbloomin the case of cljs, the macro system is fully bootstrapped by the jvm clojure
19:48bbloomso you can define cond in terms of syntax quote if you wanted
19:48bbloomif the compiler and runtime environments were more easily disconnected (not necessarily by default) in jvm clojure, then an older version of the compiler could be used to macro expand definitions in the newer version, thus enabling you to define cond in terms of syntax quote
19:49bbloomamalloy: does it now make sense what i was getting at?
19:52bbloomhmm, the common lisp hyper spec states "Four different environments relevant to compilation are distinguished: the startup environment, the compilation environment, the evaluation environment, and the run-time environment."
19:54amalloygfredericks: are you trying to write -> as a single-pass thing? https://www.refheap.com/paste/7363
20:03seangroveCL is amazing
20:03seangroveReader macros blew my mind the first time I understood what they did
20:06seangroveHmm, how can I get clojure to give me an object-literal as a string?
20:06seangrovesomething like (pr-str (clj->js {:a 10 :b "foo"}))
20:08seangroveSeems like (.stringify js/JSON (clj->js {:a 10 :b "bar"})) is the closest
20:08bbloomseangrove: yeah, you can't really provide a default string representation much better than [Object]
20:09bbloomotherwise you get into a complex scenerio of how to print higher order functions, how to deal with circular dependencies, etc
20:09seangroveI'm trying to stick an object literal as a data-attr in markup
20:09bbloomsame reasons defrecord defines a nice readable print output, but deftype gives you a <FooType: af00xaddress87353> thing
20:09bbloomseangrove: use the gclosure json lib
20:09bbloomfor better browser support
20:10bbloomgoog.json/serialize
20:10bbloomnicer usage appearance too
20:10bbloom(:require [goog.json :as json])
20:10seangroveMeh, it's going to come out as a string though
20:10bbloomjson/serialize
20:11seangroveSometimes, html just drives me crazy
20:11seangroveI'll see if I can just attach the object programmatically instead...
20:11brehautseangrove: thats its primary function
20:11seangroveTo drive me crazy, or output a string?
20:11brehautdrive you crazy
20:11seangroveHeh, fair enough
20:12brehauthtml5: less bananas than earlier html, but now also a javascript standard library‽
20:12bbloomhttp://closure-library.googlecode.com/svn/docs/closure_goog_json_json.js.source.html#line126
20:12brehautor is that library standard?
20:13bbloommake use of google closure libraries where available
20:13bbloomsame reason you'd make use of java libraries where appropriate
20:13seangroveYeah, this is just me testing things in the repl
20:22_zach|awayIs it possible to implement core interfaces in Clojure code? e.g. IPersistentSet?
20:23bbloom_zach: it's possible, but it's not a priority
20:23bbloom_zach: see cljs
20:24_zachRight, there's a heap of protocols at the top of core.
20:25_zachSo is there any reasonable way to do it now? I suppose not?
20:29gfredericksamalloy: that paste of -> is essentially what I just did, yeah
20:29gfredericksis that how it used to be? any idea why it's recursive?
20:33holohi
20:34amalloyi doubt it used to be that way. i didn't grab it from the history or anything
20:34amalloyit's probably recursive because it's shortest/easiest
20:34gfredericksrighto
20:36holoin midje, is there a way to execute code when a test fails?
20:37QuacktorcalculusRaynes, sweetie, do you have a code example for me?
21:00sshackAre there any libraries for handling user authentication/amangent and maybe administration functionality for web apps?
21:00sshackI'm thinking in the django/rails theme.
21:01seangroveI'm building up a murderous, psychotic rage here
21:01seangroveSomething has hijacked M-up in emacs so that it inserts A instead of paredit-splice-sexp-killing-backwards
21:01seangroveAnyone run into this?
21:02sshacka murderous psychotic rage when using emacs? Yeah, I have.
21:02sshackBut mostly from it being 2012 and we're still pretending it's 1970. Not from your specific problem.
21:02llasramseangrove: It's a terminal input issue
21:03seangrovellasram: In the bindings help page I do see it listed under decoding maps
21:05brehautsshack: in general the clojure web stack is too diverse and disperse to have one common solution for what you want. in particular, nobody really defaults to always using a particular datastore or datastore layer and instead chooses tools appropriate to the program in question.
21:05sshackAre there any options available?
21:05brehautsshack: in saying all that, the first answer to any authentication question you have is to look at cemerick's friend library
21:05brehautsshack: https://github.com/cemerick/friend/ i believe
21:06sshackI'll have a look.
21:06sshackI don't mean to be snarky, but it does feel a little crufty to have to build your own infrastructure. Though I understand there's good reason for it. at times.
21:07sshackThis'll work with noir?
21:07brehauti have no knowledge of noir sorry
21:08brehautre:build your own infrustructure, the alternative is to have to deal with someone elses assumptions
21:09brehautfor direct comparison, django's auth system has taken 7 years to be truely extensible, and even then you are still using djangos orm. djangos orm is a dog
21:09brehautits the intersection and lowest common denominator between relational databases and python objects
21:13sshackbrehaut: Yeah. I've got such simple requirements, I'm okay with that.
21:13sshackarm, I'm okay with other peoples assumptions.
21:14brehautfrom memory you probably want the sandbar stuff to go with friend and presumably noir
21:14sshackI shall have a look.
21:17cemericksshack: yes, friend will work with noir, though you'll have to figure out the odd way noir applies middlewares
21:17cemerickI think there's an example project somewhere using noir...
21:17sshackWell, I'm not fixed on using noir.
21:17sshack<- Porting an app from mathematica to clojure.
21:17brehautcemerick: you can now tell him im full of crap and what the real answer is ;)
21:18sshackbrehaut: It's cool, I had already assumed you were half full of crap. ;-)
21:19sshackAnyways porting from Mathematica, I'm trying to stay as high level as possible. I'm willing to accept other peoples assumptions for progress.
21:21brehautsshack: if you arent definate on noir, compojure is very nice (and its the underpinning of compojure) and you can still use libnoir
21:21brehautcompojure is (IMO) a more natural fit for web development in clojure because its closer to the ring model
21:21brehautbut what do i know
21:21sshackOkay, what was the benefit of noir? Why do people choose that?
21:22sshackWell, more than I do. Coming from Mathematica.
21:22brehautsshack: i dont know. ive never chosen noir :P
21:22brehaut(sorry chris)
21:23sshackOkay. I just picked it as it seemed simple, small, good docs and was written by the same guy as norma which I was going to use for the same reasons.
21:23brehautslightly more seriously, its got a good site that sells it well, and its a little more abstracted
21:23brehaut(than compojure)
21:23sshackYeah, Chris seems to sell things well.
21:23sshackAhh, abstracted is good.
21:23brehautis it?
21:24hiredmannoir is a pain if you ever want to do anything besides noir
21:24bbloomtpope: thanks for the fix. i'm noticing that evaluating forms is kinda slow tho :-/
21:24sshackhiredman: In what way?
21:24llasramseangrove: It took me a while to remember what I'd done to fix it, but I have this in my init.el: https://gist.github.com/4230216
21:24tpopebbloom: sounds like you're not connected to nrepl
21:24holosshack, Did you mean: ... by the same guy as korma ... ?
21:25bbloomtpope: oh duh, i was connected before, but forgot i closed it
21:25sshackbrehaut: for me, yes. I'd like to focus on where I can have a convex effect on the outcomes, which means I want to spend as much of my time improving my actual application.
21:25hiredmansshack: it does "everything" and if you have something that doesn't fit in with its everything then you end up with a lot of pain trying to get it to work
21:25sshackholo: Yes.
21:26cemericksshack: brehaut knows his stuff :-) Noir is opinionatedly stateful. That said, lots of people like it, and lots of people use it.
21:26sshackhiredman: Okay, I'll look carefully. But if it does everything I want to do right now, that's okay.
21:26hiredmanand it has things which I just find distasteful, it launches jetty, turning a "noir app" in to a ring handler you can use with anything else is a pain (or was)
21:26cemerickIf you grok it faster, then there's not a lot wrong with using it. If it becomes a problem later, it won't be tough to migrate to e.g. compojure given lib-noir
21:26bbloomtpope: would be nice to have some feedback on slow operations
21:26holoi use noir. i built my own validation library though
21:27hiredmanthe stateful way it builds up the middleware to use
21:27sshackOkay, I think the answer is, read the source and decide if I can live with that.
21:28brehautsshack: i would recommend strongly learning at least the basics of Ring no matter what you choose. it will help make everything else clearer
21:28brehauts/recommend strongly/strongly recommend/
21:28bbloomtpope: cp and cpp work nice. is there a "evaluate top level" ?
21:28bbloomother than vapcp
21:29sshackProbably a good bet. In the end everything seems to be based off ring, or influenced heavily by it
21:30sshackAre there any decent howtos on deploying clojure?
21:30sshackAgain, I'm fine with other peoples assumptions. Basic, dumb web/postgres db app.
21:31holosslhack, did you choose your IaaS?
21:31brehautyou might want to specify where you want to deploy it?
21:31brehautheroku? AWS? linux vps?
21:31sshackholo/brehaut: VPS moving to bare hw as it grows.
21:32holosshack, sorry i made a typo with your name
21:32sshackvery, very low transaction website, with a heavy CPU bound component.
21:32sshackholo: NP.
21:33brehautsshack: i run my clojure webapps with an embeded jetty (i think lein-ring might have a tool for starting that easily) that i proxy-pass through to from a front end nginx server
21:33cemericksshack: you can either just ship source and use `lein run` (same as what is used for heroku deployment), or you can do the .war thing
21:34brehautcemerick: you clojure book has a practical about this right?
21:35cemerickyes, though the mix it covers is .war deployment and elastic beanstalk
21:35cemerickheroku clojure support was nowhere near ready at the time
21:35brehautprobably wiser than covering ducktape-and-string
21:35brehautah true
21:35gfredericks"The default language is Java but you can specify JavaScript, ActionScript, XML and SQL too."
21:37sshackcemerick: apache can handle the war thing, right?
21:37cemerickno
21:37tpopebbloom: :%Eval. also :Require does a (require 'ns :reload)
21:37cemerick.war files are the unit of deployment for Java servlet containers
21:38sshackahh, so I have to go through some enterprise server thing.
21:38cemerickoh, hardly
21:38cemerickit's not 2001 anymore ;-)
21:38cemericksshack: jetty is a servlet container, for example
21:38sshackSo I should probably buy your book.
21:38tpopebbloom: I've been debating how to convey that java clojure.main is being used rather than a proper repl
21:39cemerickor, *can* be; the default ring integration ties into jetty-specific APIs for deploying ring apps, rather than going through the servlet specified APIs, IIRC
21:39cemericksshack: I have a bridge to sell you as well. :-)
21:39gfredericksdoes anybody know jira text formatting well enough to fix this? http://dev.clojure.org/jira/browse/CLJ-1121
21:39gfredericks{{(-> a b c)}} is all borked
21:39sshackcemerick: Just fyi, the last time I looked at servlet anything was 1999. I also came down with a wicked flu at the same time and haven't looked back.
21:40cemericksshack: http://www.clojurebook.com if you want a précis, ToC, etc.
21:40bbloomtpope: so maybe you want :Reload instead of :Require ? because there is a load-file function too
21:40cemericksshack: you never have to actually touch the servlet bits when you're deploying a ring app in a servlet container
21:40gfredericksI don't see anything obvious for inline code in the formatting docs
21:40sshackThe words "enterprise" or "serve let" send shivers up my spine. Unless I'm uttering them.
21:41cemericksshack: well, then perhaps you should skip the whole business and use a source deployment
21:41tpopebbloom: I made :Require pass :reload and :Require! pass :reload-all. seems like how you would want it to work interactively
21:41bbloomtpope: oh, i see you also have that
21:41sshackcemerick: I'm open to every option.
21:41bbloomtpope: seems like it confuses the word "require"
21:42cemerickIt's certainly more commonplace in the community. Most abhor anything even hinting of enterprisiness as well. :-)
21:42tpopebbloom: it does, a little bit, but :Reload would be confusing too, because it can also load for the first time
21:42bbloomtpope: i guess it's ok, since you can always just eval (require 'whatever) to get the percise behavior you want
21:43bbloommaybe the docs need a little table of vim expression to clojure expression evaluated
21:43bbloomprecise*
21:43bbloombut anyway, what i meant by "top level form" was not the whole file, i meant a def or defn or whatever
21:44bbloomhence vapcp
21:44tpopebbloom: oh, :Eval does that if you don't give a range
21:44tpopebbloom: also cpap would work if it's really a paragraph
21:45bbloomtpope: hm right. i wonder if what cpp is now should be cpip
21:45bbloomor something like that
21:46bbloomcp% maybe
21:46tpopecp% will work if you're on the parentheses
21:46bbloomevaluating top level forms is what i want to do 99% of the time
21:46tpopecpab would be the vimmy way to do that
21:46bbloomwhenever i change a function definition
21:46tpopeyeah I'll think about that
21:46bbloomcpp is nice and easy to type
21:47tpopeit's not too late to make it the default
21:47bbloomit gets my vote :-)
21:48bbloomi didn't know about ab and ib, thanks :-)
21:48bbloomthat will be useful for lots of other stuff too!
21:48tpopeother facet to consider is the parallel to cqq
21:48tpopeie "start with this but let me edit it"
21:48jcrossley3cemerick: abhor? pish-posh ;)
21:48tpopeI find that to be more useful for innermost form
21:48bbloomi just find it very rare that i want to evaluate a single expression without the lexical environment
21:49tpopewell by edit it, I mean doing stuff like wrapping it in a macroexpand
21:49cemerickjcrossley3: ;-)
21:49bbloomand, when i do want to do that, it's for debugging and usually will take several tries. in that case, i copy it out to a scratch file as a top level
21:49cemerickjcrossley3: there's actually data on this
21:49bbloombut i guess the little quasi repl thing might be useful there...
21:49cemerick"abhor" perhaps is over-strong
21:50tpopethat's the idea
21:50bbloomi never really considered q: as a sort of vim command scratch pad
21:50bbloomit's an odd parallel with the scratch file in emacs….
21:50tpopeI didn't either until this plugin :)
21:50jcrossley3cemerick: it's a big world. there are all sorts of crazies in it.
21:50cemerickjcrossley3: Don't I know it. I pay bills thanks to that world.
21:50tpopeI haven't beat on it to hard yet
21:51cemerickjcrossley3: I think there's something interesting in the positioning of Immutant, though. Whatever 'enterprisey' means or doesn't, I think Immutant has the potential for very, very broad appeal
21:51bbloomwell in the clojure world, it's very common to use a scratch area
21:51bbloomtpope: like this https://github.com/clojure/clojure/blob/master/src/clj/clojure/zip.clj#L281
21:52sshackAre there any tools people are using to build RESTful api's?
21:52bbloomeven though the q: style quasi repl is a useful scratch area for recent commands, i suspect most people prefer to work with more visual scratch space, like in a comment block
21:52bbloombut in that case, evaluating the top level would be (comment …)
21:52tpopebbloom: that's what I was about to point out!
21:52cemericksshack: bishop or liberator
21:52bbloomhence i never have blank lines in my functions, so i always use a vim paragraph text object
21:52sshackCool. Will look.
21:53tpopebbloom: in practice I mostly use cpp while already at the outermost expression
21:53bbloombut also, sometimes i have several statements in a row and evaluate them as a paragraph as a sort of top-level implicit 'do
21:53tpopebut "mostly" is a pretty empty claim for my limited experience
21:53amalloyyuck. don't refer to code that hasn't been touched for 4 1/2 years, and then only by rich himself, as an example of something it's common to do in clojure
21:53bbloomyeah, i guess cpp works if you're at the beginning of the form
21:54bbloombut there isn't an obvious way to get to the beginning quickly…. {j or something
21:54jcrossley3cemerick: interest and potential, indeed. thanks for the encouragement. ;)
21:55tpope99[( :/
21:56tpopebbloom: one possibility is making cpp do outermost, but giving a count (1cpp) does nth innermost
21:57bbloomhmm that's interesting
21:57bbloomtpope: is there a way to see my evaluation log? ie view the repl session
21:57tpopenegative
21:57bbloomok, not a high priority
21:58bbloomi really appreciate the effort you're putting into this… huuuge productivity boost for me. my vimscriptfu isn't quite up to the task
21:58tpopehey man, I did it for me
21:59bbloom+1 for scratching your own itch
21:59sshackcemerick: Those two look like nicely built libraries. I'll have to spend some time with them. Thanks for the pointers.
22:01bbloomtpope: i notice that nothing is captured from *out* or *err*
22:01tpopebbloom: it's echoed. *err* gets error highlighting
22:01tpopeseemed like the right behavior, no?
22:02bbloomtpope: (doseq [i (range 10)] (println i)) ;; only prints nil
22:03bbloomoh, i'm running nrepl headless… is it printed to that shell?
22:03tpopeshouldn't be
22:03tpopebbloom: :Doc calls (doc ...), which prints
22:04tpopejust tried your example and I got 11 lines
22:04bbloomtpope: hmm interesting… if you run `lein repl :headless` it doesn't work
22:05bbloomoh now it does
22:05bbloomwtf? weird...
22:05tpopeyeah works for me
22:05bbloomsomething is fishy here...
22:05brehautwow, disclojure hasnt tweeted anything in ages, and suddenly its something big
22:06brehaut"Apparently Microsoft is doing something big with clojure. Waiting for lawyer release to hear about it…"
22:07bbloomtpope: i'm not sure why it didn't work before… if i see it break again, i'll try to reproduce
22:07amalloyreeeeeeally
22:07bbloomseems to be workign fine tho
22:08samflorestpope, bbloom: tried the same example here and I'm getting just "nil" too
22:08samfloresbut I get the 11 lines if i run :Require
22:08bbloomdamn heisenbugs
22:09tpopesamflores: is it repeatable?
22:09tpopeI have some stuff you can try
22:09S11001001~stylel
22:09clojurebotexcusez-moi
22:09bbloombrehaut: hmm curious!
22:09S11001001~style
22:09clojurebotMan, the living creature, the creating individual, is always more important than any established style or system. -- Bruce Lee
22:09samfloresyep, tried several times. same thing
22:10tpopesamflores: :echo foreplay#client().connection.call({"op": "eval", "code": "(doseq [i (range 10)] (println i))"})
22:10brehautbbloom: indeed
22:10tpopereturns a list of the packets it got back from nrepl
22:10brehautbbloom: absolutely no reliable information at this side, but nevertheless
22:11bbloombrehaut: i keep saying it, but the languages guys at msft actually know what they are doing :-)
22:11amalloywindows 9: a clojure app?
22:11bbloomsome people just don't believe me :-)
22:11brehautbbloom: i totally agree
22:11brehautamalloy: ha
22:11samflorestpope: https://gist.github.com/4230438
22:11bbloomamalloy: well win 8 is half c++ and half javascript
22:11tpopesamflores: that looks like nrepl is sending it back...
22:11tpopesamflores: try again, but s/call/process/
22:11Apage43I was notificng an issue around this yesterday
22:11brehautbbloom: i imagine their language hallway is pipeline for funneling smart into mainstream languages. Haskell guys invent something, F# guys make it work on .net, C# guys make it accessible
22:11bbloomso my bet is CLJ++ and CLJS /s
22:12bbloombrehaut: that's basically how it works lol
22:12Apage43it was working if I grouped everything in (print (with-out-str …))
22:12Apage43Could be something to do with how the out packets are buffered
22:12samflorestpope: updated the gist
22:12Apage43it looked like it tried to chop the last newline off -each- out packet as well, so if you have a bunch of (printlns) that send as sepeate nREPL out packets
22:12Apage43you wont see any of them
22:13Apage43since it chops the newlines off each, and they echo as a single line, and then that doesn't trigger a pause, not being multiline, and then it prints the return value, so you never see the stdout
22:14Apage43so for example, I couldn't get (pprint/print-table) to work in foreplay without manually buffering it
22:14tpopesamflores: okay, that's it working as expected
22:15samfloresmaybe I have some broken Vim setting
22:15tpopepossibly
22:15tpopesamflores: reproducible if you start a fresh vim?
22:16tpopesamflores: does stuff like K still work?
22:16samfloresyep. tried both a fresh vim and a fresh repl
22:16samflorestpope: K works fine
22:17tpopeperhaps because it doesn't output the nil at the end
22:17tpopemaybe it's redrawing over itself
22:17tpopetry :echo 1|echo 2|echo 3
22:17tpopedo you get 3 lines?
22:17samflorestpope: no, just the nil
22:17Apage43this is the issue I described: https://www.refheap.com/paste/7367
22:18tpopesamflores: the :echo line shouldn't output nil
22:24samflorestpope: sorry, I didn't see the :echo command.
22:24samfloresyes, I got 3 lines
22:24tpopehrmph
22:25tpopecan you try something that outputs to *err* instead?
22:30samfloresprint to *err*
22:30samfloresPress ENTER or type command to continue"
22:30samfloresoops
22:30tpopeone difference of :Require is that it doesn't output the nil at the end :/
22:30Apage43 (binding [*out* *err*] (println "WHAT\n")) works for me; (binding [*out* *err*] (println "WHAT")) gets me only the nil
22:31tpopeApage43: interesting!
22:32samfloresApage43, tpope: "\n" dit the trick here too
22:32tpopethey both work the same for me
22:32tpopeI'm not sure why
22:32tpopeobvious option to check is lazyredraw
22:32tpopebut I tried it both ways
22:33samfloresmine is off
22:33brehautApage43: out of curiosity, what does a (do (println "WHAT") (flush)) do?
22:33samfloresno change turning it on
22:33Apage43brehaut: nil
22:34Apage43here's really weird: (do (println "WHAT") (println "HUH") (flush)) is ALSO nil
22:34Apage43 (do (println "WHAT") (println "HUH\n") (flush)) is ONLY "HUH"
22:35Apage43 (print (with-out-str (println "WHAT") (println "HUH"))) is the whole thing, "WHAT\nHUH"
22:36tpopetry :echo "1\n"|echo "2\n"|echo "3\n"|echo "nil"
22:36tpopeprintln sends a single \n, so that's basically equivalent to what we're doing
22:37tpopewhereas adding \n doubles it up
22:37samfloresgot 4 lines (1, 2, 3 and nil)
22:37Apage431, 2, 3, nil separated by new lines
22:37basicsenseihey guys, I want to reify (or change the implementation of) baseLoader which is a static java method in clojure.lang.RT, can I have some sugestions for doing so?
22:38basicsenseiand if that's possible, does that mean that everything using that method will use the modified version?
22:39tpopecan you guys try stripping down to a barebones config and see if it's still a problem?
22:39tpopeI'll do the same
22:41basicsenseianyone?
22:41clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
22:42Apage43tpope: it looks like you're stripping the newlines off the end of 'out' and 'err' packets here; https://github.com/tpope/vim-foreplay/blob/master/autoload/nrepl/foreplay_connection.vim#L113
22:43tpopeApage43: forgot that but rings a bell. I think I was having extra blank lines
22:43tpopeguys I just tried with nothing but pathogen and foreplay
22:43tpopeand it worked
22:43tpopeit's your turn
22:44bbloomtpope: i'm about to sit down for a real coding session. i'll let you know how it works out
22:44bbloomi'll try to only use foreplay rather than my old hacky techniques
22:44tpopehave fun!
22:49Apage43tpope: same behavior, not even pathogen, just a bare .vim folder with nothing but pathogen and an empty .vimrc
22:49Apage43(aside from whatever defaults MacVim jam-a-lams in there)
22:49tpopeokay, what version of macvim?
22:49tpopeI can't imagine that being relevant
22:50samflorestpope: pathogen and foreplay = no luck =\
22:50tpope(tonight I've been doing everything on linux, but a huge chunck of the development happened on macvim)
22:50tpopeare you in the terminal or gui?
22:50Apage43v7.3 (75)
22:50Apage43vim version 7.3.646
22:51Apage43also s/75/65
22:51Apage43fat fingered that
22:51bbloomApage43: heh, i'm on snapshot 61… i guess i'm overdue for an upgrade
22:52samfloresmacvim too, 7.3.646
22:52basicsenseithere's no way to change the implementation of any method if the object is already instantiated ?
22:52samflorestpope: tried both GUI and terminal
22:53Apage43basicsensei: nope.
22:53basicsenseiApage43: thanks for confirming
22:53Apage43That's a JVM thing. You can sort of load a new class over that one's name, but the old instances hanging around are tied to the old one.
22:54basicsenseiApage43: I want to change a static method's implementation, is that possible?
22:54tpopelet me try upgrading my macvim
22:54basicsenseiApage43: at runtime I mean
22:55Apage43You get really werid behavior w.r.t. that and using (defrecord..) in a REPL, for example, because if you re-run (defrecord) all the old instances are -really- instances of a different class with the same name, and lots of things break
22:55Apage43basicsensei: don't think it is
22:56basicsenseiApage43: hmm could that class classloader somehow "change" that static method? in theory
22:56Apage43i mean, you could load a new version of that class wholesale
22:57Apage43but there's not a way to -just- override a single method
22:57Apage43you might be able to do some fancy tricks with something like asm to get what you want
22:57amalloybasicsensei: no
22:57basicsenseiApage43: you mean I could reify that class somehow? before loading it?
22:58Apage43i don't understand what you mean
22:58amalloya class that's loaded is loaded, forevermore
22:58Apage43that
22:58Apage43you can never get rid of it, at best, you can have two with the same name
22:58Apage43which is just trouble
22:58basicsenseioh i see
23:02tpopeApage43, samflores: I just installed the latest macvim snapshot, stripped down to basics, and it still worked :/
23:02tpopeI don't get it
23:07bbloomupgraded my macvim
23:08bbloomand the font rendering is just subtly different
23:08bbloomdriving me slightly insane
23:08bbloomamazing how used to your tools you get
23:08tpopeApage43, samflores: ACTUALLY I've been doing cqp rather than cpp this whole time. when I switch to the latter, I get more interesting results
23:10samfloresdid you reproduce the issue?
23:11basicsenseialright guys thanks, that was the wrong way anyway, it would've been the same as setting clojure.lang.Compiler.LOADER which is not gonna work for me anyway: i need different classpaths at different points in code execution (ie. 2 different plugins running)
23:11tpopelooks like it
23:11bbloommmmm this fixes the rendering: :set linespace=3
23:11bbloommuch more comfortable :-)
23:13bbloomi have uninstalled programs in rage over smaller font rendering issues :-)
23:13samflorestpope: but 'cqp' does no good here
23:13tpopeI've long since forgotten the original usecase
23:14samflorestpope: (doseq [i (range 10)] (println i))
23:14tpopeyeah I remember that
23:14tpopebut that's an example, not a usecase
23:14samfloresah
23:14tpopecqp can handle that just fine
23:15tpopeI guess it doesn't matter, because this is definitely a bug
23:20tpopesamflores: okay, I have a pretty good understanding of the problem. it's not getting fixed tonight
23:22samfloresno problem
23:24samfloresanyway, thanks for the great plugin.
23:53lynaghkping: Raynes ninjudd
23:54RaynesHi.
23:54lynaghkI'm trying to use Drip, but I'm not sure what to do to get it to cache some of my Clojure namespaces
23:54RaynesOh, I'm useless with drip.
23:54RaynesAsk amalloy.
23:54lynaghkoh, damn. I just assumed you knew all about it = )
23:54RaynesBut I guess I just did.
23:54Raynesdrip is the flatland project I know the least about, in fact!
23:55amalloylynaghk: you really only want to cache totally-static never-ever-changes namespaces
23:55RaynesProbably the only one active project I don't have a single commit in. :p
23:55lynaghkI have namespace NS and I was hoping that "drip -jar my.jar NS arg1 arg2 arg3" would be fast after repeated invocations
23:55lynaghkamalloy: my use case is to use drip to make it viable to have autogenerated documentation call a function from the system to make output
23:56lynaghkbut right now that's not tenable if each time a chart is mentioned in the docs a JVM needs to startup to draw the chart
23:56amalloylynaghk: have you looked at https://github.com/flatland/drip#pre-initialization ?
23:57lynaghkamalloy: yeah, I just came across that but was a bit unclear about what it meant in practice---was hoping to figure it out and then add a concrete example to the Clojure wiki
23:57amalloyi think the idea is to set the class to clojure.main and the the args to "-e (require 'my-ns)"
23:57amalloyonly formatted correctly, whatever that is
23:58lynaghkamalloy: ah, I see. Because drip knows nothing special about Clojure.
23:58lynaghkamalloy: so it won't do anything with Clojure namespaces automatically. I need to explicitly tell it to require a ns if I want that namespace to be quickly available
23:59amalloyyep