#clojure logs

2012-02-20

00:02michaelr525hello
00:03emezeskemichaelr525: Hello indeed.
00:04emezeskeWoohoo, I built myself a Heisenbug. This should be fun! ^_^
00:13michaelr525Heisenbug?
00:14emezeskemichaelr525: A bug that changes it's behavior, or disappears entirely, when you try to observe it. Sort like Heisenberg's uncertainty principle.
00:16michaelr525oooh
00:16emezeskeA lot of race conditions are like that... You add some logging code or whatever, and it screws up the timing just enough that the bug goes away. Ugg!
00:19technomancyamalloy: do you think that ordered bug would be hard to fix?
00:20amalloytechnomancy: what bug is that?
00:20technomancyhttps://github.com/flatland/ordered/issues/2
00:20technomancyassumed you were watching that repo like a hawk =)
00:21devnovertone is fun.
00:21technomancybtw, does anyone still need a Leiningen sticker?
00:21amalloyi used to stay on top of github notifications, but they changed their UI in some subtle way that makes me completely ignore them
00:21technomancyamalloy: understandable
00:21technomancythe only way I keep up with them now is via email
00:21devntechnomancy: ah, yes, so long as it has a heavy duty moustache
00:21technomancysince I can actually sort and filter that stuff
00:21technomancyI've been saving a really easy issue for a beginner
00:21technomancydevn: moustache thickness guaranteed
00:22devn!!!
00:22devnthat is exciting.
00:22devntechnomancy: i would like to sponsor leiningen contributors
00:22technomancydevn: basically I want you to be able to customize which java is used from within project.clj itself
00:23devnfor every leiningen contributor you get I will send them some spirit gum and a big burly glue-on theatre-quality stache
00:23technomancynow there's an idea
00:23devnim not joking. get adresses and the staches will flow like water
00:24devntechnomancy: that's pretty hardcore. who has that use case?
00:24devn(not saying it's not valid, just never have even thought about it)
00:24technomancydevn: basically I want to be able to do lein-multi-type stuff across JDK versions
00:25technomancyeasy to test across Clojure versions: https://gist.github.com/1846759
00:25devn*nod*, but why? is that a big problem for people?
00:25technomancyI've had a couple bugs in Leiningen that only surfaced on 1.5
00:26devnhow old is that?
00:26technomancyright now 1.7 hasn't been around long, but when 1.8 hits that's potentially 4 different JDKs, plus more if you're crazy enough to care about the IBM ones etc.
00:26technomancyit's ancient, but Clojure supports it
00:26amalloytechnomancy: a fix is just five characters. still researching whether that's the right fix though
00:26emezeskeHey, I want to repeatedly run a function every N seconds from a background thread, while the main thread does other stuff. Is there an idiomatic way to do that? I thought futures might help, but my future never seems to get executed, as I never dereference it.
00:26amalloyemezeske: futures run whether you deref them or not
00:26technomancydevn: anyway, I've pretty much decided to drop 1.5 support, but it would be nice if I found out about the breakage some other way than someone bitching about it in #emacs
00:26devntechnomancy: does it make sense to support 1.5? why not be opinionated and force an upgrade?
00:27emezeskeamalloy: So that should work? I must be doing something crazy
00:27devntechnomancy: if the bug report you received came as a msg on #emacs then I would probably downgrade it even further :)
00:28technomancydevn: so do you want to send this patch or should I do it myself? =)
00:28devn:X
00:29amalloytechnomancy: so the right fix is to duplicate the crazy behavior of APersistentMap.cons, where it checks for MapEntries, then for Vectors, then for a seqable thing of MapEntries. but the general consensus seems to be that that was a crazy thing to do in the first place, so i'm not super-keen on copying it
00:29devnI think I'm advocating not doing it all
00:29devndoing it at all*
00:29technomancyantares_: what do you think? you mentioned offering support for multiple JDKs in Travis, right?
00:30devnas a stakeholder of leiningen I want new features and increased stability, not legacy support
00:30technomancywhat if it was just another profile value that you could set? then a single lein with-profiles call could test against them all
00:30devnbut that's just me
00:30technomancydevn: I don't care about 1.5 at all; I'm thinking 6-8
00:30amalloybecause (merge m ()) comes down to (conj m nil). hash-map handles that by pretending nil is an empty map, whereas i pretend it's a two-element vector with nil k/v
00:30devntechnomancy: ah
00:31devnamalloy: ick
00:31technomancywow, that's gross
00:31devnyeah, seriously, fuck that.
00:31jaimefdevn that you david?
00:31devnjaimef: nope.
00:31technomancyamalloy: if you put it that way I can work around it in lein
00:32amalloytechnomancy: i can easily fix this exact scenario, in a way that doesn't bother me
00:32technomancyamalloy: would into have the same problem?
00:32amalloy(into {} ())? no, that would be fine
00:32devnjaimef: why do you ask?
00:33technomancyamalloy: ok, I'll use that for now then
00:33amalloyin the meantime, i can choose to do nothing when you conj nil, and not fix the behavior when given a map to conj
00:33amalloywell. not "fix" it
00:38devntechnomancy: what's new on the clojars front? ;)
00:39devntechnomancy: i say that in jest only because i havent seen much change. clojars really needs an overhaul. we need rubygems-esque 1:1 dependency + require behavior
00:39technomancydevn: it's next on my plate after getting the lein2 preview out
00:39devnwhenever i am showing someone clojure we come up with a project and i say: great! i know of a library we can use!
00:40devnwe hit clojars, find it under some ridiculous nested: org.manythings.andmore.frederick/alibrary
00:40devnoh right...how do we use it in our project? (ns ... (:require [...]))
00:41devn"hold on a sec, i need to inspect the jar to figure out which freaking namespace this lives in"
00:41technomancydevn: so one thought is to keep the current repository and have a separate "releases" repository that has a higher bar for uploads
00:41devnthat is deadly to noobs
00:41technomancyit will accept uploads over HTTP, which will mean that it will be trivial to check out and hack on yourself without compiling nailgun, setting up a new unix user, etc
00:42technomancyso that means adding support for features like HTML doc hosting would be way easier
00:42amalloytechnomancy: 1.1.0 is on github and clojars now
00:42devnis there any way around the problem of: name of dependency does not match thing you actually use or require
00:42technomancydevn: because what you're describing is a documentation problem
00:42technomancyamalloy: superb; thanks
00:42technomancyamalloy: that's not a simple bugfix bump?
00:43amalloymeh. it changes behavior that wasn't well-defined; whether it's a bug or a new feature or a compatibility break is not defined either
00:43devntechnomancy: *nod*, i suppose it is -- i'm evangelizing clojure like a sonofabitch, but sometimes the dependency stuff is like 2/3rds of the time I spend working with someone on clojure. it seems crazy.
00:43amalloyso i averaged
00:44devntechnomancy: if the other person im pairing with is driving i need to show them how jars are things we can navigate to determine what namespace needs to be required. i can't overstate this: it's crazy.
00:45technomancyhm; that's the one disadvantage of not having jars in lib
00:45technomancyyou can't just pop over to emacs with them
00:46devn(at least for people coming from ruby who say: gem install foo, vim thing.rb, "require 'foo'" -- i realize there are some mismatches there as well, but in clojure land sometimes it is 3x as hard -- you dont have to guess where the - or the _ is, you have to guess at where the _ or - is in 4 different dot-separated portions of the dependency
00:46devnand then guess at whether the library creator used .core as the default
00:47technomancyhuh? you never have _ in require calls?
00:47devnthat's crazy talk from me, just riffing here.
00:47technomancythat seems like a tooling problem though
00:47devni mean, i can't be the only one who sees this when teaching new people the language
00:47technomancywell, a combination of tooling and crappy docs
00:49devn"oh right, you want to use enlive, so you need to type: (:require [net.cgrand.enlive-html :as enlive])
00:49technomancyso what we need is for slime and nrepl to offer tab completion on require and use calls
00:49technomancydoesn't help for people who insist on reverse-domain-style namespaces
00:49technomancybut there's not much hope for them
00:50technomancyright now tab completion only works for stuff that's already required
00:50devnwe have the power to redistribute. people who submit that style should automatically have their repo searched and replaced and have that release cut under "clojars"
00:51devnlike vimscript does it
00:51devngranted that's not 1:1, but they at least say: "okay, we have this zip file, we put it on github for you under vimscript"
00:51technomancyI don't know anything about vimscript
00:52technomancythis is the first time I've heard it used in any context other than "it's the worst thing I've ever seen oh no make the hurting stop"
00:52devnhonestly me either! i've written trace amounts of it and embarassed to say so
00:52devnand am*
00:53devneither way, if you go to the "canonical" website for vim scripts, you find lots of ways they're being distributed. vim-scripts created a github account where they "mirror" them
00:53Scriptorusing lein with mingw32 here, having it crash because of no class def found for jline
00:54Scriptorotherwise lein works fine if I use the batch script from cmd
00:54ibdknoxtechnomancy: what do you use for your blog?
00:54Scriptorplease help me not have to use cmd
00:54technomancyScriptor: is it possible to install rlwrap?
00:54technomancyibdknox: http://p.hagelb.org/Rakefile.html
00:54devntechnomancy: i think we have a problem in our community when it comes to finding what we want, and how to use it *right now*. yes, I realize that is instant gratification territory, but even still
00:54ibdknoxhaha
00:54devnthere are like 3-4 sites that keep track of libraries, how to get them via lein, etc.
00:55devnthat's a smell
00:55ibdknoxnice
00:55technomancydevn: there are?
00:55Scriptortechnomancy: any binaries for it available? I don't have gcc or make installed right now
00:55devntechnomancy: im referring to sites like the clojure-toolbox, etc.
00:55devnthere are others, dont have links off the top of my head
00:55technomancydevn: oh yeah, we definitely need to merge clojars and clojuresphere
00:55technomancythat's on my list too
00:56technomancyScriptor: don't know; sorry
00:57ibdknoxemezeske: me too
00:57emezeskeibdknox: I sent a nice note to the maintainer, didn't hear back. Maybe he's in the bahamas :)
00:57technomancyit's OSS =)
00:57ibdknoxwho wrote it again?
00:57devntechnomancy: i wish i could be more helpful on this front. it seems like the hole just gets bigger every day though.
00:57technomancyibdknox: jkkramer
00:58emezesketechnomancy: There's already several versions floating around, I don't want to add another
00:58emezeskeAlso, I'm lazy
00:58technomancydevn: well I'll be sure to bug you when I get a fully-http clojars working
00:58devnim not trying to be a downer, but the crazy way we all share clojure code is not making it easy to say: "hey, beginner, wanna learn clojure?"
00:59ibdknoxwait
00:59technomancydevn: oddly enough "difficulty finding dependencies" didn't rank very highly on the list of annoyances in http://lein-survey.herokuapp.com/results
00:59ibdknoxwhat's wrong with the way we share clojure code?
00:59ibdknoxgithub works nicely :)
01:00devnibdknox: tell me, how many README.md have instructions for building and installing and using it in their project?
01:00devnwhere it is the library...
01:01devnibdknox: it's layers of garbage people dont have to deal with in other environments
01:01technomancyhow do you not have this issue in Java?
01:01ibdknoxnot sure I understand
01:01devn"What's a SNAPSHOT? Why can't I require the name of the dependency in my (ns) macro?"
01:01ibdknoxthat's true regardless of the mechanism we use. There will always be libraries that will be better documented
01:01technomancythere are plenty of java projects that don't even publish to a maven repo ffs
01:01ibdknoxand made "easy"
01:02devnso wait, java *is* a requirement for clojure?
01:02ibdknoxbut that takes effort, and more people will have to invest in Clojure for more such libs to exist
01:02clojurebotExcuse me?
01:02devnfor learning* clojure
01:02technomancydevn: no, just responding to "other languages don't have this problem"
01:02technomancypython has like three different mechanisms for fetching dependencies
01:02ibdknoxother languages absolutely have the same problem
01:02devnoh, right on
01:02devnyeah, agreed
01:02technomancyocaml has ... oh man, I don't even want to talk about it
01:03ibdknoxhaha
01:03devnyeah, they're all less than great
01:03devnbut i think we can do a lot better
01:03ibdknoxwe do pretty well
01:03technomancyruby has rvm, which redefines your shell's cd command
01:03ibdknoxhaha really?
01:03devnthat's a trump card
01:04devnit's flashy, but i don't think it's related to our problem
01:04dnolendevn: lein is really good compared to what most other languages have.
01:04dnolentechnomancy: argh
01:04Scriptortechnomancy: where exactly does it look for jline? Does it look for a classpath variable?
01:04technomancydid you know you can't shell out to a rake task from one project using bundler to another project using bundler without hunting down a bunch of environment variables to unset first?
01:05technomancyScriptor: jline comes included in the leiningen standalone jar
01:05devndnolen: im just getting crazy about this because ive been scheduling time with people to work with them on clojure projects. i end up explaining more about requiring a lib than anything else
01:05devni mean, i spend 4 hours talking to them about FP too
01:06devnbut when we're just trying to hack on something and see something work, that becomes this whole discussion
01:06Scriptorany reason why it wouldn't find it? I used lein self-install and it fetched 1.7.0
01:06dnolendevn: why does talking about adding a lib take more than a minute?
01:07devndnolen: because we go out to clojars, find that someone released a version of the lib under org.foo.bar.efjdsaio/hello-world "0.2.6"
01:07devnand then i need to explain to them how we put that in the project.clj, and then how the thing we put in project.clj has nothing to do with how we actually require or use it
01:07devnit seems schizophrenic
01:07technomancyScriptor: can't imagine why; what's the precise class?
01:07Scriptorjline/ConsoleRunner
01:07technomancydevn: "some people upload crazy shit. EOF."
01:08devntechnomancy: yes, but apparently /everyone/ uploads crazy shit
01:08technomancyo_O
01:08emezeskeO_o
01:08technomancyScriptor: perhaps the jar it's trying to find doesn't exist at all?
01:08devnoo_oo
01:10Scriptortechnomancy: the leiningen stand-alone jar exists, isn't that what jline should be bundled with?
01:10michaelr525has anyone tried running clojurescript one on windows? after running 'lein repl' i get this error:
01:10michaelr525FileNotFoundException Could not locate one/tools__init.class or one/tools.clj on
01:10michaelr525 classpath: clojure.lang.RT.load (RT.java:430)
01:11technomancyScriptor: yes; I just checked and it's present here
01:11dnolennot a bad showing for Clojure, http://thecodegeneral.wordpress.com/2012/02/19/jvm-language-popularity/
01:11technomancyScriptor: sha1sum ~/.lein/self-installs/leiningen-1.7.0-standalone.jar # gives me 5ae81a504cb7f0d003bbbf27034913b54f6f272d
01:12devndnolen: congrats on the ink, btw.
01:12dnolendevn: ink?
01:12devnnewspaper
01:13dnolendevn: oh thanks!
01:13devnit was cool to read about. much respect.
01:14devnit reminds me a bit of trying to start a clojure group in madison, WI -- sometimes we have 15 people show up, others we have 3
01:15devnbut who cares? im going to do it whether im the only one there or not.
01:19alexbaranoskydevn: that's the way I feel too about our local baznex group - as long as there's one other person there I'm happy
01:19technomancyalexbaranosky: I need to head off, but I'd like to get your help testing midje on leiningen 2
01:20alexbaranoskytechnomancy, what do you need from me? I'm all for it
01:21technomancyalexbaranosky: there are a few breaking changes in lein2 and I want to go over the most common plugins to make sure they've been updated for compatibility
01:21technomancyI wrote a compatibility guide for 1.x and 2.x
01:22technomancynear the bottom of https://github.com/technomancy/leiningen/blob/master/doc/PLUGINS.md
01:22technomancyanyway, if you get a chance it would be great to hear how midje fares with that
01:22technomancyplus any other projects you feel like testing on lein2
01:22alexbaranoskyI'll take a give it a shot
01:23devnalexbaranosky: technomancy: I have 20% time tomorrow. if you guys want me to test projects for a few hours im in
01:23technomancywon't be around much tomorrow but should be able to help you after that if you run into anything
01:23technomancydevn: yeah if you've got projects you could try on lein2 that would be great
01:24technomancyonce you have a checkout on the master branch, the "Building" section at the bottom of the readme should have everything you need to get going
01:24technomancyif you can't get help in #leiningen when I'm not around please ping the mailing list
01:24devni have a project im working on to make the clojure cheat sheet more of a living document, so you can say: (cheat "foo")
01:24devnit sees java.lang.String and replies with the table of create/use/change/etc.
01:24technomancyah, handy
01:24technomancywell, gotta head off; catch you folks later
01:25devnciao technomancy
01:25devnalexbaranosky: i need to run as well, getting late here, but ill be on IRC tomorrow all day. let's try and coordinate and we can test projects against lein2
01:26devn'night all
01:26alexbaranoskydevn: sure thing.
01:40Scriptortechnomancy: not sure if you're still here, but sha1sums were the same
01:55RaynesScriptor: He's off for the night.
01:55RaynesHe doesn't have time for mere peasants like you and I.
01:55tjgilliesdoes clojure have a built in timer function like javascript's setTimeout?
01:57Raynestjgillies: Doesn't setTimeout just wait n milliseconds and then execute something?
01:57RaynesIf that's the case, you can just use Thread/sleep
01:58emezesketjgillies: Maybe something like (future (do (Thread/sleep 500) (my-thing)))
01:58tjgilliesRaynes: emezeske: thnx
01:58RaynesMan, futures are the devil for spinning up threads.
01:59emezeskeRaynes: They're bad?
02:00RaynesWell, if you plan to deref them, no. I've ran into issues where I used a future to spin off a thread that did nothing but side effects (and thus was never deref'd). Errors that occur in a future don't bubble up until you've deref'd them.
02:01RaynesSo if you never deref them, any errors that occur that could otherwise break your program are impossible to find unless you happen to check the value of the future.
02:01emezeskeRaynes: Ah, yeah, that is a problem -- probably not a bad idea to wrap the body of the future in a try/catch and print errors or something
02:04tjgilliesall my future is gonna do is tell an atom to update peridoically
02:05tjgilliesi have a hashmap and i want one of the keys to go to zero every x seconds
02:08Raynes$seen amalloy
02:08lazybotamalloy was last seen talking on #clojure 1 hour and 24 minutes ago.
02:08RaynesHuh. I didn't know he had been here.
02:08amalloystalkerbot
02:08RaynesI also didn't know that plugin still worked.
02:08RaynesI guess it's max that doesn't work.
02:08Raynes$max
02:08Raynes$max #clojure
02:08clojurebotHuh?
02:08RaynesYeah, it's still broken.
02:09ibdknoxlooks like xhr is broken in firefox for CLJS :/
02:09amalloyfwiw, the body of a future is wrapped in an implicit 'do
02:10emezeskeamalloy: nice, thanks
03:02mvid_any idea why this is happening?
03:02mvid_http://dpaste.com/705556/
03:02mvid_those are all of the files that exist in the project
03:02mvid_i can't tell which lib is tripping it up
03:04mvid_nvm
03:04Raynesmvid_: Don't quote the vector after :require
03:04mvid_yea, just noticed that
03:05mvid_that line must have been from a repl
03:59Blktgood morning everyone
07:09clajI'm having problems with åäö in aquamacs && swank-clojure 1.4.0
07:10clajusing slime-20100404, through elpa. is that to antique?
07:22clajgetting this error: byte-code("\302\300\"\210\303 \304\"\210\300\305\"\207" [error process debug slime-net-close t "net-read error: %S"] 3)
07:23clajvery strange, since I've got it working on other mac os x:es just fine
07:23tomojdo you have slime-net-coding-system set?
07:24tomojI'm using the same version of slime (though not mac)
07:24clajhmm, says iso-latin-1. not the same...
07:24clajthx
07:25tomojI setq that to 'utf-8-unix
07:25clajworks. thanks a lot.
07:26clajmiss-spelled this in a conf file.
08:33osa1_`lein deps` started to give this error after adding data.xml to dependencies: http://paste.pocoo.org/show/553929/ can anyone help?
08:37Bronsathis is because there's no public release of data.xml yet
08:40osa1_Bronsa: is it because it's not stable enough? I was planning to use it in a project
08:44Bronsahonestly, i have no idea.
08:44jkkramerosa1_: I cloned the github repo and installed locally (mvn install). it's stable enough for my purposes. the latest version is much better about not using more memory than needed to parse large xml files lazily
09:21osa1_how can I use a record from other namespaces? I tried ns/Record. but didn't work. seems like (use ..) doesn't import records to my namespace
09:24algernonamro: (import namespace.Record)
09:25osa1_strange, I'm getting ClassNotFoundException this time
09:25osa1_oh ok, found it. thanks
09:26algernonosa1_: \o/
09:36Bronsaosa1_: if you're using clojure >= 1.3.0 you can use ns/->Record
09:41osa1_Bronsa: is it a special syntax? how do you use it?
09:41Bronsait's a factory function created when you create a record
09:42Bronsaso instead of importing the record and doing (MyRecord. fields) you can simply use/require the namespace and do (ns/->MyRecord fields)
09:44osa1_wow, that's nice. thanks.
09:47osa1_how can I restart SLIME REPL(or swank session, or whatever I need to restart to reset all definitions I made)
09:47osa1_I was using ,restart in common lisp SLIME but it didn't work for Clojure
09:48osa1_whatever, I just run `slime-disconnect` and the M-x clojure-jack-in again
09:52jcromartieClojure may as well have a splash screen while it's starting up :)
09:52osa1_is there a way to use same generic method for multiple dispatch values?
09:53osa1_or do I have to create a function and call it from different multimethods?
09:59osa1damn I've disconnected just after asked a question, did anybody answer my question?
09:59osa1<osa1_> is there a way to use same generic method for multiple dispatch values?
10:01jcromartieso could Clojure's small startup time be related to loading nearly 3K classes right away?
10:01jcromartieerr
10:01jcromartiebig startup time
10:01jcromartienot small at all
10:04jcromartie~2300 classes
10:04clojurebotExcuse me?
10:04jcromartieclojurebot: I wasn't talking to you, silly bot
10:04clojurebotCool story bro.
10:05pipelineheh
10:05pipelineI actually could answer his question
10:05pipelinewhoops
10:10Bronsaosa1_: you could probably use derive to get that
10:11Bronsa16:10:25 Bronsa: osa1_: you could probably use derive to get that
10:37osa1_anyone here know a library to generate graphiz files? like s-dot for common lisp
10:41Bronsaosa1_: https://github.com/daveray/dorothy
10:46osa1_Bronsa: I found this API https://github.com/pallix/lacij easier but I couldn't (use ) or (require ) it even though I added it to project.clj and run lein deps
10:48Bronsaosa1_: what are you useing?
10:49osa1_Bronsa: (use lacij)
10:49Bronsaindeed
10:49Bronsaosa1_: https://github.com/pallix/lacij/tree/master/src/lacij
10:49Bronsayou see how the namespaces are split
10:49raekosa1_: I tried "loom" a time ago. it did what I needed. (https://github.com/jkk/loom)
10:50Bronsayou have to (use 'lacij.geom.core) etc according to your neds
10:50Bronsa*needs
10:50osa1_Bronsa: yeah, thanks
10:51osa1_raek: thanks. I think I liked lijic's API and I will go with it, I've added this as an alternative though
10:52raeksomeone should open an issue for lacij regarding that what namespace you are supposed to use is not mentioned in the readme
10:52raekwhy is this so common?
10:52Bronsabecause reading clojure is so easy, it's easier than understanding a doc
10:53osa1_raek: yeah I would do that when I arrive home(which takes about 2 hours)
10:53osa1_Bronsa: this way you make your users read the code instead of docs
10:53Bronsaosa1_: i was using sarcasm
10:53Bronsanot easy to understand sarcasm on the internet i guess
10:55osa1_now I have to find which namespace contains create-graph function ...
10:58Bronsaosa1_: lacij.graph.svg.graph
10:58Bronsawoah.
10:58Bronsaosa1_: lacij.graph.svg.graph
11:18lypanov(re-pattern "blah") == #"blah" ?
11:18lypanovrepl says so but just to verify. the docs are a bit mystifying.
11:21dnolen,(doc re-pattern)
11:21clojurebot"([s]); Returns an instance of java.util.regex.Pattern, for use, e.g. in re-matcher."
11:23lypanovdnolen: just taking time to get used to the host symbiosis.
11:24lypanovjust spotted "A regex pattern is read and compiled at read time. The resulting object is of type java.util.regex.Pattern." which makes the above re-pattern doc which i read earlier make sense :)
11:28ivanwhat's different in the second case? http://paste.lisp.org/display/127877
11:30ivanoh right, (println (pr-str names))
11:31gfredericksivan: (println (pr-str names)) should be equiv to (prn names)
11:31raekand more efficient
11:31ivanthanks
11:32gfredericksraek: cuz it doesn't build a string up on the heap?
11:32raekgfredericks: yep
11:33raek(println (pr-str ...)) will create a string writer, print the data to it, create a string from it, and then print that string
11:59chawksHey. Anyone know why something like (seq? [1 2 3]) returns false?
12:02mdeboard,(seq? [])
12:02clojurebotfalse
12:02mdeboardvectors aren't sequences
12:03chawksthey're not? I was under the impression list, vectors are seqs
12:03chawks,(seq? '())
12:03clojurebottrue
12:03chawksso what is a sequence except for lists?
12:04mdeboard,(seq? (cycle (range 5)))
12:04clojurebottrue
12:04mdeboard,(seq? (iterate inc 0))
12:04clojurebottrue
12:04mdeboarditerators and lists
12:05mdeboard,(filter (partial seq?) [[] '() {} #{}])
12:05clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$partial>
12:05mdeboard,(filter #(seq? %) [[] '() {} #{}])
12:05clojurebot(())
12:06devnanyone know their way around enlive?
12:06chawksI see... so... is there another way to check if something is either a vector or a list?
12:06gfrederickschawks: vector? and list? should work
12:06chawksexcept explicitly calling vector?/list?
12:06chawksokay... I guess that actually covers it, so should be good
12:06gfrederickswhat would motivate you to not use those functions?
12:07mdeboardchawks: Er, why not--
12:07chawksgfredericks: Nothing, you're right. It's fine that way
12:07Bronsachawks: you can (some-fn vector? list?)
12:07TimMcchawks: Depends. list? is pretty bad
12:08chawksTimMc: How come?
12:08TimMcWhat you probably want is sequential?
12:09TimMcchawks: lists and seqs get conflated in a lot of the Clojure core codebase.
12:10chawksTimMc: Thanks:)
12:10TimMc&(map sequential? [[5] '(6) (range) #{:set} {:m :ap}])
12:10lazybot⇒ (true true true false false)
12:10TimMchttp://www.brainonfire.net/files/seqs-and-colls/main.html
12:17jaleyIs there a way to control the path the 'lein deps' will try to deploy to? I need to make the artifact name match some arbitray rules for a company repo :/
12:18jaleysorry, I meant 'lein deploy'
12:32TimMcartifact name is controlled by the first line in project.clj, no?
12:33TimMcOh, not artifact ID, sorry.
12:45leafwwhat is the fastest outputstream class or nested stream classes to write a ~100kb file with java?
12:45jaleyTimMc: well.. the problem is that the repo host has the pattern matching thing set up, where it expects a build number in the jar's file name
13:14poincare101Hi everyone. I'm having a bit of trouble with learning clojure: http://pastie.org/3421981 <- Why is that functioning returning nil? According to the guide I'm following (http://pragprog.com/magazines/2011-07/growing-a-dsl-with-clojure), it should be returning a proper value.
13:17ibdknoxthat can be done in a much nicer way
13:18poincare101I know, but, why isn't that particular approach working?
13:18ibdknoxpoincare101: because of this bug http://groups.google.com/group/clojure-dev/browse_thread/thread/1e80f6eee88527
13:19poincare101was the bug introduced recently?
13:19ibdknoxin that particular case, it makes more sense just to call (str a)
13:19ibdknoxno
13:20poincare101oh. well, the guide I'm following isn't that old.
13:20poincare101are there any other places I can learn to write DSLs in Clojure from?
13:21ibdknoxthat's actually a good article, perhaps at some point that actually did work
13:21ibdknoxand once you get to the multi-method version of things, everything will be fine
13:21ibdknoxalternatively, you can look at how I wrote Korma
13:22ibdknoxbut you'd be digging through source for that
13:23poincare101That's fine, I'll read through Korma.
13:23poincare101Wow, you're the guy that wrote Korma. You're like a celebrity.
13:24ibdknoxlol
13:24poincare101any docs on "multimethod version of things"?
13:24ibdknoxfurther down in that article he replaced the case statement
13:24ibdknoxwith multi-methods, which is a much cleaner solution
13:24poincare101I'll look at that.
13:27poincare101ibdknox: oh I get it, multimethods are a bit like guards in Haskell
13:28pandeiroibdknox: i saw your response about noir memory usage... when you say the jvm will consume what you give it, does that mean one should be setting that when deploying a noir app?
13:28ibdknoxpandeiro: probably
13:28ibdknoxI've not had any issues with my sites
13:28pandeiroibdknox: as a jvm newb how do i know how much to give it?
13:29ibdknoxwell, I would give it as much as you're willing to part with :)
13:29ibdknoxit will actually decrease over time
13:29ibdknoxand run at something reasonable
13:29TimMcHmm, does 'case require *compile*-time literals, or *read*-time literals?
13:29poincare101+
13:30ibdknoxpandeiro: at RFZ we run on a really beefy machine, so we give it tons of memory. In general though setting Xmx to around 400 seems to do fine
13:30ibdknoxyou can definitely go lower
13:30ibdknoxbut I've always had enough available just to leave it around there
13:31juhu_chapaHi everybody!
13:31pandeiroibdknox: thanks, i'll take that as a rough guideline
13:31juhu_chapaHow is the recommended way to write a byte into a socket output stream?
13:31ibdknoxpandeiro: fwiw, that's the default on heroku
13:31pandeiroibdknox: i didn't know you could tweak the jvm on heroku
13:32ibdknoxyou're given a process that you can mostly do whatever you want with through buildpacks
13:32ibdknoxbut there's a set of config options where you can set the JVM_OPTS
13:33pandeiroibdknox: getting OT but if you were building a prototype would you choose heroku over a vps?
13:33ibdknoxyes
13:33ibdknoxthe latest few things I've built, I did on top of heroku
13:33pandeiroare you paying for heroku or using a free tier service?
13:33ibdknoxfree
13:34pandeirois that a consideration?
13:34pandeirojust b/c i already have a vps locked down for the year
13:34ibdknoxI have several and still used it :)
13:35ibdknoxI don't like to think about ops stuff, it's distracting
13:35ibdknoxbut it's definitely a trade
13:35ibdknoxHeroku is quite a bit more expensive than running your own EC2
13:35pandeiroibdknox: i'm still so new to linux i enjoy being the boss of everything :)
13:35ibdknoxif you're not using the free tier
13:35pandeiroand EC2 is more expensive than eg linode, yeah?
13:35lynaghk``pandeiro: you'll get over that =)
13:35ibdknoxnot that I'm aware
13:36ibdknoxlast comparison I did, EC2 was far cheaper than everyone else
13:36ibdknoxthough I was only looking at the low end
13:36lynaghk``pandeiro: in general yeah. If you know you're going to want a server 24/7 I think getting a Linode is much cheaper for the computational resources you get.
13:36ibdknoxdefinitely true
13:37pandeirolynaghk``: that was the impression i got but yeah i know squat about how EC2 charges
13:37ibdknoxheroku = ease for money
13:37pandeiroibdknox: yeah and learning the API
13:37lynaghk``pandeiro: by the hour.
13:38ibdknoxusing it is pretty trivial, I don't think that's a barrier to entry :) Learning how to set up nginx is several orders of magnitude the greater investment
13:38lynaghk``The real advantage of EC2 is being able to spin up tons of new instances when you need 'em
13:38chewbrancaec2 is actually pretty expensive, you can get more performant dedicated hardware for cheaper
13:38pandeirolynaghk``: right, that's how i saw it
13:38ibdknoxI guess I should've qualified that with instantly scalable
13:39pandeiroand since nothing i make is used by *anyone* at this point...
13:39ibdknoxstatic resources don't really work for me :)
13:39pandeiroibdknox: heroku is also 'just add money' to scale kinda thing?
13:39chewbrancabut you get more along the lines of stand alone machines that an elastic cloud, so you defintiely pay overhead to be able to easily treat ec2 as an actual cloud, just like with heroku you pay more to treat hosting a black box you magically adjust some sliders for
13:39ibdknoxpandeiro: yep :)
13:39ibdknoxpandeiro: there's no downside to using the free heroku stuff
13:40chewbrancaI'm a big fan of heroku though, I think there make a dyno out of your app approach is awesome, and I think they have the right idea with the addon api system
13:40pandeiroibdknox: only that my brain is saturated learning tex, clojure, lua, bash, etc and it's one more API
13:40pandeirosame to be said for GAE
13:40lynaghk``ibdknox: well, except you get addicted to their excellent services
13:40pandeiroi think heroku is more interesting than gae but it's a similar decision to make
13:40ibdknoxpandeiro: gae is much more difficult
13:41ibdknoxtheir sandbox is really annoying
13:41ibdknoxlynaghk``: indeed :)
13:41pandeirolynaghk``: how did you start to learn d3?
13:41ibdknoxpandeiro: build a graph! ;)
13:42pandeiroi took a stab at it for the first time the other day
13:42lynaghk``pandeiro: the tutorials are pretty good.
13:42pandeiroi was like 'this is SO easy!'
13:42pandeiro3 hours later i gave up
13:42lynaghk``ahh
13:42lynaghk``what part did you have trouble with?
13:42pandeiroi wanted to create a simple visualization over a time period
13:42pandeiroi realize time is a tricky mfer
13:42lynaghk``heh
13:42pandeirobut say i had data for things that happened over the past week
13:43lynaghk``yeah, the real value in D3 is all of the helpers. There is a pretty solid time scaling library in there now
13:43pandeiroi wanted a graph showing how many times each thing happened each day
13:43pandeirow/out going through the source i realized maybe d3 doesn't help so much with that kind of thing?
13:44pandeiro(think something like the github repo activity visualization)
13:44lynaghk``nah, it's a very low level library. You need to handle aggregation yourself
13:44lynaghk``I mean, there are some helpers like histograms, &c.
13:44lynaghk``but I would process the data in whatever language you're most familiar with, then use D3 for the actual plotting
13:45lynaghk``so once you have a dataset like [{:day "Mon" :count 17}, {:day "Tue" :count 122} ...], write that out to JSON and use D3 to visualize
13:45pandeirousing svg probably as the vehicle?
13:45lynaghk``depends, SVG or HTML would work for a bar chart.
13:46pandeiroi actually had a rough time with HTML - there's a way to bottom-align a div i must be forgetting i guess
13:46pandeirootherwise you're stuck with inverted bar graphs :)
13:46lynaghk``though, totally self-serving annoucement here, I'll be open sourcing a D3-like library in ClojureScript at Clojure/West in a month. So if you want to hold tight for a few weeks...
13:47pandeirolynaghk``: well i am wanting to look through your cljs-d3 as well...
13:47lynaghk``ah, yeah. In SVG you could make a <g transform="scale(0,-1)"> to hold your bars
13:47pandeirobut at this rate i think your announcement will probably beat me to it
13:47lynaghk``pandeiro: don't it's getting totally depreciated. = )
13:47pandeiroare you ditching d3 altogether?
13:47lynaghk``or in HTML you could just use absolute positioning with CSS like "bottom: 0"
13:48lynaghk``yeah pretty much. I mean, taking the core idea of mapping data to a DOM tree, but there is no shared code as of right now
13:48pandeiroah yeah sure, position: absolute... reminds me of that quote about programmers having a problem and wanting to use regex, now they have 2 problems
13:48dnolenlynaghk``: looking forward to it!
13:48ibdknoxlynaghk``: I'm excited to see what you came up with
13:49lynaghk``dnolen, ibdknox: I just cut a draft talk for clj/west, so if you're okay with spoiling the surprise I can send you two copies (I'd love to hear your feedback)
13:49ibdknoxdnolen: later today I'm going to put up a screencast of me building an ipad overtone controller in CLJS :)
13:49ibdknoxlynaghk``: I'd be happy to
13:49dnolenlynaghk``: yes!
13:49dnolenibdknox: haha, awesome :)
13:49pandeiroibdknox: that sounds awesome
13:49lynaghk``Chris, are we going to have to have CLJS iPad fights-to-the-death?
13:49lynaghk``because that's what we've been working on too =P
13:50ibdknoxhaha
13:50pandeiroovertone the clojure lib?
13:50ibdknoxpandeiro: yeah
13:50pandeiroit runs on a server somewhere? surely not on the ipad?
13:50ibdknoxlynaghk``: I mean, I'm ready for it :p
13:50ibdknoxcorrect
13:50pandeirosweet
13:50ibdknoxit uses noir + jayq/fetch
13:50ibdknoxand builds a little interface to control a piano and a dubstep thing
13:50ibdknoxmuch like the monome that Sam used at the conj
13:51pandeiroibdknox: will you build my prototype?
13:52pandeiroibdknox: do you write code while you sleep?
13:52ibdknoxpandeiro: not currently taking on anything new :) Things are changing quite a bit for me in the next month
13:52ibdknoxhaha
13:52ibdknoxmy girlfriend makes fun of me, because I kind of do
13:52ibdknoxI often wake up with solutions
13:52pandeiroyou must be doing that thing rich talked about, figuring out some of the background stuff
13:52lynaghk``ibdknox: that's why I take siestas every day after lunch
13:53pandeiroibdknox: how long have you been programming?
13:53ibdknox15 years
13:53ibdknoxsince I was 10 :)
13:53ibdknoxlynaghk``: yeah, it's something I've done for a long time. I believe it's a skill, more so than most people think
13:53pandeiroand when did you become a superhuman?
13:54`foguswhen he entered our solar system
13:54ibdknoxhaha well still human, but I think taking a couple years to teach myself how to learn probably helped :)
13:54TimMcibdknox: 25, and you've already lead projects at Microsoft? o.O
13:55ibdknoxTimMc: C# and VB no less ;) I was actually as surprised as you are
13:55TimMc:-D
13:55ibdknoxthat transition was a very interesting month
13:56pandeirogates has a quote about knowing if someone has what it takes to be a good programmer after 4 years... i'm approaching that soon...
13:56TimMcVB to C#?
13:56pandeiromaybe i will have to go ask him
13:56ibdknoxTimMc: I was supposed to go off and work on some future thinking stuff after working on the editor
13:56ibdknoxTimMc: but the guy who was supposed to take over C# left and then the guy who was supposed to take on VB just stopped showing up to work
13:56ibdknoxlol
13:57pandeiroibdknox: so instead you turned on, tuned in, and dropped out?
13:57TimMcibdknox: "left", "stopped showing up to work"
13:57TimMcMob connections much? :-P
13:57ibdknoxTimMc: one transfered to bing
13:57ibdknoxthe other guy was just a flake, not sure how he got hired
13:58ibdknoxmy boss was like.. well these teams have never been merged before... I'm sure Chris can do it!
13:58ibdknoxlol
13:59ibdknoxstill ended up working on far future stuff, which I don't think made it anywhere after I left :( But ended up unifying and running those two for a while
14:01ibdknoxI'd love to work on dev tools again :)
14:01TimMcIt's satisfying stuff.
14:02ibdknoxwith lots of room for improvement
14:17pandeiroibdknox: you could always build us that awesome web-based clojurescript IDE with heroku integration built in :)
14:18ibdknoxhaha
14:18ibdknoxmaybe some day :)
14:18pandeiroi was actually toying with the basic compile-cljs-via-http-request idea and got hung up on how to do it
14:18TimMcMe too.
14:19pandeirobecause the compilation takes a while
14:19TimMcSee the moldering remains of trycljs on my github.
14:19pandeiroso maybe the right way to do it would be passing messages
14:19pandeiroTimMc: i would like to
14:19pandeirolink?
14:19lnostdali still do not understand how to get DB transactions to work well with Clojure transactions.. no matter which way i "flip" things it'll end up wrong it seems
14:19TimMcpandeiro: https://github.com/baznex/trycljs
14:19TimMcI guess it's actually not under my account.
14:20lnostdali can't put any dosync inside a DB transaction; not even at the very end because the DB transaction might still roll back without the Clojure one doing so
14:21gfrederickslnostdal: the DB transaction can roll back without you finding out?
14:22lnostdali can "find it out", but i don't see how that can help me
14:22pandeiroTimMc: you remember where you were derailed with that?
14:23gfrederickslnostdal: you couldn't then about the clojure transaction?
14:23gfrederickss/about/abort
14:23llasramlnostdal: Why do you need to interweave them? I haven't thought about this too but what's the use case?
14:23llasrams,too,too deeply,
14:23TimMcpandeiro: Yes, I couldn't get namespace resolution working properly. Also, there's an annoying misfeature in GClosure that fucks with REPL usage model.
14:24lnostdalthey have to overlap somehow
14:25lnostdalone of them have to "finish", then give room for the other to finish .. before the first one "really finishes" .. or something
14:25pandeiroTimMc: I imagined namespace functionality would be limited, like you would have to shoehorn all user cljs code into one ns...
14:25gfredericksif you commit the DB transaction at the end of the clojure transaction, what's going to go wrong?
14:25llasramlnostdal: Could you give a specific example?
14:26TimMcgfredericks: Network failure, commit conflict...
14:26lnostdalnot really, llasram .. because all my examples are wrong
14:26jsabeaudryAll of a sudden, firefox says my clojurescript function is undefined although I see it defined 5 lines earlier in Firebug. I'm really puzzled!
14:26lnostdaland i can't seem to find any right way of doing this
14:26gfredericksTimMc: but if something goes wrong with the DB transaction then at least clojure should throw an exception, no?
14:26TimMclnostdal: A use-case example, not a solution.
14:27gfredericksTimMc: or do you mean DB succeeds but then clojure fails?
14:27TimMcgfredericks: That's the other option, yes.
14:27gfredericksoh, or commit conflict on clojure's side, I see
14:27lnostdaleven trivial stuff .. start a db transaction, make a decision based on some SELECT .. then write to some Clojure refs based on the decision
14:28gfrederickslnostdal: I think they're asking why you need to coordinate these things?
14:28llasramgfredericks: +1
14:28llasramI'm not saying you don't -- I just want to understand why you do
14:28lnostdalwhat else would i do? .. i can't do a "SELECT" vs. in-memory data
14:30lnostdalso i got to have both transactions working together
14:30TimMclnostdal: Friggin' example, please.
14:30gfrederickslnostdal: like what sort of data do you have on DB vs in memory
14:30llasramTimMc: No need for such language!
14:31TimMc:-P
14:32lnostdalwell, type of data? "items" .. *sigh* .. .does it matter? .. (with-db (with-query-results res ["SELECT ...;" ...] (if res-is-something (dosync this) (dosync that))
14:33lnostdal..with-db is just a the typical BEGIN + COMMIT type macro
14:33gfredericksso there are items in the db, and what're you tracking in memory?
14:35lnostdalok, yeah, so i got to not have these things in memory at all? ..
14:36llasramI guess the fundamental idea is that you have multiple coordinating threads, which are moving things between the database and the STM-managed data-structures, and you want to keep the in-memory data structures and the database completely synchronized at all times?
14:36lnostdalyes, llasram
14:36llasramOk, an easy one. That's impossible.
14:36lnostdali don't want to ask the DB for trivial stuff over and over again...
14:36lnostdalok, that sucks thes
14:36llasramOk, that was a flip answer, and I may be wrong
14:37TimMcIs there a way to tell the STM manager, "this transaction has failed, please retry it"?
14:37lnostdali guess it's a lack in the DB .. i can only see it working if i had some time semi-after the DB transaction
14:37gfrederickslnostdal: and I think he means impossible generally, not because of a clojure shortcoming
14:37llasramgfredericks: +1; that's my initial reaction as well
14:37lnostdalok, this isn't good enough then .. i can't use postgresql for this
14:37llasramOh, you're just interpreting me. Well, I definitely agree with you :-)
14:37lnostdalscrew all this .. so fed up .. gah x)
14:38TimMcCAP theorem, am I right?
14:38gfredericksisn't there some fundamental theorem of faulty communication channels where you can never have identical shared knowledge?
14:38gfredericksTimMc: I don't think so
14:39llasramlnostdal: Don't give up! Can you back off describe at a higher level what you're trying to do, outside of the synchronizing memory vs DB problem?
14:39TimMcTwo Generals' Dilemma, yes.
14:39gfredericksyeah there it is
14:40dnolenlnostdal: llasram: gfredericks: http://groups.google.com/group/clojure/browse_thread/thread/aa22a709501a64ac/b578f0915b55c4be?#b578f0915b55c4be
14:40dnolenit's an interesting idea, but no one's actually done the legwork yet.
14:41lnostdalyes, that's the other option; if i could control the clojure STM better it would also work out i think
14:42lnostdali think i'll just "give up" and move everything down to the DB for now
14:44llasramdnolen: Interesting... That would be pretty cool, although I'm not entirely sure it applies to this case though. Extending the semantics of transactions doesn't seem quite the same as interweaving the transactions of two unrelated systems
14:44lnostdalor wait, what's this; http://www.postgresql.org/docs/9.1/static/sql-prepare-transaction.html
14:44lnostdalhum
14:47gfrederickscljs doesn't have a release yet does it?
14:49_philhey, if anyone is interested, i just made a menubar time tracker for mac os as a weekend project in clojure
14:49_philhttps://github.com/pkamenarsky/atea
14:49_philit should work but i havent tested it extensively
14:59llasramlnostdal: Just out of curiosity, what are you doing that need this hard synchronization between DB and memory?
15:00mklappstuhlhey... I am thinking about packaging leiningen for Archlinux - the Debian dependency chain looks wierd and I can find no good description of what leiningen acutally needs. Is it enough (and not only a workaround) to copy the binary into $PATH?
15:00TimMctechnomancy: Ping, mklappstuhl discussing packaging lein for Arch
15:03mklappstuhlTimMc, technomancy: I'll be away for half an hour, msg/mention me, I will respond then.
15:06lnostdalllasram, auction site
15:23gfrederickslein-cljsbuild doesn't have a repl :(
15:26mrBlissibdknox: how can I test file uploads with send-request in noir? Passing a File doesn't seem to work.
15:31pandeirogfredericks: what do you mean?
15:32gfrederickspandeiro: a rhino-based clojurescript repl
15:33pandeirogfredericks: doesn't clojurescript come with a script to launch that?
15:34gfredericksyes; but part of the appeal of cljsbuild is to have the project be self contained and not need clojurescript "installed" somewhere
15:36pandeirogfredericks: not to mention i can't even get the script/repljs to work anymore with the up-to-date cljs repo
15:36pandeiroit used to work
15:37pandeiroanyway yeah cljsbuild uses a jar of a certain cljs commit?
15:38gfredericksI don't see that it's put it in my project anywhere
15:38gfredericksso I guess it's bundled up in the jar off in the ~/.m2
15:40brehautmorning talios
15:40lamedjava.lang.String cannot be cast to clojure.lang.IFn :P
15:40dnolenpandeiro: hmm, repljs is working fine on master for me.
15:41taliosMornin brehaut
15:41brehautlamed: werent you pasting these errors into irc yesterday too?
15:41dnolenthe ClojureScript One folks were having some trouble as well but I checked and they have no problems with master either
15:41lamedbrehaut: nope
15:43antares_just a little announcement here: travis-ci.org Clojure builds now have a separate machine. So, keep those builds coming!
15:44pandeirodnolen: probably my side, sorry... throws a java.lang.ClassNotFoundException: org.mozilla.javascript.Context though
15:45dnolenpandeiro: hmm that doesn't make sense, did you try a fresh checkout?
15:45pandeirodnolen: just realized maybe i need to run the build script again? it is a fresh checkout
15:45dnolenpandeiro: not a bad idea
15:45pandeiroerr, bootstrap, not build
15:48lamed(Integer/toString 10) ;; obviously
15:50graphbumis there any way to tell swing to resize a buffered image in response to a window size changing?
15:51graphbumI've seen some swing examples from the clojure community, but none of them deal with dynamically resizing the display
15:56aphyrI suspect my clojure application is slowly leaking memory. I've dumped the heap with jmap; jhat suggests my top memory allocations are (by an order of magnitude) clojure.lang.LazySeq and clojure.lang.Cons.
15:56aphyrSort of lost as to where to go from here. Any advice?
15:57brehautgraphbum: based on a quick googling i think you need to use either a windowlistener or componentlistener and implement componentResized
15:57brehautaphyr: holding onto the head of a seq while traversing / realizing it is a great way to leak memory.
15:58aphyrI've tried to avoid that, but this isn't exactly a trivial app: https://github.com/aphyr/reimann
15:59aphyrI dunno if it's somewhere inside my code, aleph, lamina, postal, protobuf...
15:59graphbumbrehaut: thanks for the googling :/ I've spent about a week on this stupid 2d rendering project....I know more about Swing than I ever wanted to. I have some stuff hooked up via component listeners, which mutates the image buffer, but it's crap and doesn't "quite" accomplish what I'm looking for.
16:00graphbumbrehaut: lau jensen and some other folks have good samples, but all of them seem to have statically sized views.
16:00brehautgraphbum: my j2d knowledge is weak and extremely out of date (i last used it in earnest in 2003 / 1.4, so grain of salt) but i recall that J2d is quite operation ordering sensitive
16:00brehautgraphbum: have you looked at any of the seesaw stuff? they might have some relevant examples?
16:01brehautgraphbum: github.com/daveray/seesaw
16:01graphbumbrehaut: I did look at seesaw (excellent lib).
16:01graphbumbrehaut: was going to use it, but I didn't need the extra size (i.e. the miglayout stuff).
16:02graphbumbrehaut: ended up wrapping the nifty gui library in Joy of Clojure, with my own extensions...
16:03dnolenaphyr: you might want to take a look at JVisualVM or YourKit
16:03graphbumbrehaut: other option is to just lock the window size for now and get on with my life.
16:04ibdknoxgfredericks: emezeske was working on adding repl support the other day
16:04devnanyone know if i need to do anything fancy with clojail beyond use the secure tester? What if I use the secure tester and my policy gives all permissions?
16:05emezeskeibdknox: It's actually finished code-wise, although I still need to document/release
16:05ibdknoxemezeske: sweet
16:05emezeskeibdknox: If you're curious, check out https://github.com/emezeske/lein-cljsbuild/blob/0.1.0/doc/REPL.md
16:05emezeskeI'm also adding test support in the next release
16:06gfredericksemezeske: writing CLJS tests in CLJS?
16:06emezeskegfredericks: Yeah, and running them in PhantomJS
16:06ibdknoxemezeske: I'm glad someone took this up in my stead :)
16:06emezeske^_^
16:06gfredericksemezeske: crossover tests for crossover code?
16:06emezeskegfredericks: I guess crossovers could be tested in either CLJ or CLJS
16:07emezeskegfredericks: I think you could write crossover tests too actually, which is.. interesting!
16:07gfredericksemezeske: yeah I would only feel half confident if I had only tested my crossover code on one host
16:07emezeskegfredericks: Although they'd be limited to the CLJ/CLJS feature intersection :)
16:08gfredericksand there isn't a clojure.test in cljs is there?
16:08emezeskegfredericks: I haven't dug into that too much yet; I'm just laying the foundation to run things
16:08emezeskegfredericks: Hoping other people will work on those tools :)
16:09gfredericksokeedoke, just curious what exactly "test support" meant
16:09emezeskegfredericks: Really it just means a way to launch tests, with lein hooks, and a decent example of how to make it work
16:10emezeskegfredericks: I'm pretty stoked to type "lein test" and see my CLJS get tested!
16:10gfredericksemezeske: I was heading toward putting together a similar library and one feature I had completed was generating a duplicate namespace for calling functions from vanilla JS; is that a feature you think would fit in cljsbuild, or is it a terrible idea?
16:11gfredericks(by "from vanilla JS" I primarily mean that it translated data structures)
16:11emezeskegfredericks: I might not understand what you mean; I've been doing that with (defn ^:export myfn [] ...)
16:11emezeskeAh, is this an OSS thing that I could look at?
16:12gfredericksoh I hope I didn't delete that project once I saw cljsbuild
16:12emezeskehaha
16:12gfredericksI think I did but I have a copy on this computer over here in my bag I think, give me a second
16:13gfredericksemezeske: the idea was that for your (ns foo.bar) it would generate a (ns foo.bar-js) with function wrappers calling into the original
16:14gfredericksI had it running and could successfully call cljs code from coffeescript
16:15emezeskegfredericks: I see, so the wrappers automatically did a clojure->javascript translation for the return values and such?
16:15gfredericksyeah, and js->clojure for the args
16:17emezeskeThat's very interesting. I'm not sure lein-cljsbuild would be the place for that. But I'm also not sure if that could be implemented outside of the build system (?)
16:18gfredericksemezeske: the project is here, though I'm not sure if you'll learn anything further by looking at it: https://github.com/fredericksgary/lib-4642
16:19gfredericksthe translator functions are in resources/cljs.cljs
16:19emezeskegfredericks: Cool, thanks!
16:20gfredericksyep; let me know if you decide you like the idea, I'd be happy to work on it. I'll probably have to set up something equivalent for my current project regardless.
16:20osa1is there a find or search function to use instead of (first (filter ...)) ?
16:20gfredericksosa1: I don't think so
16:21gfredericksosa1: lazybot has a good tool for questions like that
16:21gfredericks$findfn [3, 8, 5, -5, -3, 2] neg? -5
16:21lazybot[]
16:21brehaut(def first-match (comp first filter)) ;)
16:22gfredericksamalloy: lazybot should return results from useful as well :)
16:23amalloyit'd be more interesting if he tried some combinations of comp/juxt/partial
16:24brehautamalloy: or employed core.logic for friedman-byrd results
16:25Raynesalexbaranosky: namespaces-matching is there.
16:25Raynesalexbaranosky: Use the :prefix option to the… whatever function.
16:26alexbaranoskyRaynes, thanks for clarifying that
16:26Raynesalexbaranosky: I just streamlined it all when I moved it out of Leiningen. It's one function that does everything based on the keyword options given. The README has examples.
16:27alexbaranoskyyeah I see it now.
16:28devnhowdy alexbaranosky
16:28Raynesdevn: Did you get my messages in #flatland?
16:28alexbaranoskydevn: what's up
16:28alexbaranoskydevn, I'm looking at fixing up lein-midje at the moment
16:29alexbaranoskyusing bultitude for some ns utils the plugin depended on that have been moved
16:38devnalexbaranosky: ill be ready to look at that in a few -- im in the middle of trying resurrect my walton project from a couple of years ago
16:39devncurrently running /a lot/ of code in clojail
16:39TimMcdevn: For what purpose?
16:40RaynesTimMc: His walton project reads #clojure logs for the past 5 years and evaluates code to see what works and then forms them into structured examples of clojure libraries.
16:41TimMcWild.
16:41brehautdevn: so you've got it going now?
16:43alexbaranoskydevn: that's pretty interesting sounding! github link?
16:44devnthe code that is out on github is disgusting (and old)
16:44devnhttps://github.com/devn/walton
16:46devnit's been dead in the water for awhile -- im not parsing text logs anymore, am going to use a real store of some kind, currently playing with redis, but that's really just because it was handy
16:47Raynesdevn: Redis is probably pretty fast for this.
16:47devnyeah, i was laughing with the guys i work with: "[35484] 20 Feb 14:28:18 * 10000 changes in 60 seconds. Saving..."
16:47devnthe only problem is doing fuzzy text search on it is kind of a PITA
16:48devni'd like for people to be able to search for +, and not only see (+ 1 1), but also see something like (nested (form (that (uses (+ ...)))))
16:48TimMcand (map + (range 100)) ?
16:48osa1&(map #([(keyword %) (keyword "blaah")]) '("ok" "bir"))
16:48lazybotclojure.lang.ArityException: Wrong number of args (0) passed to: PersistentVector
16:49osa1what's wrong with this code?
16:49devn*nod*, lots of ways to search would be nice
16:49devnby class, type, symbols used, etc.
16:49TimMcosa1: The #() form has to be a function call.
16:50TimMc&([1 2 3]) <- osa1: the same thing is wrong here
16:50lazybotclojure.lang.ArityException: Wrong number of args (0) passed to: PersistentVector
16:50devnultimately i'd like to wrap it into another project im working on that will let you use the clojure cheat sheet + findfn + clojuredocs API from the repl
16:50osa1TimMc: weird. thanks.
16:50TimMc&(#())
16:50lazybot⇒ ()
16:50devnbtw, fun stuff: clojure.inspector just opened two windows
16:51devn:)
16:51brehaut,(map #(-> [%]) [1 2 3])
16:51clojurebot([1] [2] [3])
16:51TimMcbrehaut: That's hot.
16:51brehautTimMc: blatently stolen from Joy of Clojure
16:52TimMc&(map #(doto [%]) [1 2 3])
16:52lazybot⇒ ([1] [2] [3])
16:52amalloyare we using -> instead of do just to be confusing?
16:52TimMcOh yeah, do...
16:52Scriptorbut that uses letters
16:52TimMcI've actually used that, too. >_<
16:53brehautTimMc: footnote 14 page 102
16:53TimMcDon't own it. :-(
16:53amalloy&(map (comp vec hash-set first list) [1 2 3])
16:53lazybot⇒ ([1] [2] [3])
16:53amalloysuper-efficient
16:54TimMcpartial map ...
16:54TimMcbecause why not?
16:55Scriptor,(for x in [1 2 3] [x])
16:55clojurebot#<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (4) passed to: core$for>
16:56TimMc...
16:56Scriptor,(for [x in [1 2 3]] [x])
16:56clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: for requires an even number of forms in binding vector in sandbox:>
16:56TimMcs/ in//
16:56Scriptor...
16:56TimMcThis isn't JS. :-P
16:57Scriptorshut up, I just got done talking python :p
16:57TimMcaha
16:59brehauthuh. pods are kind of like a conjugation based on mutation
17:01TimMcbrehaut: In a way that transients aren't?
17:02brehautTimMc: not really. im just months behind everyone else, because ive had to wait for the video of rich's conj keynote
17:02TimMcOh, it's up now?
17:02brehauthttp://blip.tv/clojure/rich-hickey-keynote-5970064
17:03brehautwhich is to say, yes
17:03franks(doc clojure.core)
17:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.security.PrivilegedActionException: java.lang.ClassNotFoundException: clojure.core>
17:04TimMc&(-> 'clojure.core the-ns meta :doc)
17:04lazybotjava.lang.SecurityException: You tripped the alarm! the-ns is bad!
17:04TimMc,(-> 'clojure.core the-ns meta :doc)
17:04clojurebot"Fundamental library of the Clojure language"
17:05devn&(use 'clojure.repl)
17:05lazybot⇒ nil
17:05devn&(doc +)
17:05lazybot⇒ ------------------------- clojure.core/+ ([] [x] [x y] [x y & more]) Returns the sum of nums. (+) returns 0. Does not auto-promote longs, will throw on overflow. See also: +' nil
17:06TimMcWhoa, Rich apologized to cemerick in the keynote. Didn't know that.
17:07franksTimMc: right - I'm confused... I was looking at source code for clojure.repl/doc - I have the feeling that (cond...(resolve...(find-ns... should be reversed to (cond...(find-ns...(resolve...
17:08TimMcWell, now I'm distracted by a Conj video. :-P
17:08franksTimMc: if you do the find-ns first, then you can do a (doc clojure.core)
17:20rbanffyHi folks. Returning to Clojure from the pre-1.3 era. Where did clojure.contrib.string/substring? went?
17:20TimMcrbanffy: Try clojure.string
17:20TimMcand in general...
17:20TimMc~contrib
17:20clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
17:21brehautthat particular case is subs right?
17:21rbanffyTimMc, nope. No substring? there
17:21brehautoh. no it isnt
17:21amalloy$javadoc String contains
17:21lazybothttp://download.oracle.com/javase/6/docs/api/java/lang/String.html#contains(java.lang.CharSequence)
17:25franksHow do I recompile clojure.repl/doc in a running image? Trying (binding [*ns* (find-ns 'clojure.repl)] (defmacro doc..., but that tells me "CompilerException java.lang.IllegalStateException: doc already refers to: #'clojure.repl/doc in namespace: user..."
17:26amalloybinding happens at runtime, and defmacro happens at compile-time
17:27amalloywell. sorta. it's a little more complicated than that, i guess. but the short answer is: (in-ns 'clojure.repl) (defmacro ...)
17:28TimMcamalloy: Presumably just the def happens at compile time?
17:30TimMcMy understanding is: read, macro-expand, parse sexps into AST + hoist defs, emit/eval
17:31TimMcfranks: in-ns, not ns
17:31franksTimMc: same error
17:35franksTimMc: used an old trick that you taught me to get around private functions ;-) - substituted namespace-doc by #'namespace-doc and it works
17:40franksPls see "https://gist.github.com/1872000&quot; - which would make (doc clojure.core) work - feels like a bug - pls someone confirm
17:47uvtcHi #clojure. I just noticed that you can optionally pass `fn` a "name". As in: `(def a (fn foobar [x] (* x x)))`. How is this name used? What is the common use of it?
17:47uvtcIn the above case, the symbol `a` refers to my fn. What use is the "foobar" name?
17:48brehautuvtc: you can use it like any other local
17:48brehautusually you wont be passing it to a def though
17:48uvtcbrehaut, but `(foobar 3)` doesn't return 9...
17:48uvtcClojure is unable to resolve the symbol "foobar".
17:49brehautuvtc: its local to the fn, not global to the NS
17:49brehaut,((fn fac [n] (if (= 1 n) 1 (* n (fac (dec n))))) 5)
17:49clojurebot120
17:50TimMc&((fn introspect [] (class introspect)))
17:50lazybot⇒ sandbox6832$eval10921$introspect__10922
17:50brehautuvtc: sometimes you want to have a anonymous function that knows about itself, eg for recursion
17:50TimMcAlso it makes for more readable stack traces. :-P
17:50brehautTimMc: ah yes, good point!
17:51uvtcbrehaut, thanks for that `fac` example ... When I saw it, I thought, "wouldn't I just use `recur` for that?"
17:51brehautuvtc: you would!
17:52brehautuvtc: but if it was an indirect recursion you wouldnt be able to
17:52TimMcThere are definitely times when it is useful for a fn to pass itself to something else.
17:52TimMcNothing off the top of my head, though.
17:53uvtcbrehaut, in your `fac` example, using `recur` doesn't work, with Clojure telling me that I of course can only recur from the tail pos.
17:54brehautuvtc: sure, but you'd rewrite it to use an accumulator
17:54brehautactually thats a use right there
17:55uvtcAgh, ... kids, dinner,.. can't ... hold ... out ... much longer ....... thanks for the help!
17:55brehaut,((fn fac ([n] (fac (dec n) n)) ([n acc] (if (<= n 1) acc (recur (dec n) (* n acc))))) 5)
17:55clojurebot120
17:55brehautbah
17:55brehauta minute to late
17:56bweaverfwiw, naming a `fn` is really useful in this case: (fn foo ([] (foo default-value)) ([val] (do-something val)))
17:56TimMcooh, right
18:03amalloybrehaut: isn't that just an ugly way to write a loop/recur?
18:04brehautamalloy: i guess thats true
18:04TimMcbrehaut: Were you referring to the value->transient and transient->value stuff as conjugation, or something later?
18:04brehautbweaver's example made more sense
18:04Raynesamalloy: List comprehensions are bad. :P
18:05RaynesJust throwing that out there.
18:05brehautTimMc: thats stuff and the pod stuff that follows
18:05TimMcOK
18:05amalloyTimMc: correct, re: the def. but since the point of the binding was to change the def's namespace, the important part of defmacro happens at compile-time
18:06TimMcAgreed.
18:06amalloyRaynes: what? is that somehow related to anything, or are you just flamebaiting?
18:07TimMcProbably directed at Scriptor
18:07Raynesamalloy: It was a reference to our discussion with alexbaranosky at the conj.
18:07RaynesAt least, I think it was alexbaranosky, right?
18:07RaynesMaybe it was lynaghk``
18:07RaynesAt the art place? You remember.
18:07amalloyhim and rplevy. but alex was easily convinced that for might be nice, whereas rplevy was like "wut i hate for loops it's like java"
18:07alexbaranoskythat was both myself and lynaghk``
18:08RaynesI apologize. I'm not great with names and faces.
18:08alexbaranoskymy argument was that there are times for both
18:08RaynesI know there was somebody there who was just totally "it sux"
18:08RaynesAt least at first.
18:08ScriptorI think for is more readable for the example people were discussing earlier
18:08qbgI need a list of CSci books relating to Clojure without too much overlap. I already have "The Reasoned Schemer". Anything else?
18:08Scriptorturning a list into a list of lists
18:08alexbaranoskywho knows, it might have been me; I was drinking
18:09amalloyScriptor: oh, the #(do [%]) thing? yeah, i wouldn't recommend anyone actually do that
18:09alexbaranoskyI like for especially for times when I want to utilize destructuring -- in other words, mapping over an anonymous fn that destructures is a code smell to me
18:10amalloybut i'd prefer (map vector [1 2 3]) to (for [x [1 2 3]] [x]), personally
18:10alexbaranoskyamalloy, absolutely
18:10amalloyjust because all the brackets mush together and i have to squint to see what's happening
18:10Scriptortrue, using vector is way cleaner
18:11amalloyi think (hope) TimMc and brehaut were just fooling around looking for short/interesting ways to write it
18:11brehautamalloy: yes
18:13amalloyi don't know of anyone who has ever written #(do ...) in real code and lived to tell the tale...because anyone who does that, i murder
18:13qbgSo do #(list %) instead?
18:15Scriptorthere's also #([[%]] 0)
18:15amalloyhaha
18:16TimMcniiiice
18:21PntBlnkHi all, I'm having some difficulty modifying a macro in the Korma library and wonder if someone could have a peek at https://gist.github.com/1872212 and tell me what I'm doing wrong. I can't seem to get evaluation to happen in the right order.
18:23qbgIf only transpose was built in. (transpose [[1 2 3]])
18:25amalloy&(let [transpose (partial apply map vector)] (transpose [[1 2 3]]))
18:25lazybot⇒ ([1] [2] [3])
18:25amalloyit's built in, it just has a slightly longer name :P
18:26Scriptoris there a function that returns vector or list depending on the collection type you passed it?
18:26qbg&(empty [1 2 3])
18:26lazybot⇒ []
18:26Scriptor*type of the collection
18:26qbg&(empty '(1 2 3))
18:26lazybot⇒ ()
18:27qbgGood enough?
18:27Scriptoras in the functions list or vector themselves
18:27TimMcScriptor: associative?
18:27TimMcif you know it is either a list/seq or a vector
18:27Scriptorso you could do ((f [1 2 3]) 4) -> [4]
18:28qbg#(partial apply conj (empty %)) ? :p
18:28qbg&(let [foo #(partial apply conj (empty %))] ((foo [1 2 3]) 4))
18:28lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long
18:28amalloyi think you just want conj, not apply conj
18:28qbg&(let [foo #(partial conj (empty %))] ((foo [1 2 3]) 4))
18:28lazybot⇒ [4]
18:29qbgYep. For bonus points make it varargs
18:29amalloyit already is
18:29qbg&(let [foo #(partial conj (empty %))] ((foo [1 2 3]) 4 5 6))
18:29lazybot⇒ [4 5 6]
18:29qbgYou are correct!
18:30qbgNever did use partial much...
18:30qbg&(let [foo #(partial conj (empty %))] ((foo '(1 2 3)) 4 5 6))
18:30lazybot⇒ (6 5 4)
18:30amalloypartial is not as cool as juxt, but it's pretty handy
18:31amalloyoh hah. right
18:31qbgNew bonus points: make it return it in the right order
18:32TimMcOf course, none of this is what Scriptor actually asked for.
18:32amalloy(comp {() list [] vector} empty)
18:32amalloyTimMc: i think it actually is?
18:32Scriptorhow do you copy in emacs with the starter kit settings?
18:32ScriptorTimMc: close enough, and it's not something I need right now
18:32TimMcOh, so it is.
18:32qbg&(let [foo (comp {() list [] vector} empty)] [((foo '(1 2 3)) 1 2 3) ((foo [1 2 3]) 1 2 3)])
18:32lazybotjava.lang.IllegalArgumentException: Duplicate key: clojure.lang.PersistentList$EmptyList@1
18:32PntBlnkCalling again for help with macro evaluation: https://gist.github.com/1872212. I'm embarrassed by the amount of time I've spent failing to understand how to solve the problem.
18:33qbgYeah, not good enough
18:33amalloyoh man
18:33qbgPntBlnk: What do you mean by 'I want this to be evaluated before pred-map'?
18:34qbg&(type [])
18:34lazybot⇒ clojure.lang.PersistentVector
18:35qbgamalloy: I guess you could go from the type names, but eww
18:35amalloyyeah, i thought of that first but it's so gross
18:35amalloywelcome to #clojure, where we can't tell how to make collections
18:36PntBlnkOh yay, thanks! Well the pred-map is getting the parse-where function instead of the result..
18:36jweissin the REPL is there anything that can be done to stop the memory use from ever-increasing? (System/gc) gives back nothing and my jvm is at 780m
18:37TimMc&(let [f (fn [x] {:pre [(sequential? x)]} (if (associative? x) vector list))] (map f [[1 2 3] (range 10)]))
18:37lazybot⇒ (#<core$vector clojure.core$vector@5e119c> #< clojure.lang.PersistentList$1@4dc33c>)
18:37qbgjweiss: Sounds you you're holding onto some big object
18:38TimMcjweiss: Start unmapping namespaces and defs.
18:38jweissTimMc: i was about to ask whether it's typically data or code that takes up a lot of space
18:38jweisssounds like code is a part of it
18:38jweisssignificant part i mean
18:39qbgjweiss: What have you done in your repl session? I've only ever gotten that big by def'ing a huge object
18:39TimMcGood question. Start VisualVM or whatever and find out!
18:39amalloyyou guys are assuming that the jvm gives memory back to the OS when it's done GCing. unless you give it a max heap size at startup, it often won't do that
18:39jweissi'm installing visualvm now
18:39qbgDo you have the JDK installed?
18:39qbgIf so, you already have it
18:39jweissamalloy: good point, i need to ask the jvm rather than linux
18:40jweissqbg: separate package on my distro, apparently
18:40qbgYeah, it is sort of a random addition :p
18:41qbgPntBlnk: Does manually invoking the effective eng/parse-where call work?
18:41jweissPSYoungGen total 598208K, used 157197K
18:42PntBlnkYes, as follows in a sec...
18:42wubopretty awesome talk on JVM memory tuning and what the generations (like PSYoungGen) mean: http://www.infoq.com/presentations/JVM-Performance-Tuning-twitter
18:43qbgjweiss: You can do a heap dump and see what is using what
18:43qbg(probably want to compute retained sizes)
18:43jweissqbg: i think what i pasted shows the jvm isn't actually using it
18:44jweissbut it's not giving anything back to the os, so i think i need to lower Xmx
18:44jweisscurrently at 512mb
18:44qbgDo you really need the jvm to give up that virtual memory?
18:44jweissstill, kinda surprised at 780m memory use
18:44jweissqbg: i think that's res not virtual
18:45jweisson this box, i have plenty of mem, but i want other people to be able to do the same without using embarrassing amounts
18:45qbgIf you have plenty of memory, I'm not surprised that linux is keeping most of the unused mem resident
18:45duck1123with lein-cljsbuild, I should be able to just specify clojurescript libraries in my project and it should find them, or does it not work that easily jet?
18:46jweissi guess i should just not try to solve this problem until it's actually a problem :)
18:46gfredericksduck1123: I think that's advertised in the README
18:47qbgProbably be better to find the peak amount of mem your app uses
18:47Scriptoris there an equivalent to & rest but for #(do %) style functions?
18:47gfredericksduck1123: I take it back
18:47qbgYou don't want to set Xmx too low or else you'll get GC overhead limit exceeded exceptions.
18:47duck1123I've tried that, and it doesn't seem to work. Can't find jayq.core
18:47PntBlnkIf I call (select call (where (like :assignee "ab"))), the parse where is evaluated and the pred-map function gets (korma.sql.fns/pred-like :assigned_to "ab").
18:47qbg&(#(do %&) 1 2 3)
18:47lazybot⇒ (1 2 3)
18:48Scriptorooh
18:48ibdknoxduck1123: it does work that easily :)
18:48PntBlnkThe parse-where function takes a the predicate and replaces it with a function. What I want it to get is the resulting map: {:korma.sql.utils/pred #<engine$do_infix korma.sql.engine$do_infix@19e17b0>, :korma.sql.utils/args [:assigned_to "LIKE" "ab"]}
18:50PntBlnkSorry, I wasn't clear. I would like pred-map to get the resulting map from evaluating the function returned by parse-where.
18:51qbgPntBlnk: Do you really want to be passing parse-where a list of the form (unalias-form ...)?\
18:51PntBlnkNope, what you see there is the result of many painful experiments and misunderstandings.
18:52qbgYou just want to call parse-where with the result of unalias-form I presume?
18:52PntBlnkThe unalias-form function returns the same form with replacements.
18:53qbgDoes replace that section with (unalias-form form query) work?
18:54newb_clHi, does aleph work with clojure 1.3?
18:54PntBlnkYes. But I was having lots of trouble getting form to stay as it is and forcing the query to evaluate. Unevaluated the query is something like (select* call). I want the form to stay unevaluated, because of course it has to be processed by the parse-where...
18:55PntBlnkYou you suggest completely unquoting the bottom line?
18:55duck1123Well, It appears I simply needed a more recent copy of clojurescript. I apologize for suggesting that something may not be easy. Now to hack some clojurescript
18:56qbgPntBlnk: Yeah, so you'll passing the result of unalias-form to parse-where
18:56ibdknoxduck1123: I'm about to put up a video of me building an app from start to finish :)
18:57ibdknoxI guess I should probably narrate it though
18:57ibdknoxhm
18:57gfredericksibdknox: you finish apps?
18:57ibdknoxupon occasion ;)
18:57PntBlnkqbg: That gets back to my previous issue.
18:57gfredericksyou could sell that.
18:57duck1123that would be very cool to watch. I've been holding off on doing much javascript until I could actually, you know, get any dependencies to work
18:58qbgDoes replacing ~(eng/parse-where ...) with '~(eng/parse-where ...) help with your previous issue?
18:58PntBlnkThe form gets passed okay, but the query is unevaluated.
18:59qbgPntBlnk: What does query look like?
18:59PntBlnkMassive. You don't want it posted here :)
19:00PntBlnkKorma uses pretty complicated nested maps for queries and tables.
19:01ibdknoxoh, you guys are talking about korma.. maybe I should pay attention lol
19:01PntBlnkFeel free to have a look at my Korma fork if you'd like to see what I've been up to. I'm working on the field-aliases branch. https://github.com/pauldorman/Korma
19:01ibdknoxwhat are you guys trying to accomplish?
19:02qbghttps://gist.github.com/1872212
19:02qbgPntBlnk: Are you essentially wanting to use (unalias-form form q#) instead of (unalias-form form query)?
19:03PntBlnkqbg: If I quote the parse-where line the form gets evaluated...
19:03ibdknoxlol or don't tell me :)
19:03qbgibdknox: The second macro isn't working correctly
19:03ibdknoxsure
19:04ibdknoxI don't know what that does :)
19:04ibdknoxwhat is the ultimate goal?
19:04PntBlnkibdknox: I've almost got this licked, just having a fight with the 'where' macro.
19:05franksIs there a way to see if a var refers to a protocol ? (doc or meta doesn't seem to provide any clue...)
19:05PntBlnkThe 'field-aliases TLDR': Enable the definition of default aliases for entities (using the 'aliases' function) which can be used in place of actual field names for all Korma functions.
19:07franksA protocol function, however, does have a meta :protocol meta member...
19:07ibdknoxcouldn't you just do (def myalias :some-crazy-long-field) and use that all over?
19:08franksSorry, not function but : A protocol interface definition, however, does have a meta :protocol meta member...
19:08qbgPntBlnk: Did you write unalias-form?
19:08PntBlnkAll of the existing tests pass (with a couple of minor changes).
19:08PntBlnkSure, but why not do it at the entity?
19:09ibdknoxbecause it adds another layer of indirection, and I would assume complicates the implementation a fair amount
19:09PntBlnkActually, the changes are pretty minor aside from the functions I've added.
19:10qbgIf you wrote unalias-form, do you have to do it before parse-where?
19:10ibdknoxcomplexity isn't always measured in the size of a change :)
19:10PntBlnkI'd love it if you'd have a peek, though it's not ready for a pull request yet ;)
19:10devntake for instance the code i just rewrote
19:11PntBlnkqbg: yep, because parse where needs the unaliased form.
19:11qbgIs unalias-form out in that repo? If so, where?
19:12PntBlnkqbg: It's in the field-aliases branch.
19:12PntBlnkhttps://github.com/pauldorman/Korma/tree/field-aliases
19:13weavejesterDoes anyone happen to know of an easy way of running an interactive shell script from a Gist?
19:13weavejesterMy usual "wget -O - http://blah | bash" doesn't work due to the pipe
19:14amalloycurl http://blah > foo && chmod +x foo && bash ./foo?
19:15weavejesteramalloy: Yeah… but… that's kinda ugly… *whines*
19:16brehautisnt theres some sort of parenthesised file source notation in bash?
19:16amalloythere is, but i don't remember it
19:16brehautliekwise
19:16brehaut$(…) or something?
19:16amalloybash <(curl http://blah) maybe
19:16weavejesterHm…
19:16brehautyes
19:17brehautecho "echo \"hello, world\"" > test.sh; bash <(cat test.sh)
19:17brehautworks for me
19:17amalloyyeah
19:17qbgPntBlnk: Are you sure parse-where needs the unaliased form? I'm not seeing how from a quick peek at the source of parse-where
19:18brehauti think http://mywiki.wooledge.org/BashSheet looks bookmark worthy
19:18weavejesterYep, it works!
19:18weavejesterbash <(echo "read -p 'Username: ' username")
19:19PntBlnkWell, this is possibly my non-lazy thinking, but shouldn't parse-where get the expected form rather than a function call to unalias-form?
19:19weavejesterbrehaut, amalloy: Thanks for the help
19:19amalloyi've learned enough cool bash tricks that i no longer feel a pressing need to better myself
19:20TimMcI use diff <(svn cat or whatever) <(etc) all the time.
19:20brehauti have learnt that bash frightens me enough that i dont want to learn any more
19:21amalloyaw. the bash syntax is a complete hodgepodge, but it's amazingly powerful and concise
19:21brehauthah yes
19:21brehauti also havent learnt apl ;)
19:22amalloybut clojure!? i hear those guys just use parentheses for everything, even to represent numbers!
19:22brehautoleg numbers for life!
19:22qbgPntBlnk: If I'm understanding this correctly, the issue here is that query is not evaluated before it is passed to unalias-form (if you do (unalias-form form query)).
19:22PntBlnkYes, exactly
19:23qbgIf that is the case, I think you might be out of luck because you've made a big complecting of runtime and macroexpansion time as far as I can see
19:23PntBlnkI clearly have expert help. Thank you.
19:23TimMcAre you saying PntBlnk has an ugly complexion?
19:24qbgYou'd probably have to add an interpreter to Korma to do what you want in that case
19:24qbgOr do some big restructuring
19:24PntBlnkHmm.
19:24amalloyis unalias-form a macro?
19:24qbgfunction
19:24PntBlnkNot yet :)
19:25amalloyokay good. i haven't been paying much attention but it seems like it should be a function, and you're saying things that sound like accidental-macros
19:25qbgBecause you want to get the runtime value of query at macroexpansion time currently (to determine the aliases)
19:25ibdknoxin theory, if it walked the form and just replaced keywords with other keywords, you'd get most of the way there
19:25TimMctechnomancy: By the way, I finally figured out how to do temp-namespace sandboxing for my tests: https://github.com/timmc/handy/blob/v1.1.0/src/org/timmc/handy.clj#L53
19:25qbgBut the mappings are determined at runtime currently
19:26ibdknoxyep
19:26qbgAnd Korma is basically a compiler...
19:26qbgSo we need to invent time travel
19:26ibdknoxit *is* a compiler :)
19:26ibdknoxmostly
19:26ibdknoxheh
19:26PntBlnkI've been avoiding macros as much as possible - partly because of where I am in Clojure development, and partly because I haven't needed to learn much about them yet.
19:27TimMcMacros are extensions to the compiler.
19:28qbgKorma is at the 'put a compiler into the macro system' level of compilerception.
19:29ibdknoxyou can use korma without any macros at all actually
19:29ibdknoxthey just make it slightly nicer
19:29ibdknoxso you can use = instead of pred-=
19:29ibdknoxand (select ...) instead of (-> select)
19:29qbgBut we're touching the macro part here
19:29ibdknoxyeah :(
19:30PntBlnkqbg: Well I have done similar with the realias-fields function.
19:31PntBlnkIt was necessary to keep with Korma's goal of being very composable
19:31TimMcqbg: At one point I was going to help someone rewrite a macro that expanded from a CFG definition into a parser. Is Korma fancier than that? :-P
19:32qbgNot really
19:32qbgFrom my quick look at it
19:32PntBlnkThank you very much for your help qbg and ibdknox. I'll take a different tack and see where that get's me.
19:32TimMcqbg: http://www.shivers.com/~shivers/scheme04/tmp/scheme04/article/05-lexparse.pdf
19:33ibdknoxTimMc: I actively tried to make korma not be fancy
19:33TimMcIt's crazy shit.
19:33qbgNot having read that paper (at least recently), I'd think the way you'd go is expand into code that builds up the parser using parser combinators
19:33PntBlnkibdknox: I've also got a pred-between branch on my Korma fork, implementing inclusive ('between'), and exclusive ('between!') predicates. Let me know if you think they might be suitable for a pull request :)
19:34qbgI've basically done that before when working on an implementation of something like syntax-parse
19:36TimMcqbg: I actually don't remember much about the details. At the time, I was trying to learn Scheme48, advanced macros, and Emacs all at the same time. That was ill-fated enough without also trying to grok the existing (apparently somewhat heinous) codebase and learn how to write parsers at the same time.
19:37qbgparser combinators are cool :)
19:37TimMcOh, and there was something about CPS macros or some such. o.O
19:37TimMcqbg: I bet.
19:37qbgOh fun!
19:38qbgIn my attempt to create something like syntax-parse, I discovered that syntax-parse is way too complected
19:38qbgAll what Clojure really needs is a good parser generator library that works on sexps
19:39TimMc:-)
19:39qbgAnd the hard part about writing such a parser is providing the good error messages that syntax-parse provides
19:40qbg(more like awesome error messages)
19:40TimMcOh yeah, errors are hard.
19:41qbgAt the same time, defmacro provides for 90% of the use cases, the other 10% being macros on the order of defn for example
19:43qbgAnd defn seems to be essentially hard if you think about it
19:44TimMcYou mean, making something like defn?
19:44qbgIt is all about normalizing the macro call into something that is easier to use
19:44qbgYeah
19:45TimMcWell, all the hard stuff is really in fn. Sort of.
19:45qbgI've done a basically complete port of defn to my macro system for Clojure
19:45qbgWell, you have a ton of different forms to handle
19:46TimMcI had a look at the impl. It was brimming with ugliness.
19:46TimMc...but that's largely because of the large number of weird formats it can take.
19:47qbgHere is what I did: https://github.com/qbg/syntax-rules/wiki/defn-implementation See how ugly it is :)
19:48qbgNeed to rewrite that library from scratch at some point in time, and bring it up to Clojure 1.3 :)
20:08tjgilliesim working on http://cl.ly/2P121e1Z0R020n0O1k0W and (map raise subneurons) in the fire function isn't causing the subneuron to increment
20:08tjgilliesis it because you can't do a dosync inside a dosync?
20:11brehautyou can definately do a dosync in a dosync; thats half the point of the primative
20:11brehautalthough its restart semantics might suprise some people
20:12tjgilliesweird
20:12brehautbut i cant actually see your code (dunno why)
20:13TimMcYeah, there's nothing there.
20:13tjgillieshrm
20:13tjgilliesodd
20:13tjgilliesoh weird just disspeared for me too
20:13tjgillieswas there
20:13tjgilliesmust be a glitch in cloudapp
20:13TimMctjgillies: Try https://refheap.com/paste
20:13tjgillieshave to go i'll come back later and paste
20:14tjgilliesrefheap uses browserid
20:14tjgilliesnice
20:14tjgilliesive been waiting for more actual uses of it before i use it myself
20:15TimMcRaynes: Remind me again of my opinion of browserid?
20:25Scriptoroh come on, clojure-jack-in doesn't work because " 'lein' is not recognized as an internal or external command,\noperable program or batch file."
20:26ScriptorM-x slime-connect works fine
20:26TimMcScriptor: And lein is on your PATH?
20:27ScriptorTimMc: yep, it works fine in cmd
21:07muhoowith a lein in your path and a spring in your step.
21:08muhooibdknox: does korma handle tables with composite primary keys?
21:09ibdknoxnot implicitly
21:09ibdknoxyou can make it do so explicitly though
21:10ibdknox(join some-ent (and (= k1 se.k1) (= k2 se.k2)))
21:10ibdknoxor just add a where
21:11muhoothanks
21:12muhoodid your demo of the cljs synth front-end ever get published anywhere?
21:38ibdknoxmuhoo: I'm finishing up a couple things and then it goes live :)
21:48brehautwhat is the autocomplete mode sam aaron uses in his overtone vid?
21:58devnbrehaut: this is just a guess, but maybe slime-fuzzy?
21:58ibdknoxAs requested: http://news.ycombinator.com/item?id=3615022
21:58devnbrehaut: his dotfiles are online
21:58devnovertone-emacs i believe is the repo name
21:58brehautdevn: oh right. thanks :)
21:58devnbrehaut: if you want something really fancy for live coding you have to check out hilight-tail-mode
21:58ibdknoxalong with the video is an epic blog post
21:59brehautibdknox: oh, the jekyll blog?
21:59brehautthat was fast
21:59ibdknoxNo point in waiting around ;)
21:59brehautnope ;P
22:00ibdknoxthat should provide a pretty good intro for those looking to mess around with CLJS though
22:00ibdknoxlots of good tidbits in there
22:01brehautibdknox: pygments highlighting?
22:01ibdknoxyessir
22:02jimdueyibdknox: nice job on the blog and the app.
22:03jimdueyI thought about doing an app like that, but buried it deep in my TODO stack. Glad to see you do it.
22:03ibdknox:)
22:03ibdknoxit was fun and quick
22:04jimdueyWhat did you think of Jekyll?
22:05ibdknoxit took me a bit to get it "right"
22:05ibdknoxI tried starting from that bootstrap thing, but it just seemed like there was way too much there
22:05brehautibdknox: surely you'll still be getting it 'right' for the next 6 months or more :P
22:05ibdknoxnow that it works, I like it
22:05ibdknoxbrehaut: there's nothing to mess with! I'm pretty happy with the design
22:06ibdknoxthe content for projects could probably be a little better
22:06ibdknoxI threw most of those together pretty quickly
22:06brehautibdknox: haha. ive been happy with the design every time i refreshed my site, but still found heaps of stuff to tweak after not too long
22:10devn,(def yall? every?)
22:10clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
22:10devn&(def yall? every?)
22:10lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
22:10devn:(
22:11devni stole that from gnuvince: http://clojure-log.n01se.net/date/2009-02-05.html
22:11devni need to make a redneck clojure, (def ygot? contains?)
22:25devn,(let [foo (let [bar 2] (str bar))] foo)
22:25clojurebot"2"
22:28muhoois there any clojure library for interfacing directly with git?
22:28muhooother than maybe using java interop and jgit, perhaps.
22:28devnmuhoo: not probably what you're after, but: https://github.com/Raynes/tentacles
22:29devnmuhoo: also, checkout clojars, seems to be a few things worth looking into including: [quickbeam "1.0.0-SNAPSHOT"]
22:30devnmuhoo: https://github.com/technomancy/quickbeam
22:31muhoocool. thanks.
22:31devnnp, looks like it uses jgit
22:31devnpretty tiny lib, but probably ripe for commits if you feel so inclined :)
22:34tjgillieswhen neuron2 fires its not increasign neuron1 https://refheap.com/paste/783
22:34tjgilliesincreasing*
22:34devnhuzzah!
22:35devnlet the neurons fire!
22:35pandeiroibdknox: does your jekyll site automatically make a post to hn too and generate the link at the bottom?
22:35ibdknoxnope, I did that
22:35pandeirobut you intend to let hn handle the comments for your posts?
22:35devnibdknox: reading back up in my buffer now -- i never liked jekyll
22:35devni found it to be a pain in the ass
22:35devn:X
22:35ibdknoxso far I really do
22:36devni tried almost as many times as i tried emacs
22:36ibdknoxwhat was the problem?
22:36ibdknoxit seems like now that I have it in this state, all I do is add posts
22:36devnhonestly I'm not sure, it just felt like most of the time I was plumbing and not doing
22:36devnerr not "adding value"
22:36devnit took long enough to setup that i was like...great, why didn't i use wordpress?
22:37muhooibdknox: that cljs app is fantastic. thanks for documenting it so clearly. actually, all of your stuff seems really well documented to me. thanks for that.
22:37devn+10, ibdknox's docs rule
22:37devnmodel clojurian
22:37ibdknox:)
22:38devnhis color scheme choices are fun too
22:38devnibdknox: do you have a donate button somewhere on your repos?
22:38pandeiroibdknox: all the comments for your blog will be through hn then?
22:38ibdknoxpandeiro: probably, I never found it useful to have them on my own site
22:38ibdknoxdevn: I keep forgetting to do that
22:40devnibdknox: i work at a small company and we have a sort of internal "give other people company money" sort of thing. tooting my own horn: I gave to a couple of open source projects recently and noticed that a half dozen of my favorite clojure projects have no way to donate
22:40devni want a world where we all get paid to work on open source
22:40devnso get them buttons up, ibdknox! :D
22:42Scriptordonations raise a whole bunch of issues though, like being more partial to the donator's wants, even if you don't realize it
22:46ibdknoxit'd have to be anonymous
22:46muhooi don't think that's necessarily a bad thing. i like to eat. others do too, i'm told.
22:46brehautmuhoo: thats a ridiculous liberal media conspiracy
22:46muhoo:-)
22:47brehautsuper-pac? is that some sort of american thing?
22:47gfredericksquite
22:47muhoobrehaut: you don't want to know :-/
22:47brehautprobably right
22:48gfredericksdon't google it it would just make you sad
22:48brehautgfredericks: most of your political system makes me sad
22:48Scriptorhas anyone used clojurescript's reader on its own?
22:48muhooone dollar, one vote!
22:48Scriptoror are there any guides to do so?
22:55devnScriptor: There is a degree of being partial to donors' wants that is healthy.
22:56devnScriptor: some projects do not have donors and cater to themselves exclusively. Balance is healthy.
22:59pandeiroibdknox: did you mute your mic or are you really that zen when all this crap keeps throwing exceptions and screwing up?
22:59ibdknoxhaha
22:59ibdknoxno muting
22:59muhooi think anyone with experience in web dev is used to that
23:00pandeiroyeah i guess you gotta be in the zone
23:00pandeirobut i don't even hear a sigh, nothing
23:00pandeiroyou gotta swear at the compiler or it's not programming i thought
23:01muhooweb dev, usually does not involve a compiler. it usually involves multiple broken browsers and broken languages.
23:02mrevilwhat do people use for building rest clients?
23:02brehautmrevil: in clj or cljs?
23:02mrevilclj
23:02brehautclj-http is probably a good start
23:02brehauthttp://github.com/dakrone/clj-http/ i think?
23:02pandeiromuhoo: in this case talking about the cljs compiler
23:03muhoooh, well my understanding it that cljs is still very alpha. so maybe that's still the norm.
23:04mrevilno higher level abstraction?
23:04muhoomrevil: noir? ring?
23:04mrevili thought that was server side
23:05muhooclj, yes, server side. cljs is client-side.
23:07brehautmrevil: higher level? rest is an architectural style, not a protocol. there really isnt a 'higher level' than http for rest in general
23:07TimMcdevn: So, should I put a bitcoin address on all my READMEs or what? :-P
23:08mrevilno, but take for instance httparty for ruby, there are abstractions that make writing rest clients easier/faster.
23:08devnTimMc: I look around at some of the projects I really love and people support them, allow them to work full time on a particular project. I don't think some people care to be tied down their open source projects. I think there are others who would like that very much.
23:09devndown by their*
23:09TimMcMaintainership can be a real bear, yes.
23:09TimMcSometimes I want to release code anonymously. :-P
23:09brehautmrevil: a quick look at some docs for that and it looks horrible! specific urls‽ thats not restful
23:10devnI think we all sort of do that TimMc
23:10TimMcMore seriously, how to handle multi-contributer projects?
23:11devnIRC is sort of like this oracle. You can walk into this room, and if people are around you can wind up with some really great answers to problems you never asked to be answered.
23:11devnTimMc: I have no idea
23:11devnTimMc: a lot of real communication?
23:12TimMcLet's say I put a donation button on org.baznex/imports, which started out as a clojure.contrib migration but is now largely code written by me, with some code and ideas from tmciver and a bunch of ideas from the channel.
23:12devnpoint taken
23:12devnbut also, meh.
23:12TimMcI think the easiest thing to do would be to have a donation button that actually sends the money to some explicitly listed charity, and all the contributors just get a boost by seeing donations that come in.
23:13brehautTimMc: that sounds like a great idea
23:13devnTimMc: I think that should be everyone's choice
23:13devnIf someone becomes an addict maintainer, who is to say that I should stop them?
23:14TimMchaha
23:14devnIf someone can make it a job and help the community a ton by asking for modest donations that seems like a net win.
23:14TimMcI *want* it to be easy for people to make money from this stuff, but figuring out non-poisonous incentive structures is hard.
23:16devnyeah, totally agree. at the end of the day I think I really feel like if someone has a dream to maintain the hell of out projects, then I think we should encourage that. There shouldn't be whispers around it.
23:16devnIt's sort of like people are afraid to get paid a living wage for doing what they love.
23:18TimMc1) Project owner takes all: People would probably feel a little weird doing significant contributions. 2) Proportional take by LOC/issues closed/etc.: Skews what works is done (probably! or could be in a good way!) 3) renegotiate percentages occasionally
23:18TimMcMaybe (1) + project owner puts a bounty on issues.
23:18devnTimMc: There is a middle ground still though, maybe?
23:19TimMcI should have labeled those A B and C, by the way -- those are alternatives, if it wasn't clear.
23:19devnThink of Heroku, AWS. You can get a free micro, or free hosting, the base platform, but there's a buiness model outside of it that builds *with* the community behind it..
23:20TimMcRight, it has a good incentive model, just like NFSN
23:20TimMcpay-for-what-you-use
23:20devnI'm not familiar
23:20TimMcNearlyFreeSpeech.net, a web host I use.
23:21devnTimMc: *nod* -- I like that. Here's the guts. You could build this yourself. Most of it is open source, the rest would be useless to organize.
23:21TimMcPrepay, and bandwidth, storage, and other site fees are deducted penny by penny.
23:21devnbut, hey, if you want some of that stuff, we're plumbing the system together.
23:21TimMcNot following.
23:22devnputs quotes around everything I just said from "Here's the guts." on...
23:22devnTimMc: I'm speaking from the perspective of a Heroku or AWS.
23:23TimMcHmm, OK. I got confused by the dual role of "open source" in this conversation.
23:23tjgilliesheroku is expensive for more than one dyno
23:23devn*nod* -- sorry, I realize I'm a confusing typist. I write like I speak a lot of the time and it gets me in constant trouble.
23:23TimMctjgillies: Yeah, I'd love a middle ground.
23:24TimMcdevn: Oh, I figured out that you were summing up their sales pitch.
23:24devnTimMc: As I wrote that I had changed my tone, inflection to clearly be another person.
23:24devn:)
23:24tjgilliesclearly
23:24devnTimMc: I mean, that's not far off.
23:24TimMcdevn: Are you suggesting a pay-for-customization model?
23:25devnI don't know. I don't know enough about that to have a reasonable opinion.
23:25devnWhat is the Heroku, AWS model in your opinion?
23:26ibdknoxPaaS
23:26devnNot to assume they're the same... They might be very different. I guess I personally see them as similar, but would be curious to know your take.
23:26tjgilliesso weird. on line 17 https://refheap.com/paste/784#L-17 it works with an anonymous function, but if i try to map over the vector of refs it doesn't do anything
23:26TimMcibdknox: "P" == ?
23:26ibdknoxPlatform
23:26TimMcplumbing?
23:26devnhaha
23:26brehautpoodles
23:27devnparsnips
23:27tjgilliesplojure
23:27devn"i hear plojure is really making a splash these days"
23:28TimMctjgillies: Those dangling parens after (inside?) the dosync make it hard to see the structure.
23:28tjgilliesTimMc: i'll rewrite that section
23:28brehauttjgillies: why are you using an anon fn in a let anyway?
23:29TimMctjgillies: Anyway, you call that fn with (first subneurons), right?
23:29devntjgillies: it seems a little weird to me that your arities are reversed
23:29TimMctjgillies: At this point, all I can offer is doall around any side-effecting maps, or maybe just a doseq
23:30devntjgillies: why is [popularity] after [popularity subneurons]
23:30TimMcdevn: polarity
23:30devneither way, it struck me as being sort of odd, just saying...
23:31tjgilliesdevn: because im a clojure noob thats why
23:31TimMcI can see it either way. Most general case first, helpers later? (No implication of "forward reference".)
23:32TimMcWhen writing chaining Java constructors, I can never decide which order to put them in.
23:32devntjgillies: nah it's fine, i don't mean to nitpick
23:32devnTimMc: im just cargo culting -- i see that most people go low to high. that seems to be a common pattern in clojure
23:32tjgilliesTimMc: https://refheap.com/paste/785
23:32devnit's an unspoken idiom
23:33tjgilliesi cleared that function up to its easier to see structure
23:33tjgilliesso it's*
23:33brehauttjgillies: you (dosync (alter subneuron…)) can be rewritten as (dosync (alter subneuron update-in [:value] inc))
23:33tjgilliesbrehaut: thnx
23:33brehautupdate-in is magic :)
23:34devnselect-keys too
23:34brehauttjgillies: you might even find (fnil inc 0) useful too
23:34TimMcbrehaut: especially when combined with fnil
23:34devn:)
23:34TimMcbah!
23:34brehaut,(update-in {} [:value] (fnil inc 0))
23:34clojurebot{:value 1}
23:34brehaut,(update-in {:value 100} [:value] (fnil inc 0))
23:34clojurebot{:value 101}
23:34TimMcSniped by a kiwi! My internet must be super-laggy tonight.
23:34brehautTimMc: ahaha
23:34devn"f nil" seems to be fitting
23:34tjgilliesmy question was i don't understand why my anonymous function alters the ref, but when i try to map over subneurons nothing happens
23:34brehautstephen fry says yes
23:35brehauttjgillies: im not sure i understand why you are creating a fn in the let and then executing it it imiediately?
23:35TimMctjgillies: Show the attempt at using map.
23:36brehautwhy ont just (let [[subneuron & _] (:subneurons @neuron)] (dosync …)) ?
23:36TimMcand remember that map is lazy
23:37tjgilliesTimMc: here it is with the map: https://refheap.com/paste/786
23:37TimMctjgillies: Right, put a (doall ...) around that map, see what happens.
23:38tjgilliesok not sure what doall is
23:38brehaut, (let [{[subneuron & _] :neurons} {:neurons [:magic 2 3]}] subneuron) ;; more magic
23:38clojurebot:magic
23:38tjgillieslemme try it
23:38brehauttjgillies: doall forces the realization of a lazy sequence
23:38tjgilliesi wish i could use doall on people
23:38brehautbaha
23:40tjgilliesTimMc: sweet its working now
23:40TimMctjgillies: Now replace the doall and map with https://refheap.com/paste/787
23:40tjgilliesim not used to working with lazy stuff
23:40tjgilliesim a ruby guy
23:40TimMcYou were throwing away the return values anyway, right?
23:41tjgilliesyeah i was essentially using it as for-each
23:41TimMcdoseq = dorun map
23:41brehautdoseq = dorun for
23:41tjgillieswhats dorun?
23:41tjgilliesso many do* functions in clojure
23:42brehautlike doall but it discards the sequence rather than returning the head
23:42tjgilliesah, is that more efficient?
23:42brehautit wont consume memory for no reason
23:42Scriptorso dorun is only for side effects?
23:42tjgilliesi'll take that as a yes
23:43brehautScriptor: yes
23:43brehauttjgillies: it was a specific yes ;)
23:45tjgilliesTimMc: awesome thanks
23:46TimMctjgillies: Make sure you learn the difference between dorun and doall and why they exist; what it means for doall to "hold onto the head" of the seq.
23:47tjgilliesok
23:49tjgillieswhats the best way to clear all the values in clojure-swank? just reload it?
23:49tjgilliesswank-clojure rather
23:52tjgilliesoh looks like c-c c-k clears the values as well as compiling
23:53Scriptoris there a list joining function or is (reduce str ...) the idiomatic way?
23:54lynaghk``for a list of strings?
23:54lynaghk``clojure.string/join
23:54ibdknoxlynaghk``: did you catch my blog post? :)
23:55lynaghk``yeah, I just saw it on HN
23:55lynaghk``I'm tempted to crank out my own iPad overtone controller
23:55lynaghk``in our iFight.
23:55ibdknoxhaha
23:55lynaghk``LUCKILY for you Chris, I'm slammed with other work
23:55lynaghk``=P
23:55ibdknoxI am too, I'll probably regret losing the day to making this
23:55ibdknoxlol
23:55ibdknoxoh well, for the good of the community and all
23:56pandeiroibdknox: so this didn't all happen in 23 minutes you mean?
23:56ibdknoxbuilding it did
23:56pandeiroi saw that ipadtest vim session boy...
23:56pandeiro;)
23:56ibdknoxthen writing the blog post and cleaning up the blog and blah blah
23:56ibdknoxlol
23:56ibdknoxthat one was actually faster
23:56ibdknoxoddly enough
23:57ibdknoxtook me about 15 minutes
23:57ibdknoxapparently my computer can't take recording an HD screencast and getting deps at the same time
23:57ibdknoxlol
23:57ibdknoxthe screencap at two cores the whole time :/
23:58Scriptoris there a function that returns whether a value is an atom (not Atom), so if it's a string, integer, boolean, etc.
23:58Scriptoratom? seems to do the trick
23:59pandeiroibdknox: awesome that you also did the write up... one thing still foggy in my mind is what the remotes middleware is doing