#clojure log - Jul 31 2013

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

0:02 lynaghk: b

0:14 * technomancy has a two-core machine

0:14 technomancy: still waiting for them to release something better; until they do I'm staying put

0:19 callen: technomancy: isn't Lenovo just going to keep making the Thinkpads worse?

0:19 technomancy: if that's the case, I think I'm stuck with this T430 for a long time.

0:20 I don't really know what alternatives exist.

0:20 technomancy: callen: I'm prepared to just keep on repairing and repairing

0:20 callen: technomancy: post-apocalyptic programmers. :(

0:21 technomancy: callen: if they don't release a high-res user-serviceable X series in the next two years Imma start stockpiling

0:21 callen: technomancy: time to raid craigslist in fear and loathing.

0:22 technomancy: callen: is the T430 the last T series before they chickleted everything?

0:22 callen: technomancy: 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

0:22 technomancy: post-chiclet but still tolerable due to not being overly shallow.

0:23 technomancy: I might bite the bullet and drop my 12-inch requirement if it's decently light

0:23 do you know how many cd/m^2 it is?

0:26 callen: technomancy: max is 281

0:27 I have the T430s

0:27 technomancy: average is apparently 245. I don't know what that's supposed to mean as opposed to max.

0:27 technomancy: yeah, mine is 250 and I'm not thrilled with it

0:27 the samsung I got was 400, which was incredible, but the keyboard was unforgivable

0:27 callen: apparently MBPs range around 250-300

0:28 technomancy: 400 sounds great. Too bad about the keyboard.

0:28 technomancy: yeah, if I'm going to get an upgrade I'd like it to be over 300.

0:29 callen: I basically never turned it all the way up

0:29 callen: okay

0:29 technomancy: HD screen for T430s is 200, HD+ (1600x900) is 250 nits.

0:29 technomancy: (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!)

0:29 =\

0:29 callen: and yes, they're calling a 900 pixel tall resolution "HD+"

0:29 what a farce.

0:30 technomancy: hahahahaha

0:30 clj_newb_2345: dumb question: how do I check if the type of clojure.core/*e is "clojure.lang.Compiler$CompilerException" ?

0:31 callen: technomancy: I used to own a Thinkpad that was 1600x1200. The "HD"-ness of today's displays is questionable at best.

0:31 I'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.

0:31 * sdegutis is on an rMBP

0:31 technomancy: are they still forcing glossy screens on the retinas?

0:32 sdegutis: well mines glossy, but its a year old

0:32 technomancy: makes me want to go live in a cave

0:32 clj_newb_2345: is the "r" for "retina" ?

0:32 callen: technomancy: I have a retina display MBP for work, if it's glossy, I haven't noticed.

0:32 clj_newb_2345: yes

0:32 sdegutis: yes

0:32 callen: technomancy: I don't code outside like you though.

0:32 technomancy: callen: you should!

0:32 clj_newb_2345: I like my 17" mbp; why do people want retina macbook airs ?

0:32 technomancy: it's the best

0:32 sdegutis: i only notice its glossy when im working in the park. which is never.

0:32 callen: technomancy: it's definitely not as "matte" as my Thinkpad.

0:32 technomancy: sdegutis: adjust thy priorities

0:32 callen: working in the park is kind of the norm for technomancy I think.

0:32 sdegutis: technomancy: but its way cozier to work in my bedroom. plus i get free access to pizza rolls at any time this way

0:33 technomancy: https://secure.flickr.com/search/?q=remoteoffice&w=technomancy&adv=1&mt=all&ct=6&m=tags

0:33 callen: clj_newb_2345: dude. if you care about text retina displays are god's gift.

0:33 clj_newb_2345: i stare at code all day long

0:33 callen: just be warned

0:33 clj_newb_2345: retina can make fixed width font that much prettier?

0:33 callen: if you get a retina display, you'll notice low res assets *EVERYWHERE*

0:33 clj_newb_2345: yes

0:34 sdegutis: so whats the topic?

0:34 technomancy: clj_newb_2345: depends on how good your eyesight is =)

0:34 callen: whining about the fall of the Thinkpad.

0:34 clj_newb_2345: #apple-fan-club

0:34 callen: no, it was originally about thinkpads.

0:35 sdegutis: well anyway my project surpassed 200 stars today :)

0:35 and some people on twitter praised the readme, specifically the story part i kinda half-stole from technomancy

0:35 *idea

0:35 so yay

0:36 callen: I'm technically not really a mac owner anymore.

0:36 my personal MBA died :(

0:36 clj_newb_2345: how do I clear clojure.core/*e ?

0:37 sdegutis: ,*e

0:37 clojurebot: #<Unbound Unbound: #'clojure.core/*e>

0:37 sdegutis: clj_newb_2345: whys it need clearing?

0:37 clj_newb_2345: clojure.tools.namespace/refresh

0:37 can set it when there is a compiler error

0:38 however, I need to clear it other wise it reports an old exception (that is no longer true)

0:38 sdegutis: presumably the same way they set it

0:38 clj_newb_2345: http://clojuredocs.org/clojure_core/clojure.core/*e

0:38 I have no idea how they set it

0:39 sdegutis: https://github.com/clojure/tools.namespace/blob/master/src/main/clojure/clojure/tools/namespace/repl.clj#L23

0:39 looks like they're setting it that way

0:39 clj_newb_2345: sdegutis: damn it, how did you find it that fast?

0:39 hmm, the clojure.tools.namespace part looks familiar

0:39 sdegutis: i.. dont know?

0:40 clj_newb_2345: did you use google, some type of github code search, or just started reading tools/namepace/repl.clj ?

0:40 sdegutis: i googled clojure.tools.namespace, found it on github, opened all the files and searched for "refresh"

0:40 and found that one

0:40 clj_newb_2345: I'm not sarcastic and genuinetly interested in the thought process that led to finding this

0:40 "opened all the files and searched" as in git clone; grep ?

0:40 sdegutis: no

0:40 clj_newb_2345: or the web interface

0:41 sdegutis: i clicked and clicked and clicked until i was in a dir that had lots of .clj files

0:41 clj_newb_2345: lol

0:41 sdegutis: then i held cmd and clicked each of them to open in new tab

0:41 clj_newb_2345: okay; cool; thanks;

0:41 then you hit ctrl-f

0:41 sdegutis: well i only had to do cmd-f once

0:41 clj_newb_2345: so basically, I'm lazy for not doing that

0:41 sdegutis: then id move on to each tab and hit cmd-g which is find-again

0:41 clj_newb_2345: I should have git clone and git grep to a single command

0:41 sdegutis: yeah you shoulda done that

0:42 oh well

0:42 clj_newb_2345: well, problem now fixed

0:42 thanks for your help and explainig your though tprocess

0:42 sdegutis: im still excited over having successfully embedded ruby in a mac app in just a dya

0:42 *day

0:42 bbloom: https://gist.github.com/brandonbloom/6119263

0:42 ^^ trivial search found where it's set

0:43 callen: bbloom: is there a reason to use ag over ack?

0:43 sdegutis: supposedly faster

0:43 bbloom: dramatically faster

0:43 sdegutis: i believe it

0:43 ack was in *perl*

0:43 callen: I don't know if 5x is dramatically

0:43 but I'll give it a whirl.

0:43 sdegutis: i dont even use ag.

0:43 my tool chain is horribly broken.

0:43 callen: ack is pretty damn fast.

0:44 "The command name is 33% shorter than ack!" - sold.

0:44 sdegutis: i spend too much time in emacs, but i couldnt get emacs doing all the things i used to do outside of it

0:44 so i just sit here doing everything manually nowadays

0:45 clj_newb_2345: well

0:45 technomancy: using grep like a freaking caveman

0:45 clj_newb_2345: setting up my own code hot reloading system took a few hours longer than expected

0:45 I'm going to take that as a compliment.

0:45 callen: ack vs. ag for a Clojure codebase I tried it on was 0.04s vs. 0.01s.

0:45 lol.

0:45 clj_newb_2345: caveman are focused, ruthless, and don't give a damn about politeness

0:46 callen: cavemen*

0:46 and that's a stereotype.

0:46 you don't share space with other people in a cave without being polite.

0:46 close quarters is rough.

0:46 sdegutis: callen: noticably faster?

0:46 technomancy: smelly though

0:46 clj_newb_2345: caveman polite?

0:46 don't they solve problems by who's stronger

0:46 callen: sigh...ag also lacks all of the intelligent features ack had.

0:46 sdegutis: im really hoping colin fleming does wonders with his intellij plugin

0:47 i really hate the state of all IDEs

0:47 using Xcode for Mac apps spoiled me.

0:47 for how slow it can be, it does so many awesome things.

0:47 technomancy: isn't ack functionally just a set of nicer defaults for grep?

0:47 amalloy: technomancy: well, for find+grep, i think

0:47 sdegutis: technomancy: a ton of them. an insurmoutable amount

0:47 technomancy: sdegutis: M-x grep tho

0:48 sdegutis: i have *something* like that in my setup

0:48 technomancy: plus it's hyperlinked

0:48 or M-x rgrep, I guess

0:48 amalloy: M-x find-grep ; real ultimate power

0:48 sdegutis: grep 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

0:48 technomancy: hyperlinks are pretty nice

0:48 sdegutis: that block of code probably sums up why im trying to ditch emacs :(

0:50 well not just the block, but the hours i spent digging through old emacswiki pages about it, and github repos and docs and ugh

0:50 so many grep modes, all of them have some flaw and none is Just Right™

0:50 * sdegutis shuts up

0:58 sdegutis: ok time to get back to clojure

0:58 anyone using nevermore yet?

0:59 callen: what's that?

1:06 sdegutis: callen: https://github.com/sdegutis/nevermore

1:06 testing lib for clj code

1:06 callen: oh, you renamed the testing lib

1:06 sdegutis: its functional as well as functional

1:06 callen: sure.

1:07 it functions and it tries to be super FP

1:07 callen: sorry, I'm all about procedural programming and global state.

1:07 clj_newb_2345: is 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

1:07 callen: if I'm not explicitly smashing a location in memory, my day is ruined.

1:07 sdegutis: callen: then you'll like some of the alternatives

1:09 callen: sdegutis: nope, not enough global state to smash.

1:09 sdegutis: k

1:09 callen: I should make a testing library based on ztellman's proteus

1:09 ftw.

1:23 alexgunnarson: hey everyone! anyone using clojure with javaFX?

1:30 clj_newb_2345: how does mustache and compojure compare

1:30 are they both still actively maintained?

1:30 alexgunnarson: nobody here uses javafx?

1:31 amalloy: ~anyone

1:31 clojurebot: Just 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 ..."

1:32 alexgunnarson: okay, the question is, who here uses / has experience with javaFX?

1:32 mainly javaFX with Clojure, that is

1:33 i'm trying to build an RIA with javaFX and clojure

1:34 there's not very much information about the two together, but there's tons on clojure+HTML5+JS

1:34 *clojurescript+HTML5+JS

1:43 callen: clojurebot: mustache and compojure are two totally different kinds of things

1:43 clojurebot: compojure is http://github.com/weavejester/compojure/tree/master

1:43 callen: or

1:43 clj_newb_2345: ^^

1:43 clj_newb_2345: does pedestal use compojure or mustache ?

1:43 callen: clj_newb_2345: you just threw an exception for a type erorr.

1:43 clj_newb_2345: dude, they're not comparable. they solve two totally different problems. It's a malformed question.

1:43 clj_newb_2345: callen?

1:44 callen: error*

1:44 clj_newb_2345: https://github.com/cgrand/moustache

1:44 my bad, mis spelling

1:44 callen: sigh.

1:44 use Compojure.

1:44 clj_newb_2345: callen: sorry, today = long day

1:44 callen: clj_newb_2345: if you don't know what you're doing, you should just be using Luminus.

1:44 clj_newb_2345: this morning started with css

1:44 clojurebot: Huh?

1:51 alexgunnarson: clojurebot: have you ever used javaFX with clojure by chance? or not really?

1:51 clojurebot: clojurebot is pretty cool

1:53 alexgunnarson: uhh… sure?

1:54 sauerkrause: I'm pretty sure you triggered bot behavior

1:54 alexgunnarson: i don't get it… is clojurebot a user or a bot or… something else?

1:56 terom: ,(print "I'm a bot")

1:56 clojurebot: I'm a bot

1:56 bbloom: ,(print "No, I'm human.")

1:56 clojurebot: No, I'm human.

1:57 callen: alexgunnarson: http://www.youtube.com/watch?v=KxcP7TRY178

1:57 alexgunnarson: wow interesting never knew that

1:57 : ,(print "Hi, I'm clojurebot. This sentence is false.")

1:58 hmm doesn't do it for me

1:58 so, lies! haha

1:58 bbloom: ,(print "SYNTAX ERROR")

1:58 clojurebot: SYNTAX ERROR

1:58 alexgunnarson: : ,(print "COLLABORATION")

1:58 mischov: ,(print "Yea.. lies!")

1:58 clojurebot: Yea.. lies!

1:59 terom: alexgunnarson: you have extra ":" in the beginning and that's why the bot is not triggered

1:59 alexgunnarson: ahhh

1:59 ,(print "COLLABORATION")

1:59 clojurebot: COLLABORATION

1:59 mischov: ,(print "Quit ruining this for the rest of us.")

1:59 clojurebot: Quit ruining this for the rest of us.

1:59 alexgunnarson: ,(print "clojurebot does what it wants")

1:59 clojurebot: clojurebot does what it wants

2:00 callen: alexgunnarson: /query

2:00 alexgunnarson: stop abusing the bot in a public channel.

2:00 alexgunnarson: query the bot in private or just stop.

2:00 alexgunnarson: sorry.

2:01 so… who of you has used javafx with clojure? if nobody has, i suppose that wouldn't be unusual… but just curious

2:01 i haven't really gotten a clear response which leads me to believe nobody has experience with the two

2:03 callen: alexgunnarson: no

2:03 terom: alexgunnarson: 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.

2:04 alexgunnarson: i wish i had a specific problem - it's more like, where do i start?

2:04 i've scoured the internet and there are probably only two or three sites that really mention it more than just passingly

2:05 bbloom: alexgunnarson: 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

2:05 alexgunnarson: bbloom: i've been reading the docs and i'll continue with that but it's always nice when there's an easier way

2:05 bbloom: you'll have better luck learning javafx in isolation from clojure & asking in some javafx channel, if that exists

2:06 alexgunnarson: bbloom: 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?

2:06 bbloom: alexgunnarson: you're talking to the wrong guy. i read the source to ring before i used it :-P

2:06 callen: might be the first time I've seen Ring called low level. Sweet.

2:06 alexgunnarson: no, i'm saying the stuff that ring abstracts out is low level

2:06 callen: bbloom: does this mean Clojure is mainstream now?

2:06 alexgunnarson: that doesn't change what I said.

2:06 clj_newb_2345: pedestal is awesome

2:07 callen: clj_newb_2345: no it's not.

2:07 clj_newb_2345: callen: what do you have against it?

2:07 callen: an IRC channel isn't the place to enumerate grievances.

2:07 clj_newb_2345: callen: let's hear the top 3

2:07 I'm curious

2:07 callen: clj_newb_2345: nope, I already told you what to use.

2:07 clj_newb_2345: this might save me days of my life spent sutdying pedestal

2:07 callen: clj_newb_2345: no need, I already told you to use Luminus.

2:08 clj_newb_2345: callen: what's your github account? I want to see what libraries you've written

2:08 * callen grins

2:08 callen: I'm mostly fucking with Selmer and neubite right now.

2:08 I'll probably convert neubite to http-kit and extract that into some kind of project template.

2:09 I like that Github has become "LETS FIGHT AND SEE WHAT YA GOT BRO" go-to for brogrammers though.

2:09 clj_newb_2345: no, it's a quick signaing mechanism

2:09 to see what qualifications a developer has

2:10 https://github.com/pedestal/app-tutorial <-- next 24 hours of my life

2:10 callen: most large/important projects are under their own orgs

2:10 alexgunnarson: i 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"?

2:10 callen: not under the accounts of the principal maintainers

2:10 so what signals are you looking for exactly?

2:11 clj_newb_2345: contributions to large projects

2:13 hmm, lein version 2.2.0 required

2:13 time to update lein

2:13 hmm, still 2.1.2

2:28 RuralClojurer: any good libraries for inspecting java classes?

2:29 callen: RuralClojurer: .getClass .getDeclaredMethods

2:30 RuralClojurer: yeah.. but i'm disappointed if that's the best available )

2:31 guns: A little macro sugar goes a long way

2:32 RuralClojurer: i guess i'll write my own then

2:32 which leads to another question.. in emacs, how do i always load a package into nrepl at startup?

2:33 guns: hTat can all be done through the :user profile

2:34 RuralClojurer: ahh, thx.. i kept thinking it was an emacs config question

2:34 guns: You can even run arbitrary code with {:user {:repl-options {:init …}}}

2:34 RuralClojurer: that sounds much easier

2:41 amalloy: RuralClojurer: clojure.reflect/reflect

2:41 (callen)

2:52 callen: amalloy: I wanted him to know what it was to go uphill both ways first.

2:52 you've robbed him of a character building opportunity.

2:55 Raynes: http://www.youtube.com/watch?v=Q7DRA0_ATUI

3:04 _wei: hello folks

3:04 bearwithclaws: hola!

3:09 callen: bearwithclaws: HAI

3:43 Raynes: callen: I can get behind that.

3:44 callen: <3

3:47 ro_st: Raynes: what do you think of Pedestal?

3:47 #random-interview

3:48 Raynes: I 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.

3:48 ro_st: ok. don't care because you don't have problems it's designed to solve, or because you don't like the approach?

3:48 Raynes: callen: It suggested Nina Nesbitt after that. :<

3:49 If I have problems it can solve, I haven't noticed them. :p

3:49 ro_st: bi-directional http-only server <> browser comms, basically

3:50 callen: that's not specific to Pedestal in the slightest.

3:50 ro_st: the whole HTTP SSE thing

3:50 callen: that's not specific to Pedestal either.

3:50 ro_st: divorcing threads from http requests

3:50 callen: that's not specific to Pedestal either.

3:50 ro_st: thanks callen. i'll make a note

3:50 callen: Raynes: to be honest, if Pedestal takes off in Clojure-land, I'm quitting.

3:50 Raynes: because I will have lost all faith.

3:51 ro_st: why? what about it irks you?

3:54 Raynes: ro_st: You can rest assured that I don't care about it nearly enough to have that sort of reaction. :p

3:54 ro_st: -grin-

4:43 speedwagon2: Hi, 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?

4:44 I.E. 1.5.*

5:24 noncom: hi! 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..

5:27 hyPiRion: I 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?

5:27 noncom: how i check if it is correct?

5:28 to me, the code is fine and all namespaces are in corresponding packages/files...

5:46 supersym: say 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?

5:48 hyPiRion: supersym: recompile =/

5:48 Well, if you're changing the protocol itself that is

5:49 noncom: hyPiRion: 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

5:51 supersym: hyPiRion: the protocol itself? You mean add extra methods (types being fine)?

5:52 for 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

5:52 hyPiRion: supersym: 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)

5:53 supersym: anyway 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

5:53 cool... I'll keep reading/testing :)

5:54 3 LightTable instarepls work nicely in showing me some mechanics

5:58 shdwprince: Hey, 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.

5:58 From java I can just use A.B

6:03 supersym: "the desire to implement an existing set of abstract methods for an existing concrete class without having to change the code that defines either."

6:04 there we go, looks like I can't add abstract methods, new ones with defprotocol so far

6:04 thats fine... as long as I know :)

6:05 shdwprince: http://clojure.org/java_interop

6:06 I'm not sure which you want, often one might provide a accessor method for those I think?

6:06 you'd probably need a public constructor for it anyway

6:07 but I'm no Java guru, I come from C# originally

6:07 asuming the inner class is private anyway

6:09 ahh... gen-class :methods... answers my final question about "defines a new method foo not present in any superclass/interfaces"

6:09 sweet

6:11 number36: hi all i dont know if i can ask simple question about fibonacci sequence function that i found ?

6:11 rcg: number36, just give it a try :)

6:15 number36: rcg thank you

6:15 defn fibonacci [s]

6:15 (#(take % (map first (iterate (fn [[a b]] [b (+ a b)]) [1 1]))) s)

6:15 )

6:15 i understand iterate

6:15 shdwprince: humm, 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.

6:15 number36: also there is no problem with fn iteself

6:15 but i dont get the map first thing

6:16 noncom: shdwprince: A&B

6:16 shdwprince: sorry i meant A$B

6:17 shdwprince: you get something like Terminal$Color/RED I guess... (not sure bout the exact names in your code)

6:18 shdwprince: No such namespace - Terminal$Color

6:20 8/b 1

6:20 oh, sorry

6:21 noncom: shdwprince: first, try qualifing it fully like org.yourlib.terminal.Terminal$Color/WHATEVER and see if it works

6:21 you can try that in repl

6:23 supersym: oh right... $ :)

6:24 tgoossens: I 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?

6:24 shdwprince: noncom, that's works, thanks a lot

6:24 tgoossens: (there will be multiple rules that might change in the future)

6:26 noncom: shdwprince: 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

6:26 supersym: tgoossens: once you grasp it, sure

6:26 I found it really cool to learn some, and combined with map I guess a lot of these tasks become more trivial

6:26 but if that is the only problem, just a few rules not too much related really, you could just use function predicates

6:26 IamDrowsy: number36: https://www.refheap.com/17052

6:27 supersym: ask yourself, is it worth the learning curve you expect

6:28 tgoossens: I would like to see all the possible plans

6:29 hmm using only predicates?

6:29 noncom: number36: first is just an fn. you can think of it as (defn first [collection] (nth collection 0))

6:29 so you simply pass it as the function for the (map)

6:30 it means that you take first items of all collections that are passed to the map in a single collection created by iterate..

6:31 tgoossens: supersym: could you refer to some example of doing this with predicates only?

6:31 hanDerPeder: I'm getting a NoClassDefFoundError when compiling my project after switching to logging using timbre

6:31 after some googling it seems to be related to nameshadowing

6:32 but the strange thing is it does not happen on my colleagues machine

6:32 i've tried cleaning maven dependencies etc

6:32 anyone experienced something like this?

6:32 noncom: now 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...?

6:33 hanDerPeder: what IDE do you use?

6:33 supersym: ok that last bit, might make it a bit harder

6:33 hanDerPeder: emacs

6:33 supersym: I use math.combinatronics for those

6:33 the possible plans

6:34 noncom: hanDerPeder: 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)

6:34 tgoossens: hmm

6:34 jonasen: down for me or everyone else? http://repo1.maven.org/maven2/org/clojure/clojure/1.5.1/clojure-1.5.1.zip

6:35 supersym: tgoossens: 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?

6:35 jonasen: I can't run the clojurescript bootstrap script since the above url gives returns a 503

6:35 supersym: like I said, depends on how complicated/transparant perhaps the whole process needs to be :P

6:36 noncom: jonasen: works fine for me

6:36 tgoossens: also there arent much objects

6:36 supersym: if 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

6:36 tgoossens: about 24 or so

6:36 supersym: ok

6:36 jonasen: noncom: oh, interesting :(

6:36 tgoossens: fyi: its for planning my courses the next two year (4 slots: 4 semesters )

6:37 jonasen: noncom: thanks for testing

6:37 supersym: :)

6:37 tgoossens: and maybe other people might want to use it

6:37 supersym: right... you want rosters generated? :P tought problems to solve usually

6:37 *tough

6:37 tgoossens: not really. its really just

6:37 hanDerPeder: noncom: lein run fails during compilation

6:37 tgoossens: saying "semester 1 2 3 or 4"

6:37 and to make it even easier:

6:38 every course has a certain semester it is given

6:38 hanDerPeder: did a bisect and it works up untill i added timbre

6:38 tgoossens: hmm

6:38 so actually I have two slots

6:38 hanDerPeder: but only an issue on my machine

6:38 tgoossens: year1 or year 2

6:38 that might make the task much easier

6:39 supersym: :)

6:39 tgoossens: for me

6:39 but not in general

6:39 supersym: so you want to generate possible moments you could go there and then just crosscheck against whatever you have planned at those times manually?

6:39 tgoossens: a course might be given in first or second

6:40 (not for me but it might for others)

6:40 supersym: yea

6:40 tgoossens: and there might be some requirements on

6:41 course X must be followed BEFORE course Y

6:41 or only in second year

6:41 like you said. it gets complicated quickly :p

6:42 supersym: http://stackoverflow.com/a/7671914

6:42 read and wheep :P

6:42 -h

6:42 cause you'd quickly head in those directions: core.logic will contain constraints eventually

6:43 then you'd generate sets based on those, and use math.combinatorics to probably generate the whole possible range of options

6:45 tgoossens: so you would do it just combinatorically ?

6:47 supersym:thanks for your time btw

6:49 supersym: do you sometimes attend Dutch clojure meetups?

6:52 noncom: anyone familiar with 'lein uberjar' ?

6:55 supersym: tgoossens: 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

6:56 well 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

6:57 as it easily creates the possible outcomes,... but those are easy with dice, two vectors [0...6] will get 36 possible outcomes

6:57 but since you have constraints

6:58 I 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.

6:58 this is what makes it damn hard indeed :P

7:00 check this out: http://programming-puzzler.blogspot.nl/2013/03/logic-programming-is-overrated.html

7:00 I just found it, he argues you don't need core.logic for some of these puzzles

7:04 llasram: supersym: Did you see dnolen's response to that post?

7:05 supersym: llasram: not yet, I'm still reading it

7:05 dnolen: supersym: llasram: the post is correct about not needing core.logic - but I don't really agree with any of the other opinions expressed therein

7:07 llasram: Oh, and dnolen is here. EDT early-risers, go!

7:07 supersym: If you don't have the link in hand: http://swannodette.github.io/2013/03/09/logic-programming-is-underrated/

7:12 supersym: daniel eklunds post was very insightful for me, as a complete newb in this field

7:12 :)

7:12 thanks

8:03 AWizzArd: ,15

8:03 clojurebot: 15

8:04 AWizzArd: that works:

8:04 ,(= (sorted-set "a") #{"a"})

8:04 clojurebot: true

8:04 AWizzArd: but this doesn’t:

8:05 ,(= (sorted-set "a") #{:a})

8:05 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Keyword>

8:05 AWizzArd: Bug or feature?

8:05 Cause when the types match and both are (unsorted-) sets it works again:

8:05 ,(= (set (sorted-set "a")) #{:a})

8:05 clojurebot: false

8:08 llasram: Oooh. That does seem kind of nasty

8:09 &(= "a" :a")

8:09 lazybot: java.lang.RuntimeException: EOF while reading string

8:09 llasram: &(= "a" :a)

8:09 lazybot: ⇒ false

8:10 Bronsa: there's also ##(get (sorted-set 1) :a 0)

8:10 lazybot: java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.Keyword

8:15 llasram: My jira-foo is proving insufficient for determining if this is already bugged

8:18 &(= #{:a} (sorted-set "a"))

8:18 lazybot: ⇒ false

8:19 laurentpetit: Hello

8:19 clgv: laurentpetit: hi

8:20 crepsac: I'm wondering whether it is possible to have a namespace always available from the repl

8:20 laurentpetit: clgv: hi. did you try the latest beta with autoshift ? :)

8:20 tbaldridge: &(= #{:a} (sorted-set :a))

8:20 lazybot: ⇒ true

8:20 laurentpetit: (I know, I'm "monomaniac" as we say in French)

8:20 crepsac: i tried using lein :injections, but that doesn't seem to stay loaded outside user namespace

8:21 laurentpetit: What is the status of Pallet these days?

8:21 Do you know how Pallet compares to Ansible ?

8:22 llasram: crepsac: I'm afraid there's no mechanism which can cause one namespace to be referred from every other namespace

8:22 crepsac: Once a namespace is loaded, you can reference its symbols by their namespace-qualified names from anywhere

8:23 But if you want them refered into a new namespace, you need to do it manually

8:23 crepsac: ah thanks

8:23 clgv: laurentpetit: not yet. will do asap

8:23 crepsac: i would have thought that was a kind of useful thing to be able to do tbh

8:24 laurentpetit: clgb: 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

8:24 crepsac: for instance if I wanted clojure.repl everywhere from the repl...

8:24 laurentpetit: jkkramer seems to appreciate it already, and didn't (yet) report fundamental problems

8:25 clgv: laurentpetit: I should have time tonight.

8:25 llasram: crepsac: 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

8:25 But there isn't a generic in-Clojure solution

8:25 s,but,by,

8:26 laurentpetit: clgv: that would be great. But no pressure, eh :)

8:26 crepsac: the lein repl uses nrepl though right?

8:27 llasram: It 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

8:28 clgv: llasram: lein repl, uses REPL-y as client for nrepl

8:28 llasram: When 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

8:28 hanDerPeder: when compiling with lein compile i get a NoClassDefFoundError complaining about clojure/lang/ILookupHost missing

8:28 llasram: clgv: Cool beans. That is good to know

8:28 jonasen: sanity 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.

8:29 hanDerPeder: afaik this was last present in clojure 1.2 and im compiling with 1.5.1

8:29 anyone know how to debug this

8:29 clgv: hanDerPeder: did you run "lein clean" before compiling again?

8:29 crepsac: llasram: thanks, I'll try to figure out a solution :)

8:29 hanDerPeder: clgv: yes

8:29 clgv: hanDerPeder: or dou you use that Class explicitely in your code?

8:29 llasram: crepsac: Best of luck!

8:30 jkkramer: laurentpetit: happy to see if you fixed the Alt+R issue; almost downgraded to fix that ;)

8:30 hanDerPeder: no

8:30 strange thing is it does not happen on my colleagues machine

8:30 crepsac: llasram: i still think it's wierd that there is no standard solution for think

8:30 hanDerPeder: with identical classpath and lein version

8:30 crepsac: *this

8:30 jkkramer: laurentpetit: still liking the autoshift after using it for a day or so

8:30 hanDerPeder: i've tried cleaning, deleting local maven repo etc

8:31 clgv: hanDerPeder: you usually get this kind of error with old compiled files from 1.2 so there might be some remaining files...

8:31 hanDerPeder: clgv: this seems very plausible

8:32 clgv: hanDerPeder: maybe some AOT-compiled dependency which was compiled with clojure 1.2?

8:32 hanDerPeder: but then it would happen for everyone, right?

8:32 llasram: Ah! 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

8:32 &(compare :a "a")

8:32 lazybot: java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.Keyword

8:33 clgv: hanDerPeder: yes, if there are no locally installed versions that differ

8:34 hanDerPeder: are dependencies installed in other places than .m2?

8:35 clgv: hanDerPeder: with plain leiningen? no.

8:35 Bronsa: llasram: yeah. I have a patch for that but I think it's intended behaviour

8:36 llasram: Bronsa: Link to patch & discussion? Curious

8:36 hanDerPeder: clgv: ok, thanks

8:36 Bronsa: llasram: I just wrote it :)

8:36 llasram: hah!

8:36 laurentpetit: jkkramer: so the fact that the text sometimes moves like crazy to follow the indentation is not too disturbing when doing long coding sessions?

8:37 hanDerPeder: clgv: the error is specifically related to having timbre as a dependency, if i revert to tools.logging it goes away

8:37 llasram: Bronsa: What's your approach? I was just considering catching the ClassCastException in PersistentTreeMap.valAt

8:37 Bronsa: llasram: catching the CCE in entryAt

8:37 llasram: Oh yeah, that guy is public too

8:37 hanDerPeder: but afaik timbre does not need to aot compile anything

8:37 Bronsa: llasram: and it's used by both equiv and valAt

8:38 laurentpetit: jkkramer: tomorrow i'll work on adding support for paredit commands (raise over, etc.)

8:38 Bronsa: so you fix them both

8:38 llasram: Oh, I missed the extra calls to `entryAt`

8:39 Yeah, that seems the way to go

8:39 If you open a ticket in the Clojure Jira, I'll vote for it :-)

8:39 Bronsa: sure. let me just write a bunch of tests

8:39 jkkramer: laurentpetit: nah, the text moves predictably, so doesn't feel weird

8:40 laurentpetit: having it work with paredit commands will be great

8:40 laurentpetit: jkkramer: great, I'm quite happy that you enjoy it.

8:41 jkkramer: 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

8:41 (those are tricky because somehow they "bypass" the Eclipse extension point I'm using)

8:44 clgv: laurentpetit: next stable release two weaks after your vacation? ;)

8:45 laurentpetit: clgv: hopefully yeah :)

8:46 jkkramer, clgv : depends on whether you find it important to have autoshift integrated with copy/cut/paste before releasing ?

8:46 clgv: laurentpetit: gotta try it first to answer that ;)

8:47 jkkramer: laurentpetit: beta is stable enough for me; i'm happy regardless

8:49 Bronsa: llasram: http://dev.clojure.org/jira/browse/CLJ-1242

8:49 laurentpetit: jkkramer: 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

8:50 jkkramer: 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 ?

8:51 jkkramer: laurentpetit: i can do a blog/video when i have some time

8:54 laurentpetit: so far, when using cljx, I just do "lein repl :headless" then "connect to repl" in ccw. pretty painless

8:55 with the cljx/piggieback nrepl middleware in place, i can load code in ccw as i normally would - for clj, cljs, and cljx

8:56 haven't wrapped my head around how to do browser repl yet

9:18 laurentpetit: jkkramer: 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?

9:18 I'm missing something

9:19 jkkramer: sure, another blog/video in the vein of what Chas did for pure server development would benefit people!

9:20 jkkramer: laurentpetit: 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

9:21 i'm still a cljs/cljx newb

9:26 laurentpetit: jkkramer: I was disconnected, after your message "i'm still cljs/cljx newb" => did I miss something?

9:27 jkkramer: ok, so just rhino to check evaluation is ok

9:39 supersym: erh maybe a dumb question, but could you flip (horizontal/vertical) unicode character? besides using a image editor that is :P

9:40 or would that involve hacking into the gfx subsystem

9:40 clgv: supersym: should be possible since you can also can flip writing direction via unicoe

9:40 supersym: clgv: yeah it has writing direction with a mirror-character

9:40 but its just right to left

9:42 since 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 :)

9:42 clgv: f -> ɟ

9:43 supersym: hey

9:43 same one? or just trickery, as in differnt unicode actually has a reversed f? :P

9:44 clgv: it says U+025F

9:45 supersym: '(int \ɟ)

9:45 clgv: ,(long \ɟ)

9:45 supersym: 607 + 102.. yeah I get that :P

9:45 clojurebot: 607

9:45 supersym: ,(long \f)

9:45 clojurebot: 102

9:46 supersym: so as long as they aren't mapped explicitly like that

9:48 UNICODE Text Flipper.. they have sites for it... gonna check it out for a bit what the trick is they use :)

9:48 http://www.revfad.com/flip.html

9:52 The 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.

9:52 yeah,...just not possible

9:53 xonev: I have a noob question — can someone tell me why this doesn't work? https://gist.github.com/xonev/df517e2dc6716cf0f339

9:53 I 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?

9:56 nkoza: xonev: you can use for

9:56 xonev: I tried using `for`, too

9:56 It gives me the same problem as map

9:56 nkoza: what problem?

9:57 xonev: ('IOException Stream closed java.io.BufferedReader.ensureOpen (BufferedReader.java:97)

9:57 tbaldridge: xonev: map is lazy, the file has closed by the time you actually read the file

9:57 nkoza: map is lazy

9:57 tbaldridge: xonev: wrap map in "doall"

9:58 ,(doc doall)

9:58 clojurebot: "([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."

9:58 nkoza: maybe the question is how to return a lazy sequence that reads from a file without closing the file before consuming it all

9:59 xonev: nkoza: yeah, that's what i want to do. Although, I guess this will be fine for now...

10:00 tbaldridge: xonev: 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:01 xonev: tbaldridge: that might be a little advanced for me atm i think, but i'll keep that in mind for down the road

10:01 i wouldn't be using `with-open` then, correct?

10:01 tbaldridge: xonev: it's something like this: https://gist.github.com/halgari/6122107

10:02 blast...a typeo there.

10:02 here we go, this should work: https://gist.github.com/halgari/6122107

10:02 xonev: yeah, the other option is to not use with-open, and instead just call .close manually when you're done with the file.

10:03 xonev: tbaldridge: cool, thanks

10:07 manutter: ,(doc line-seq)

10:07 clojurebot: "([rdr]); Returns the lines of text from rdr as a lazy sequence of strings. rdr must implement java.io.BufferedReader."

10:08 manutter: ,(doc file-seq)

10:09 clojurebot: "([dir]); A tree seq on java.io.Files"

10:14 jonasen: dnolen: I vaguely remember some trick you did to get fast mutable let bindings in clojurescript?

10:14 dnolen: jonasen: not really, you have two options - mutate a local array or use deftype

10:17 jonasen: yeah, it was "mutate local array" I was thinking of. I'll try that :)

10:18 stuartsierra: Somebody made a wrapper that uses deftype to provide mutable locals.

10:24 cmajor7: is 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:25 tcrayford: cmajor: is the condition known at compile time?

10:25 nDuff: cmajor7: the "comment" macro _is_ a macro that gets evaluated to nothing. All you're doing is making that behavior conditional. :)

10:25 cmajor7: it can be.. e.g. evn variable

10:26 tcrayford: well, you are always going to have some overhead then

10:26 * nDuff doesn't follow ("evn"?)

10:26 tcrayford: unless you read the env variable at compile time

10:26 nDuff: Oh, environment. Yeah.

10:26 cmajor7: nDuff: 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:27 tcrayford: why can't you?

10:27 nDuff: cmajor7: 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:27 cmajor7: well, the problem with reading from the environment at compile time is that compile time might not be the same thing as runtime. :)

10:27 cmajor7: think about the case where someone AOTs your code.

10:28 cmajor7: well a "comment" macro will never execute/make visible its body to a compiler, unless it is removed

10:28 nDuff: cmajor7: right, so you need to make it conditional. But there's nothing hard about that.

10:29 cmajor7: if you want to eat the overhead of only checking the environment once, that's a thing you can still do at runtime.

10:29 cmajor7: so far "macroexpand-1" returns the whole body (with condition checking) nomatter whether the condition is met

10:29 nDuff: cmajor7: well, we can't very well debug a macro you haven't shown us.

10:30 cmajor7: nDuff: sure, good point. I was just curious if it is possible. one sec, I'll refheap it

10:33 https://www.refheap.com/17057

10:34 nDuff: cmajor7: why are you putting the if-not inside the syntax-quotes if you want it to be run at compile-time?

10:34 cmajor7: ok, that maybe a problem I am facing..

10:35 so "`…" is what it actually gets evaluated.. vs. a decision making it needs to do at compile time?

10:36 nDuff: cmajor7: your return value is what gets invoked at runtime rather than compile time.

10:36 cmajor7: using the syntax-quotes where they are in that macro make those contents part of the return value.

10:36 s/gets invoked at runtime/gets compiled for later invocation at runtime/

10:37 cmajor7: https://www.refheap.com/17057 (updated) ?

10:37 nDuff: cmajor7: it's not like ` is special in macros; ' would do the same thing, but without the ability to unquote, unquote-splice, etc.

10:40 cmajor7: 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:41 err, that last paste was bad.

10:41 cmajor7: nDuff: 'fun' is just an arbitrary function that is available in the same namespace

10:41 nDuff: ...better now.

10:41 cmajor7: ...see https://www.refheap.com/17058 again.

10:42 duck1123: so, is id some code that you don't want evaluated? If not, are you sure you even need a macro?

10:43 cmajor7: nDuff: niice :)

10:43 I was a bit confused with "`"

10:44 is that common to always have "do" in front of ~@ ?

10:44 nDuff: cmajor7: it's unsafe not to.

10:44 ...well, sometimes unsafe not to.

10:45 cmajor7: think about when you're unsplicing into an "if" form.

10:45 cmajor7: nDuff: I can see that.. ok, now let me try with a 'fun' which I am sure should work the same..

10:45 nDuff: cmajor7: if you didn't have the do, the second item would become the else clause, and ones after that would be invalid.

10:45 cmajor7: right, I understand in this case

10:45 nDuff: cmajor7: 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:46 cmajor7: 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:46 (or, if it's not obvious, explicit notes).

10:46 cmajor7: nDuff: just an arbitrary 'fun' that takes in an id

10:47 nDuff: yea, sure. I understand. thanks for your help! I feel, like I am a step closer to grok the evil macro usage

10:49 nDuff: the reason I asked about "do":

10:49 user=> (macroexpand '(xyz))

10:49 (do)

10:50 but I guess I can check for "id" presence before "do"ing it

10:50 nDuff: cmajor7: if "id" isn't something you call for side effects, you don't want the do at all.

10:50 cmajor7: it probably helps to actually know what things mean before copying them.

10:51 cmajor7: nDuff: right, I am not hiding anything, I just want to understand how macro can be used to have no overhead given a condition

10:52 nDuff: ...

10:53 cmajor7: it has no return value. Thus it generates no code. Thus it has no overhead.

10:53 So, make it have no return value -- there's your literal answer. :)

10:54 cmajor7: right, 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:57 would be cool to have the same behavior at runtime.. i.e. hint JVM that (if condition (dontload/unload this code block))

10:59 nDuff: cmajor7: no reason you couldn't do something similar if you wanted.

10:59 cmajor7: make a var point to a noop rather than an actual function or such.

10:59 s/similar/similar at runtime/

11:02 cmajor7: nDuff: not sure I understand. so I have:

11:02 line1

11:02 line2

11:02 line3

11:02 how do I make sure line2 has 0 runtime overhead in case of a condition?

11:03 nDuff: cmajor7: first, thinking of clojure code as lines rather than forms is something of a structural no-no.

11:03 cmajor7: i.e. checking for a condition at runtime _once_ to "remove" line2's overhead vs. checking it every time before line2

11:04 nDuff: cmajor7: well, what does line2 _do_? If it calls a fn behind a var, replace the var with a noop.

11:04 cmajor7: nDuff: ok, I am intrigued

11:04 nDuff: cmajor7: 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:05 s/clojure/LISP/

11:05 * nDuff wanders off to get actual work done.

11:06 cmajor7: nDuff: 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:06 nDuff: sure, thanks for your help

11:06 nDuff: cmajor7: ...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:08 cmajor7: there are plenty of solutions here. Frankly, though, if you need to do this level of microoptimization, you have much bigger problems.

11:08 cmajor7: "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:08 nDuff: I am not taking it personally, and all this is a way to learn, rather than "having bigger problems".. I don't :)

11:09 nDuff: cmajor7: it's more useful to learn by finding practical problems rather than chasing theoretical ones.

11:09 cmajor7: anyhow, I'd start by learning how var binding works if this is really something you want to play with.

11:10 cmajor7: nDuff: this is a philosophical point. and I do have practical problems as well

11:10 nDuff: right I tried var bindings, just not sure how to bind a function to a noop

11:10 so even though it is there in the code, it won't be called

11:11 nDuff: cmajor7: 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:11 Again, if you care about ACTUAL PRACTICAL cases of this, look at how log calls for inactive verbosity levels are handled

11:12 the log4j, slf4j, java commons logging, &c. folks put a lot of effort into this

11:12 ...measuring both the overhead of the conditional checks and the amout of time needed for the JIT to manage appropriately.

11:12 If 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:13 s/rather a bit/rather a lot/

11:13 cmajor7: are you saying that because of JIT kicking in and optimizing it anyway?

11:17 nDuff: cmajor7: ...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:17 cmajor7: ...if you care about the overhead of a 1ns-2ns noop function call, Clojure is almost certainly the wrong language for your project.

11:23 cmajor7: nDuff: 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:25 nDuff: *shrug*. *plonk*.

11:37 poppingtonic: Hello

11:38 kmicu: is it me you're looking for?

11:38 I can see it in your eyes

11:38 I can see it in your smile

11:39 poppingtonic: technomancy: I'm having a problem with leiningen's self-install procedure

11:39 I keep getting this message: http://pastebin.com/QVx0cYWy

11:40 hi kmicu

11:46 nDuff: ~pastebin.com

11:46 clojurebot: Pardon?

11:46 nDuff: Eh.

11:46 poppingtonic: 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:48 kmicu: curl: (23) Failed writing body (0 != 7775)

11:49 nDuff: oh, no set -x log provided?

11:49 that's not very useful.

11:49 poppingtonic: ...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:50 poppingtonic: 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:50 poppingtonic: you could fix that like so: sudo chown -R brian /home/brian/.lein

11:55 poppingtonic: nDuff: you sir/madam deserve internet goodwill. Thank you, I can now download leiningen. :)

11:57 clr

11:57 oops, wrong terminal

11:57 instilled1: Hi 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:57 functionform: the 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:58 clj_newb_2345: anyone here writing actual apps in pedestal? (https://github.com/pedestal/app-tutorial/wiki/Debug-Messages)

11:58 this seems like quite an interesting model

11:58 with the messages and "diffs"

11:59 instilled1: I've tried to use (wrap-json-body hndlr {:keywords? true}) but that did not seem to help.

12:01 racycle: instilled1: use clojure.data.json/read-str and this option with :key-fn as keyword

12:03 instilled1: more here: https://github.com/clojure/data.json

12:04 instilled1: racycle: ok. so i shall retrieve the request body and "manaually" parse it with data.json.

12:04 racycle: thanks!

12:04 racycle: instilled1: no problem

12:18 instilled1: racycle: 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:20 racycle: instilled1: i use wrap-json-params and just look at the :query part of the map

12:20 instilled1: i'm sure there are many other ways to do it. This worked for my needs

12:30 instilled1: racycle: cheers. will investigate other options…

12:30 racycle: instilled1: sure, let me know if you come up with something more elegant.

12:31 coventry: The 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:31 technomancy: coventry: unfortunately I think the nrepl.el defaults have changed to hide stuff like that =\

12:32 (setq nrepl-popup-stacktraces t)

12:32 seangrove: The nrepl-popup-stacktrace is annoying as hell

12:32 Until you've forgotten you turned it off and you're not getting any proper stacktrace at all inside of nrepl

12:33 coventry`: 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:41 egghead: hmm, 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:42 tbaldridge: egghead: yes...but think about what happens if your channel consumer is slower than the websocket enqueuer....

12:43 You'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:44 egghead: I 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:45 but it must be somewhere else if the serial put! guarantees order

12:46 and 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:46 tbaldridge: yeah.....to tell you the truth I may be wrong there. Let's look at the impl

12:46 egghead: tbaldridge: I wasn't able to reproduce it in the clj repl

12:46 don't wanna send you on a goose hunt

12:47 tbaldridge: egghead: it may be a bug in the CLJS side

12:48 egghead: tbaldridge: is an unbounded queue more expensive than a buffered queue with a large size?

12:49 are there practical benefits from just saying (chan 1000000) instead of (chan)

12:49 given I'll never foresee having 1000000 messages in my buffer

12:50 tbaldridge: egghead: 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:50 With 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:51 dnolen: egghead: 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:52 egghead: ya, it's hard since I have to reproduce the websocket producer end of things too :p

12:52 but the cljs code itself is small

12:52 dnolen: egghead: 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:53 egghead: what browser are you seeing this in?

12:54 tbaldridge: I'm pretty sure this is a bug in CLJS

12:55 https://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:55 *in the CLJS impl

13:01 dnolen: tbaldridge: oh hm, sidenote should probably be using a custom LinkedList type in CLJS to to avoid array slicing?

13:01 tbaldridge: dnolen: actually yeah, that'd probably be better

13:03 egghead: dnolen: https://www.refheap.com/17062 here's the offending code

13:03 nothing too complicated

13:03 i'll see if I can somehow reproduce it

13:03 dnolen: egghead: still way too much context :)

13:03 egghead: ya

13:03 coventry: The 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:03 dnolen: egghead: but I think tbaldridge is right anyhow

13:04 technomancy: coventry: no, again the docs are wrong =\

13:04 egghead: I know tbaldridge doesn't want me using the protocols but it's so nice to pretend a ws is a core.async chan

13:04 coventry: Thanks, I'll includethat

13:05 egghead: :p

13:05 coventry: In that case, what's the command to compile the entire project in one go?

13:07 technomancy: coventry: nrepl.el doesn't include any file-walking commands afaik

13:08 there might be a deep-reload though; lemme check

13:08 aha

13:08 ;; TODO: implement reloading ns

13:08 =(

13:08 tbaldridge: egghead: 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:09 *though

13:09 coventry: Thanks, technomancy. You can always restart the repl, I suppose.

13:09 technomancy: coventry: (require 'entry.ns :reload-all) if you want to do it by hand

13:12 egghead: tbaldridge: I think I'm just in a sort of 'core.async all the things' mode

13:16 sdegutis: technomancy: ever read Zen and the Art of Motorcycle Maintenance?

13:22 technomancy: sdegutis: haven't, but I know I should

13:22 sdegutis: why should you?

13:23 technomancy: because my brother recommended it

13:25 poppingtonic: sdegutis: I have. Though I have a feeling I should read it again.

13:26 sdegutis: meh

13:27 coventry: Something 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:35 llasram: coventry: Link to tutorial in question?

13:42 sdegutis: not *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:43 llasram: Unix domain sockets may be faster, but there's no standard way to use unix domain sockets from the JVM

13:44 But there is https://github.com/jnr/jnr-unixsocket, which looks nice

13:53 coventry: llasram: http://clojure-doc.org/articles/tutorials/emacs.html#creating_a_project

13:56 llasram: coventry: 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:56 Er, s,`.core.clj`,`core.clj`,

14:03 sdegutis: llasram: daaang

14:04 llasram: thanks for the tip

14:04 coventry: llasram: Thanks, that's what I thought. I'll include that in the pull request

14:10 sdegutis: is there a CLojure TCP lib?

14:15 egghead: dnolen: I worked a bit on making a minimum test case but I couldn't quite get anything consistent

14:16 dnolen: https://www.refheap.com/17064

14:16 I think its some race condition that is hard to hit

14:16 so the slower your computer the better luck you have in hitting it

14:28 justin_smith: insanity wolf: race condition? give it a head start

14:29 would a vm configured to give smaller slices to threads also make it easier to hit them?

14:29 or would it be an os kernel level thing

14:32 _wei: how do you expire the :flash message in compojure? (dissoc resp :flash) doesn't seem to work

14:33 ddellacosta: I'm renaming a namespace within a codebase, and I'm wondering if there are any good emacs tricks to do that?

14:33 justin_smith: ddellacosta: m-x rgrep

14:33 gives clickable links for all matches in all files in subdirs matching regex

14:34 click with mouse or place cursor on text and hit return

14:35 ddellacosta: justin_smith: thanks. I was hoping for something even smarter, like some sort of clojure refactoring thingamajig. But, this certainly gets me much closer.

14:35 technomancy: no one's done find-usages yet for clojure

14:35 justin_smith: ddellacosta: if you find something more clojure smart please share

14:35 technomancy: as far as I know

14:35 I'd love to see it though

14:36 justin_smith: yeah, that would be cool

14:36 * ddellacosta thinks about finally writing some clojure-mode extensions

14:36 technomancy: I tried to talk danielglauser into writing it =)

14:37 ddellacosta: don't do it! write editor-agnostic nrepl commands instead: https://github.com/technomancy/nrepl-discover

14:38 stuartsierra: There's a dumb ns-renaming tool in tools.namespace.

14:38 danielglauser: technomancy: that guy is a slacker

14:38 ddellacosta: technomancy: ah, gotcha, thanks for the tip!

14:38 Raynes: A right asshole, I hear.

14:38 ddellacosta: heh

14:39 stuartsierra: interesting…checking it out now, thanks

14:40 stuartsierra: you're taking about .move? Actually, that's as smart as I need right now I think. Very good, thanks.

14:45 seangrove: technomancy: Isn't that codeq, essentially?

14:46 technomancy: seangrove: I meant that I'd love to see an OSS tool to do that.

14:47 seangrove: The datomic part not being OSS?

14:47 tcrayford: ddellacosta: if you're interested, writing a clojure refactoring tool isn't very hard

14:48 ddellacosta: tcrayford: I believe you, it's more just a question of how lazy I am

14:48 technomancy: seangrove: I haven't looked into the details

14:48 ddellacosta: tcrayford: and along those lines, what priority it would take with all the other side projects I have going one.

14:48 one -> on

14:49 llasram: tcrayford ddellacosta: as long as it has an "extract monad" feature

14:49 tcrayford: ddellacosta/llasram: speaking from experience here, I wrote a clojure refactoring tool for emacs a long time ago

14:49 ddellacosta: llasram: hey now, that's not nice, I have good friends who are monads

14:49 tcrayford: it really isn't a very hard problem, assuming you just punt on macros

14:52 ddellacosta: tcrayford: 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:52 one

14:52 tcrayford: ddellacosta: haha, yeah :/

14:53 ddellacosta: ;-)

14:53 technomancy: fine; I'll add it to the seajure projects list

14:53 you've forced my hand

14:54 ddellacosta: not that it wouldn't be worthwhile as a longer term thing for the community as a whole (sorry technomancy)

14:54 sdegutis: hmm, i think aleph can do tcp

14:55 squidz: what is the difference between put! and >! in core.async?

14:55 justin_smith: sdegutis: doesn't aleph mainly do tcp?

14:55 sdegutis: i dont know, i was looking for a TCP lib in Clojure

14:55 tbaldridge: squidz: put! is a low level function, only really for advanced use.

14:55 sdegutis: seems like aleph will work

14:56 stuartsierra: tbaldridge: What's the cost to creating lots of `go` blocks that don't ever return a value?

14:56 justin_smith: tehre is also (java.net.Socket.) to just create a tcp socket

14:57 tbaldridge: stuartsierra: if a value is never returned, there is the cost of the return channel, that's it.

14:57 justin_smith: (java.net.Socket. "hostname" port-number)

14:57 stuartsierra: tbaldridge: So just an extra object to GC?

14:57 tbaldridge: stuartsierra: that is, the cost of the return channel is wasted. I assume that's what you were asking

14:58 stuartsierra: ish, channels consist of 3 lists + a channel object

14:58 stuartsierra: ko

14:58 tbaldridge: stuartsierra: and perhaps the allocation of a few locks as well. I don't think I've ever benchmarked it.

14:58 stuartsierra: *ok

14:59 Seems like a lot of early examples look like (go (loop [] …)) and don't ever use the channel returned by `go`.

15:00 tbaldridge: yeah. And the way go blocks work, that channel won't get GC'd until the block exists

15:00 *exits

15:00 stuartsierra: That doesn't sound so good.

15:01 Maybe we need an alternate `go` that has no return value. Call it `go-away`. :)

15:01 tbaldridge: lol

15:01 squidz: hehe

15:01 tbaldridge: that being said, it's kindof a bad idea to spawn large numbers of go blocks and never do anything with them

15:02 that creates a unbounded queue

15:02 stuartsierra: Yeah, I caught part of that discussion yesterday, but missed some details.

15:09 ambrosebs: In 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:11 atyz: Does 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:12 dnolen: ambroff: nice!

15:12 oops

15:12 nDuff: atyz: what do you want? lein to set them during invocation?

15:13 atyz: nDuff: that would be great

15:16 bbloom: dnolen: heh, i almost did exactly the same thing. failed tab completion on ambrose

15:19 nDuff: atyz: 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:19 technomancy: atyz: have you tried environ?

15:27 sdegutis: environ is useful

15:34 ddellacosta: stuartsierra: 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:34 stuartsierra: but otherwise worked like a charm.

15:34 stuartsierra: Documentation could be better, I admin.

15:34 *admit.

15:36 gfredericks: lein's ^:test-selectors don't prevent fixtures from running?

15:36 s/^//

15:38 timvisher: why 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:47 atyz: nDuff: technomancy, sorry got called into a meeting

15:48 nDuff: i'll definitely look into that. thank you

15:50 gfredericks: I see it hooks into test-var; and the fixtures aren't handled there :/

15:50 atyz: technomancy: i hadn't - thank you

15:51 gfredericks: I think removing the :test metadata from vars instead would be more effective

15:51 would that be bad?

16:03 jouiswalker: how do a read files containing unicode in clojure?

16:03 my strings get munged with \ufffd

16:04 seangrov`: Hrm, find-usages via tools.reader surely couldn't be too difficult

16:04 Famous last words, I assume

16:05 jouiswalker: possibly

16:05 a quick check at the file in question reveals iso-8859-1

16:05 so maybe i can avoid wasting some effort

16:14 timvisher: what'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:14 technomancy: gfredericks: test fixtures are kinda half-baked

16:15 I mean, they're implemented as a monkeypatch, so they do as well as you can expect, but there's still weirdnesses

16:15 sdegutis: try nevermore

16:15 its fixtures are designed to be more sane and easy and flexible

16:16 https://github.com/sdegutis/nevermore#fixtures

16:16 rlb: timvisher: (future ...) should be one way.

16:16 sdegutis: </plug>

16:16 technomancy: gfredericks: oh

16:16 I just realized what you were suggesting

16:16 so it could be done without a monkeypatch

16:16 clever

16:20 timvisher: rlb: that works. thanks! :)

16:21 gfredericks: technomancy: the test fixtures in clojure.test don't seem to be a monkey patch

16:21 they're just run outside of test-var

16:21 technomancy: the main reason I'd be hestitant to remove the :test metadata is since it's a global side effect

16:21 it could be reversed (though no reason to 99% of the time)

16:21 could also be moved to an alternate key like :removed-test just in case

16:22 come to think of it though this would require enumerating all the vars, which the current approach avoids

16:24 clojure.test just uses ns-interns, so not too hard

16:24 we could hook around test-ns instead and do it at that point

16:24 * gfredericks goes to create a github issue

16:30 technomancy: gfredericks: sorry, selectors are a monkeypatch

16:31 stuartsierra: Do people keep trying to work around clojure.test because they don't know how to fix it?

16:31 gfredericks: it seems to preclude the 80% use case though

16:32 technomancy: stuartsierra: I could fix the code; getting it accepted upstream just isn't worth the trouble.

16:33 stuartsierra: technomancy: I might be able to help with that, if you're at least willing to submit a patch.

16:33 gfredericks: are we talking about fixing something in particular, or something starting with design work?

16:33 dakrone: stuartsierra: plus, getting it accepted into clojure.test means waiting another 6-18 months for the next clojure release to use it :P

16:33 technomancy: yeah, at least the monkeypatches work retroactively

16:33 clj_newb_2345: what's a good library to read for writing peg parsers in clojure?

16:33 stuartsierra: I can't do anything about the release cycle.

16:34 clj_newb_2345: phrased another way: what's a readable library for peg parsing code?

16:34 gfredericks: stuartsierra: I don't mind putting work into contributing, I just assume that the design phase is difficult

16:34 stuartsierra: But seriously, if something about clojure.test inhibits tooling, fix it and submit a patch.

16:35 amalloy: technomancy, 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:36 gfredericks: amalloy: yeah that would give a much more obvious hook point

16:36 so this has been patched for 9 months now?

16:37 not tested I guess

16:37 so I can work on this

16:38 there doesn't seem to be an obvious way to handle the :once fixtures

16:43 _wei: trying 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:46 gfredericks: I think clojure.test runs them regardless of whether there are any tests to run around

16:46 maybe the nicest thing would be the ability to exclude entire namespaces of tests

16:46 that would take care of the :once case nicely

16:48 coventry: Should 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:48 noncom: ztellman: 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:49 ztellman: noncom: I don't think that's a problem, I create uberjars with aleph/lamina regularly

16:49 it is, however, pretty slow

16:49 noncom: but 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:49 amalloy: fwiw i just made an uberjar out of aleph/master and it took like six seconds

16:50 noncom: hmmmm

16:50 coventry: Ah, I think I need to install the jdk. https://github.com/pallet/ritz/issues/28

16:50 noncom: very strange...

16:50 ztellman: haha, yeah, 30 minutes is a bit long

16:50 can you post a gist with your full list of dependencies?

16:50 noncom: yes, wait

16:50 ztellman: also, what version of lein are you using?

16:50 amalloy: ztellman: i'd be inclined to say it's something in his project, not the dependencies

16:50 akurilin: Is 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:51 amalloy: akurilin: don't call conj :P

16:51 gfredericks: ,(conj [])

16:51 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$conj>

16:51 akurilin: amalloy, would I have to reduce in this case?

16:51 ztellman: amalloy: I tend to agree, I just want to make sure there's nothing obviously wonky

16:51 amalloy: akurilin: question is far too broad and ill-specified. god knows

16:51 gfredericks: akurilin: your question is pretty weird

16:52 amalloy: gfredericks: i imagine he's doing something like (-> xs (conj (when whatever (something else)))) and wants to skip the conj step

16:52 ztellman: akurilin: you maybe want concat?

16:52 amalloy: but he hasn't given nearly enough detail to know

16:52 akurilin: I'm trying to build a list by recursing through a tree.

16:52 ztellman: ,(concat nil nil)

16:52 clojurebot: ()

16:52 amalloy: akurilin: probably mapcat, then

16:53 akurilin: A list of nodes that match a certain predicate.

16:53 noncom: ztellman: https://www.refheap.com/17067

16:55 ztellman: noncom: it's possible quil has some non-daemon threads, but I don't know why tweaking the aleph version would have any effect

16:55 noncom: also 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:55 ztellman: allright, i will investigate into this further and let you know

16:55 ztellman: make sure you run 'lein clean' before uberjar

16:55 amalloy: technomancy: a heretic! ^

16:56 llasram: More like `lein unclean`

16:56 ztellman: haha, maybe I'm the only one who's been bit by not running clean, but I definitely have

16:56 technomancy: amalloy: there are definitely cases where it's necessary, but those cases are bugs in lein

16:56 I think 2.3.0 will squash a lot of them

16:57 amalloy: ztellman: i have too. AOT really introduces a lot of tricky issues

16:57 technomancy: (modulo crazy protocol stuff)

16:57 ztellman: technomancy: glad to hear it, but I'll probably hold onto my voodoo regardless

16:57 amalloy: it's just technomancy gets sad anytime someone runs lein clean

16:57 technomancy: amalloy: it reminds me of my own failings

16:57 amalloy: yeah, i just realized the only reason for me to bring it to your attention would be if i like seeing you sad

16:58 technomancy: haha

16:58 clojurebot: lein clean?

16:58 llasram: Or to guard him against hubris

16:58 clojurebot: lein is not clojure

16:58 technomancy: hmm

16:58 llasram: As the servant whispering in the ear of a Roman general on the day of his Triumph

16:58 Remember: your code too has bugs

16:58 ztellman: technomancy: Camus said that Sisyphus was happy, so cheer up

16:59 technomancy: (defproject [...] :memento :mori)

16:59 hyPiRion: Even king Leonidas had off-by-one errors.

16:59 technomancy: clojurebot: lein clean is usually the equivalent of taking out the NES cartridge, blowing in it, and reinserting it.

16:59 clojurebot: In Ordnung

17:00 bbloom: technomancy: that totally works. don't ruin my childhood

17:00 clj_newb_2345: instaparse is amazing

17:00 amalloy: technomancy: well, that procedure actually did help. not because of the blowing, but because of the removing and reinserting

17:00 bbloom: clj_newb_2345: yeah, it's pretty damn good

17:01 leifw: "<amalloy> technomancy: well, that procedure actually did help. not because of the blowing, but because of the removing and reinserting"

17:01 amalloy: *chuckle*

17:01 technomancy: brb changing desktop background to http://www.wga.hu/art/b/bocklin/selfport.jpg

17:01 * leifw apparently only pays attention to #clojure when it gets racy

17:02 amalloy: leifw: i'll take "NES or NSFW" for $500

17:02 technomancy: amalloy: sometimes `lein clean` helps because people do it and then restart

17:02 amalloy: restart what?

17:03 technomancy: the repl or whatever

17:04 Raynes: callen: Here, have some Elixir for turning git repos into git submodules: https://www.refheap.com/17069

17:04 ztellman: still waiting for 'lein unslime'

17:06 clj_newb_2345: hmm, how do I say "arbitrary character" in instaparse?

17:06 noncom: i'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:06 ahh i hoped that was a simple solution but no

17:07 ztellman: noncom: 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:07 and if you're extra lucky, it will have a name that reveals where it came from

17:08 best of luck, I've been down this path before and it's not fun

17:08 nDuff: clj_newb_2345: #'.'

17:08 clj_newb_2345: nDuff: looking at the docs, this is by using #'' to specify a regex, and the "." is interpreted as the regex "anything" ?

17:08 amalloy: ztellman: bet you a dollar it's clojure-agent-send-off-pool0, or whatever their naming scheme is

17:08 nDuff: clj_newb_2345: exactly.

17:09 technomancy: couldn't you decorate the Thread class with some crazy bytecode thing to log its creation?

17:09 noncom: ztellman: 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:09 ok, i'll go research more!

17:09 ztellman: technomancy: I'd alter-var-root the Clojure entry points first, that sounds easier

17:09 technomancy: right; that'd be quicker

17:10 ztellman: noncom: for reference, those are send and send-off

17:10 technomancy: future and agent

17:10 err

17:10 ztellman: and future, right

17:10 noncom: thanks!

17:10 amalloy: technomancy: i don't think you can easily change how arbitrary threads are created

17:10 you'd have to change the threadfactory of the threadpool you're interested in, or similar

17:10 technomancy: amalloy: what about with a -javaagent?

17:11 supposedly lets you instrument arbitrary classes

17:11 amalloy: lord, i dunno

17:11 probably, agents can do anything. but it doesn't sound easy

17:12 clj_newb_2345: with java regex, is ther anyway to have a "." that can also match vs "\n" ?

17:12 amalloy: $google java regex flags

17:12 lazybot: [Lesson: Regular Expressions (The Java™ Tutorials > Essential ...] http://docs.oracle.com/javase/tutorial/essential/regex/

17:12 glosoli: Hmm 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:13 clj_newb_2345: hmm, apparently I need to enaable DOTALL

17:13 or use ?s

17:13 technomancy: glosoli: C-c C-k to compile; C-c C-n to switch the repl to the right namespace

17:14 I think the readme covers this?

17:14 pbostrom: C-c M-n to switch ns

17:16 noncom: technomancy: how can i make lein to include everything that is in resource-paths into the uberjar?

17:16 glosoli: technomancy, pbostrom thanks :)

17:16 clj_newb_2345: Dotall 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:17 llasram: clj_newb_2345: It's a literal `(?s)`, like `#"(?s)."`

17:18 clj_newb_2345: llasram: worked; thanks!

17:18 technomancy: noncom: you don't need to do anything

17:19 justin_smith: ,(re-find #"(?s)." (str \newline))

17:19 clojurebot: "\n"

17:19 justin_smith: it matched!

17:19 noncom: so, if it did not happen then there was some error somewhere?

17:19 ztellman: amalloy technomancy: I think you could just instrument allocation with yourkit and look for where threads are being created

17:19 I dunno how easy it is to do that automatically on a lein task

17:20 technomancy: :java-agent support was just added in 2.2

17:21 noncom: is it possible to compile a program with leiningen, where the entry point is not in a clojure namespace, but in a java class?

17:21 technomancy: noncom: an uberjar or lein run?

17:21 poppingtonic: technomancy: I'm getting weird problems with my leiningen installation process, again: http://pastebin.com/DbU5VPF4

17:22 noncom: technomancy: both?

17:23 technomancy: poppingtonic: pretty weird. I don't know why your curl can't connect to S3 other than having a weird CA store

17:23 noncom: lein run supports it. not sure about uberjar.

17:23 noncom: tias?

17:23 coventry: I'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:24 noncom: what is tias?

17:24 technomancy: try it and see

17:24

17:24 clojurebot: tias is try it and see

17:24 clojurebot: In Ordnung

17:24 noncom: ah, right :)

17:25 poppingtonic: technomancy: How do I fix the CA store? Isn't that s3's job?

17:25 technomancy: poppingtonic: it's up to your OS to provide a certificate store with which curl can verify its connection to S3

17:26 clj_newb_2345: is there a way to force instaparse to be greedy?

17:26 technomancy: but the error message has a description of how to turn off certificate verification if you don't care

17:27 coventry: Oh, stracing it, lein appears to be using java 6. I will try that jdk.

17:28 Success!

17:29 poppingtonic: Hmmm.

17:29 By turning off certification, I lose automatic proof-of-security

17:30 nDuff: poppingtonic: 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:30 poppingtonic: So I'll have to do it myself. Where can I get leiningen-2.0.0-standalone.jar's .asc file?

17:31 nDuff: poppingtonic: 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:31 * nDuff recalls when GitHub moved to a CA that wasn't recognized by RHEL5 out-of-the-box. *grr*.

17:31 poppingtonic: I believe Ubuntu 12.04 LTS still enjoys support.

17:32 * nDuff also tends to consider use of niche CAs irresponsible for large companies running paid services, but that's a separate discussion.

17:32 technomancy: poppingtonic: I think you just append .asc to the jar's URL?

17:32 nDuff: poppingtonic: ...so, I haven't actually seen the error, since you pasted it on that place full of ads.

17:32 poppingtonic: 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:33 poppingtonic: My system clock deviates from time to time, which seems to be a pervasive problem with Ubuntu..

17:33 But it's running properly afaict

17:34 llasram: Are you running ntpd?

17:34 technomancy: yeah, "unknown ssl error" might not be a certificate problem; those are usually more specific with the error messages IIRC

17:34 poppingtonic: yep, but not as daemon.

17:34 technomancy: poppingtonic: just confirmed re: the .asc file

17:35 poppingtonic: so I just append .asc to the url?

17:35 technomancy: yeah

17:35 poppingtonic: nDuff: what alternative paste can you suggest?

17:36 nDuff: poppingtonic: refheap.com, gist.github.com, ix.io, sprunge.us

17:36 poppingtonic: the first of those is written in Clojure, so using it is dogfooding somewhat.

17:36 poppingtonic: technomancy: got it.

17:37 technomancy: poppingtonic: does wget fail too?

17:37 nDuff: poppingtonic: you'd also get more useful details by using, say, openssl s_client -connect hostname:443

17:37 clj_newb_2345: dumb question: how does parsec and packrat differ?

17:37 (for parsing)

17:37 nDuff: poppingtonic: ...which would give you a dump of the SSL negotiation and some actual details in terms of why validation failed.

17:38 technomancy: I'm curious as to why it failed, but I don't know a lot about debugging SSL

17:38 just that an outdated CA store is the most common source of problems we've seen historically

17:39 poppingtonic: is s_client a variable or a flag to openssl? I havent used it for anything other than md5 hash checking.

17:39 oh, seen the man.

17:39 nDuff: poppingtonic: subcommand.

17:43 Has anyone looked at how separable Pedestal's FRP model is from the rest of the framework?

17:43 callen: Raynes: does Elixir have something nicer than ports in its stdlib or something?

17:43 Raynes: callen: No.

17:43 callen: Why do you ask?

17:43 Oh, System.cmd

17:43 poppingtonic: nDuff: I get "connect: Connection refused \n connect:errno111"

17:43 Raynes: Yeah, that's a wrapper around Erlang's os:cmd, which is basically clojure.java.sh without the ability to do… well anything.

17:43 It just happened to be good enough for this purpose, callen.

17:43 poppingtonic: *errno=111

17:44 nDuff: poppingtonic: well, there you are -- it's not a SSL negotiation failure, it's a TCP connection failure.

17:44 callen: Raynes: 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:44 * technomancy chooses to believe nDuff called that without looking it up

17:44 Raynes: callen: true_droid is writing https://github.com/alco/goon

17:44 Because of my issues with Erlang's ports.

17:44 poppingtonic: stuff of the gods

17:45 callen: Raynes: it's Golang.

17:45 Raynes: In other news, the discussion I started on the Erlang mailing list has turned into a nice big wank fest between PhDs and such.

17:45 callen: Yeah, but it was either Golang or C or <insert natively compiled language here>

17:45 poppingtonic: heh

17:45 amalloy: technomancy: well, "connection refused" is a big hint; i don't think he has errno 111 memorized

17:45 fun as it would be to build up a whole mythology around nDuff

17:45 technomancy: amalloy: oh, I only saw the second line

17:46 callen: Raynes: should've used Rust with Elixir for maximum hipster-hood.

17:46 Raynes: callen: :p

17:46 poppingtonic: but really, errno 111 does mean "connection has been refused".

17:48 I think I like refheap already :) /dogfooding

17:49 callen: Raynes: I'm actually half serious about that.

17:49 Raynes: poppingtonic: :D

17:50 callen: I think true_droid actually likes Golang for some reason though.

17:55 callen: Raynes: sad-face :(

17:55 poppingtonic: What's the state of Clojure on Android these days?

17:56 callen: poppingtonic: not a fantastic idea, not likely to change.

17:57 nDuff: poppingtonic: ClojureScript is probably practical for use. Clojure, not so much.

17:57 * poppingtonic gnashes his teeth. Bah! A man can dream, can't he?

17:58 gfredericks: I don't know anything about android and am curious what the issue is; memory usage?

17:59 bbloom: gfredericks: my guess would be startup time

17:59 nDuff: gfredericks: that's part of it -- garbage collection isn't particularly great there, and clojure relies a great deal on GC performance.

17:59 bbloom: gfredericks: startup of clojure involves compilation & a lot of stuff

17:59 poppingtonic: partly. iirc, the install files get massive due to needing to carry the entire clojure jarfile together with your app.

17:59 s/carry/bundle

17:59 bbloom: cljs is a bit different b/c the clojure is precompiled to javascript, but then you still need to load & compile that javascript

18:00 might 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:01 poppingtonic: bbloom: that doesn't seem like such a big problem, considering phonegap/apache-cordova does something similar.

18:01 bbloom: those do javascript tho, right?

18:01 poppingtonic: only, cljs goes one level higher.

18:02 bbloom: javascript compilation is lazy & heavily optimized

18:02 clojure compilation on startup is eager & there is no tree shaking or anything like you get with cljs via gclosure

18:03 poppingtonic: bbloom: it's the same project, it just has different names for different versions, when the project was taken up by the apache guys.

18:03 and girls.

18:03 bbloom: it's a js framework tho, right?

18:03 poppingtonic: yep. js->android/ios/symbian

18:04 egghead: but doesn't it just use the js instead of a web container ors omething

18:04 inside*

18:05 I know some people are using cljs to good effect on mobile

18:05 http://theweathertron.com/ is one that comes to mind

18:09 poppingtonic: hmmm...looks good

18:10 dnolen: egghead: iOS 7 will ship with a JSC bridge

18:10 so scripting native apps and thus CLJS shouldn't be very difficult

18:12 poppingtonic: Still leaves me to wonder why I'd want a repl in my (hypothetical) iPhone. Except for the sheer cool, of course.

18:12 bbloom: poppingtonic: would be absurdly useful for debugging :-)

18:13 everything needs an evaluator and a repl server!

18:13 dnolen: seems like Android still needs to get it's act together with a "native" JS bridge that doesn't involve a WebView?

18:14 hiredman: bbloom: clojure.core is aot compiled in the clojure jars last I checked

18:14 poppingtonic: If 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:14 hiredman: or maybe that got split in to a different jar or something

18:14 bbloom: oh, ok

18:15 technomancy: hiredman: isn't -slim the one that leaves out AOT?

18:15 hiredman: technomancy: maybe?

18:26 glosoli: Do you people use some package for indentation on Emacs ?

18:28 poppingtonic: glosoli: auto-indent-mode

18:28 glosoli: poppingtonic: So like never indenting manually using tabs ?

18:30 coventry`: 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:30 llasram: glosoli: Try hitting `C-j` instead of `Enter/Return`. If that works, then you just need to remap some keys

18:31 poppingtonic: glosoli: yeah. However, my clojure-mode autoloads Fill mode and Paredit, which do the same thing. Paredit, I believe, is what handles the indentation.

18:31 llasram: glosoli: 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:31 glosoli: llasram nah C-j as Enter just creates new line

18:32 aa

18:32 llasram: Huh

18:32 glosoli: llasram: sorry got confused

18:32 Kinda new to the Emacs world

18:32 is there some way I could open docs on the selected symbol ?

18:33 llasram: With nrepl.el, C-c C-d. You can hit `C-h m` in most modes to see a list of what they provide

18:33 poppingtonic: are you using nrepl.el?

18:33 glosoli: Kinda 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:33 poppingtonic: Yeah I am

18:33 poppingtonic: what llasram said

18:35 glosoli: aah works fine, ok thanks!:)

18:36 thanks for the help again and good night

19:20 justin_smith: a) what the hell javax.imageio/ImageIO/read cannot handle cmyk jpeg

19:21 b) what the hell there is cmyk jpeg?

19:26 brehaut: justin_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:26 Raynes: brehaut: YOU.

19:27 justin_smith: brehaut: but at least the presence of that data does not break my auto-image-optimization lib :)

19:27 brehaut: justin_smith: well no, but it is still bananas

19:27 justin_smith: true enough

19:27 TimMc: It also stores your geographic location and the last 5 pages in your browser history.

19:27 The pages, not just the URLs.

19:28 brehaut: TimMc: that explains the bloat when not 'saved for web'

19:28 TimMc: Yeah, the default is "saved for NSA".

19:30 brehaut: vaguely related http://i.imgur.com/svyjbZr.jpg

19:31 (the new zealand government's response to prism etc is 'fuck em, lets just make it legal')

19:32 TimMc: D-:

19:32 Unfortunately, it's legal in the US as well -- unconstitutional, but legal.

19:34 Bah, I need to get a new shell server so that I can keep IRC open in lurk mode.

19:35 clj_newb_2345: http://www.infoq.com/presentations/Parser-Combinators is worth the time it takes to view it

20:17 akurilin: Say 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:18 Raynes: It's pretty hard to beat that level of easy.

20:18 callen: akurilin: yes

20:19 akurilin: well, *EASIEST* is paying somebody else to write (memoize …)

20:19 akurilin: Basically I just want to save on DB round trips. Is memoize a good fit for that case?

20:19 callen, ;)

20:19 callen: akurilin: if it's small, yes.

20:19 akurilin: and if liveness isn't a concern.

20:20 I've used thread-global timestamps to trip caches before.

20:20 akurilin: callen, 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:21 callen, Raynes, thanks for confirming, gentlemen.

20:43 callen: Raynes: I like the new picture. Happy.

20:43 Raynes: callen: What new picture?

20:44 coventry`: 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:45 callen: Raynes: github!

20:45 Raynes: Stalker.

20:45 callen: :(

20:45 Raynes: I was pointing a friend to your tentacles library.

20:46 Raynes: :p

21:10 timvisher: i'm trying to get an nrepl session connected to a piggiebacked clojurescript browser-repl.

21:11 i've got a cemerick.piggieback/cljs-repl listening on :9000 and the browser is connected to it

21:11 i validated this by `(js/alert "Ohai")` from the console and the alert indeed does appear in the browser

21:12 clj_newb_2345: maybe I'm an idiot. I tried parsatron and instaparse -- is there any _fast_ clojure parser ?

21:12 it should not take seconds to parse 1000 lines of code

21:12 * gfredericks opens up the tests for leiningen.test and straps on his meta-helmet

21:12 timvisher: the nrepl server is listening on port 56249 and i can connect to it via `nrepl` from emacs

21:12 but at that point i can't interact with clojurescript at all, it would seem

21:12 am i doing anything obviously wrong?

21:12 project source here: https://github.com/timvisher/bible-plan

21:13 arohner: clj_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:13 clj_newb_2345: arohner: 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:14 bbloom: clj_newb_2345: have you tried the "parses" (note, not "parse") function on your grammar with instaparse?

21:14 if your grammar is highly ambiguous, that might be causing some slowness

21:14 timvisher: the 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:14 i could be barking up the wrong tree

21:14 clj_newb_2345: bbloom: 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:14 arohner: hrm, looks like instaparse didn't exist (or wasn't mature) when I last needed a parser

21:15 bbloom: clj_newb_2345: the docs discuss "peg extensions"

21:15 clj_newb_2345: bbloom: yeah, but it's more like "we'll steal a few features" ... but no way to make * greedy

21:15 bbloom: clj_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:16 clj_newb_2345: bbloom: I'd prefer something more limited that I can iterate on

21:16 I'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:17 then there's https://github.com/ericnormand/squarepeg .. which I'm not sure if it has a theoretically sound foundation

21:17 maybe I should stop bitching and write yet another clojure parsing library :-)

21:17 coventry`: Is there a debug mode for nrepl which logs the communication between the processes? nrepl-ritz-line-breakpoint seems to fail silently.

21:19 technomancy: coventry`: yeah, `lein help sample` will show you a logging middleware as an example

21:19 nrepl middleware

21:19 timvisher: i swear i'm the only one who doesn't like interacting directly with the repl

21:20 every tutorial i can find all talks about merrily typing into a readline process

21:20 do you then manually copy and paste code into your source files when you're done with them?

21:20 :\

21:23 callen: timvisher: my REPL lives in Emacs.

21:24 timvisher: 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:24 kind of like beer.

21:24 timvisher: callen: 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:25 callen: there's an nRepl process running, then nrepl.el is the client.

21:26 timvisher: that'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:26 callen: hum.

21:26 I generally live in the REPL, the source files are secondary.

21:26 timvisher: I can't seem to set up that work flow in Clojurescript. Trying to get piggieback working.

21:27 callen: there's a lot of browser REPL stuff that the serious CLJSers seem to like.

21:27 they're probably like me.

21:27 timvisher: so you then copy and paste your source code out of the repl into source files?

21:27 have you ever had emacs crash while you're working on something?

21:28 callen: it's a continuous process and it's bidirectional

21:28 clj_newb_2345: input: (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:28 timvisher: the 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:28 callen: if I'm editing an existing function, I'll just eval it and work with it in the REPL

21:28 clj_newb_2345: s is a long string, and I'd prefer to avoid constructing new strings if possible

21:28 callen: new development starts in the REPL and gets migrated to the source file in chunks.

21:28 timvisher: my repl is in emacs.

21:28 timvisher: it's an editing environment isomorphic with my source file editing env.

21:29 timvisher: one day someone will pair with me and i'll have my mind blown by that workflow's effectiveness. :)

21:30 i've only ever experienced the ecrd cycle and the style of interactive development i now use

21:30 clj_newb_2345: callen: where can I read about this magical repl work flow you have?

21:30 callen: anywhere a Lisp + Emacs user brags on their blog.

21:31 I started in CL.

21:31 clj_newb_2345: n/m, I use vim

21:31 callen: timvisher: pairing is really the way to go.

21:31 clj_newb_2345: well then you're fucked regardless.

21:31 timvisher: so is there any way to have nrepl.el connect to the clojurescript repl?

21:31 callen: timvisher: for learning new workflows anyway.

21:31 timvisher: piggieback.

21:32 timvisher: apparently connecting to the port that nrepl listens on doesn't drop you into the clojurescript process, and 9000 isn't an nrepl server.

21:33 do 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:33 coventry`: technomancy: Thanks. I'm trying that clause out.

21:34 timvisher: i've read a lot of lisp and emacs blog posts but i don't think i've seen any that talk about that

21:34 every one seems to just take it as read that if you're developing lisp you are typing at the repl

21:35 without ever considering that you can interact with the repl via the source files

21:41 cemerick: clj_newb_2345: vim is capable of providing a quality REPL experience. vim-fireplace is a great start.

21:41 clj_newb_2345: cemerick: I'm using vim-fireplace together with clojure.tools.namespace

21:41 cemerick: you're on the right track, then

21:41 clj_newb_2345: cemerick: however, I recently playing with pedestal, and it just blew my mind away

21:41 the fact that in dev mode, a url request will _recompile my clojure code_

21:41 that is something else for a workflow

21:42 cemerick: heh, I didn't realize that

21:42 Sounds...problematic. :-P

21:42 timvisher: got 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:42 cemerick: reminds me of JSPs, though that's not as much of an insult as it probably sounds like

21:43 timvisher: the 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:43 veckon: anyone 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:52 gfredericks: seancorfield: ping

22:01 veckon: afaict you don't need these to be macros

22:01 but I'm not quite getting what you're trying to do

22:01 I just know those macros aren't doing anything macrolike

22:01 noonian: cant you just (let [meta-data (meta col)]... and then at the end return the col with the meta data?

22:02 clj_newb_2345: trampoline is awesome

22:02 * clj_newb_2345 jumps up and down

22:03 timvisher: cemerick: i'm trying to debug why i need to manually call `clojure.browser.repl.connect.call(null, "http://localhost:9000/repl")` 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:03 clj_newb_2345: so simple too; I really like how thtat "the jvm lacks tail recursion" can be solved by a few-line function

22:03 gfredericks: "solved"

22:04 veckon: I don't *need* the macros, I'm just experimenting with syntax for interacting with channels in a UI.

22:04 timvisher: the 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:04 veckon: And noonian - yeah, that would be nice. But sorts return a funky type

22:05 timvisher: however, once i run the .connect call directly in the browser, the long poll starts up just fine.

22:05 cemerick: timvisher: 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:05 timvisher: a hah. interesting that the log functions are executed.

22:05 cemerick: timvisher: do you see the Ohai's?

22:05 timvisher: yes.

22:05 cemerick: hum

22:06 well, that shoots a hole in my theory, then :-P

22:06 I'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:06 timvisher: suppose this would be useful as well https://github.com/timvisher/bible-plan/blob/master/resources/public/index.html

22:07 i am indeed requiring that namespace

22:07 cemerick: timvisher: yeah, I'm stumped

22:08 timvisher: go ahead and template in that call :-P

22:09 timvisher: what'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:09 lol. i'll give that a try

22:09 veckon: So the problem is: sorts return an array in cljs. Arrays apparently don't implement IWithMeta. That was my problem.

22:09 Extending it solves it for me

22:16 timvisher: cemerick: 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:16

22:16 * timvisher mindblown

22:17 timvisher: https://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:18 night night folks. happy coding!

22:18 cemerick: timvisher: wait, removing `goog.require('piggieback_browser');` fixed it?

22:20 veckon: I ran into a similar problem with piggieback when the goog namespace was munged by the compiler.

22:26 seancorfield: gfredericks: you rang, sir?

22:28 fowlslegs: Is 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:32 xeqi: fowlslegs: what are you trying to do? I thinking `apply` might be useful here

22:32 amalloy: fowlslegs: that sounds like a confused question. go back a step; why do you want that?

22:32 fowlslegs: For example what if I want (#(f %&) a b c ...) to return (f a b c ...) instead of (a b c ...)

22:32 ?

22:32 amalloy: indeed, #(apply f %&)

22:33 of course in this simple case you could just replace the whole thing with f; i assume you have a better usage in mind

22:35 squidz: what are messaging libraries like zeroMQ usually used for?

22:38 fowlslegs: Why 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:38 echo-area: cemerick: What inspired you of the maze programs in your book? Were they the first choice?

22:38 fowlslegs: Very cool site by the way.

22:38 And yep, problem #39: Interleave Two Seqs.

22:40 amalloy: fowlslegs: (fn [xs ys] (mapcat list xs ys)) is a nice simple solution, fwiw

22:40 worth studying if it doesn't make sense

22:41 cemerick: echo-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:42 echo-area: Sure. And using that for the zip usage is also seamless

22:43 *for demonstrating the zip usage

22:46 fowlslegs: amalloy: Yes, I used #(apply (partial mapcat list) %&), but mapcat list was all that was really needed.

22:49 squidz: lynaghk: I was asking because I saw your code using core.async together with zeroMQ

22:51 amalloy: huh, someone found a 28-line solution to "interleave two sequences"

22:56 bbloom: surely they didn't handle all of the special cases

22:57 amalloy: bbloom: looks correct to me, actually

22:57 as of course it would be since 4clojure's test cases always provide 100% test coverage...

22:57 bbloom: i was kidding… link?

22:57 amalloy: https://www.refheap.com/a8974c7703ff09ac729ab0846

22:58 and yeah, of course you were kidding. but it was a fun read

22:58 bbloom: heh

22:59 * bbloom checks what he came up with last year

22:59 bbloom: i had "#(mapcat vector %1 %2)" …. just changed that to "mapcat vector"

23:00 :-)

23:03 coventry`: 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:04 gfredericks: technomancy: is it bad for leiningen to use clojure functions added in 1.3?

23:05 in the in-project code

23:09 amalloy: bbloom: mapcat list!

23:10 gfredericks: i think anyone still on clojure 1.2 is probably not running leiningen master

23:10 though of course that's up to technomancy

23:11 bbloom: amalloy: playing golf? or is there some advantage to lists here over vectors?

23:11 gfredericks: you might have an old hairy project you're afraid to upgrade

23:11 amalloy: well, a two-element list is cheaper to create and cheaper to iterate

23:12 no *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:12 gfredericks: ask hiredman what version of lein clojurebot uses

23:14 gfredericks: hiredman: what version of lein clojurebot uses

23:20 hiredman: 2?

23:20 clojurebot: 2 is mark

23:20 gfredericks: and clojurebot is on pre 1.3?

23:21 hiredman: the lion's share

23:22 but the part keeping it on 1.2.1 has been split off, so at some point I can upgrade

23:23 gfredericks: so if `lein test` started breaking because the project was pre 1.3 would you consider that lein's fault or yours?

23:24 hiredman: you assume clojurebot has tests

23:24 gfredericks: can we imagine a world where it does?

23:24 r0bglees0n: lol

23:24 hiredman: guard rails, fuh, where we are going there aren't even roads

23:24 gfredericks: I like to blame every on lein and technomancy

23:25 everything

23:25 gfredericks: leiningen, who wrote technomancy, is responsible for most of the frustrations that have been plaguing the clojure community for the past several years

23:26 that sentence seems kind of plausible since "leiningen" sounds more like a regular name than "technomancy" does

23:33 okay well I am doing my part to push people onto 1.3

23:33 by using every-pred

23:35 hiredman: I 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:38 clojurebot in fact predates lein by maybe a year or more

23:44 https://gist.github.com/hiredman/27733/2381e7989977b8999aa0f863ef0a50415bb6e5fc clojurebot from five years ago

23:49 technomancy: hiredman: oh man remember when clojurebot polled svn for changes

23:49 gfredericks: gracefully degrading in the presence of 1.3 is OK

23:50 err--1.2

23:50 gfredericks: technomancy: graceful???

23:50 lazybot: gfredericks: Oh, absolutely.

23:50 technomancy: (not blowing up, but warning and saying "we're running all the tests lol")

23:50 gfredericks: hrm

23:50 easier to pull out the every-pred

23:51 hiredman: technomancy: remember? as far as I am concered it still does

23:51 technomancy: hahaha

23:52 that was my first clojure oss contribution

Logging service provided by n01se.net