#clojure logs

2013-07-31

00:02lynaghkb
00:14technomancystill waiting for them to release something better; until they do I'm staying put
00:19callentechnomancy: isn't Lenovo just going to keep making the Thinkpads worse?
00:19callentechnomancy: if that's the case, I think I'm stuck with this T430 for a long time.
00:20callenI don't really know what alternatives exist.
00:20technomancycallen: I'm prepared to just keep on repairing and repairing
00:20callentechnomancy: post-apocalyptic programmers. :(
00:21technomancycallen: if they don't release a high-res user-serviceable X series in the next two years Imma start stockpiling
00:21callentechnomancy: time to raid craigslist in fear and loathing.
00:22technomancycallen: is the T430 the last T series before they chickleted everything?
00:22callentechnomancy: honestly, if nobody comes out with the sort of laptop you and I like, I'll just start a business manufacturing laptops for professionals :P
00:22callentechnomancy: post-chiclet but still tolerable due to not being overly shallow.
00:23technomancyI might bite the bullet and drop my 12-inch requirement if it's decently light
00:23technomancydo you know how many cd/m^2 it is?
00:26callentechnomancy: max is 281
00:27callenI have the T430s
00:27callentechnomancy: average is apparently 245. I don't know what that's supposed to mean as opposed to max.
00:27technomancyyeah, mine is 250 and I'm not thrilled with it
00:27technomancythe samsung I got was 400, which was incredible, but the keyboard was unforgivable
00:27callenapparently MBPs range around 250-300
00:28callentechnomancy: 400 sounds great. Too bad about the keyboard.
00:28technomancyyeah, if I'm going to get an upgrade I'd like it to be over 300.
00:29technomancycallen: I basically never turned it all the way up
00:29callenokay
00:29callentechnomancy: HD screen for T430s is 200, HD+ (1600x900) is 250 nits.
00:29technomancy(except in direct sunlight, but it turns out you can't use it in direct sunlight anyway because the case is solid metal, so after a few minutes it gets too hot to touch... brilliant design!)
00:29technomancy=\
00:29callenand yes, they're calling a 900 pixel tall resolution "HD+"
00:29callenwhat a farce.
00:30technomancyhahahahaha
00:30clj_newb_2345dumb question: how do I check if the type of clojure.core/*e is "clojure.lang.Compiler$CompilerException" ?
00:31callentechnomancy: I used to own a Thinkpad that was 1600x1200. The "HD"-ness of today's displays is questionable at best.
00:31callenI'm really mad it's literally impossible these days to get a laptop (except for retina MBPs, and that's something else) with more vertical pixels than I had almost a decade ago.
00:31technomancyare they still forcing glossy screens on the retinas?
00:32sdegutiswell mines glossy, but its a year old
00:32technomancymakes me want to go live in a cave
00:32clj_newb_2345is the "r" for "retina" ?
00:32callentechnomancy: I have a retina display MBP for work, if it's glossy, I haven't noticed.
00:32callenclj_newb_2345: yes
00:32sdegutisyes
00:32callentechnomancy: I don't code outside like you though.
00:32technomancycallen: you should!
00:32clj_newb_2345I like my 17" mbp; why do people want retina macbook airs ?
00:32technomancyit's the best
00:32sdegutisi only notice its glossy when im working in the park. which is never.
00:32callentechnomancy: it's definitely not as "matte" as my Thinkpad.
00:32technomancysdegutis: adjust thy priorities
00:32callenworking in the park is kind of the norm for technomancy I think.
00:32sdegutistechnomancy: but its way cozier to work in my bedroom. plus i get free access to pizza rolls at any time this way
00:33technomancyhttps://secure.flickr.com/search/?q=remoteoffice&w=technomancy&adv=1&mt=all&ct=6&m=tags
00:33callenclj_newb_2345: dude. if you care about text retina displays are god's gift.
00:33clj_newb_2345i stare at code all day long
00:33callenjust be warned
00:33clj_newb_2345retina can make fixed width font that much prettier?
00:33callenif you get a retina display, you'll notice low res assets *EVERYWHERE*
00:33callenclj_newb_2345: yes
00:34sdegutisso whats the topic?
00:34technomancyclj_newb_2345: depends on how good your eyesight is =)
00:34callenwhining about the fall of the Thinkpad.
00:34clj_newb_2345#apple-fan-club
00:34callenno, it was originally about thinkpads.
00:35sdegutiswell anyway my project surpassed 200 stars today :)
00:35sdegutisand some people on twitter praised the readme, specifically the story part i kinda half-stole from technomancy
00:35sdegutis*idea
00:35sdegutisso yay
00:36callenI'm technically not really a mac owner anymore.
00:36callenmy personal MBA died :(
00:36clj_newb_2345how do I clear clojure.core/*e ?
00:37sdegutis,*e
00:37clojurebot#<Unbound Unbound: #'clojure.core/*e>
00:37sdegutisclj_newb_2345: whys it need clearing?
00:37clj_newb_2345clojure.tools.namespace/refresh
00:37clj_newb_2345can set it when there is a compiler error
00:38clj_newb_2345however, I need to clear it other wise it reports an old exception (that is no longer true)
00:38sdegutispresumably the same way they set it
00:38clj_newb_2345http://clojuredocs.org/clojure_core/clojure.core/*e
00:38clj_newb_2345I have no idea how they set it
00:39sdegutishttps://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/repl.clj#L23
00:39sdegutislooks like they're setting it that way
00:39clj_newb_2345sdegutis: damn it, how did you find it that fast?
00:39clj_newb_2345hmm, the clojure.tools.namespace part looks familiar
00:39sdegutisi.. dont know?
00:40clj_newb_2345did you use google, some type of github code search, or just started reading tools/namepace/repl.clj ?
00:40sdegutisi googled clojure.tools.namespace, found it on github, opened all the files and searched for "refresh"
00:40sdegutisand found that one
00:40clj_newb_2345I'm not sarcastic and genuinetly interested in the thought process that led to finding this
00:40clj_newb_2345"opened all the files and searched" as in git clone; grep ?
00:40sdegutisno
00:40clj_newb_2345or the web interface
00:41sdegutisi clicked and clicked and clicked until i was in a dir that had lots of .clj files
00:41clj_newb_2345lol
00:41sdegutisthen i held cmd and clicked each of them to open in new tab
00:41clj_newb_2345okay; cool; thanks;
00:41clj_newb_2345then you hit ctrl-f
00:41sdegutiswell i only had to do cmd-f once
00:41clj_newb_2345so basically, I'm lazy for not doing that
00:41sdegutisthen id move on to each tab and hit cmd-g which is find-again
00:41clj_newb_2345I should have git clone and git grep to a single command
00:41sdegutisyeah you shoulda done that
00:42sdegutisoh well
00:42clj_newb_2345well, problem now fixed
00:42clj_newb_2345thanks for your help and explainig your though tprocess
00:42sdegutisim still excited over having successfully embedded ruby in a mac app in just a dya
00:42sdegutis*day
00:42bbloomhttps://gist.github.com/brandonbloom/6119263
00:42bbloom^^ trivial search found where it's set
00:43callenbbloom: is there a reason to use ag over ack?
00:43sdegutissupposedly faster
00:43bbloomdramatically faster
00:43sdegutisi believe it
00:43sdegutisack was in *perl*
00:43callenI don't know if 5x is dramatically
00:43callenbut I'll give it a whirl.
00:43sdegutisi dont even use ag.
00:43sdegutismy tool chain is horribly broken.
00:43callenack is pretty damn fast.
00:44callen"The command name is 33% shorter than ack!" - sold.
00:44sdegutisi spend too much time in emacs, but i couldnt get emacs doing all the things i used to do outside of it
00:44sdegutisso i just sit here doing everything manually nowadays
00:45clj_newb_2345well
00:45technomancyusing grep like a freaking caveman
00:45clj_newb_2345setting up my own code hot reloading system took a few hours longer than expected
00:45clj_newb_2345I'm going to take that as a compliment.
00:45callenack vs. ag for a Clojure codebase I tried it on was 0.04s vs. 0.01s.
00:45callenlol.
00:45clj_newb_2345caveman are focused, ruthless, and don't give a damn about politeness
00:46callencavemen*
00:46callenand that's a stereotype.
00:46callenyou don't share space with other people in a cave without being polite.
00:46callenclose quarters is rough.
00:46sdegutiscallen: noticably faster?
00:46technomancysmelly though
00:46clj_newb_2345caveman polite?
00:46clj_newb_2345don't they solve problems by who's stronger
00:46callensigh...ag also lacks all of the intelligent features ack had.
00:46sdegutisim really hoping colin fleming does wonders with his intellij plugin
00:47sdegutisi really hate the state of all IDEs
00:47sdegutisusing Xcode for Mac apps spoiled me.
00:47sdegutisfor how slow it can be, it does so many awesome things.
00:47technomancyisn't ack functionally just a set of nicer defaults for grep?
00:47amalloytechnomancy: well, for find+grep, i think
00:47sdegutistechnomancy: a ton of them. an insurmoutable amount
00:47technomancysdegutis: M-x grep tho
00:48sdegutisi have *something* like that in my setup
00:48technomancyplus it's hyperlinked
00:48technomancyor M-x rgrep, I guess
00:48amalloyM-x find-grep ; real ultimate power
00:48sdegutisgrep was broken in emacs (for me anyway), so i had to do this: https://github.com/sdegutis/dotfiles/blob/master/home/.emacs.d/init.el#L154-L167
00:48technomancyhyperlinks are pretty nice
00:48sdegutisthat block of code probably sums up why im trying to ditch emacs :(
00:50sdegutiswell not just the block, but the hours i spent digging through old emacswiki pages about it, and github repos and docs and ugh
00:50sdegutisso many grep modes, all of them have some flaw and none is Just Right™
00:58sdegutisok time to get back to clojure
00:58sdegutisanyone using nevermore yet?
00:59callenwhat's that?
01:06sdegutiscallen: https://github.com/sdegutis/nevermore
01:06sdegutistesting lib for clj code
01:06callenoh, you renamed the testing lib
01:06sdegutisits functional as well as functional
01:06sdegutiscallen: sure.
01:07sdegutisit functions and it tries to be super FP
01:07callensorry, I'm all about procedural programming and global state.
01:07clj_newb_2345is there a clojure/java builtin for saying "read file" "root_dir/extended_path", where the "root_dir" is trusted, but the "extended_path" is not trusted, and the system makes sure there is no nastiness like ".." and the such
01:07callenif I'm not explicitly smashing a location in memory, my day is ruined.
01:07sdegutiscallen: then you'll like some of the alternatives
01:09callensdegutis: nope, not enough global state to smash.
01:09sdegutisk
01:09callenI should make a testing library based on ztellman's proteus
01:09callenftw.
01:23alexgunnarsonhey everyone! anyone using clojure with javaFX?
01:30clj_newb_2345how does mustache and compojure compare
01:30clj_newb_2345are they both still actively maintained?
01:30alexgunnarsonnobody here uses javafx?
01:31amalloy~anyone
01:31clojurebotJust 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 ..."
01:32alexgunnarsonokay, the question is, who here uses / has experience with javaFX?
01:32alexgunnarsonmainly javaFX with Clojure, that is
01:33alexgunnarsoni'm trying to build an RIA with javaFX and clojure
01:34alexgunnarsonthere's not very much information about the two together, but there's tons on clojure+HTML5+JS
01:34alexgunnarson*clojurescript+HTML5+JS
01:43callenclojurebot: mustache and compojure are two totally different kinds of things
01:43clojurebotcompojure is http://github.com/weavejester/compojure/tree/master
01:43callenor
01:43callenclj_newb_2345: ^^
01:43clj_newb_2345does pedestal use compojure or mustache ?
01:43callenclj_newb_2345: you just threw an exception for a type erorr.
01:43callenclj_newb_2345: dude, they're not comparable. they solve two totally different problems. It's a malformed question.
01:43clj_newb_2345callen?
01:44callenerror*
01:44clj_newb_2345https://github.com/cgrand/moustache
01:44clj_newb_2345my bad, mis spelling
01:44callensigh.
01:44callenuse Compojure.
01:44clj_newb_2345callen: sorry, today = long day
01:44callenclj_newb_2345: if you don't know what you're doing, you should just be using Luminus.
01:44clj_newb_2345this morning started with css
01:44clojurebotHuh?
01:51alexgunnarsonclojurebot: have you ever used javaFX with clojure by chance? or not really?
01:51clojurebotclojurebot is pretty cool
01:53alexgunnarsonuhh… sure?
01:54sauerkrauseI'm pretty sure you triggered bot behavior
01:54alexgunnarsoni don't get it… is clojurebot a user or a bot or… something else?
01:56terom,(print "I'm a bot")
01:56clojurebotI'm a bot
01:56bbloom,(print "No, I'm human.")
01:56clojurebotNo, I'm human.
01:57callenalexgunnarson: http://www.youtube.com/watch?v=KxcP7TRY178
01:57alexgunnarsonwow interesting never knew that
01:57alexgunnarson: ,(print "Hi, I'm clojurebot. This sentence is false.")
01:58alexgunnarsonhmm doesn't do it for me
01:58alexgunnarsonso, lies! haha
01:58bbloom,(print "SYNTAX ERROR")
01:58clojurebotSYNTAX ERROR
01:58alexgunnarson: ,(print "COLLABORATION")
01:58mischov,(print "Yea.. lies!")
01:58clojurebotYea.. lies!
01:59teromalexgunnarson: you have extra ":" in the beginning and that's why the bot is not triggered
01:59alexgunnarsonahhh
01:59alexgunnarson,(print "COLLABORATION")
01:59clojurebotCOLLABORATION
01:59mischov,(print "Quit ruining this for the rest of us.")
01:59clojurebotQuit ruining this for the rest of us.
01:59alexgunnarson,(print "clojurebot does what it wants")
01:59clojurebotclojurebot does what it wants
02:00callenalexgunnarson: /query
02:00callenalexgunnarson: stop abusing the bot in a public channel.
02:00callenalexgunnarson: query the bot in private or just stop.
02:00alexgunnarsonsorry.
02:01alexgunnarsonso… who of you has used javafx with clojure? if nobody has, i suppose that wouldn't be unusual… but just curious
02:01alexgunnarsoni haven't really gotten a clear response which leads me to believe nobody has experience with the two
02:03callenalexgunnarson: no
02:03teromalexgunnarson: it could be that no one (currently present) here has, but you could ask more specific question, i.e. what is your problem with javafx and clojure? Maybe then someone can help.
02:04alexgunnarsoni wish i had a specific problem - it's more like, where do i start?
02:04alexgunnarsoni've scoured the internet and there are probably only two or three sites that really mention it more than just passingly
02:05bbloomalexgunnarson: well then, there are two choices: read the docs or wait until somebody else does it and packages it up nice into a blog post for you
02:05alexgunnarsonbbloom: i've been reading the docs and i'll continue with that but it's always nice when there's an easier way
02:05bbloomyou'll have better luck learning javafx in isolation from clojure & asking in some javafx channel, if that exists
02:06alexgunnarsonbbloom: it's like, why get hung up on the arcane details of HTTP requests when there's ring to handle the low-level stuff for you?
02:06bbloomalexgunnarson: you're talking to the wrong guy. i read the source to ring before i used it :-P
02:06callenmight be the first time I've seen Ring called low level. Sweet.
02:06alexgunnarsonno, i'm saying the stuff that ring abstracts out is low level
02:06callenbbloom: does this mean Clojure is mainstream now?
02:06callenalexgunnarson: that doesn't change what I said.
02:06clj_newb_2345pedestal is awesome
02:07callenclj_newb_2345: no it's not.
02:07clj_newb_2345callen: what do you have against it?
02:07callenan IRC channel isn't the place to enumerate grievances.
02:07clj_newb_2345callen: let's hear the top 3
02:07clj_newb_2345I'm curious
02:07callenclj_newb_2345: nope, I already told you what to use.
02:07clj_newb_2345this might save me days of my life spent sutdying pedestal
02:07callenclj_newb_2345: no need, I already told you to use Luminus.
02:08clj_newb_2345callen: what's your github account? I want to see what libraries you've written
02:08callenI'm mostly fucking with Selmer and neubite right now.
02:08callenI'll probably convert neubite to http-kit and extract that into some kind of project template.
02:09callenI like that Github has become "LETS FIGHT AND SEE WHAT YA GOT BRO" go-to for brogrammers though.
02:09clj_newb_2345no, it's a quick signaing mechanism
02:09clj_newb_2345to see what qualifications a developer has
02:10clj_newb_2345https://github.com/pedestal/app-tutorial <-- next 24 hours of my life
02:10callenmost large/important projects are under their own orgs
02:10alexgunnarsoni wonder why there have been so many man-hours spent working on clojure + JS + HTML5 + CSS and virtually none on clojure + javaFX… maybe because javaFX is new? or maybe because the existing java interop is assumed to "take care of it all"?
02:10callennot under the accounts of the principal maintainers
02:10callenso what signals are you looking for exactly?
02:11clj_newb_2345contributions to large projects
02:13clj_newb_2345hmm, lein version 2.2.0 required
02:13clj_newb_2345time to update lein
02:13clj_newb_2345hmm, still 2.1.2
02:28RuralClojurerany good libraries for inspecting java classes?
02:29callenRuralClojurer: .getClass .getDeclaredMethods
02:30RuralClojureryeah.. but i'm disappointed if that's the best available )
02:31gunsA little macro sugar goes a long way
02:32RuralClojureri guess i'll write my own then
02:32RuralClojurerwhich leads to another question.. in emacs, how do i always load a package into nrepl at startup?
02:33gunshTat can all be done through the :user profile
02:34RuralClojurerahh, thx.. i kept thinking it was an emacs config question
02:34gunsYou can even run arbitrary code with {:user {:repl-options {:init …}}}
02:34RuralClojurerthat sounds much easier
02:41amalloyRuralClojurer: clojure.reflect/reflect
02:41amalloy(callen)
02:52callenamalloy: I wanted him to know what it was to go uphill both ways first.
02:52callenyou've robbed him of a character building opportunity.
02:55callenRaynes: http://www.youtube.com/watch?v=Q7DRA0_ATUI
03:04_weihello folks
03:04bearwithclawshola!
03:09callenbearwithclaws: HAI
03:43Raynescallen: I can get behind that.
03:44callen<3
03:47ro_stRaynes: what do you think of Pedestal?
03:47ro_st#random-interview
03:48RaynesI think I like ring and Compojure and don't care about pedestal and thus don't have enough intel on it to form a valid opinion.
03:48ro_stok. don't care because you don't have problems it's designed to solve, or because you don't like the approach?
03:48Raynescallen: It suggested Nina Nesbitt after that. :<
03:49RaynesIf I have problems it can solve, I haven't noticed them. :p
03:49ro_stbi-directional http-only server <> browser comms, basically
03:50callenthat's not specific to Pedestal in the slightest.
03:50ro_stthe whole HTTP SSE thing
03:50callenthat's not specific to Pedestal either.
03:50ro_stdivorcing threads from http requests
03:50callenthat's not specific to Pedestal either.
03:50ro_stthanks callen. i'll make a note
03:50callenRaynes: to be honest, if Pedestal takes off in Clojure-land, I'm quitting.
03:50callenRaynes: because I will have lost all faith.
03:51ro_stwhy? what about it irks you?
03:54Raynesro_st: You can rest assured that I don't care about it nearly enough to have that sort of reaction. :p
03:54ro_st-grin-
04:43speedwagon2Hi, i have a short question about clojure-clr. The latest binaries' version seems to be 1.4.1 and the procedure for installing from source says "Visual Studio 2010 (Express edition not supported)" Does this mean, unless I spend money for the non-express version of Visual Studio, I can't get the latest version of clojure-clr?
04:44speedwagon2I.E. 1.5.*
05:24noncomhi! i have a problem - lein run works fine but lein uberjar gives an npe.. https://www.refheap.com/17049 what could be wrong? there is nothing special in the code, and it launches fine both from ccw and lein run..
05:27hyPiRionI have/had the same issue in "Hello Swearjure", and I figured it was something with the namespaces. Could you check out if the namespace handling is correct?
05:27noncomhow i check if it is correct?
05:28noncomto me, the code is fine and all namespaces are in corresponding packages/files...
05:46supersymsay guys, if I extend on a protocol, add another type/method, and other namespaces in the same VM are using that protocol, are those changes visible right away? or do I need to recompile, restart, reify?
05:48hyPiRionsupersym: recompile =/
05:48hyPiRionWell, if you're changing the protocol itself that is
05:49noncomhyPiRion: solution proposed by Dave Ray here http://stackoverflow.com/questions/7991685/confusing-clojure-compile-errors-bad-line-reporting did the trick... did not think that that mattered.. i strongly believe they had to make a better error message since shadowing names is so common in clojure
05:51supersymhyPiRion: the protocol itself? You mean add extra methods (types being fine)?
05:52supersymfor types I could just have them implement the protocol.... I was just wondering because I'd like do work with some 'hot-reloading' of namespace based 'plugin' architecture
05:52hyPiRionsupersym: if you change the definition of the protocol itself, you'd have to recompile. I'm not sure on the other parts, because I haven't used protocols that much (I prefer multimethods)
05:53supersymanyway I'll need to have state properly contained and persisted on file before I can do any recompile/reload... I was looking how stuart sierra explained this earlies with tools.namespace
05:53supersymcool... I'll keep reading/testing :)
05:54supersym3 LightTable instarepls work nicely in showing me some mechanics
05:58shdwprinceHey, I have java class A with static class B inside, how can I get it? A/B - no such field, A.B - class not found.
05:58shdwprinceFrom java I can just use A.B
06:03supersym"the desire to implement an existing set of abstract methods for an existing concrete class without having to change the code that defines either."
06:04supersymthere we go, looks like I can't add abstract methods, new ones with defprotocol so far
06:04supersymthats fine... as long as I know :)
06:05supersymshdwprince: http://clojure.org/java_interop
06:06supersymI'm not sure which you want, often one might provide a accessor method for those I think?
06:06supersymyou'd probably need a public constructor for it anyway
06:07supersymbut I'm no Java guru, I come from C# originally
06:07supersymasuming the inner class is private anyway
06:09supersymahh... gen-class :methods... answers my final question about "defines a new method foo not present in any superclass/interfaces"
06:09supersymsweet
06:11number36hi all i dont know if i can ask simple question about fibonacci sequence function that i found ?
06:11rcgnumber36, just give it a try :)
06:15number36rcg thank you
06:15number36 defn fibonacci [s]
06:15number36 (#(take % (map first (iterate (fn [[a b]] [b (+ a b)]) [1 1]))) s)
06:15number36 )
06:15number36i understand iterate
06:15shdwprincehumm, I dont found any answer on docs. I have third-party Terminal class, and static enum class Color inside it. Tried many variants, but cant get any values from Color.
06:15number36also there is no problem with fn iteself
06:15number36but i dont get the map first thing
06:16noncomshdwprince: A&B
06:16noncomshdwprince: sorry i meant A$B
06:17noncomshdwprince: you get something like Terminal$Color/RED I guess... (not sure bout the exact names in your code)
06:18shdwprinceNo such namespace - Terminal$Color
06:20shdwprince8/b 1
06:20shdwprinceoh, sorry
06:21noncomshdwprince: first, try qualifing it fully like org.yourlib.terminal.Terminal$Color/WHATEVER and see if it works
06:21noncomyou can try that in repl
06:23supersymoh right... $ :)
06:24tgoossensI have a collection of "objects" with certain properties and I want to distribute them over 4 slots according to some rules. (Like: evey object has a score, and the sum of scores in one slot must be less than 30). Is core.logic a good fit for this?
06:24shdwprincenoncom, that's works, thanks a lot
06:24tgoossens(there will be multiple rules that might change in the future)
06:26noncomshdwprince: if you use that class/enum a lot, consider adding an (:import org.yourlib.terminal.Terminal) clause to your ns definition so that you could simply call Terminal$Color/WHATEVER later
06:26supersymtgoossens: once you grasp it, sure
06:26supersymI found it really cool to learn some, and combined with map I guess a lot of these tasks become more trivial
06:26supersymbut if that is the only problem, just a few rules not too much related really, you could just use function predicates
06:26IamDrowsynumber36: https://www.refheap.com/17052
06:27supersymask yourself, is it worth the learning curve you expect
06:28tgoossensI would like to see all the possible plans
06:29tgoossenshmm using only predicates?
06:29noncomnumber36: first is just an fn. you can think of it as (defn first [collection] (nth collection 0))
06:29noncomso you simply pass it as the function for the (map)
06:30noncomit means that you take first items of all collections that are passed to the map in a single collection created by iterate..
06:31tgoossenssupersym: could you refer to some example of doing this with predicates only?
06:31hanDerPederI'm getting a NoClassDefFoundError when compiling my project after switching to logging using timbre
06:31hanDerPederafter some googling it seems to be related to nameshadowing
06:32hanDerPederbut the strange thing is it does not happen on my colleagues machine
06:32hanDerPederi've tried cleaning maven dependencies etc
06:32hanDerPederanyone experienced something like this?
06:32noncomnow i have another trouble with lein uberjar now: it simply hands forever. i have likt 150MBs of jars and about 150MBs of graphical assets, so how long should it take? i think not as long as i've been waiting for now...?
06:33noncomhanDerPeder: what IDE do you use?
06:33supersymok that last bit, might make it a bit harder
06:33hanDerPederemacs
06:33supersymI use math.combinatronics for those
06:33supersymthe possible plans
06:34noncomhanDerPeder: than i think, idk.. i had this issue with CounterClockWise when it was not delegatin program start to leiningen... as for you - try doing lein run in your project and see if it works (do not forget to specify -main fn and :main key in project.clj)
06:34tgoossenshmm
06:34jonasendown for me or everyone else? http://repo1.maven.org/maven2/org/clojure/clojure/1.5.1/clojure-1.5.1.zip
06:35supersymtgoossens: well if slots is like (def slots [[1 2 3][33 5 20][...]) you can (map #(reduce + %) slots) to test for those values and then assoc-in the right slot?
06:35jonasenI can't run the clojurescript bootstrap script since the above url gives returns a 503
06:35supersymlike I said, depends on how complicated/transparant perhaps the whole process needs to be :P
06:36noncomjonasen: works fine for me
06:36tgoossensalso there arent much objects
06:36supersymif you really want to define 'rules' in that sense that there is interrelated logic, obviously core.logic would be better in the long run, keeping stuff clean really
06:36tgoossensabout 24 or so
06:36supersymok
06:36jonasennoncom: oh, interesting :(
06:36tgoossensfyi: its for planning my courses the next two year (4 slots: 4 semesters )
06:37jonasennoncom: thanks for testing
06:37supersym:)
06:37tgoossensand maybe other people might want to use it
06:37supersymright... you want rosters generated? :P tought problems to solve usually
06:37supersym*tough
06:37tgoossensnot really. its really just
06:37hanDerPedernoncom: lein run fails during compilation
06:37tgoossenssaying "semester 1 2 3 or 4"
06:37tgoossensand to make it even easier:
06:38tgoossensevery course has a certain semester it is given
06:38hanDerPederdid a bisect and it works up untill i added timbre
06:38tgoossenshmm
06:38tgoossensso actually I have two slots
06:38hanDerPederbut only an issue on my machine
06:38tgoossensyear1 or year 2
06:38tgoossensthat might make the task much easier
06:39supersym:)
06:39tgoossensfor me
06:39tgoossensbut not in general
06:39supersymso you want to generate possible moments you could go there and then just crosscheck against whatever you have planned at those times manually?
06:39tgoossensa course might be given in first or second
06:40tgoossens(not for me but it might for others)
06:40supersymyea
06:40tgoossensand there might be some requirements on
06:41tgoossenscourse X must be followed BEFORE course Y
06:41tgoossensor only in second year
06:41tgoossenslike you said. it gets complicated quickly :p
06:42supersymhttp://stackoverflow.com/a/7671914
06:42supersymread and wheep :P
06:42supersym-h
06:42supersymcause you'd quickly head in those directions: core.logic will contain constraints eventually
06:43supersymthen you'd generate sets based on those, and use math.combinatorics to probably generate the whole possible range of options
06:45tgoossensso you would do it just combinatorically ?
06:47tgoossenssupersym:thanks for your time btw
06:49tgoossenssupersym: do you sometimes attend Dutch clojure meetups?
06:52noncomanyone familiar with 'lein uberjar' ?
06:55supersymtgoossens: sure np... I haven't looked any up as of yet, but I really should. Stuff freelancing is becoming quite boring anyway, so I'm thinking to spend most time learning tons of clojure stuff and then work for someone/partner up. I'm an INTP, can't work by myself on projects or they will never finish :P
06:56supersymwell I don't know, as I just started experimenting with those, I did find cartesian-product to do wonders on a backgamon game I'm working on
06:57supersymas it easily creates the possible outcomes,... but those are easy with dice, two vectors [0...6] will get 36 possible outcomes
06:57supersymbut since you have constraints
06:58supersymI haven't really done anything with that yet... and it might not be a 1-on-1 correlation between the sets, since date/time would be involved, stuff can't overlap etc.
06:58supersymthis is what makes it damn hard indeed :P
07:00supersymcheck this out: http://programming-puzzler.blogspot.nl/2013/03/logic-programming-is-overrated.html
07:00supersymI just found it, he argues you don't need core.logic for some of these puzzles
07:04llasramsupersym: Did you see dnolen's response to that post?
07:05supersymllasram: not yet, I'm still reading it
07:05dnolensupersym: llasram: the post is correct about not needing core.logic - but I don't really agree with any of the other opinions expressed therein
07:07llasramOh, and dnolen is here. EDT early-risers, go!
07:07llasramsupersym: If you don't have the link in hand: http://swannodette.github.io/2013/03/09/logic-programming-is-underrated/
07:12supersymdaniel eklunds post was very insightful for me, as a complete newb in this field
07:12supersym:)
07:12supersymthanks
08:03AWizzArd,15
08:03clojurebot15
08:04AWizzArdthat works:
08:04AWizzArd,(= (sorted-set "a") #{"a"})
08:04clojurebottrue
08:04AWizzArdbut this doesn’t:
08:05AWizzArd,(= (sorted-set "a") #{:a})
08:05clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Keyword>
08:05AWizzArdBug or feature?
08:05AWizzArdCause when the types match and both are (unsorted-) sets it works again:
08:05AWizzArd,(= (set (sorted-set "a")) #{:a})
08:05clojurebotfalse
08:08llasramOooh. That does seem kind of nasty
08:09llasram&(= "a" :a")
08:09lazybotjava.lang.RuntimeException: EOF while reading string
08:09llasram&(= "a" :a)
08:09lazybot⇒ false
08:10Bronsathere's also ##(get (sorted-set 1) :a 0)
08:10lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.Keyword
08:15llasramMy jira-foo is proving insufficient for determining if this is already bugged
08:18llasram&(= #{:a} (sorted-set "a"))
08:18lazybot⇒ false
08:19laurentpetitHello
08:19clgvlaurentpetit: hi
08:20crepsacI'm wondering whether it is possible to have a namespace always available from the repl
08:20laurentpetitclgv: hi. did you try the latest beta with autoshift ? :)
08:20tbaldridge&(= #{:a} (sorted-set :a))
08:20lazybot⇒ true
08:20laurentpetit(I know, I'm "monomaniac" as we say in French)
08:20crepsaci tried using lein :injections, but that doesn't seem to stay loaded outside user namespace
08:21laurentpetitWhat is the status of Pallet these days?
08:21laurentpetitDo you know how Pallet compares to Ansible ?
08:22llasramcrepsac: I'm afraid there's no mechanism which can cause one namespace to be referred from every other namespace
08:22llasramcrepsac: Once a namespace is loaded, you can reference its symbols by their namespace-qualified names from anywhere
08:23llasramBut if you want them refered into a new namespace, you need to do it manually
08:23crepsacah thanks
08:23clgvlaurentpetit: not yet. will do asap
08:23crepsaci would have thought that was a kind of useful thing to be able to do tbh
08:24laurentpetitclgb: I'll be on holidays soon, would have been great to get feedback before, so that hopefully tomorrow I can fix the most important issues
08:24crepsacfor instance if I wanted clojure.repl everywhere from the repl...
08:24laurentpetitjkkramer seems to appreciate it already, and didn't (yet) report fundamental problems
08:25clgvlaurentpetit: I should have time tonight.
08:25llasramcrepsac: Yeah, it is an annoyance. Some people fix it client-side, but e.g. in nrepl.el adding a hook to refer the namespace whenever switching namespaces
08:25llasramBut there isn't a generic in-Clojure solution
08:25llasrams,but,by,
08:26laurentpetitclgv: that would be great. But no pressure, eh :)
08:26crepsacthe lein repl uses nrepl though right?
08:27llasramIt launches an nrepl server when you run `lein repl`, but I don't believe the terminal REPL you get is bouncing through nrepl. But I don't know for certain w/o looking at the code
08:28clgvllasram: lein repl, uses REPL-y as client for nrepl
08:28llasramWhen I mentioned hooking nrepl.el, I meant hooking the emacs-level command you use to switch namespaces via editor command. It might be something you could do with nrepl middleware, but I don't know
08:28hanDerPeder when compiling with lein compile i get a NoClassDefFoundError complaining about clojure/lang/ILookupHost missing
08:28llasramclgv: Cool beans. That is good to know
08:28jonasensanity check: Can someone run "git clone https://github.com/clojure/clojurescript.git && cd clojurescript && ./script/bootstrap && ./script/test" in an empty directory and tell me if the tests pass or not? I'm still not able to run the clojurescript tests.
08:29hanDerPederafaik this was last present in clojure 1.2 and im compiling with 1.5.1
08:29hanDerPederanyone know how to debug this
08:29clgvhanDerPeder: did you run "lein clean" before compiling again?
08:29crepsacllasram: thanks, I'll try to figure out a solution :)
08:29hanDerPederclgv: yes
08:29clgvhanDerPeder: or dou you use that Class explicitely in your code?
08:29llasramcrepsac: Best of luck!
08:30jkkramerlaurentpetit: happy to see if you fixed the Alt+R issue; almost downgraded to fix that ;)
08:30hanDerPederno
08:30hanDerPederstrange thing is it does not happen on my colleagues machine
08:30crepsacllasram: i still think it's wierd that there is no standard solution for think
08:30hanDerPederwith identical classpath and lein version
08:30crepsac*this
08:30jkkramerlaurentpetit: still liking the autoshift after using it for a day or so
08:30hanDerPederi've tried cleaning, deleting local maven repo etc
08:31clgvhanDerPeder: you usually get this kind of error with old compiled files from 1.2 so there might be some remaining files...
08:31hanDerPederclgv: this seems very plausible
08:32clgvhanDerPeder: maybe some AOT-compiled dependency which was compiled with clojure 1.2?
08:32hanDerPederbut then it would happen for everyone, right?
08:32llasramAh! The sorted-set `=` boils down to the `get` Bronsa pointed out, which ultimately does a `compare` on the provided and tree-set keys in the backing implementation tree-map
08:32llasram&(compare :a "a")
08:32lazybotjava.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Keyword
08:33clgvhanDerPeder: yes, if there are no locally installed versions that differ
08:34hanDerPederare dependencies installed in other places than .m2?
08:35clgvhanDerPeder: with plain leiningen? no.
08:35Bronsallasram: yeah. I have a patch for that but I think it's intended behaviour
08:36llasramBronsa: Link to patch & discussion? Curious
08:36hanDerPederclgv: ok, thanks
08:36Bronsallasram: I just wrote it :)
08:36llasramhah!
08:36laurentpetitjkkramer: so the fact that the text sometimes moves like crazy to follow the indentation is not too disturbing when doing long coding sessions?
08:37hanDerPederclgv: the error is specifically related to having timbre as a dependency, if i revert to tools.logging it goes away
08:37llasramBronsa: What's your approach? I was just considering catching the ClassCastException in PersistentTreeMap.valAt
08:37Bronsallasram: catching the CCE in entryAt
08:37llasramOh yeah, that guy is public too
08:37hanDerPederbut afaik timbre does not need to aot compile anything
08:37Bronsallasram: and it's used by both equiv and valAt
08:38laurentpetitjkkramer: tomorrow i'll work on adding support for paredit commands (raise over, etc.)
08:38Bronsaso you fix them both
08:38llasramOh, I missed the extra calls to `entryAt`
08:39llasramYeah, that seems the way to go
08:39llasramIf you open a ticket in the Clojure Jira, I'll vote for it :-)
08:39Bronsasure. let me just write a bunch of tests
08:39jkkramerlaurentpetit: nah, the text moves predictably, so doesn't feel weird
08:40jkkramerlaurentpetit: having it work with paredit commands will be great
08:40laurentpetitjkkramer: great, I'm quite happy that you enjoy it.
08:41laurentpetitjkkramer: I have no doubt I'll manage to get it to work. And then there'll only be the copy/paste/cut to work on
08:41laurentpetit(those are tricky because somehow they "bypass" the Eclipse extension point I'm using)
08:44clgvlaurentpetit: next stable release two weaks after your vacation? ;)
08:45laurentpetitclgv: hopefully yeah :)
08:46laurentpetitjkkramer, clgv : depends on whether you find it important to have autoshift integrated with copy/cut/paste before releasing ?
08:46clgvlaurentpetit: gotta try it first to answer that ;)
08:47jkkramerlaurentpetit: beta is stable enough for me; i'm happy regardless
08:49Bronsallasram: http://dev.clojure.org/jira/browse/CLJ-1242
08:49laurentpetitjkkramer: I would be happy to see someday a video showing how to use CCW to do Web server side & client side (cljs). This would certainly help me understand the current pain points
08:50laurentpetitjkkramer: in september I intend to restart the work on generic leiningen support, this will probably help boostrapping piggieback, etc. from the comfort of the IDE ?
08:51jkkramerlaurentpetit: i can do a blog/video when i have some time
08:54jkkramerlaurentpetit: so far, when using cljx, I just do "lein repl :headless" then "connect to repl" in ccw. pretty painless
08:55jkkramerwith the cljx/piggieback nrepl middleware in place, i can load code in ccw as i normally would - for clj, cljs, and cljx
08:56jkkramerhaven't wrapped my head around how to do browser repl yet
09:18laurentpetitjkkramer: there are definitely things I don't understand in the cljs/cljx/etc. setup. For instance I was just surprised that you said "haven't wrapped my head around how to do browser repl yet". If you don't do browser repl, what's the point of having a repl connection?
09:18laurentpetitI'm missing something
09:19laurentpetitjkkramer: sure, another blog/video in the vein of what Chas did for pure server development would benefit people!
09:20jkkramerlaurentpetit: I used the repl to help develop a combined clj/cljs library - can use rhino for testing cljs and such. for app development, so far i've just been using cljsbuild sans repl, but planning to fix that soon
09:21jkkrameri'm still a cljs/cljx newb
09:26laurentpetitjkkramer: I was disconnected, after your message "i'm still cljs/cljx newb" => did I miss something?
09:27laurentpetitjkkramer: ok, so just rhino to check evaluation is ok
09:39supersymerh maybe a dumb question, but could you flip (horizontal/vertical) unicode character? besides using a image editor that is :P
09:40supersymor would that involve hacking into the gfx subsystem
09:40clgvsupersym: should be possible since you can also can flip writing direction via unicoe
09:40supersymclgv: yeah it has writing direction with a mirror-character
09:40supersymbut its just right to left
09:42supersymsince I just learned the matrix green code = reversed katakana, I can reverse the (map char (range 12449 12540)) but I don't think I could actually flip the signs :)
09:42clgvf -> ɟ
09:43supersymhey
09:43supersymsame one? or just trickery, as in differnt unicode actually has a reversed f? :P
09:44clgvit says U+025F
09:45supersym'(int \ɟ)
09:45clgv,(long \ɟ)
09:45supersym607 + 102.. yeah I get that :P
09:45clojurebot607
09:45supersym,(long \f)
09:45clojurebot102
09:46supersymso as long as they aren't mapped explicitly like that
09:48supersymUNICODE Text Flipper.. they have sites for it... gonna check it out for a bit what the trick is they use :)
09:48supersymhttp://www.revfad.com/flip.html
09:52supersymThe Fixedsys Excelsior typeface includes a complete set of reversed characters like this in its Private Use Area. However, online utilities to create mirrored text are not readily available, and most sites that claim to "mirror text" or "reverse text" in fact only change the order of the letters and do not actually flip the letters themselves.
09:52supersymyeah,...just not possible
09:53xonevI have a noob question — can someone tell me why this doesn't work? https://gist.github.com/xonev/df517e2dc6716cf0f339
09:53xonevI can do something similar with `doseq` that works, but I want to return a lazy sequence from this function. Is it possible to do something like that?
09:56nkozaxonev: you can use for
09:56xonevI tried using `for`, too
09:56xonevIt gives me the same problem as map
09:56nkozawhat problem?
09:57xonev('IOException Stream closed java.io.BufferedReader.ensureOpen (BufferedReader.java:97)
09:57tbaldridgexonev: map is lazy, the file has closed by the time you actually read the file
09:57nkozamap is lazy
09:57tbaldridgexonev: wrap map in "doall"
09:58tbaldridge,(doc doall)
09:58clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time."
09:58nkozamaybe the question is how to return a lazy sequence that reads from a file without closing the file before consuming it all
09:59xonevnkoza: yeah, that's what i want to do. Although, I guess this will be fine for now...
10:00tbaldridgexonev: it can be done, you just have to wrap your seq in a seq that detects the end of the seq and closes the channel.
10:01xonevtbaldridge: that might be a little advanced for me atm i think, but i'll keep that in mind for down the road
10:01xonevi wouldn't be using `with-open` then, correct?
10:01tbaldridgexonev: it's something like this: https://gist.github.com/halgari/6122107
10:02tbaldridgeblast...a typeo there.
10:02tbaldridgehere we go, this should work: https://gist.github.com/halgari/6122107
10:02tbaldridgexonev: yeah, the other option is to not use with-open, and instead just call .close manually when you're done with the file.
10:03xonevtbaldridge: cool, thanks
10:07manutter,(doc line-seq)
10:07clojurebot"([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader."
10:08manutter,(doc file-seq)
10:09clojurebot"([dir]); A tree seq on java.io.Files"
10:14jonasendnolen: I vaguely remember some trick you did to get fast mutable let bindings in clojurescript?
10:14dnolenjonasen: not really, you have two options - mutate a local array or use deftype
10:17jonasenyeah, it was "mutate local array" I was thinking of. I'll try that :)
10:18stuartsierraSomebody made a wrapper that uses deftype to provide mutable locals.
10:24cmajor7is there a way to create a macro that gets evaluated to nothing (i.e. could be just comments) based on a certain condition.. e.g. "(defmacro .. (if condition evaluate to function :else ";; noop"))"? the idea is not to have any overhead/impact on the code in case a condition is not met
10:25tcrayfordcmajor: is the condition known at compile time?
10:25nDuffcmajor7: the "comment" macro _is_ a macro that gets evaluated to nothing. All you're doing is making that behavior conditional. :)
10:25cmajor7it can be.. e.g. evn variable
10:26tcrayfordwell, you are always going to have some overhead then
10:26tcrayfordunless you read the env variable at compile time
10:26nDuffOh, environment. Yeah.
10:26cmajor7nDuff: interesting, good point, let me look at the source.. but a comment macro has to be removed in order to "get to the body"..
10:27cmajor7tcrayford: why can't you?
10:27nDuffcmajor7: you're going to have the exact some constraints here as you do with the comment macro. Not sure what you mean by "get to the body".
10:27nDuffcmajor7: well, the problem with reading from the environment at compile time is that compile time might not be the same thing as runtime. :)
10:27nDuffcmajor7: think about the case where someone AOTs your code.
10:28cmajor7well a "comment" macro will never execute/make visible its body to a compiler, unless it is removed
10:28nDuffcmajor7: right, so you need to make it conditional. But there's nothing hard about that.
10:29nDuffcmajor7: if you want to eat the overhead of only checking the environment once, that's a thing you can still do at runtime.
10:29cmajor7so far "macroexpand-1" returns the whole body (with condition checking) nomatter whether the condition is met
10:29nDuffcmajor7: well, we can't very well debug a macro you haven't shown us.
10:30cmajor7nDuff: sure, good point. I was just curious if it is possible. one sec, I'll refheap it
10:33cmajor7https://www.refheap.com/17057
10:34nDuffcmajor7: why are you putting the if-not inside the syntax-quotes if you want it to be run at compile-time?
10:34cmajor7ok, that maybe a problem I am facing..
10:35cmajor7so "`…" is what it actually gets evaluated.. vs. a decision making it needs to do at compile time?
10:36nDuffcmajor7: your return value is what gets invoked at runtime rather than compile time.
10:36nDuffcmajor7: using the syntax-quotes where they are in that macro make those contents part of the return value.
10:36nDuffs/gets invoked at runtime/gets compiled for later invocation at runtime/
10:37cmajor7https://www.refheap.com/17057 (updated) ?
10:37nDuffcmajor7: it's not like ` is special in macros; ' would do the same thing, but without the ability to unquote, unquote-splice, etc.
10:40nDuffcmajor7: what is "fun" here? Personally, I'd do something more like https://www.refheap.com/17058, and that's _if_ I didn't want to parameterize the condition.
10:41nDufferr, that last paste was bad.
10:41cmajor7nDuff: 'fun' is just an arbitrary function that is available in the same namespace
10:41nDuff...better now.
10:41nDuffcmajor7: ...see https://www.refheap.com/17058 again.
10:42duck1123so, is id some code that you don't want evaluated? If not, are you sure you even need a macro?
10:43cmajor7nDuff: niice :)
10:43cmajor7I was a bit confused with "`"
10:44cmajor7is that common to always have "do" in front of ~@ ?
10:44nDuffcmajor7: it's unsafe not to.
10:44nDuff...well, sometimes unsafe not to.
10:45nDuffcmajor7: think about when you're unsplicing into an "if" form.
10:45cmajor7nDuff: I can see that.. ok, now let me try with a 'fun' which I am sure should work the same..
10:45nDuffcmajor7: if you didn't have the do, the second item would become the else clause, and ones after that would be invalid.
10:45cmajor7right, I understand in this case
10:45nDuffcmajor7: I don't know how your "fun" is supposed to be called, or how you're using the macro, so I can't speak to that case.
10:46nDuffcmajor7: if you're going to want follow-up help, you'll need to provide a sample implementation of "fun", and a sample of calls to the macro that makes it obvious what those calls should actually transform to.
10:46nDuff(or, if it's not obvious, explicit notes).
10:46cmajor7nDuff: just an arbitrary 'fun' that takes in an id
10:47cmajor7nDuff: yea, sure. I understand. thanks for your help! I feel, like I am a step closer to grok the evil macro usage
10:49cmajor7nDuff: the reason I asked about "do":
10:49cmajor7user=> (macroexpand '(xyz))
10:49cmajor7(do)
10:50cmajor7but I guess I can check for "id" presence before "do"ing it
10:50nDuffcmajor7: if "id" isn't something you call for side effects, you don't want the do at all.
10:50nDuffcmajor7: it probably helps to actually know what things mean before copying them.
10:51cmajor7nDuff: right, I am not hiding anything, I just want to understand how macro can be used to have no overhead given a condition
10:52nDuff...
10:53nDuffcmajor7: it has no return value. Thus it generates no code. Thus it has no overhead.
10:53nDuffSo, make it have no return value -- there's your literal answer. :)
10:54cmajor7right, I was confused in the syntax and the fact that it always gets evaluated to the return value vs. … a last logical block of "`()"
10:57cmajor7would be cool to have the same behavior at runtime.. i.e. hint JVM that (if condition (dontload/unload this code block))
10:59nDuffcmajor7: no reason you couldn't do something similar if you wanted.
10:59nDuffcmajor7: make a var point to a noop rather than an actual function or such.
10:59nDuffs/similar/similar at runtime/
11:02cmajor7nDuff: not sure I understand. so I have:
11:02cmajor7line1
11:02cmajor7line2
11:02cmajor7line3
11:02cmajor7how do I make sure line2 has 0 runtime overhead in case of a condition?
11:03nDuffcmajor7: first, thinking of clojure code as lines rather than forms is something of a structural no-no.
11:03cmajor7i.e. checking for a condition at runtime _once_ to "remove" line2's overhead vs. checking it every time before line2
11:04nDuffcmajor7: well, what does line2 _do_? If it calls a fn behind a var, replace the var with a noop.
11:04cmajor7nDuff: ok, I am intrigued
11:04nDuffcmajor7: that doesn't go to ZERO overhead, but it goes to very, very little -- and the Java runtime will *notice* that it's not doing anything and eventually JIT it out entirely.
11:05nDuffs/clojure/LISP/
11:06cmajor7nDuff: after 10,000 iterations, yes. would be cool to be able to make no such function call to begin with in case of a condition. helping poor JIT out
11:06cmajor7nDuff: sure, thanks for your help
11:06nDuffcmajor7: ...so, you have the macro approach, and you can also rebind the calling fn to a version that doesn't make the call at all if you want to.
11:08nDuffcmajor7: there are plenty of solutions here. Frankly, though, if you need to do this level of microoptimization, you have much bigger problems.
11:08cmajor7"rebind the calling fn to a version that doesn't make the call at all if you want to"… how do I do that?
11:08cmajor7nDuff: I am not taking it personally, and all this is a way to learn, rather than "having bigger problems".. I don't :)
11:09nDuffcmajor7: it's more useful to learn by finding practical problems rather than chasing theoretical ones.
11:09nDuffcmajor7: anyhow, I'd start by learning how var binding works if this is really something you want to play with.
11:10cmajor7nDuff: this is a philosophical point. and I do have practical problems as well
11:10cmajor7nDuff: right I tried var bindings, just not sure how to bind a function to a noop
11:10cmajor7so even though it is there in the code, it won't be called
11:11nDuffcmajor7: Have a fn that's a noop. set the var that points to the thing you want to nop out to instead point to that function. Done.
11:11nDuffAgain, if you care about ACTUAL PRACTICAL cases of this, look at how log calls for inactive verbosity levels are handled
11:12nDuffthe log4j, slf4j, java commons logging, &c. folks put a lot of effort into this
11:12nDuff...measuring both the overhead of the conditional checks and the amout of time needed for the JIT to manage appropriately.
11:12nDuffIf you read the literature on the subject, it will be blindingly clear that there's absolutely no point to the work you're currently trying to accomplish.
11:13nDuffs/rather a bit/rather a lot/
11:13cmajor7are you saying that because of JIT kicking in and optimizing it anyway?
11:17nDuffcmajor7: ...to use log4j's benchmarks -- for two method invocations plus an integer comparison, you're talking 3ns. In the situation you're talking about here, it's only one method invocation (of an empty/noop method), which the JIT can optimize away completely in a way it can't optimize away log4j calls (due to the potential for runtime changes to log configuration).
11:17nDuffcmajor7: ...if you care about the overhead of a 1ns-2ns noop function call, Clojure is almost certainly the wrong language for your project.
11:23cmajor7nDuff: thanks. I do care about wasting a function call, since there are potentially maybe more than one to waste more than a single time. I agree with this being an almost non existent problem, but it does not decrease my curiosity.
11:25nDuff*shrug*. *plonk*.
11:37poppingtonicHello
11:38kmicuis it me you're looking for?
11:38kmicuI can see it in your eyes
11:38kmicuI can see it in your smile
11:39poppingtonictechnomancy: I'm having a problem with leiningen's self-install procedure
11:39poppingtonicI keep getting this message: http://pastebin.com/QVx0cYWy
11:40poppingtonichi kmicu
11:46nDuff~pastebin.com
11:46clojurebotPardon?
11:46nDuffEh.
11:46nDuffpoppingtonic: Could you paste that somewhere without the animated ads? I'm actually a little curious to look at the issue, at least if it's on the shell side.
11:48kmicucurl: (23) Failed writing body (0 != 7775)
11:49nDuffoh, no set -x log provided?
11:49nDuffthat's not very useful.
11:49nDuffpoppingtonic: ...so, I pulled that up in a text-based browser. The error message is pretty self-explanatory -- you don't have write permission to ~/.lein/self-installs
11:50nDuffpoppingtonic: I'm guessing maybe you used sudo for another lein command in the past, so it created directories owned by root, not your personal account.
11:50nDuffpoppingtonic: you could fix that like so: sudo chown -R brian /home/brian/.lein
11:55poppingtonicnDuff: you sir/madam deserve internet goodwill. Thank you, I can now download leiningen. :)
11:57poppingtonicclr
11:57poppingtonicoops, wrong terminal
11:57instilled1Hi all. I'm having troubles with compojure and ring. I would like to get the json body as a map with the keys as keywords and not strings. I can get the body as a map but the keywords are strings. How can I do that?
11:57functionformthe 4clojure problem sets are hard, even at medium... did i miss the book that would teach you in a way to be prepared for these?
11:58clj_newb_2345anyone here writing actual apps in pedestal? (https://github.com/pedestal/app-tutorial/wiki/Debug-Messages)
11:58clj_newb_2345this seems like quite an interesting model
11:58clj_newb_2345with the messages and "diffs"
11:59instilled1I've tried to use (wrap-json-body hndlr {:keywords? true}) but that did not seem to help.
12:01racycleinstilled1: use clojure.data.json/read-str and this option with :key-fn as keyword
12:03racycleinstilled1: more here: https://github.com/clojure/data.json
12:04instilled1racycle: ok. so i shall retrieve the request body and "manaually" parse it with data.json.
12:04instilled1racycle: thanks!
12:04racycleinstilled1: no problem
12:18instilled1racycle: that worked fine! but I had to remove all wrap-json-(body|params) and use slurp to read the request body and then parse it. Isn't there another, maybe simpler way, to do the same?
12:20racycleinstilled1: i use wrap-json-params and just look at the :query part of the map
12:20racycleinstilled1: i'm sure there are many other ways to do it. This worked for my needs
12:30instilled1racycle: cheers. will investigate other options…
12:30racycleinstilled1: sure, let me know if you come up with something more elegant.
12:31coventryThe instructions in http://clojure-doc.org/articles/tutorials/emacs.html#creating_a_project imply that the first time you hit C-c C-k in core_test.clj you should get a stack-trace window. But I am just getting an error message in the minibuffer, albeit one that I would expect, about not resolving the symbol parse-args. Do I need to turn on the stack-trace window explicitly?
12:31technomancycoventry: unfortunately I think the nrepl.el defaults have changed to hide stuff like that =\
12:32technomancy(setq nrepl-popup-stacktraces t)
12:32seangroveThe nrepl-popup-stacktrace is annoying as hell
12:32seangroveUntil you've forgotten you turned it off and you're not getting any proper stacktrace at all inside of nrepl
12:33coventry`Thanks, technomancy. I'll file a pull-request against the docs. seangrove: yeah, I probably would have turned it off anyway, I just wanted to know whether I'd installed it correctly.
12:41eggheadhmm, if I have an async handler like a websocket connection and every time a message comes in I put! a message on a channel does that guarantee ordering?
12:42tbaldridgeegghead: yes...but think about what happens if your channel consumer is slower than the websocket enqueuer....
12:43tbaldridgeYou're going to be piling up put!s onto the channel. Now you have a unbounded queue. So perhaps think about using a sliding buffer with a really large size.
12:44eggheadI have a simple case where a ws puts rendering instructions on a channel and a the browser consumes -> renders them in a go loop, but sometimes the rendering is happening out of order
12:45eggheadbut it must be somewhere else if the serial put! guarantees order
12:46eggheadand ya, the producer is much faster than the consumer, but it's kind of fun to watch the rendering messages unwind one at a time :p
12:46tbaldridgeyeah.....to tell you the truth I may be wrong there. Let's look at the impl
12:46eggheadtbaldridge: I wasn't able to reproduce it in the clj repl
12:46eggheaddon't wanna send you on a goose hunt
12:47tbaldridgeegghead: it may be a bug in the CLJS side
12:48eggheadtbaldridge: is an unbounded queue more expensive than a buffered queue with a large size?
12:49eggheadare there practical benefits from just saying (chan 1000000) instead of (chan)
12:49eggheadgiven I'll never foresee having 1000000 messages in my buffer
12:50tbaldridgeegghead: it's less about performance, and more about correctness, and resource usage. A small queue means that gos with start parking (blocking). So the question is, when things fail...what do you want your semantics to be?
12:50tbaldridgeWith sliding buffers, messages get dropped and the system continues to run. With a unbounded queue you can get a OOM error. And the whole thing could crash.
12:51dnolenegghead: for the out of order thing would helpful to see a minimal case that isn't tied up w/ whatever you're trying to do.
12:52eggheadya, it's hard since I have to reproduce the websocket producer end of things too :p
12:52eggheadbut the cljs code itself is small
12:52dnolenegghead: if there is a real out of order issue I think you'd be able to repro w/o WebSockets being involved at all
12:53dnolenegghead: what browser are you seeing this in?
12:54tbaldridgeI'm pretty sure this is a bug in CLJS
12:55tbaldridgehttps://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/impl/channels.cljs#L47 takes are scanned starting at idx 0, takes are added via unshift
12:55tbaldridge*in the CLJS impl
13:01dnolentbaldridge: oh hm, sidenote should probably be using a custom LinkedList type in CLJS to to avoid array slicing?
13:01tbaldridgednolen: actually yeah, that'd probably be better
13:03eggheaddnolen: https://www.refheap.com/17062 here's the offending code
13:03eggheadnothing too complicated
13:03eggheadi'll see if I can somehow reproduce it
13:03dnolenegghead: still way too much context :)
13:03eggheadya
13:03coventryThe same emacs instructions say to put (defn parse-args [args] {}) in core.clj. I assume it means src/command_line_args/core.clj. Then it says to change back to core_test.clj, and hit C-c C-k again. I get the same complaint that parse-args doesn't exist, unless I first do C-c C-k in core.clj first. Is this another configuration change?
13:03dnolenegghead: but I think tbaldridge is right anyhow
13:04technomancycoventry: no, again the docs are wrong =\
13:04eggheadI know tbaldridge doesn't want me using the protocols but it's so nice to pretend a ws is a core.async chan
13:04coventryThanks, I'll includethat
13:05egghead:p
13:05coventryIn that case, what's the command to compile the entire project in one go?
13:07technomancycoventry: nrepl.el doesn't include any file-walking commands afaik
13:08technomancythere might be a deep-reload though; lemme check
13:08technomancyaha
13:08technomancy;; TODO: implement reloading ns
13:08technomancy=(
13:08tbaldridgeegghead: is it thought? Does it follow all the same semantics? (two phase commit, blocking puts, blocking takes, etc). I'm just suggesting it might not be a good idea to represent things as channels that don't follow the same semantics
13:09tbaldridge*though
13:09coventryThanks, technomancy. You can always restart the repl, I suppose.
13:09technomancycoventry: (require 'entry.ns :reload-all) if you want to do it by hand
13:12eggheadtbaldridge: I think I'm just in a sort of 'core.async all the things' mode
13:16sdegutistechnomancy: ever read Zen and the Art of Motorcycle Maintenance?
13:22technomancysdegutis: haven't, but I know I should
13:22sdegutiswhy should you?
13:23technomancybecause my brother recommended it
13:25poppingtonicsdegutis: I have. Though I have a feeling I should read it again.
13:26sdegutismeh
13:27coventrySomething about this emacs tutorial which is confusing me: It says to switch to a new ns with C-c M-n, then refactor an anonymous function into 'keywordize' in core_test.clj, compile that with C-c C-k, then test 'keywordize' in the nrepl. But the ns in nrepl is now different, so it doesn't recognize kewordize. You have to reset the ns to .core or something which requires .core like .core-test, for it to work. Is that correct?
13:35llasramcoventry: Link to tutorial in question?
13:42sdegutisnot *strictly* on topic, but .. would unix sockets or tcp be better/faster/easier when the server and clients are all on the same machine?
13:43llasramUnix domain sockets may be faster, but there's no standard way to use unix domain sockets from the JVM
13:44llasramBut there is https://github.com/jnr/jnr-unixsocket, which looks nice
13:53coventryllasram: http://clojure-doc.org/articles/tutorials/emacs.html#creating_a_project
13:56llasramcoventry: I think the intent there is that you have the `.core.clj` file open and use `C-c M-n` to switch into the `.core` namespace. THen when you add the new function to the `.core.clj` file and compile it with `C-c C-k`, your REPL is already in the context of that same namespace
13:56llasramEr, s,`.core.clj`,`core.clj`,
14:03sdegutisllasram: daaang
14:04sdegutisllasram: thanks for the tip
14:04coventryllasram: Thanks, that's what I thought. I'll include that in the pull request
14:10sdegutisis there a CLojure TCP lib?
14:15eggheaddnolen: I worked a bit on making a minimum test case but I couldn't quite get anything consistent
14:16eggheaddnolen: https://www.refheap.com/17064
14:16eggheadI think its some race condition that is hard to hit
14:16eggheadso the slower your computer the better luck you have in hitting it
14:28justin_smithinsanity wolf: race condition? give it a head start
14:29justin_smithwould a vm configured to give smaller slices to threads also make it easier to hit them?
14:29justin_smithor would it be an os kernel level thing
14:32_weihow do you expire the :flash message in compojure? (dissoc resp :flash) doesn't seem to work
14:33ddellacostaI'm renaming a namespace within a codebase, and I'm wondering if there are any good emacs tricks to do that?
14:33justin_smithddellacosta: m-x rgrep
14:33justin_smithgives clickable links for all matches in all files in subdirs matching regex
14:34justin_smithclick with mouse or place cursor on text and hit return
14:35ddellacostajustin_smith: thanks. I was hoping for something even smarter, like some sort of clojure refactoring thingamajig. But, this certainly gets me much closer.
14:35technomancyno one's done find-usages yet for clojure
14:35justin_smithddellacosta: if you find something more clojure smart please share
14:35technomancyas far as I know
14:35technomancyI'd love to see it though
14:36justin_smithyeah, that would be cool
14:36technomancyI tried to talk danielglauser into writing it =)
14:37technomancyddellacosta: don't do it! write editor-agnostic nrepl commands instead: https://github.com/technomancy/nrepl-discover
14:38stuartsierraThere's a dumb ns-renaming tool in tools.namespace.
14:38danielglausertechnomancy: that guy is a slacker
14:38ddellacostatechnomancy: ah, gotcha, thanks for the tip!
14:38RaynesA right asshole, I hear.
14:38ddellacostaheh
14:39ddellacostastuartsierra: interesting…checking it out now, thanks
14:40ddellacostastuartsierra: you're taking about .move? Actually, that's as smart as I need right now I think. Very good, thanks.
14:45seangrovetechnomancy: Isn't that codeq, essentially?
14:46technomancyseangrove: I meant that I'd love to see an OSS tool to do that.
14:47seangroveThe datomic part not being OSS?
14:47tcrayfordddellacosta: if you're interested, writing a clojure refactoring tool isn't very hard
14:48ddellacostatcrayford: I believe you, it's more just a question of how lazy I am
14:48technomancyseangrove: I haven't looked into the details
14:48ddellacostatcrayford: and along those lines, what priority it would take with all the other side projects I have going one.
14:48ddellacostaone -> on
14:49llasramtcrayford ddellacosta: as long as it has an "extract monad" feature
14:49tcrayfordddellacosta/llasram: speaking from experience here, I wrote a clojure refactoring tool for emacs a long time ago
14:49ddellacostallasram: hey now, that's not nice, I have good friends who are monads
14:49tcrayfordit really isn't a very hard problem, assuming you just punt on macros
14:52ddellacostatcrayford: yeah, the thing is, the amount of times I rename a namespace is on the order of like, once every few months, other than when I first start a project, at which point it's usually just editing two files which I already have open in emacs. So I just asked in case someone had something already I could just drop in. That's how lazy I am on this one.
14:52ddellacostaone
14:52tcrayfordddellacosta: haha, yeah :/
14:53ddellacosta;-)
14:53technomancyfine; I'll add it to the seajure projects list
14:53technomancyyou've forced my hand
14:54ddellacostanot that it wouldn't be worthwhile as a longer term thing for the community as a whole (sorry technomancy)
14:54sdegutishmm, i think aleph can do tcp
14:55squidzwhat is the difference between put! and >! in core.async?
14:55justin_smithsdegutis: doesn't aleph mainly do tcp?
14:55sdegutisi dont know, i was looking for a TCP lib in Clojure
14:55tbaldridgesquidz: put! is a low level function, only really for advanced use.
14:55sdegutisseems like aleph will work
14:56stuartsierratbaldridge: What's the cost to creating lots of `go` blocks that don't ever return a value?
14:56justin_smithtehre is also (java.net.Socket.) to just create a tcp socket
14:57tbaldridgestuartsierra: if a value is never returned, there is the cost of the return channel, that's it.
14:57justin_smith(java.net.Socket. "hostname" port-number)
14:57stuartsierratbaldridge: So just an extra object to GC?
14:57tbaldridgestuartsierra: that is, the cost of the return channel is wasted. I assume that's what you were asking
14:58tbaldridgestuartsierra: ish, channels consist of 3 lists + a channel object
14:58stuartsierrako
14:58tbaldridgestuartsierra: and perhaps the allocation of a few locks as well. I don't think I've ever benchmarked it.
14:58stuartsierra*ok
14:59stuartsierraSeems like a lot of early examples look like (go (loop [] …)) and don't ever use the channel returned by `go`.
15:00tbaldridgeyeah. And the way go blocks work, that channel won't get GC'd until the block exists
15:00tbaldridge*exits
15:00stuartsierraThat doesn't sound so good.
15:01stuartsierraMaybe we need an alternate `go` that has no return value. Call it `go-away`. :)
15:01tbaldridgelol
15:01squidzhehe
15:01tbaldridgethat being said, it's kindof a bad idea to spawn large numbers of go blocks and never do anything with them
15:02tbaldridgethat creates a unbounded queue
15:02stuartsierraYeah, I caught part of that discussion yesterday, but missed some details.
15:09ambrosebsIn other news, I finally figured out how to support (filter identity coll) in core.typed. https://groups.google.com/d/msg/clojure-core-typed/My1PjslgGrk/pjYWLMayyk0J
15:11atyzDoes anyone know of a good way to use per-project/per-environement environment variables.I don't like the idea of putting them into my .bash_profile
15:12dnolenambroff: nice!
15:12dnolenoops
15:12nDuffatyz: what do you want? lein to set them during invocation?
15:13atyznDuff: that would be great
15:16bbloomdnolen: heh, i almost did exactly the same thing. failed tab completion on ambrose
15:19nDuffatyz: lein provides plenty of flexibility. If this is for REPL-style invocations you can use :repl-options :init; you have provide a plugin, you can tell it to load a namespace of your choice...
15:19technomancyatyz: have you tried environ?
15:27sdegutisenviron is useful
15:34ddellacostastuartsierra: would you be interested in a patch to the documentation for move-ns? I had to go actually read the source code/tests to understand what the source-path and dirs arguments should be, and I figure a little bit more description of those args would be handy for other users.
15:34ddellacostastuartsierra: but otherwise worked like a charm.
15:34stuartsierraDocumentation could be better, I admin.
15:34stuartsierra*admit.
15:36gfrederickslein's ^:test-selectors don't prevent fixtures from running?
15:36gfrederickss/^//
15:38timvisherwhy does the `*nrepl-error*` buffer every now and then begin to cut off the top of the exception and is it possible to fix it?
15:47atyznDuff: technomancy, sorry got called into a meeting
15:48atyznDuff: i'll definitely look into that. thank you
15:50gfredericksI see it hooks into test-var; and the fixtures aren't handled there :/
15:50atyztechnomancy: i hadn't - thank you
15:51gfredericksI think removing the :test metadata from vars instead would be more effective
15:51gfrederickswould that be bad?
16:03jouiswalkerhow do a read files containing unicode in clojure?
16:03jouiswalkermy strings get munged with \ufffd
16:04seangrov`Hrm, find-usages via tools.reader surely couldn't be too difficult
16:04seangrov`Famous last words, I assume
16:05jouiswalkerpossibly
16:05jouiswalkera quick check at the file in question reveals iso-8859-1
16:05jouiswalkerso maybe i can avoid wasting some effort
16:14timvisherwhat's the simplest way for me to execute a given computation on a new thread? i don't have to worry about performance or anything. it's not production code.
16:14technomancygfredericks: test fixtures are kinda half-baked
16:15technomancyI mean, they're implemented as a monkeypatch, so they do as well as you can expect, but there's still weirdnesses
16:15sdegutistry nevermore
16:15sdegutisits fixtures are designed to be more sane and easy and flexible
16:16sdegutishttps://github.com/sdegutis/nevermore#fixtures
16:16rlbtimvisher: (future ...) should be one way.
16:16sdegutis</plug>
16:16technomancygfredericks: oh
16:16technomancyI just realized what you were suggesting
16:16technomancyso it could be done without a monkeypatch
16:16technomancyclever
16:20timvisherrlb: that works. thanks! :)
16:21gfrederickstechnomancy: the test fixtures in clojure.test don't seem to be a monkey patch
16:21gfredericksthey're just run outside of test-var
16:21gfrederickstechnomancy: the main reason I'd be hestitant to remove the :test metadata is since it's a global side effect
16:21gfredericksit could be reversed (though no reason to 99% of the time)
16:21gfrederickscould also be moved to an alternate key like :removed-test just in case
16:22gfrederickscome to think of it though this would require enumerating all the vars, which the current approach avoids
16:24gfredericksclojure.test just uses ns-interns, so not too hard
16:24gfrederickswe could hook around test-ns instead and do it at that point
16:30technomancygfredericks: sorry, selectors are a monkeypatch
16:31stuartsierraDo people keep trying to work around clojure.test because they don't know how to fix it?
16:31gfredericksit seems to preclude the 80% use case though
16:32technomancystuartsierra: I could fix the code; getting it accepted upstream just isn't worth the trouble.
16:33stuartsierratechnomancy: I might be able to help with that, if you're at least willing to submit a patch.
16:33gfredericksare we talking about fixing something in particular, or something starting with design work?
16:33dakronestuartsierra: plus, getting it accepted into clojure.test means waiting another 6-18 months for the next clojure release to use it :P
16:33technomancyyeah, at least the monkeypatches work retroactively
16:33clj_newb_2345what's a good library to read for writing peg parsers in clojure?
16:33stuartsierraI can't do anything about the release cycle.
16:34clj_newb_2345phrased another way: what's a readable library for peg parsing code?
16:34gfredericksstuartsierra: I don't mind putting work into contributing, I just assume that the design phase is difficult
16:34stuartsierraBut seriously, if something about clojure.test inhibits tooling, fix it and submit a patch.
16:35amalloytechnomancy, gfredericks: this discussion is a bit out of my depth, but it sounds like you might be talking about the same issue as http://dev.clojure.org/jira/browse/CLJ-866
16:36gfredericksamalloy: yeah that would give a much more obvious hook point
16:36gfredericksso this has been patched for 9 months now?
16:37gfredericksnot tested I guess
16:37gfredericksso I can work on this
16:38gfredericksthere doesn't seem to be an obvious way to handle the :once fixtures
16:43_weitrying to use lib-noir's flash and session, is there some kind of setup beyond wrapping the handlers? looks like *noir-session* is unbound.
16:46gfredericksI think clojure.test runs them regardless of whether there are any tests to run around
16:46gfredericksmaybe the nicest thing would be the ability to exclude entire namespaces of tests
16:46gfredericksthat would take care of the :once case nicely
16:48coventryShould lein-ritz come with the JDI, or do I need to install that separately (on ubuntu 12.04)? "lein ritz" is failing with a ClassNotFoundException, and I think the relevant line in the backtrace (http://pastebin.com/nbufapG8) may be "at ritz.jpda.jdi$eval277.invoke(jdi.clj:1)". In case it's relevant, my ~/.lein/profile is at http://pastebin.com/fZyGWkGt
16:48noncomztellman: hi! today been trying to uberjar my project and it hanged forever. then i found a post where it was said that there was a non-daemon thread while evaling lamina.. and an advice to revert to an older version, somthing like 2.1... i did that and it worked... so now, in aleph 3.x-rc there is again this problem?
16:49ztellmannoncom: I don't think that's a problem, I create uberjars with aleph/lamina regularly
16:49ztellmanit is, however, pretty slow
16:49noncombut that really strange, i did as it was said in the instruction and it worked just in like 10 seconds.. with 3.x-rc i waited for 30 minutes..
16:49amalloyfwiw i just made an uberjar out of aleph/master and it took like six seconds
16:50noncomhmmmm
16:50coventryAh, I think I need to install the jdk. https://github.com/pallet/ritz/issues/28
16:50noncomvery strange...
16:50ztellmanhaha, yeah, 30 minutes is a bit long
16:50ztellmancan you post a gist with your full list of dependencies?
16:50noncomyes, wait
16:50ztellmanalso, what version of lein are you using?
16:50amalloyztellman: i'd be inclined to say it's something in his project, not the dependencies
16:50akurilinIs there a way to conj nothing to a collection? Conjing nil adds a nil to it, I'm wondering if there's a way of making conj do nothing.
16:51amalloyakurilin: don't call conj :P
16:51gfredericks,(conj [])
16:51clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$conj>
16:51akurilinamalloy, would I have to reduce in this case?
16:51ztellmanamalloy: I tend to agree, I just want to make sure there's nothing obviously wonky
16:51amalloyakurilin: question is far too broad and ill-specified. god knows
16:51gfredericksakurilin: your question is pretty weird
16:52amalloygfredericks: i imagine he's doing something like (-> xs (conj (when whatever (something else)))) and wants to skip the conj step
16:52ztellmanakurilin: you maybe want concat?
16:52amalloybut he hasn't given nearly enough detail to know
16:52akurilinI'm trying to build a list by recursing through a tree.
16:52ztellman,(concat nil nil)
16:52clojurebot()
16:52amalloyakurilin: probably mapcat, then
16:53akurilinA list of nodes that match a certain predicate.
16:53noncomztellman: https://www.refheap.com/17067
16:55ztellmannoncom: it's possible quil has some non-daemon threads, but I don't know why tweaking the aleph version would have any effect
16:55noncomalso there is a load of *.jar files in the lib folder, but they seem to be no issue, as the single change of aleph version fixes the hang...
16:55noncomztellman: allright, i will investigate into this further and let you know
16:55ztellmanmake sure you run 'lein clean' before uberjar
16:55amalloytechnomancy: a heretic! ^
16:56llasramMore like `lein unclean`
16:56ztellmanhaha, maybe I'm the only one who's been bit by not running clean, but I definitely have
16:56technomancyamalloy: there are definitely cases where it's necessary, but those cases are bugs in lein
16:56technomancyI think 2.3.0 will squash a lot of them
16:57amalloyztellman: i have too. AOT really introduces a lot of tricky issues
16:57technomancy(modulo crazy protocol stuff)
16:57ztellmantechnomancy: glad to hear it, but I'll probably hold onto my voodoo regardless
16:57amalloyit's just technomancy gets sad anytime someone runs lein clean
16:57technomancyamalloy: it reminds me of my own failings
16:57amalloyyeah, i just realized the only reason for me to bring it to your attention would be if i like seeing you sad
16:58technomancyhaha
16:58technomancyclojurebot: lein clean?
16:58llasramOr to guard him against hubris
16:58clojurebotlein is not clojure
16:58technomancyhmm
16:58llasramAs the servant whispering in the ear of a Roman general on the day of his Triumph
16:58llasramRemember: your code too has bugs
16:58ztellmantechnomancy: Camus said that Sisyphus was happy, so cheer up
16:59technomancy(defproject [...] :memento :mori)
16:59hyPiRionEven king Leonidas had off-by-one errors.
16:59technomancyclojurebot: lein clean is usually the equivalent of taking out the NES cartridge, blowing in it, and reinserting it.
16:59clojurebotIn Ordnung
17:00bbloomtechnomancy: that totally works. don't ruin my childhood
17:00clj_newb_2345instaparse is amazing
17:00amalloytechnomancy: well, that procedure actually did help. not because of the blowing, but because of the removing and reinserting
17:00bbloomclj_newb_2345: yeah, it's pretty damn good
17:01leifw"<amalloy> technomancy: well, that procedure actually did help. not because of the blowing, but because of the removing and reinserting"
17:01amalloy*chuckle*
17:01technomancybrb changing desktop background to http://www.wga.hu/art/b/bocklin/selfport.jpg
17:02amalloyleifw: i'll take "NES or NSFW" for $500
17:02technomancyamalloy: sometimes `lein clean` helps because people do it and then restart
17:02amalloyrestart what?
17:03technomancythe repl or whatever
17:04Raynescallen: Here, have some Elixir for turning git repos into git submodules: https://www.refheap.com/17069
17:04ztellmanstill waiting for 'lein unslime'
17:06clj_newb_2345hmm, how do I say "arbitrary character" in instaparse?
17:06noncomi've cut out quil and all that relates to it and the aleph is the 2.1 version and now it hands again, so that wasn't the problem..
17:06noncomahh i hoped that was a simple solution but no
17:07ztellmannoncom: it almost certainly is a non-daemon thread, if you run jstack on the compilation process you might be able to figure out which thread it is
17:07ztellmanand if you're extra lucky, it will have a name that reveals where it came from
17:08ztellmanbest of luck, I've been down this path before and it's not fun
17:08nDuffclj_newb_2345: #'.'
17:08clj_newb_2345nDuff: looking at the docs, this is by using #'' to specify a regex, and the "." is interpreted as the regex "anything" ?
17:08amalloyztellman: bet you a dollar it's clojure-agent-send-off-pool0, or whatever their naming scheme is
17:08nDuffclj_newb_2345: exactly.
17:09technomancycouldn't you decorate the Thread class with some crazy bytecode thing to log its creation?
17:09noncomztellman: good idea! what puzzles me though - how i got uberjar built for several times, right after aleph version change? if that wasn't the reason then what could it be? omg..
17:09noncomok, i'll go research more!
17:09ztellmantechnomancy: I'd alter-var-root the Clojure entry points first, that sounds easier
17:09technomancyright; that'd be quicker
17:10ztellmannoncom: for reference, those are send and send-off
17:10technomancyfuture and agent
17:10technomancyerr
17:10ztellmanand future, right
17:10noncomthanks!
17:10amalloytechnomancy: i don't think you can easily change how arbitrary threads are created
17:10amalloyyou'd have to change the threadfactory of the threadpool you're interested in, or similar
17:10technomancyamalloy: what about with a -javaagent?
17:11technomancysupposedly lets you instrument arbitrary classes
17:11amalloylord, i dunno
17:11amalloyprobably, agents can do anything. but it doesn't sound easy
17:12clj_newb_2345with java regex, is ther anyway to have a "." that can also match vs "\n" ?
17:12amalloy$google java regex flags
17:12lazybot[Lesson: Regular Expressions (The Java™ Tutorials > Essential ...] http://docs.oracle.com/javase/tutorial/essential/regex/
17:12glosoliHmm hey folks, I am a bit struggling with NREPL in Emacs, I have jacked it in , and I am curious how could I Load my current buffer to make all his functions accessable by nrepl buffer, or this is wrong ?
17:13clj_newb_2345hmm, apparently I need to enaable DOTALL
17:13clj_newb_2345or use ?s
17:13technomancyglosoli: C-c C-k to compile; C-c C-n to switch the repl to the right namespace
17:14technomancyI think the readme covers this?
17:14pbostromC-c M-n to switch ns
17:16noncomtechnomancy: how can i make lein to include everything that is in resource-paths into the uberjar?
17:16glosolitechnomancy, pbostrom thanks :)
17:16clj_newb_2345Dotall mode can also be enabled via the embedded flag expression (?s). (The s is a mnemonic for "single-line" mode, which is what this is called in Perl.) <-- how do I embed a ?s intoa regex?
17:17llasramclj_newb_2345: It's a literal `(?s)`, like `#"(?s)."`
17:18clj_newb_2345llasram: worked; thanks!
17:18technomancynoncom: you don't need to do anything
17:19justin_smith,(re-find #"(?s)." (str \newline))
17:19clojurebot"\n"
17:19justin_smithit matched!
17:19noncomso, if it did not happen then there was some error somewhere?
17:19ztellmanamalloy technomancy: I think you could just instrument allocation with yourkit and look for where threads are being created
17:19ztellmanI dunno how easy it is to do that automatically on a lein task
17:20technomancy:java-agent support was just added in 2.2
17:21noncomis it possible to compile a program with leiningen, where the entry point is not in a clojure namespace, but in a java class?
17:21technomancynoncom: an uberjar or lein run?
17:21poppingtonictechnomancy: I'm getting weird problems with my leiningen installation process, again: http://pastebin.com/DbU5VPF4
17:22noncomtechnomancy: both?
17:23technomancypoppingtonic: pretty weird. I don't know why your curl can't connect to S3 other than having a weird CA store
17:23technomancynoncom: lein run supports it. not sure about uberjar.
17:23technomancynoncom: tias?
17:23coventryI've installed openjdk-7-jdk on an ubuntu 12.04 machine. The tools.jar it provides contains com/sun/jdi/VirtualMachine, according to "jar tf", but "lein ritz" is failing with a "ClassNotFoundException: com.sun.jdi.VirtualMachine". How do I point lein at this jar file?
17:24noncomwhat is tias?
17:24technomancytry it and see
17:24technomancy
17:24technomancyclojurebot: tias is try it and see
17:24clojurebotIn Ordnung
17:24noncomah, right :)
17:25poppingtonictechnomancy: How do I fix the CA store? Isn't that s3's job?
17:25technomancypoppingtonic: it's up to your OS to provide a certificate store with which curl can verify its connection to S3
17:26clj_newb_2345is there a way to force instaparse to be greedy?
17:26technomancybut the error message has a description of how to turn off certificate verification if you don't care
17:27coventryOh, stracing it, lein appears to be using java 6. I will try that jdk.
17:28coventrySuccess!
17:29poppingtonicHmmm.
17:29poppingtonicBy turning off certification, I lose automatic proof-of-security
17:30nDuffpoppingtonic: whether it's S3's job depends on who's at fault here. If your OS is up-to-date, and actively supported, it should have a current CA list.
17:30poppingtonicSo I'll have to do it myself. Where can I get leiningen-2.0.0-standalone.jar's .asc file?
17:31nDuffpoppingtonic: if you're running an OS that no longer gets updates from its vendor, it's not uncommon for that list to fall behind.
17:31poppingtonicI believe Ubuntu 12.04 LTS still enjoys support.
17:32technomancypoppingtonic: I think you just append .asc to the jar's URL?
17:32nDuffpoppingtonic: ...so, I haven't actually seen the error, since you pasted it on that place full of ads.
17:32nDuffpoppingtonic: it'd be interesting to know the details -- could be your system clock is way off, for instance, and that the certificate is playing expired for that reason.
17:33poppingtonicMy system clock deviates from time to time, which seems to be a pervasive problem with Ubuntu..
17:33poppingtonicBut it's running properly afaict
17:34llasramAre you running ntpd?
17:34technomancyyeah, "unknown ssl error" might not be a certificate problem; those are usually more specific with the error messages IIRC
17:34poppingtonicyep, but not as daemon.
17:34technomancypoppingtonic: just confirmed re: the .asc file
17:35poppingtonicso I just append .asc to the url?
17:35technomancyyeah
17:35poppingtonicnDuff: what alternative paste can you suggest?
17:36nDuffpoppingtonic: refheap.com, gist.github.com, ix.io, sprunge.us
17:36nDuffpoppingtonic: the first of those is written in Clojure, so using it is dogfooding somewhat.
17:36poppingtonictechnomancy: got it.
17:37technomancypoppingtonic: does wget fail too?
17:37nDuffpoppingtonic: you'd also get more useful details by using, say, openssl s_client -connect hostname:443
17:37clj_newb_2345dumb question: how does parsec and packrat differ?
17:37clj_newb_2345(for parsing)
17:37nDuffpoppingtonic: ...which would give you a dump of the SSL negotiation and some actual details in terms of why validation failed.
17:38technomancyI'm curious as to why it failed, but I don't know a lot about debugging SSL
17:38technomancyjust that an outdated CA store is the most common source of problems we've seen historically
17:39poppingtonicis s_client a variable or a flag to openssl? I havent used it for anything other than md5 hash checking.
17:39poppingtonicoh, seen the man.
17:39nDuffpoppingtonic: subcommand.
17:43nDuffHas anyone looked at how separable Pedestal's FRP model is from the rest of the framework?
17:43callenRaynes: does Elixir have something nicer than ports in its stdlib or something?
17:43Raynescallen: No.
17:43Raynescallen: Why do you ask?
17:43RaynesOh, System.cmd
17:43poppingtonicnDuff: I get "connect: Connection refused \n connect:errno111"
17:43RaynesYeah, that's a wrapper around Erlang's os:cmd, which is basically clojure.java.sh without the ability to do… well anything.
17:43RaynesIt just happened to be good enough for this purpose, callen.
17:43poppingtonic*errno=111
17:44nDuffpoppingtonic: well, there you are -- it's not a SSL negotiation failure, it's a TCP connection failure.
17:44callenRaynes: I was just curious. I write a lot of glue code similar to what you end up doing, so it's a subject dear to my heart.
17:44Raynescallen: true_droid is writing https://github.com/alco/goon
17:44RaynesBecause of my issues with Erlang's ports.
17:44poppingtonicstuff of the gods
17:45callenRaynes: it's Golang.
17:45RaynesIn other news, the discussion I started on the Erlang mailing list has turned into a nice big wank fest between PhDs and such.
17:45Raynescallen: Yeah, but it was either Golang or C or <insert natively compiled language here>
17:45poppingtonicheh
17:45amalloytechnomancy: well, "connection refused" is a big hint; i don't think he has errno 111 memorized
17:45amalloyfun as it would be to build up a whole mythology around nDuff
17:45technomancyamalloy: oh, I only saw the second line
17:46callenRaynes: should've used Rust with Elixir for maximum hipster-hood.
17:46Raynescallen: :p
17:46poppingtonicbut really, errno 111 does mean "connection has been refused".
17:48poppingtonicI think I like refheap already :) /dogfooding
17:49callenRaynes: I'm actually half serious about that.
17:49Raynespoppingtonic: :D
17:50Raynescallen: I think true_droid actually likes Golang for some reason though.
17:55callenRaynes: sad-face :(
17:55poppingtonicWhat's the state of Clojure on Android these days?
17:56callenpoppingtonic: not a fantastic idea, not likely to change.
17:57nDuffpoppingtonic: ClojureScript is probably practical for use. Clojure, not so much.
17:58gfredericksI don't know anything about android and am curious what the issue is; memory usage?
17:59bbloomgfredericks: my guess would be startup time
17:59nDuffgfredericks: that's part of it -- garbage collection isn't particularly great there, and clojure relies a great deal on GC performance.
17:59bbloomgfredericks: startup of clojure involves compilation & a lot of stuff
17:59poppingtonicpartly. iirc, the install files get massive due to needing to carry the entire clojure jarfile together with your app.
17:59poppingtonics/carry/bundle
17:59bbloomcljs is a bit different b/c the clojure is precompiled to javascript, but then you still need to load & compile that javascript
18:00bbloommight help if you ahead-of-time compiled all of clojure.core etc, but that would mean you'd lose eval & all the fun dev stuff on the device, so you'd only want that for deployment
18:01poppingtonicbbloom: that doesn't seem like such a big problem, considering phonegap/apache-cordova does something similar.
18:01bbloomthose do javascript tho, right?
18:01poppingtoniconly, cljs goes one level higher.
18:02bbloomjavascript compilation is lazy & heavily optimized
18:02bbloomclojure compilation on startup is eager & there is no tree shaking or anything like you get with cljs via gclosure
18:03poppingtonicbbloom: it's the same project, it just has different names for different versions, when the project was taken up by the apache guys.
18:03poppingtonicand girls.
18:03bbloomit's a js framework tho, right?
18:03poppingtonicyep. js->android/ios/symbian
18:04eggheadbut doesn't it just use the js instead of a web container ors omething
18:04eggheadinside*
18:05eggheadI know some people are using cljs to good effect on mobile
18:05eggheadhttp://theweathertron.com/ is one that comes to mind
18:09poppingtonichmmm...looks good
18:10dnolenegghead: iOS 7 will ship with a JSC bridge
18:10dnolenso scripting native apps and thus CLJS shouldn't be very difficult
18:12poppingtonicStill leaves me to wonder why I'd want a repl in my (hypothetical) iPhone. Except for the sheer cool, of course.
18:12bbloompoppingtonic: would be absurdly useful for debugging :-)
18:13bbloomeverything needs an evaluator and a repl server!
18:13dnolenseems like Android still needs to get it's act together with a "native" JS bridge that doesn't involve a WebView?
18:14hiredmanbbloom: clojure.core is aot compiled in the clojure jars last I checked
18:14poppingtonicIf I could jack in my local repl to someone's phone in real-time, and fix a bug/run a stack trace, that'd be phenomenal!
18:14hiredmanor maybe that got split in to a different jar or something
18:14bbloomoh, ok
18:15technomancyhiredman: isn't -slim the one that leaves out AOT?
18:15hiredmantechnomancy: maybe?
18:26glosoliDo you people use some package for indentation on Emacs ?
18:28poppingtonicglosoli: auto-indent-mode
18:28glosolipoppingtonic: So like never indenting manually using tabs ?
18:30coventry`Is it possible to get jump-to-source in the nrepl-ritz break-on-exception window to jump to the java sources, too, for frames in java code?
18:30llasramglosoli: Try hitting `C-j` instead of `Enter/Return`. If that works, then you just need to remap some keys
18:31poppingtonicglosoli: yeah. However, my clojure-mode autoloads Fill mode and Paredit, which do the same thing. Paredit, I believe, is what handles the indentation.
18:31llasramglosoli: Most modes have their own mode-specific auto-indent. It's just that somewhat archaic Emacs standards require Enter/Return be just a bare newline, and auto-indenting newline is on C-j
18:31glosolillasram nah C-j as Enter just creates new line
18:32glosoliaa
18:32llasramHuh
18:32glosolillasram: sorry got confused
18:32glosoliKinda new to the Emacs world
18:32glosoliis there some way I could open docs on the selected symbol ?
18:33llasramWith nrepl.el, C-c C-d. You can hit `C-h m` in most modes to see a list of what they provide
18:33poppingtonicare you using nrepl.el?
18:33glosoliKinda similar functionality I was having in vim, when I put cursor on smth like: conj and press Shift+K it opens docs in the buffer
18:33glosolipoppingtonic: Yeah I am
18:33poppingtonicwhat llasram said
18:35glosoliaah works fine, ok thanks!:)
18:36glosolithanks for the help again and good night
19:20justin_smitha) what the hell javax.imageio/ImageIO/read cannot handle cmyk jpeg
19:21justin_smithb) what the hell there is cmyk jpeg?
19:26brehautjustin_smith: i was even more surprised to discover that photoshop would save all kinds of crazy specific extra data in a jpeg, like all the guides and paths
19:26Raynesbrehaut: YOU.
19:27justin_smithbrehaut: but at least the presence of that data does not break my auto-image-optimization lib :)
19:27brehautjustin_smith: well no, but it is still bananas
19:27justin_smithtrue enough
19:27TimMcIt also stores your geographic location and the last 5 pages in your browser history.
19:27TimMcThe pages, not just the URLs.
19:28brehautTimMc: that explains the bloat when not 'saved for web'
19:28TimMcYeah, the default is "saved for NSA".
19:30brehautvaguely related http://i.imgur.com/svyjbZr.jpg
19:31brehaut(the new zealand government's response to prism etc is 'fuck em, lets just make it legal')
19:32TimMcD-:
19:32TimMcUnfortunately, it's legal in the US as well -- unconstitutional, but legal.
19:34TimMcBah, I need to get a new shell server so that I can keep IRC open in lurk mode.
19:35clj_newb_2345http://www.infoq.com/presentations/Parser-Combinators is worth the time it takes to view it
20:17akurilinSay I have a very small table in the DB that will never change while the app is running that I need to reference pretty often from the business layer. Is the easiest way to cache it to just memoize the DB call to fetch the contents of that table?
20:18RaynesIt's pretty hard to beat that level of easy.
20:18callenakurilin: yes
20:19callenakurilin: well, *EASIEST* is paying somebody else to write (memoize …)
20:19akurilinBasically I just want to save on DB round trips. Is memoize a good fit for that case?
20:19akurilincallen, ;)
20:19callenakurilin: if it's small, yes.
20:19callenakurilin: and if liveness isn't a concern.
20:20callenI've used thread-global timestamps to trip caches before.
20:20akurilincallen, yes. It's not going to change, but I still need to join against it in a few queries so I can't just move it in a .json somewhere and parse it at boot.
20:21akurilincallen, Raynes, thanks for confirming, gentlemen.
20:43callenRaynes: I like the new picture. Happy.
20:43Raynescallen: What new picture?
20:44coventry`What do I put in ~/.lein/profiles.clj to get the bleeding-edge ritz debugger? The README.md mentions SNAPSHOT, which doesn't work, nor does 0.7.0-SNAPSHOT, and the tags in the git repository only go to 0.6.0.
20:45callenRaynes: github!
20:45RaynesStalker.
20:45callen :(
20:45callenRaynes: I was pointing a friend to your tentacles library.
20:46Raynes:p
21:10timvisheri'm trying to get an nrepl session connected to a piggiebacked clojurescript browser-repl.
21:11timvisheri've got a cemerick.piggieback/cljs-repl listening on :9000 and the browser is connected to it
21:11timvisheri validated this by `(js/alert "Ohai")` from the console and the alert indeed does appear in the browser
21:12clj_newb_2345maybe I'm an idiot. I tried parsatron and instaparse -- is there any _fast_ clojure parser ?
21:12clj_newb_2345it should not take seconds to parse 1000 lines of code
21:12timvisherthe nrepl server is listening on port 56249 and i can connect to it via `nrepl` from emacs
21:12timvisherbut at that point i can't interact with clojurescript at all, it would seem
21:12timvisheram i doing anything obviously wrong?
21:12timvisherproject source here: https://github.com/timvisher/bible-plan
21:13arohnerclj_newb_2345: I don't think so. Last time I tried ~2 years ago, the fastest parser for me was lexing w/ regex, then recursive descent
21:13clj_newb_2345arohner: yeah, I feel like some of the techniques (like parsec) is really cute in buildling up things out of characters --- but at the end of the time, I'd prefer to use Java's regex (probably highly optimized) to find tokens rather than creating a closure for each function to trampoline into for each character
21:14bbloomclj_newb_2345: have you tried the "parses" (note, not "parse") function on your grammar with instaparse?
21:14bbloomif your grammar is highly ambiguous, that might be causing some slowness
21:14timvisherthe workflow i'm trying to support is interacting with the browser repl in the same way i'm used to interacting with the clojure repl by editing a source file, loading it, `C-x C-e`ing functions and expressions, etc.
21:14timvisheri could be barking up the wrong tree
21:14clj_newb_2345bbloom: that's what I don't like about instaparse -- I couldn't find how to force it to do peg style parsing, where I specify preferences; furthermore, I want * to be greedy, whereas instaparse seems to be "we consider it a feature to give you all possible parsess rather than the most greedy one"
21:14arohnerhrm, looks like instaparse didn't exist (or wasn't mature) when I last needed a parser
21:15bbloomclj_newb_2345: the docs discuss "peg extensions"
21:15clj_newb_2345bbloom: yeah, but it's more like "we'll steal a few features" ... but no way to make * greedy
21:15bbloomclj_newb_2345: however, generalized CFG parsing w/ ambiguity has the wonderful property that it closed under union, which no subset of CFGs, especially not pegs, support
21:16clj_newb_2345bbloom: I'd prefer something more limited that I can iterate on
21:16clj_newb_2345I'm half tempted to take https://github.com/youngnh/parsatron ... and hack regular expressions into it (rather than creating a closure for each character consumed)
21:17clj_newb_2345then there's https://github.com/ericnormand/squarepeg .. which I'm not sure if it has a theoretically sound foundation
21:17clj_newb_2345maybe I should stop bitching and write yet another clojure parsing library :-)
21:17coventry`Is there a debug mode for nrepl which logs the communication between the processes? nrepl-ritz-line-breakpoint seems to fail silently.
21:19technomancycoventry`: yeah, `lein help sample` will show you a logging middleware as an example
21:19technomancynrepl middleware
21:19timvisheri swear i'm the only one who doesn't like interacting directly with the repl
21:20timvisherevery tutorial i can find all talks about merrily typing into a readline process
21:20timvisherdo you then manually copy and paste code into your source files when you're done with them?
21:20timvisher:\
21:23callentimvisher: my REPL lives in Emacs.
21:24callentimvisher: it's a workflow you develop and personalize over time, a REPL is not something whose benefits are immediately apparent to everybody that tries them.
21:24callenkind of like beer.
21:24timvishercallen: meaning that the process is under emacs or that you develop at the repl in emacs and then copy and paste the code into a file when you think it's ready?
21:25callenthere's an nRepl process running, then nrepl.el is the client.
21:26timvisherthat's what i'm used to in POC. I start up an nrepl server (either via `lein repl` or `C-c M-j`) and then edit my source files, sending their contents to the REPL in various fashions.
21:26callenhum.
21:26callenI generally live in the REPL, the source files are secondary.
21:26timvisherI can't seem to set up that work flow in Clojurescript. Trying to get piggieback working.
21:27callenthere's a lot of browser REPL stuff that the serious CLJSers seem to like.
21:27callenthey're probably like me.
21:27timvisherso you then copy and paste your source code out of the repl into source files?
21:27timvisherhave you ever had emacs crash while you're working on something?
21:28callenit's a continuous process and it's bidirectional
21:28clj_newb_2345input: (s: string), (o: int, representing an offset), (r: a regular expression) -- given the above, what is the most efficienct way to see if there is a match for r in s.substring(o) ?
21:28timvisherthe thing i hate about developing at the repl is that it generally is a subprime editing environment and if emacs crashes i've lost what i've been working on as it's not in a file that I can save
21:28callenif I'm editing an existing function, I'll just eval it and work with it in the REPL
21:28clj_newb_2345s is a long string, and I'd prefer to avoid constructing new strings if possible
21:28callennew development starts in the REPL and gets migrated to the source file in chunks.
21:28callentimvisher: my repl is in emacs.
21:28callentimvisher: it's an editing environment isomorphic with my source file editing env.
21:29timvisherone day someone will pair with me and i'll have my mind blown by that workflow's effectiveness. :)
21:30timvisheri've only ever experienced the ecrd cycle and the style of interactive development i now use
21:30clj_newb_2345callen: where can I read about this magical repl work flow you have?
21:30callenanywhere a Lisp + Emacs user brags on their blog.
21:31callenI started in CL.
21:31clj_newb_2345n/m, I use vim
21:31callentimvisher: pairing is really the way to go.
21:31callenclj_newb_2345: well then you're fucked regardless.
21:31timvisherso is there any way to have nrepl.el connect to the clojurescript repl?
21:31callentimvisher: for learning new workflows anyway.
21:31callentimvisher: piggieback.
21:32timvisherapparently connecting to the port that nrepl listens on doesn't drop you into the clojurescript process, and 9000 isn't an nrepl server.
21:33timvisherdo you have any particular posts that talk about why it's better to edit in the repl and move the code to a source file and change the source code a litle in the file and send it the repl and then move the code back to the repl and edit it a little more and then move it back to the source files?
21:33coventry`technomancy: Thanks. I'm trying that clause out.
21:34timvisheri've read a lot of lisp and emacs blog posts but i don't think i've seen any that talk about that
21:34timvisherevery one seems to just take it as read that if you're developing lisp you are typing at the repl
21:35timvisherwithout ever considering that you can interact with the repl via the source files
21:41cemerickclj_newb_2345: vim is capable of providing a quality REPL experience. vim-fireplace is a great start.
21:41clj_newb_2345cemerick: I'm using vim-fireplace together with clojure.tools.namespace
21:41cemerickyou're on the right track, then
21:41clj_newb_2345cemerick: however, I recently playing with pedestal, and it just blew my mind away
21:41clj_newb_2345the fact that in dev mode, a url request will _recompile my clojure code_
21:41clj_newb_2345that is something else for a workflow
21:42cemerickheh, I didn't realize that
21:42cemerickSounds...problematic. :-P
21:42timvishergot it! the trick is to start the repl like normal (in my case `C-c M-j`) and then from the repl _inside_ emacs, evaluate the magical cemerick.piggieback/cljs-repl incantation and _then_ nrepl.el is in the browser magic
21:42cemerickreminds me of JSPs, though that's not as much of an insult as it probably sounds like
21:43timvisherthe problem was that i was evaluating the server stuffus in the repl that i was creating at the cli and _then_ trying to connect to the server via nrepl.el
21:43veckonanyone have any sagely advice/best practice on preserving metadata on a collection after a sort? For some context - here's a simple gist which illustrates what I'd like to be able to do: https://gist.github.com/aamedina/6127733.
21:52gfredericksseancorfield: ping
22:01gfredericksveckon: afaict you don't need these to be macros
22:01gfredericksbut I'm not quite getting what you're trying to do
22:01gfredericksI just know those macros aren't doing anything macrolike
22:01nooniancant you just (let [meta-data (meta col)]... and then at the end return the col with the meta data?
22:02clj_newb_2345trampoline is awesome
22:03timvishercemerick: i'm trying to debug why i need to manually call `clojure.browser.repl.connect.call(null, "http://localhost:9000/repl&quot;)` from the browser console after loading up this page in order for the long poll to take effect. https://github.com/timvisher/bible-plan/blob/master/src/cljs/piggieback_browser.cljs
22:03clj_newb_2345so simple too; I really like how thtat "the jvm lacks tail recursion" can be solved by a few-line function
22:03gfredericks"solved"
22:04veckonI don't *need* the macros, I'm just experimenting with syntax for interacting with channels in a UI.
22:04timvisherthe piggiebacked brepl is listening on 9000, it's running under emacs, and then i load the page and i see a GET to /repl and a POST to repl which immediately returns and then no subsequent long poll commences.
22:04veckonAnd noonian - yeah, that would be nice. But sorts return a funky type
22:05timvisherhowever, once i run the .connect call directly in the browser, the long poll starts up just fine.
22:05cemericktimvisher: I believe that's to be expected. I template in a similar call in my app's main page. The piggieback-browser namespace turns into a javascript "module" that needs to be required in order for its top-levels to be evaluated.
22:05timvishera hah. interesting that the log functions are executed.
22:05cemericktimvisher: do you see the Ohai's?
22:05timvisheryes.
22:05cemerickhum
22:06cemerickwell, that shoots a hole in my theory, then :-P
22:06cemerickI've been adding a call to connect since forever. Perhaps there's an easier way, but I've not bothered to find it yet.
22:06timvishersuppose this would be useful as well https://github.com/timvisher/bible-plan/blob/master/resources/public/index.html
22:07timvisheri am indeed requiring that namespace
22:07cemericktimvisher: yeah, I'm stumped
22:08cemericktimvisher: go ahead and template in that call :-P
22:09timvisherwhat's even more odd is that when i execute that call manually, the exact same sequence of HTTP requests are made except that there is a tpc-check.html being requested between the GET and the POST in the first one and in the second the happen directly consecutively.
22:09timvisherlol. i'll give that a try
22:09veckonSo the problem is: sorts return an array in cljs. Arrays apparently don't implement IWithMeta. That was my problem.
22:09veckonExtending it solves it for me
22:16timvishercemerick: no idea why this works, but the problem seems to have been that i was requiring the piggieback namespace. i should specify, i guess, that i'm building the piggieback.js file via `cljsbuild once`. Maybe that has something to do with it? anyway, removing the require now connects just fine.
22:16timvisher
22:17timvisherhttps://github.com/timvisher/bible-plan/blob/master/resources/public/index.html and https://github.com/timvisher/bible-plan/blob/master/src/cljs/piggieback_browser.cljs are all that seem to be necessary.
22:18timvishernight night folks. happy coding!
22:18cemericktimvisher: wait, removing `goog.require('piggieback_browser');` fixed it?
22:20veckonI ran into a similar problem with piggieback when the goog namespace was munged by the compiler.
22:26seancorfieldgfredericks: you rang, sir?
22:28fowlslegsIs there anyway to specify that you want variable arguments to the #() reader form represented by %& not to be group into a clojure.lang.ArraySeq before being processed by your #() form?
22:32xeqifowlslegs: what are you trying to do? I thinking `apply` might be useful here
22:32amalloyfowlslegs: that sounds like a confused question. go back a step; why do you want that?
22:32fowlslegsFor example what if I want (#(f %&) a b c ...) to return (f a b c ...) instead of (a b c ...)
22:32fowlslegs?
22:32amalloyindeed, #(apply f %&)
22:33amalloyof course in this simple case you could just replace the whole thing with f; i assume you have a better usage in mind
22:35squidzwhat are messaging libraries like zeroMQ usually used for?
22:38fowlslegsWhy am I even asking this? This is some tiredness-induced irony. I just used that method to solve one of the 4clojure problems amalloy.
22:38echo-areacemerick: What inspired you of the maze programs in your book? Were they the first choice?
22:38fowlslegsVery cool site by the way.
22:38fowlslegsAnd yep, problem #39: Interleave Two Seqs.
22:40amalloyfowlslegs: (fn [xs ys] (mapcat list xs ys)) is a nice simple solution, fwiw
22:40amalloyworth studying if it doesn't make sense
22:41cemerickecho-area: First, all credit for the mazes goes to Christophe. :-) It's a great (i.e. not-boring, atypical) demonstration of data structures, generalized polymorphism, etc.
22:42echo-areaSure. And using that for the zip usage is also seamless
22:43echo-area*for demonstrating the zip usage
22:46fowlslegsamalloy: Yes, I used #(apply (partial mapcat list) %&), but mapcat list was all that was really needed.
22:49squidzlynaghk: I was asking because I saw your code using core.async together with zeroMQ
22:51amalloyhuh, someone found a 28-line solution to "interleave two sequences"
22:56bbloomsurely they didn't handle all of the special cases
22:57amalloybbloom: looks correct to me, actually
22:57amalloyas of course it would be since 4clojure's test cases always provide 100% test coverage...
22:57bbloomi was kidding… link?
22:57amalloyhttps://www.refheap.com/a8974c7703ff09ac729ab0846
22:58amalloyand yeah, of course you were kidding. but it was a fun read
22:58bbloomheh
22:59bbloomi had "#(mapcat vector %1 %2)" …. just changed that to "mapcat vector"
23:00bbloom:-)
23:03coventry`technomancy: For me, that nrepl-middleware snippet from 'lein help sample' (to log nrepl IPC) is causing nrepl to hang while trying to connect to the server. Is it working for you? (Here is the project.clj including the snippet: http://pastebin.com/Wjf2bBgs).
23:04gfrederickstechnomancy: is it bad for leiningen to use clojure functions added in 1.3?
23:05gfredericksin the in-project code
23:09amalloybbloom: mapcat list!
23:10amalloygfredericks: i think anyone still on clojure 1.2 is probably not running leiningen master
23:10amalloythough of course that's up to technomancy
23:11bbloomamalloy: playing golf? or is there some advantage to lists here over vectors?
23:11gfredericksyou might have an old hairy project you're afraid to upgrade
23:11amalloywell, a two-element list is cheaper to create and cheaper to iterate
23:12amalloyno *huge* advantage, but a better habit to be in IMO, especially in a context where the only thing that will ever be done on the output is call seq
23:12amalloygfredericks: ask hiredman what version of lein clojurebot uses
23:14gfrederickshiredman: what version of lein clojurebot uses
23:20hiredman2?
23:20clojurebot2 is mark
23:20gfredericksand clojurebot is on pre 1.3?
23:21hiredmanthe lion's share
23:22hiredmanbut the part keeping it on 1.2.1 has been split off, so at some point I can upgrade
23:23gfredericksso if `lein test` started breaking because the project was pre 1.3 would you consider that lein's fault or yours?
23:24hiredmanyou assume clojurebot has tests
23:24gfrederickscan we imagine a world where it does?
23:24r0bglees0nlol
23:24hiredmanguard rails, fuh, where we are going there aren't even roads
23:24hiredmangfredericks: I like to blame every on lein and technomancy
23:25hiredmaneverything
23:25gfredericksleiningen, who wrote technomancy, is responsible for most of the frustrations that have been plaguing the clojure community for the past several years
23:26gfredericksthat sentence seems kind of plausible since "leiningen" sounds more like a regular name than "technomancy" does
23:33gfredericksokay well I am doing my part to push people onto 1.3
23:33gfredericksby using every-pred
23:35hiredmanI would survive if lein broke on pre 1.3 (in my mind 1.3 doesn't exist, just a pit to jump over between 1.2 and 1.4) because not having lein has never stopped me before
23:38hiredmanclojurebot in fact predates lein by maybe a year or more
23:44hiredmanhttps://gist.github.com/hiredman/27733/2381e7989977b8999aa0f863ef0a50415bb6e5fc clojurebot from five years ago
23:49technomancyhiredman: oh man remember when clojurebot polled svn for changes
23:49technomancygfredericks: gracefully degrading in the presence of 1.3 is OK
23:50technomancyerr--1.2
23:50gfrederickstechnomancy: graceful???
23:50lazybotgfredericks: Oh, absolutely.
23:50technomancy(not blowing up, but warning and saying "we're running all the tests lol")
23:50gfrederickshrm
23:50gfrederickseasier to pull out the every-pred
23:51hiredmantechnomancy: remember? as far as I am concered it still does
23:51technomancyhahaha
23:52technomancythat was my first clojure oss contribution