#clojure logs

2013-03-15

00:10johnmn3_(let [fr (js/FileReader.) _ (.readAsBinaryString fr my-file)] (.-result fr))
00:11johnmn3_there's the bytes
00:17johnmn3_I'm constantly getting brepl disconnects. socket write errors. Is there a way to avoid that?
00:20rationalrevolt,(defmacro a [] `(fn [d#] (+ @~d#)))
00:20clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
00:21rationalrevoltthis gives me an error "Unable to resolve symbol: d# in this context"
00:22rationalrevoltis this not allowed / is there an alternative?
00:22rationalrevolt,`(fn [d#] (+ @~d#))
00:22clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: d# in this context, compiling:(NO_SOURCE_PATH:0:0)>
00:30ambrosebsrationalrevolt: you want (apply + d#)
00:31rationalrevoltno, i think its not allowing me to defer to g# inside the unquote splice
00:31rationalrevolt*refer
00:31rationalrevoltd#
00:31bbloomrationalrevolt: yeah, you can't refer to gensyms in unquoted contexts
00:32bbloomrationalrevolt: because those symbols represent stuff in code that has yet to be constructed, never mind evaluated... and unquoted code is evaluated
00:32bbloomrationalrevolt: ambrosebs provides the solution
00:32rationalrevoltbut the outer most expression has a `
00:32hiredman,`d#
00:32clojurebotd__35__auto__
00:32hiredman,'d#
00:32clojurebotd#
00:33bbloomrationalrevolt: ~ and ~@ undoes a layer of `
00:34rationalrevoltalright
00:38johnmn3_https://www.refheap.com/paste/12580
00:39johnmn3_I'm having trouble with a defn in cljs, in the above refheap
00:39hiredmanjohnmn3_: the js file reading stuff is all async
00:40johnmn3_I need a doall?
00:40hiredmanno
00:41hiredmanit is async in js, you need to setup on onload call back on the rdr
00:41johnmn3_ooooh
00:41johnmn3_even though I already have the file stored in an atom?
00:42hiredmanhttps://gist.github.com/hiredman/5167534
00:43johnmn3_okay, I think I'm tracking
00:44johnmn3_does it matter what the onload function does? if all I want is the result of readAsBinaryString?
00:55johnmn3_oh, the -result goes in the onload
00:59jjjddd0Does anyone here know how to make luminus app work in counterclockwise ??
00:59lazybotjjjddd0: Definitely not.
01:00jjjddd0I'm having a problem with this at the moment: I keep getting "FileNotFoundException Could not locate clabango/parser__init.class or clabango/parser.clj on classpath: clojure.lang.RT.load (RT.java:443)"
01:00akhudekjjjddd0: I don't know much about cc, but it sounds like your deps were not pulled in.
01:01amalloy~helpme
01:01clojurebotA bug report (or other request for help) has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it's awfully hard to help you.
01:02jjjddd0akhudek: the weird part is running lein ring server in terminal works fine. But I can't load myproject.repl in the CCW repl without getting this error
01:03jjjddd0Also weird, in the previous version of luminus, clabango was not included as a dep and things worked fine
01:05Frozenlock(binding [noir.session/*noir-session* {:username "a"}] (session/get :username)) ----> ClassCastException clojure.lang.PersistentArrayMap cannot be cast to java.util.concurrent.Future
01:05Frozenlocko_O
01:06Frozenlock(binding [noir.session/*noir-session* {:username "a"}] (get noir.session/*noir-session* :username)) ---> "a"
01:07FrozenlockThe atom is trolling me...
01:07tomojnoir?
01:07clojurebotnoir is great
01:07Frozenlocklib-noir
01:08amalloyFrozenlock: sounds like *noir-session* isn't supposed to be a map
01:08Raynestomoj: lib-noir has a whole lot of noir.
01:08amalloypresumably it's supposed to be a future of a map
01:08Raynesamalloy, Frozenlock: amalloy is right, it is an atom.
01:08RaynesWell, he *was* right until he went and caught the dums there at the end.
01:09Rayneswat, why that error
01:09tomojgoddamn exclamation points everywhere
01:09tomojexcuse me, just woke up :)
01:09amalloy&(deref {})
01:09lazybotjava.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.IDeref
01:10FrozenlockYup, works fine with an atom.
01:10RaynesYeah, it certainly shouldn't ever be a future.
01:10FrozenlockThanks :)
01:10tomojin 1.5 deref falls back to Future
01:10RaynesBut amalloy didn't catch the dums like I thought, since the error alluded to it.
01:10amalloyFrozenlock: i doubt if you're supposed to bind it yourself, though
01:10RaynesYou are not.
01:10RaynesBut he is probably testing.
01:10RaynesIn which case he has to do that.
01:11FrozenlockNo I'm not, but I'm trying to debug a function that was working in Noir and isn't anymore...
01:11amalloyi'm surprised there isn't a (with-session {} ...) macro
01:11amalloyyou apparently can't use sessions except by wrapping a ring handler
01:12Frozenlockamalloy: There was a 'with-noir' function in the days...
01:12FrozenlockIIRC it was just binding the dynamic variables.
01:26yunfanbbloom: but i am a chinese, 28 server is really not that cheaper than my times
01:26bbloomyunfan: then optimize away
01:27yunfanbbloom: ]
01:42FrozenlockAnyone familiar with *excel*? (creepy music in the background). I wonder if I should export some time data as an iso-8601 string or a milliseconds timestamp.
01:43bbloomFrozenlock: i'd go with milliseconds
01:44bbloomFrozenlock: http://office.microsoft.com/en-us/excel-help/excel-functions-by-category-HP005204211.aspx
01:44bbloomthe DATEVALUE function is quite limited when it comes to standard formats
01:45bbloomthose pages also document windows AND mac epochs, internal date formats, etc
01:45bbloomthere is also an absurdly large spec for excel.... somewhere
01:45bbloomGODSPEED.
01:50Frozenlockbbloom: Thank you very much
01:51FrozenlockI shiver just by opening this page
02:37holohi
02:41holoit seems the class org.apache.log4j.net.SMTPAppender is in log4j which i have as a dependency in project.clj - [log4j "1.2.17"] . when i try to do (:import org.apache.log4j.net.SMTPAppender), i get class not found exception
02:46durka42confused about array hashing. is there a rational explanation for this? http://pastebin.com/bUGJfck1
02:48durka42oh, it seems { } is a macro and it checks for equality before evaluating
02:49durka42you can't make a {(rand) 1, (rand) 2} either
02:49durka42weird
02:51holodurka42, it seems the generated number is the same, so it complains it cannot create a key a duplicate key
02:52holo*create a duplicate key
02:52durka42holo: but once evaluated, the keys _are_ different
02:52durka42,[(rand) (rand)]
02:52clojurebot[0.2257251605859344 0.5444336271390366]
02:52durka42,{(rand) 1, (rand) 2}
02:52clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (rand)>
02:53durka42,(hash-map (rand) 1, (rand) 2)
02:53clojurebot{0.9717426194056751 2, 0.9426321195663582 1}
02:53holoi see, the problem is before evaluation
02:53durka42it seems like a bit of a reader bug?
02:54durka42an inconsequential one
02:54holosurely looks unexpected behaviour
02:55durka42there are some sentence fragments here http://dev.clojure.org/display/design/Allow+duplicate+map+keys+and+set+elements
02:55tomojyou expect (read-string "{(rand) 1, (rand) 2}") to return a map with two values for '(rand) ?
02:56durka42tomoj: well I would have expected (read-string "{(rand) 1, (rand) 2}") == (read-string "(hash-map (rand) 1, (rand) 2)")
02:56tomojthen you don't understand the reader yet :)
02:57tomoj&(read-string "(hash-map (rand) 1 (rand) 2)")
02:57lazybot⇒ (hash-map (rand) 1 (rand) 2)
02:57tomoj&(read-string "{(rand1) 1 (rand2) 2}")
02:57lazybot⇒ {(rand1) 1, (rand2) 2}
02:58durka42wait, what's that rand1 and rand2
02:58tomojI just did that because ##(read-string "{(rand) 1 (rand) 2}")
02:58lazybotjava.lang.IllegalArgumentException: Duplicate key: (rand)
02:59tomojbut {} is not like a macro for hash-map or something, it's a literal map notation. so "{(rand) 1 (rand) 2}" makes no sense
02:59tomojyou have to read it and return a map before evaluating '(rand)
03:00durka42so in ##{(+ 1 2) 3, (+ 4 5) 6}
03:00lazybot⇒ {3 3, 9 6}
03:00durka42conceptually, the map is constructed and returned, and then the additions are computed?
03:00tomoj&(keys (read-string "{(+ 1 2) 3, (+ 4 5) 6}"))
03:00lazybot⇒ ((+ 1 2) (+ 4 5))
03:00durka42oh
03:00durka42interesting
03:01tomojlazybot won't let me eval, but, yeah. the map is then eval'd which evals the keys and the vals
03:01tomojdisclaimer: maybe there's more going on in the guts than I know about
03:02durka42and tomoj said unto durka42, { } is not a macro for hash-map!
03:02durka42and durka42 was enlightened
03:03tomojit is something like a data reader for hash-maps
03:03tomoj"data macro" never occurred to me
03:04tomoj"reader macro" is avoided since it means something else to other people. but so {} is like a hypothetical #hash-map 'reader macro'
03:05tomojI kind of think everything should be a reader macro
03:06durka42everything?
03:07durka42anyway I need some sleep
03:07p_lwell, in CL it is, and works quite fine
03:07p_l(other than "base" symbols and numbers, and, iirc, lists)
03:08tomojs/reader macro/data macro/ :)
03:08tomoj..i.e. data reader
03:09tomojtake `. if it was interpreted via default data readers 'syntax-quote, 'unquote, and 'unquote-splicing (so that `(foo ~x ~y) == #syntax-quote (foo #unquote x #unquote y)), then 1) you could customize syntax-quote (ala bblöom's wonderful backtick) and 2) you could get ` into edn (not that rich would have it)
03:11tomojaliasing would just be an override of the 'keyword default reader
03:12ChousukeI tried to implement syntax-quote like that once. It's tricky
03:12tomoj"like that" == with data readers?
03:12Chousukeas a regular macro
03:12tomojah
03:13tomojI don't think I even would have tried, luckily bblöom's tests pass
03:25tomojhuh, did dnolen get source-maps working last night? :O
03:36catkcAs a point of curiosity, and also since I want to make double-checking future assignments more efficient, does anyone have any ideas for how to solve equations with so many knowns for an unknown? I don't particularly like the brute solution of writing one function for each possible rearrangement.
03:36catkcThe more convoluted the solution the better, of course. This is a learning exercise.
03:55tomojsweet, seeing a sourcemap in chrome
03:55tomojof course everything is 404'ing because the urls are like http://localhost/repl/file:/home/tom/.m2/repository/org/clojure/... etc
04:54luxbockdoes anyone here use cljr? https://github.com/liebke/cljr
05:04mpfundsteinright now i am using clojure with vim + lein repl. but i heard great stories about emacs + slime? can anyone point me to a good tutorial how to set it up?
05:06borkdudeluxbock it looks nice, especially the installer. maybe leiningen could have such an installer (for windows)
05:06luxbockyeah that's what I was thinking as well
05:07luxbockbut it hasn't been updated in 3 years and the readme talks about clojure-contrib so I was wondering if it's still usable
05:08borkdudeluxbock yeah, don't think so
05:09luxbockI'd like to have the option to install libraries the cljr way
05:10borkdudeluxbock plugins were installed this way before kind of I think
05:10borkdudeluxbock you can do the same with pomegranate now
05:10borkdudeluxbock just load a library from clojars etc on demand
05:10luxbockyeah I was loooking into that before but I had some trouble with it, but that was a while ag'
05:10luxbockguess I should try it again
05:10luxbockago*
05:18borkdudeI was looking at the xml api here: https://github.com/clojure/clojure/blob/master/src/clj/clojure/xml.clj and noticed the use of dynamic vars
05:19borkdudeis this considered idiomatic and/or functional? It works in Clojure of course
05:25fredyrisn't it a result of managing state while working w/ the java sax parser
05:25fredyr?
05:29borkdudefredyr ah yes, probably.
05:32borkdudefredyr what would be the way if this were purely functional: reduce with a map representing the state, which gets updated every "iteration"?
05:34fredyrsomething like that i'd guess
05:35fredyrit's not entirely clear to me what a pure functional approach would look like working with a callback API like that
05:36fredyrisn't the point of the callback to manage state transitions
05:36borkdudefredyr which a java interop callback it can't be purely functional
05:36borkdudewith
05:36fredyrright
05:40illiuxSo Ive managed to get myself into a situation where someone expects me to make a UML class diagram for a clojure program...lol
05:42p_lilliux: class diagrams are evil
05:42borkdudeilliux lol
05:42p_lbut some of the other UML diagrams are better :D
05:42borkdudeilliux a sequence diagram might make sense?
05:47ambroseb_bbloom: had a chance to look at any more AST spec stuff? I recently released clr.tools.analyzer and unsurprisingly it's almost identical to the JVM version.
05:48illiuxI asked to use clojure instead of java and got an okay on it, but I don't think this guy is aware of the existance of functional programming, in retrospect
05:48illiuxand kind of assumed that clojure was object oriented
05:50p_ltechnically, lisps are more object oriented than java most of the time... ;)
05:50p_l(no special-casing of primitives)
05:52illiuxtoo bad uml class diagrams revolve around mutable state
05:52borkdudeilliux maybe you can fool him by making a class for each namespace ;)
05:54borkdudethe official uml website looks a bit 90ies http://www.uml.org/
05:55illiuxThats probably because UML is a bit 90ies
06:02p_lilliux: no, that's because UML Class diagram is perverted by the perversion of Simula's object model that exists in certain languages
06:03p_ln.b. trying to make Class diagram be 1:1 to code is *stupid*
06:04illiuxI think that's true for everything but an ideal language
08:23PeregrinePDXdfcr[p-p-4~4~4~4~~4~4~as|78
08:45sirvalianceAre there any clojure tools to autoformat code? I know eastwood is a lint tool, but something that would properly fix syntax (like indents)
08:57TimMcsirvaliance: You mean in an automated fashion from the command line, as opposed to on a spot basis in an editor?
08:57sirvalianceTimMc: Ideally, yes
08:57sirvalianceI use vim for editing and use the clojure plugins
08:58TimMcThere was a discussion of this within the past month... mayb eI can find it.
09:00TimMcsirvaliance: Start from here: http://clojure-log.n01se.net/date/2013-02-24.html#16:52b
09:00TimMcI forget how it ends.
09:01sirvalianceThanks (reading it now)
09:35pandeirocan a lein new template pull down any remote resources?
09:36pandeiroie if i wanted it to grab the latest jquery instead of providing a static one
09:40cemerickpandeiro: even better, have your template use a jquery dependency from http://www.webjars.org/
09:41pandeirocemerick: awesome thanks
09:42cemerickpandeiro: you just need a resources route in the app that loads the files from where they sit in the jar, e.g. (route/resources "/" {:root "META-INF/resources/webjars/foundation/4.0.4/"})
09:43pandeirocemerick: ah ok, gotcha
09:51jcromartieman I can never keep the clojure.zip, clojure.data.zip, clojure.data.zip.xml stuff straight
09:52jcromartie(clojure.data.zip.xml/xml-> (clojure.zip/xml-zip (clojure.xml/parse something)) ...)
09:52jcromartiethree namespaces just to query… :/
09:52jcromartieI know I can just get away with clojure.xml
09:52p_lto be abstracted by single function! :P
09:53jcromartieyeah
10:11sundbpis it possible to make a protocol "private" i.e. (defprotocol ^:private XYZ ..) ? in such a way the it does not produce and public vars
10:14clgvsundbp: why do you care about that?
10:16sundbpclgv: it's a weird use-case. i'm basically writing a mini-language for my domain (financial derivatives). i define entities via a macro. central to everything is a time-manager, which i'd like to define using the macro, but i don't want it exposed
10:17sundbpif i move the time-manager to it's own namespace (to avoid polution), i get a cyclical dependency (need the macro from ns1 to setup ns2, but the rest of ns1 depends on the time-manager)
10:18sundbpright now my way is to define ns2 (time-manager) not via macro and get around it that way. if i could keep it in ns1 as a "private" that'd be nicer though
11:37jcromartieis this overkill? https://gist.github.com/anonymous/6cdd57718f14454bbe46
11:37jcromartieI'm thinking maybe the hierarchy should be orthogonal to the pattern matching
11:37jcromartielike, just define patterns and the lowest-level tags, then expand them
11:38jcromartiebecause things won't always be hierarchical
11:57luxbockI added clojure.math.numeric-tower to my dependencies for a project and ran lein deps
11:57luxbockbut now I can only access it when I run 'lein repl' from the projects directory
11:58luxbockI know this is an issue with the CLASSPATH but I already have the /.m2/repository/ folder set up as a part of the CLASSPATH environment variable
11:59luxbockhow can I access it from wherever I want?
12:00hyPiRionluxbock: you wait for 2.1.0 because technomancy/leiningen#957 fixed it.
12:00lazybotlein run doesn't close stdin of the clojure process. -- https://github.com/technomancy/leiningen/issues/957 is open
12:00hyPiRiondur, I mean technomancy/leiningen#966
12:00lazybot:user profile not getting picked up in non-project repls -- https://github.com/technomancy/leiningen/issues/966 is closed
12:00luxbockoh
12:01technomancyyou can put it in :plugins to have it available in non-project repls
12:01luxbockalright, thanks
12:08luxbockis there a way for me to define a list of dependencies that get loaded everytime I nrepl-jack-in in Emacs?
12:14hyPiRionluxbock: like ac-nrepl for instance?
12:14hyPiRionand paredit
12:14luxbockI mean clojure libraries
12:14technomancyluxbock: yeah, that's what the :user profile is for
12:15technomancyconvenience dependencies like slamhound or tools.trace that aren't used by the code you're hacking on
12:15luxbockalright I'll google up on that
12:26jcromartieis there a function to turn a value into a list if it's not already a collection?
12:27jcromartieI'm just doing (if (coll? x) x (list x))
12:28rahcolai'm getting "only interfaces are supported, had: derp_octo_cyril.error.ParseError" when trying to implement a protocol when defining a record
12:28rahcolaany ideas?
12:28hyPiRionjcromartie: you don't convert it to a list though? You just wrap in one
12:28llasramjcromartie: Not in the core lib. Exists in various people's utility libraries. I'm not certain such functions are a good idea myself
12:28jcromartiehyPiRion: right, not convert it...
12:29jcromartieit comes in handy with mapcat when you sometimes have a collection and sometimes a single value
12:29jcromartiei.e. (mapcat to-coll [:foo [:bar bat] :baz])
12:29jcromartiecontrived I know
12:30hyPiRion,*clojure-version*
12:30clojurebot{:major 1, :minor 5, :incremental 0, :qualifier "RC6"}
12:32hyPiRionI was thinking perhaps cond-> could make it more evident, but I'm not entirely sure how it's used
12:32jcromartiespecifically, I have a seq of keywords or sets of keywords
12:33jcromartieso flatten doesn't work
12:33jcromartie,(flatten '(:foo #{:bar} :bat))
12:33clojurebot(:foo #{:bar} :bat)
12:33jcromartie,(flatten '(:foo [:bar] :bat))
12:33clojurebot(:foo :bar :bat)
12:36tomoj#(cond-> % (not (set? %)) set) ?
12:37hyPiRiontomoj: isn't easier to write, like, #(if-not (set? %) %)
12:37tomojI've been trying to resist extending my IReduce-like protocol to all values so that they just call the reducef with themselves
12:37hyPiRionbur, forgot the (set %) part
12:37tomojyeah, probably
12:38tomoj#(if (set? %) % #{%})
12:38jcromartietomoj: I already use #(if (coll? %) % (list %)) to be a little more generic
12:38jcromartiesupports sets and vectors etc
12:38jcromartieand mapcat doesn't care
12:39jcromartiewhat the return type is, as long as it's a coll
12:39hyPiRionjcromartie: do you want mapcat to care?
12:40jcromartieno, because I'll just call set on it later
12:40jcromartie(set (mapcat to-coll things-possibly-nested-once))
12:42jcromartieI could just build up a set with reduce
12:42hyPiRion,(reduce (fn [S a] (if (coll? a) (into S a) (conj S a))) #{} [:hello #{:hello :world} [:gogo :gadget]])
12:42clojurebot#{:world :gogo :hello :gadget}
12:42tomojin which case, be careful if you use r/mapcat, it does care about the return value..
12:42jcromartieheh :) I'm not, it's not that intensive
12:43tomojneither of the bots have reducers
12:44jcromartiethis is what I'm doing https://gist.github.com/anonymous/5171258
12:45jcromartiethe example in the docstring doesn't include a set-to-coll mapping
12:45jcromartiebut it happens
12:55tomojhmm, Data.Data looks interesting
12:56tomojit seems like you should be able to say to a macro "nested set of keywords" and get CollReduce
12:57aaelonyhey guys, can someone point me to a ring/compojure/hiccup example that works with lein2 and clojure 1.5 ?
12:57aaelonysomething like https://github.com/mmcgrana/adder would be great
12:57edwI saw something recently on the Clojure Google Group about a db migration tool. Anyone recall what it was?
12:58antares_Raynes: please ping me when you are around
12:58antares_edw: ragtime? lobos?
12:59edwIt was called bridge or sludge or slide or smear or something like that. I am open-minded though. I love South in Django.
13:01clgvaaelony: why not use the "adder" project, learn the basics and then setup a web project with the latest versions?
13:01aaelonyclgv: that's the plan for now. It doesn't quite compile straight up though. likely needs a few tweaks
13:02mindbender1is it possible to specify a path/dir of my own javascript sources to the cljs compiler rather than a single file as done with the :libs option?
13:02clgvaaelony: uhhh clojure 1.2.0-beta1 - thats damn old
13:02aaelonylol, yeah
13:03clgvaaelony: there should be something more recent
13:03aaelonyclgv: I'm sure there is… just haven't found it yet
13:03clgvaaelony: I learned to use ring and compojure just from reading their docs.
13:04mindbender1dnolen:
13:04dnolenmindbender1: ?
13:04mindbender1^^
13:04mindbender1is it possible to specify a path/dir of my own javascript
13:04mindbender1 sources to the cljs compiler rather than a single file as done
13:04mindbender1 with the :libs option?
13:05mindbender1http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html
13:07aaelonyclgv: that's always good advice. :)
13:21dnolenmindbender1: I think that's what :foreign-libs is for?
13:58Raynesantares_: ping
13:58antares_Raynes: hey. How are things?
14:00Raynesantares_: Well enough.
14:00Raynes:p
14:01jjido,(map #("pong") ['ping 'ping 'ping])
14:01clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval35$fn>
14:05antares_Raynes: cool. Have you seen my tryclj pull request? does it look reasonable to you?
14:06Raynesantares_: Haven't looked at it yet. Just got in to work.
14:07antares_Raynes: ok, let me know once you get to it :)
14:08jjido,(map (fn [_] 'pong) ['ping 'ping 'ping])
14:08clojurebot(pong pong pong)
14:08Raynesantares_: I'm fine with linking to that, but "Clojure Tutorials" and "Clojure Guides" is confusing. What is the difference between these two things? Also, you capitalized 'tutorials' but not 'guides' there.
14:08antares_Raynes: tutorials are for complete beginners, guides are for "novice to upper-intermediate" kind of developers
14:08antares_Raynes: guides go into a lot of details
14:09ibdknoxthat's non-obvious from the names :)
14:09RaynesYeah, I don't like the names.
14:09RaynesIs there somewhere we can just link to once?
14:09ibdknoxI would pick one and then just categorize them as "beginner" and "intermediate"
14:09antares_if you want to re-word that, I'd be happy to, I'm just curious if you think clojure-doc.org is good enough to replace two popular links with it
14:09RaynesSure.
14:09antares_Raynes: we can link it as "Clojure documentation"
14:09antares_that would be ideal
14:09antares_I just followed the way links were structured before
14:10antares_Raynes: I will update the PR
14:10ibdknox<3 Raynes. He is wise.
14:10antares_Raynes rocks :)
14:10Raynesantares_: I'd link to clojure-doc's top level and title it "Clojure Tutorials and Guides"
14:10RaynesI'll be signing tshirts afterwards.
14:11antares_Raynes: got it
14:11antares_by the way, Leiningen survey is up: https://lein-survey-2013.herokuapp.com/
14:11technomancyoh yeah, forgot to mention that in here; silly me
14:17Raynesantares_: Fwiw, you could have rebased the current pull request instead of opening a new one. It doesn't matter to me at all, but just a general tip for similar things in the future because it is sometimes faster.
14:17antares_Raynes: I edit stuff on github and it creates a new branch for each edit. Here: https://github.com/Raynes/tryclojure/pull/37
14:18RaynesOh, I see.
14:18pochois there an easy way to use map that returns a vector, assuming im calling map on a vector?
14:19joegallo,(doc mapv)
14:19clojurebot"([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & ...]); Returns a vector consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments."
14:19joegallo,(mapv + [1 2 3])
14:19clojurebot[1 2 3]
14:20joegallo,(mapv inc [1 2 3]) ;; is what i meant
14:20clojurebot[2 3 4]
14:20pochowhy isnt that on clojuredocs?
14:20technomancypocho: clojuredocs doesn't cover 1.4
14:21RaynesClojuredocs is a disaster these days. :(
14:22RaynesI really wish antares_'s thing had a different name so that we could say that without potentially damaging its reputation.
14:24technomancyafaiu the API works great; it's just the rails web frontend that sucks
14:26antares_Raynes: next gen clojuredocs.org now lived under the same GH account
14:27antares_dakrone: ping
14:27antares_*lives
14:37tomojdoes non-native imply safe-test?
14:45jcromartieI like the idea of xml zippers but it seems like overkill
14:46jcromartieI don't need to go up/down/sideways
14:46TimMcSo which direction do you need to go? :-P
14:48nDuffjcromartie: Think about XPath expressions. They go up and down all the time.
14:48jcromartieyeah, Xpath is handy
14:48jcromartiebut clojure.data.zip.xml is not Xpath, unfortunately
14:48jcromartieactually I have a xpath lib here
14:49jcromartieI'm just parsing RSS and Atom
14:49jcromartieit's not very complicated
14:49jcromartie(yet)
14:51nDuffjcromartie: One can do a lot of XPath-y things with zippers
14:51nDuff...but, bigger picture, yes.
14:52jcromartiedon't get me wrong, zippers are awesome
14:53nDuff...actually, its tendency to discard namespace data makes me pretty uncomfortable with clojure.data.xml
14:53jcromartiehm yeah
14:58jeremyheilerjcromartie: What lib are you using for XPath?
14:58jcromartieI wrote it myself
14:58jcromartieI'm pretty sure I stole some ideas from something else
14:59jeremyheilerNice. I just released an XPath library https://github.com/jeremyheiler/xenopath
14:59jeremyheilerI wasn't a fan of clj-xpath, so that was born.
15:01nDuffjeremyheiler: Which version does it support?
15:01nDuff...ahh, I suppose I should be asking which version of XPath the JDK's libraries support
15:01jeremyheiler1.0 I think
15:02jeremyheilerbut yeah,s econd question is better lol
15:06jcromartiejeremyheiler: cool
15:06jcromartieI just have one little namespace
15:07antares_Spyglass 1.1.0-beta3 is released: http://blog.clojurewerkz.org/blog/2013/03/15/spyglass-1-dot-1-0-beta3-is-released/
15:08akhudeksometimes JNI just drives me crazy: if I don't set java.library.path, the library cannot be found. If I set java.library.path to /usr/local/lib, it finds it, but not a method within it. If I symlink /usr/local/lib to a local directory in the project folder and set java.library.path to this, it both finds the library and can use the methods within it.
15:09tomojhow do you handle initialization in cljs? exactly one namespace does a top-level call to kick things off?
15:09akhudekyep
15:09hiredmanI generally export a boot function, and have a <script></script> at the bottom of the html page that calls it
15:10tomojright, nice
15:11hiredmanhttps://github.com/hiredman/ideapad/blob/master/cljs/boot.cljs#L82 https://github.com/hiredman/ideapad/blob/master/src/com/thelastcitadel/page.clj#L71
15:13jeremyheilerjcromartie: Cool. Do you worry about re-using xpathfactoy, xpath, or xpathexpression objects?
15:13phuffSo I have a little program that I'm using leiningen to develop/run
15:13phuffIt goes and parses an xml feed and then sends an email
15:13jcromartiejeremyheiler: this is it right now https://gist.github.com/jcromartie/5172313
15:13jcromartieworks fine
15:13phuffI'm updating it so that it stores the results of the parsing in a datomic db.
15:14phuffAnd now, when I run lein run it gets to the end of my program and lein run never returns.
15:14jcromartie(oops… updated!)
15:14jcromartiejeremyheiler: reload if you haven't
15:14tomojI wonder how much it helps to intersperse the script tags throughout a moderately-sized DOM
15:15jcromartiejeremyheiler: so you say for example (with-ns-mappings {"media" "http://search.yahoo.com/mrss/&quot;} ...)
15:15jcromartieassuming they have good namespaces… :|
15:15jcromartiesometimes they don't
15:20jcromartieI pretty much assume that you'll only be using xpath to return node sequences
15:20jcromartieand that you can get the text out of it or do whatever you want after the fact
15:20jcromartieit's a limited subset of Xpath but it makes more sense
15:20konr`How can I get the "this" variable in clojurescript?
15:21llasramphuff: Sounds like you have some extra non-daemon threads hanging around
15:21pochoIs there something like pmapv that a parallel version of mapv?
15:21phuffllasram How do I find them and kill them? :)
15:21aroemerstechnomancy: what is the bind-key set to, for tmux in a syme session?
15:21llasram&(doc shutdown-agents)
15:21lazybot⇒ "([]); Initiates a shutdown of the thread pools that back the agent system. Running actions will complete, but no new actions will be accepted"
15:22llasramphuff: That may help. If the problem is a thread started by something else, System/exit is your main option
15:22phuffAh okay...
15:22phuffI'm not expllicitly calling System/exit...
15:22llasramWell, that or going through the clean-up protocol of whatever started the thread
15:22phuffIs there some command I can use to print all the running threads?
15:22jeremyheilerjcromartie: Cool. That's the next thing I want to tackle. Currently I don't expose the XPath and XPathFactory instances, and I am hoping I wont have to, but we'll see. It depends on how I add support for namespaces. RE: Only returning nodes. Yeah, that make sense, I just find the get text case useful enough to warrent a fn.
15:23jcromartieyeah
15:23phuffllasram I probably just have not properly told things I'm done with them, and I'd like to figure out what I have done improperly :)
15:24jeremyheilerjcromartie: Adding support for resolvers will be interesting
15:24phuffI suppose I could just attach a debugger, eh?
15:24phuffBut then I'd have to figure out how to attach a debugger ;)
15:25jcromartiejeremyheiler: take a look at mine, it's super easy
15:25jcromartiejust a map
15:25jcromartieand a binding
15:25llasramphuff: Yeah, that's probably the main option. jvisualvm is probably sufficient though
15:27tyler__whats the difference between putting require,import,use in namespace delcaration vs the "body"? Cleanliness?
15:27phuffllasram: Thanks for the help
15:27jeremyheilerjcromartie: I don't think I want to do it that way. It's definitely clean, but at the very least I want to support passing in the values directly.
15:29jcromartieyou mean vs a macro?
15:30jeremyheilerjcromartie: Yeah
15:41aroemerstechnomancy: nvm, figured it out by looking at your .symerc/.tmux.conf :)
15:44tyler__"You are receiving this email because you registered for Clojure/West 2013." woot woot
15:44mrb_bkohpauleez: fuck, http://mitpress.mit.edu/books/software-abstractions looks insane
15:45jeremyheilertyler__: I'm pumped!
15:45tyler__jeremyheiler: im stoked becsause its across the street from my office
15:45tyler__heh
15:46jeremyheilertyler__: Very nice. I'm travelling across the country :-/
15:46pandeirois there a way to directly access or know about a memoized functions cache, if there is one?
15:46akhudekpandeiro: https://github.com/clojure/core.cache
15:47hyPiRionpandeiro: not if you're using memoize, as the cache is within a closure.
15:48pandeirohyPiRion: akhudek: thanks
15:48akhudekpandeiro: or maybe https://github.com/clojure/core.memoize
15:49akhudekthe library has had many name changes :-/
15:50technomancyaroemers: motd should explain that when you log in; did that work for you?
15:50akhudekhttp://clojure.github.com/ has docs for both libraries
15:51technomancypandeiro: I submitted a patch for that, but it was rejected
15:51technomancyreally annoying since it was like a 2-line change
15:51technomancyI've looked at core.cache like three times trying to figure it out and always just give up and roll something stupid
15:51ohpauleezmrb_bk: It's going to be… wait for it… awesome
15:53mrb_bkohpauleez: i'm looking for tools to analyze ASTs, looks like it could be cool for that
15:54ohpauleezmrb_bk: It operates at a slightly higher level than that, but if you modeled your AST process in some form of domain model (like you made a query language for it), Alloy could help you there
15:55mrb_bkohpauleez: awesome
15:55ohpauleezAlloy is great at telling you if you missed something in your query language, or your protocol, or your security system
15:55ohpauleezfor example, when you toss XPath at it, you find a hole in XPath
15:56akhudekohpauleez: it's some sort of model checking type tool?
15:56mrb_bkgot it
15:56ohpauleezwhere the spec is underspecified and ambiguous
15:56ohpauleezakhudek: Yeah, it's a model checker // verifier.
15:56ohpauleezit's like test generative for your domain model // requirements
15:57akhudekman, more reading for me to do!
15:57dnolenohpauleez: have you been using it on your Clojure projects?
15:58ohpauleezdnolen: On Monday, you will find out
15:58akhudekhuh, so it uses reduction to sat
15:58ohpauleezBut yes, I have an interface where you can do it all dynamically and run the checker in the repl // environment
15:58dnolenohpauleez: hehe cool
15:58sexpFunchey Clojurians... I've got a little question: basically I think I just had an "ah ah" moment yesterday evening while coding in Clojure. I noticed that I tend to pass way less parameters around than in Java code, mainly for two reasons:
15:59sexpFuncfirst reason is that by using a map containing all the parameters, there's no need to call functions with a crazy number of parameters (and there's no need to create as many objects as in Java)
16:00ohpauleezdnolen: and it I *sort of* have it working with Records too
16:00the_malkolmsexpFunc: cool, huh?
16:00sexpFuncand then the second reason is that I realized that apparently in a lot of case instead of passing parameters to a function and calling another function inside the outer function, I can pass a HOF to my other function, which "encloses" the parameters.
16:00ohpauleezjust following the same ideas in DynAlloy
16:01sexpFuncSo I'm not "seeing things" right!? There's *way* less boilerplate than in Java?
16:01jcromartiehow do bindings and lazy seqs work together
16:01arrdemsexpFunc: yep! you're sane!
16:02dnolenohpauleez: cool, looking forward to hearing more - I looked at Alloy once a very long time ago but never looked at closely enough to understand what it was really all about.
16:02aroemerstechnomancy: sorry, just logged out.. will check the next time I start syme.
16:02dnolensexpFunc: yep
16:03sexpFuncwhat about monads, for those who are using them? In addition to having less mutable state, aren't monads typically yelding shorter programs? (specifically because you don't need all these "parameter juggling" / "parameters passing around", seen that the state is inside, say, the state monad?
16:03sexpFuncdnolen: I love your videos btw... core.logic is next on my todo list.
16:04dnolensexpFunc: I prefer atoms to the state monad
16:04bbloomsexpFunc: monads aren't super interesting or common in Clojure
16:04sexpFuncdnolen: so you're keeping the mutable state in an atom?
16:05dnolensexpFunc: yes, and nobody that uses needs write their code in the monadic style, nor do you need to mess w/ lifiting etc
16:05bbloomsexpFunc: all the main haskell monads have similar/analogous things in clojure, but they aren't quite monads per say
16:06bbloomsexpFunc: the `for macro is the list monad, atoms are like state monads, nil punning emulates the maybe monad, etc
16:06sexpFuncbbloom: like 'let' which is more or less the identity monad you mean?
16:06sexpFuncbbloom: I see...
16:06bbloomsexpFunc: if you're interested in monads, study haskell. if you're trying to learn clojure, it's best not to even think about monads
16:06jcromartieugh, laziness and bindings don't play well together!
16:07bbloomjcromartie: true story: see #(doc bound-fn)
16:07bbloomjcromartie: er ##(doc bound-fn)
16:07lazybot⇒ "Macro ([& fntail]); Returns a function defined by the given fntail, which will install the same bindings in effect as in the thread at the time bound-fn was called. This may be used to define a helper function which runs on a different thread, but needs the same bindings in place."
16:07bbloomjcromartie: or doall/doseq/dorun/mapv/vec or some other way to force eagerness
16:07jonasendnolen: What's the :as key used for in the context of constraint maps passed to unify?
16:08dnolenjonasen: it allows you to name subforms
16:08sexpFuncRegarding atoms and swap!, I've got a question about swap! : swap! doc says it returns the value that was swapped in. What if I want both the value that was swapped in and the value that was swapped out?
16:08dnolen:as {?x [?z (1 2)]}, then in the list of unification terms ?x will refer to that.
16:08jonasendnolen: are there any examples? All I've found is the core.logc tests
16:09jcromartiebbloom: I was trying to track it down, but I forced all of the lazy calls I could see
16:09dnolenjonasen: it's not a complex idea :), for example you have (?x ?y) and you in a term, but you also want to give it a name, :as lets you do that.
16:10bbloomjcromartie: passing identity to clojure.walk is a decent way to force evaluation. i don't recommend that as a SOLUTION, but i've used it to debug laziness/binding interactions
16:10bbloomie performing a manual bisect by walking sub trees to figure out which subtrees are lazy
16:10jcromartiehm
16:11ibdknoxbbloom: that is both clever and depressing lol
16:11ppppaulcool bbloom !
16:11bbloomibdknox: i view it as a bug that laziness doesn't defacto capture bindings :-P
16:12ppppaulbbloom, have you used that with datomic?
16:12bbloomppppaul: no, i haven't done more than play with datomic
16:12dnolenbbloom: it's desirable, but the perf implications are not good.
16:12sexpFuncHow do I send this to the bot: ((fn [a] (do (println "swaped out: " @a) (println "swaped in: "(swap! a inc)))) (atom 0))
16:12bbloomdnolen: i know, it sucks :-/
16:13sexpFunc,(+ 2 3)
16:13clojurebot5
16:13sexpFunc,((fn [a] (do (println "swaped out: " @a) (println "swaped in: "(swap! a inc)))) (atom 0))
16:13clojurebotswaped out: 0\nswaped in: 1\n
16:13ro_stohpauleez: ehy
16:14ro_sts/ehy/hey :-)
16:14ohpauleezro_st: Welcome to the west!
16:14ohpauleezI just sent you an email
16:14ro_stare my tweets getting through to you? :-)
16:14ro_staha!
16:14sexpFunc"inc" is a stupid example here but if another thread swap! between my deref and my swap!, the "swaped out" value ain't correct. How can get I know exactly which value was swaped out when using a swap! on an atom?
16:14ohpauleezI'm basically just hammering away at some content and code today. So I can totally meet you and your crew downtown for a beer/coffee
16:15sexpFunc("inc" is a stupid example because obviously if I get back 3 I know that 2 is the value that got swaped out, but that's not my question ; )
16:15stuartsierrasexpFunc: With built-in functions, you can't. But you can easily define an alternate version of `swap!` that returns the old value.
16:16ro_sthey stuart. looking forward to meeting you :-)
16:16ro_stnext week is going to be a blast
16:17hyPiRionOh you guys
16:17ro_stit took us 30 hours to get from capetown to portland. was killer
16:18sexpFuncstuartsierra: thanks... (love your vids too btw)
16:18hyPiRionI'll be here in this cold country programming Erlang next week, so go enjoy ClojureWest for me.
16:19jonasendnolen: I think I get it now. For example (unify {:as '{?x (?y 2)}} '[[?y ?x] [1 (1 2)]]) unifies
16:19jonasenwhile (unify {:as '{?x (?y 2)}} '[[?y ?x] [2 (1 2)]]) doesn't
16:20dnolenjonasen: yes, because ?y can't be 1 & 2
16:20ro_stand you, too, dnolen!
16:21ro_stgosh. going to be mad.
16:24stuartsierrasexpFunc: Thanks, and you're welcome.
16:26tomojcan't you get the old value with add-watch?
16:26amalloytomoj: you don't need add-watch, you can just wrap the swap function
16:27jonasendnolen: so should not the following unify: (unify {:as '{?x (?y ?y)}} '[[?y ?x] [1 (1 1)]])?
16:27tomojoh yeah
16:27gfredericksamalloy: to reset some other local atom?
16:27amalloygfredericks: yeah
16:27dnolenjonasen: it should unify yes.
16:28squidzIm trying to get started with clojurescript, and when trying to lein cljsbuild once I get an exception (NoClassDefFoundError com/google/protobuff/MessageOrBuilder). Does anybody have an idea why this is happening=?
16:28jonasendnolen: I'll open a ticket then :)
16:28dnolenjonasen: thanks!
16:28gfredericks(defn $wap! [a f & args] (let [a' (atom nil)] (swap! a #(do (reset! a' %) (apply f % args))) @a'))
16:29amalloy&(let [a (atom 10), old-value (atom nil), instrumented-inc ((fn [f] (fn [x & args] (reset! old-value x) (apply f x args))) inc)] [(swap! a instrumented-inc) @old-value])
16:29lazybot⇒ [11 10]
16:33jonasendnolen: I wish I'd understand the unifier internals better so I'd be able to provide patches along with the issues
16:34dnolenjonasen: well it's not very much code :)
16:35dnolenjonasen: what it does is pretty simply, walk everything looking for ?foo, those are the vars. That's the prep phase, then pass those to core.logic to do the real unification work.
16:35dnolenjonasen: the interface changed for 0.8.0 since I wanted to support options. :as is one, and of course more fine grained constraints on vars.
16:36jonasenthat much I understand. But I've yet to understand how constraints are implemented
16:36dnolenjonasen: it's mostly irrelevant for the unifier code.
16:36dnolenjonasen: they are just passed along.
16:37sexpFunc(I asked the question on SO: http://stackoverflow.com/questions/15441638/alternate-version-of-swap-also-returning-swapped-out-value so there's a trace of it)
16:37squidzit is only happening when I try to use clojurescript in an already existing project. When I start a new project it compiles fine
16:38dnolenjonasen: internally the substitution has a queue for the constraints. So unifier just queues them up, after all the terms have been unified, we run the queue to make sure nothing has been violated.
16:38jonasendnolen: yesterday, I tried to figure out how (unifier ..) produces the result map {?x .. ?y ..}.
16:41sexpFuncamalloy: sweet example with the instrumented-inc : )
16:41dnolenjonasen: opts will contain all the lvars the user cares about. we use this to look inside the substitution to get a seq of vectors of lvar -> value that we pour into a map.
16:42dnolenjonasen: line 123-129. note we call fix-constraints after unify, like I said.
16:42dnolenjonasen: in unifier.clj
16:43dnolenjonasen: one subtlely is is that (lvar 'foo) generates random names - we don't want that. ?x should always refer to ?x every where it occurs. thus (lvar 'foo false), prevents gen-syming
16:44borkdudejonasen I tried kibit yesterday. I found another rule you can add: (if-not .. (do ....)) ;;=> (when-not .. ….)
16:44dnolenjonasen: there rest is pretty simply, walk the lvar, reify it's value.
16:44borkdudejonasen and other variations on that
16:44jonasenborkdude: pull request welcome :)
16:44borkdudejonasen cool :)
16:44technomancyaroemers: do you remember if it had a fancy "SYME" ascii-art baner when you logged in or if it was the boring default Ubuntu one?
16:45jonasendnolen: I'll try to tackle LOGIC-121 then. One possible reason for the bug might be that (for some reason) opts does not contain all the lvars
16:45dnolenjonasen: that's a possibility
16:46sexpFuncamalloy: sweet example with identity-inc. What if swap! gets called multiple times: identity-inc is free of side-effect and it's guaranteed that on the last call (if it's called multiple times), then the inner atom (old-value) shall be reset! to the last swapped-out value?
16:47jcromartiejeremyheiler: got it!
16:48jcromartiejeremyheiler: instead of just returning the raw java XML DOM node, I use an internal hash map to keep the xpath context along with the parsed doc and any node seqs
16:48jcromartieall of my xpath functions now take this map representation and use the bundled xpath context
16:48dnolenjonasen: another possible bug, unifier* may need to be like unify*, unify* does the right thing, all unifications proceed w/o reifying vars to symbols ?foo, except for the very last unification. I see unifier* isn't written this way.
16:49jcromartieso you set up the namespace mappings when you parse the document
16:51dnolenjonasen: hrm ... unifier* just may be wrong :P, unify* is correct. I think all that stuff in -unifier* line 122-129 should probably only happen the last time.
16:57jeremyheilerjcromartie: Nice! I was thinking of doing something similar, where there is my own protocol+type that you pass around instead of the mutable XPath one.
16:59aroemerstechnomancy: I guess the default ubuntu one, since I didn't notice anything special. Want me to test it for you?
17:00borkdudejonasen does kibit work transitively in the sense that a -> b (meaning suggest rewrite a to b) and b -> c, so it suggests a -> c?
17:01borkdudejonasen from one test I added I sense it does
17:01aroemerstechnomancy: opening a new session now...
17:02jonasenborkdude: I doesn't do that
17:02borkdudejonasen then I don't know why '(when-not test body) '(if (not test) (do body)) passes
17:03borkdudejonasen because maybe (not test) unifies with one single thing?
17:04aroemerstechnomancy: nope, just the ordinary ubuntu message.
17:05aroemersand this time I waited until Syme was done configuring before I connected.
17:06stuartsierrasexpFunc: provided my answer on StackOverflow
17:09jonasenborkdude: I think it might actually do transitive simplification. I'm not actually sure (both are possible: it depends on if the tests use simplify or simplify-one)
17:09technomancyaroemers: good to know; thanks.
17:09technomancybaffles me why motd doesn't get installed though
17:10technomancysince when I run the exact same bootstrap script when I'm logged in it works fine
17:10technomancyI guess I could turn off the custom .tmuxrc since syme supports user-specific dotfiles now
17:11technomancyI didn't want to inflict C-a-stealing on people, but now they have a way out
17:13konr`How can I turn a clojurescript entity into a console-friendly js object?
17:14aroemerstechnomancy: And by C-a you mean C-b? (the default) :)
17:14aroemerstechnomancy: but yeah, I think users expect defaults now that they can have their own .symerc
17:15technomancyaroemers: they're both so horrible that I think of them as the same thing =)
17:15aroemersheh
17:15technomancyaroemers: if you have the inclination to dig into the motd thing I would love some help with it
17:15technomancyalso the shutdown hook is broken, and I have no idea why
17:16technomancybelieve it or not, it's really hard to debug a feature that only triggers upon the shutdown of an EC2 node =)
17:16aroemersAh, you mean the hook that notifies Syme of a shutdown?
17:16technomancyaroemers: yeah, so that it shows "halted" as the status
17:17aroemersI'll have a look, Syme is not that much of source code anyway.
17:17technomancythat's my favourite thing about it =)
17:17technomancyI'm sure the shutdown hook is obvious to anyone who knows how update-rc.d works
17:18aroemersI don't, but one can find out. "To the bus!"
17:18technomancyheh
17:18technomancymagic school bus?
17:18aroemersYep
17:18technomancyhaha
17:19aroemersGotta love XKCD
17:19konr`ah-ha, it's `clj->js`!
17:19ravsteraroemers: hmmm, I need to catch up with that.
17:20tyler__is there a way to parallelize a list comprehension?
17:21aroemersravster: http://xkcd.com/911/
17:21tyler__im trying to do (for [item collection] (long-lived-computation))
17:22technomancytyler__: can't do it with for; try pmap
17:22tyler__technomancy: ok. i guess pmap is the swiss army knife of parallel land heh
17:22technomancyeh
17:22technomancyactually it's mostly demo-ware
17:23technomancyfor IO-bound stuff it's no good
17:23technomancyyou would need to drop down to Executors for that
17:24tyler__technomancy: ... by computation i meant response from ssh session. i thought it would be the same deal but guess not
17:24technomancypmap refuses to let the newest computation get too far ahead of the oldest unfinished element
17:25technomancyso it's also only good for lists of uniform compute load
17:25tyler__ah so for io bound things that have the same io bound
17:25tyler__its ok?
17:25technomancywell, it's also lazy
17:31hyPiRionI find pmap the weirdest thing parallel thing
17:32hyPiRionit's like, "oh, you're most likely interested in speed. Let me give you a partially lazy function which confuses you"
17:36amalloytyler__: like technomancy said, pmap is demo-ware. it's really hard to profitably use pmap, but it's really easy to say "look, i just added a single character and now my app is multithreaded and threadsafe"
17:37amalloy"(isn't clojure great)"
17:42QStevenwhen I run lein cljsbuild clojure.browser.repl is not found on the classpath
17:45QStevenhere is the offending code: https://github.com/sdevijver/webfui-repl
17:47QStevenwhen I run lein cljsbuild once I get this error message: http://pastebin.com/aw3rsRY4
17:48aroemerstechnomancy: sent you a PR for the MOTD problem.
17:49tomojQSteven: clojure.browser.repl is cljs
17:49tomojlooks like you're trying to require it from clj
17:49tomojare you doing that so you can alias in a macro?
17:50tyler__amalloy: i love your tongue-in-cheekness ;)
17:50QSteventomoj, I forked this example, it works perfectly here: https://github.com/emezeske/lein-cljsbuild/blob/0.3.0/example-projects/advanced/project.clj
17:50technomancyaroemers: woooo thanks
17:50aroemerstechnomancy: no thanking yet, not sure if it works ;)
17:50tomojQSteven: where did wrepl.clj come from?
17:50QSteventomoj, I'm doing this: https://github.com/sdevijver/webfui-repl/blob/master/src-cljs/wrepl.clj
17:51tomojthat says .clj
17:51tomojit should be .cljs
17:52QSteventomoj, *danj*
17:53QSteventomoj, thank you, you're a scholar and a gentleman!
17:54technomancyaroemers: deployed; I'll start an instance and see
17:56technomancyone of these days I'll get around to writing a manifesto re: remote hacking and how syme fits into that
17:58technomancyaroemers: my hat is off to you; that was bugging me for ages and now it works =)
17:59aroemerstechnomancy: nice
18:07Guestaroemers: The big secret behind this is that technomancy doesn't wear a hat at all and thus gave you no tribute.
18:08amalloyRaynes: your switch to a Guest account to mock technomancy wasn't subtle enough. i think he knows it was you
18:08RaynesYeah, no clue what znc is doing.
18:09technomancyamalloy: I used to have all NICK events ignored, but now with the latest ERC it only ignores NICK/JOIN/PART of lurkers so the ruse is up!
18:09aroemersRaynes: thanks, makes me feel much better.. I think.. wait..
18:10amalloyc'mon, let's all /nick spartacus so that one of us can safely say something rude
18:14aroemersI have all NICKs ignored as well. Had to do a /whowas to find out..
18:15technomancyaroemers: derp; the shutdown hook was just a chmod problem
18:16aroemerstechnomancy: nice, you solved it!
18:17technomancyaroemers: if you want to keep hacking there are some actually-interesting problems on the issue tracker =)
18:17aroemersheh, already there :)
18:18technomancysweet; which one?
18:19aroemersnot decided yet
18:19technomancyall the functions for DNS manipulations already exist in the syme.dns namespace if you want to do that one
18:19technomancyI wasn't handling it because I couldn't do deregistration without the shutdown hook
18:20QStevenhow can I load macros from a cljs repl?
18:20technomancyaroemers: but #6 might be the best bang-for-buck
18:20technomancyoh, oops; but maio already volunteered =)
18:22aroemerstechnomancy: #6 is a nice one as well. As a user, I would like such a function. Will think about it.
18:25aroemerstechnomancy: and why is technomancy/syme#20 reopened?
18:25lazybotSupport inviting an entire organization at once -- https://github.com/technomancy/syme/issues/20 is open
18:25technomancyaroemers: I had it working, but I removed it during a refactoring and haven't bothered to bring it back.
18:27QStevenfrom loading macros in the cljs repl should I also use load-namespace?
18:27aroemerstechnomancy: alright, will keep it all in mind. Going to sleep now.
18:28technomancyaroemers: cool; thanks for your help
18:36tyler__anyone know of an app that convert the output of `ps` into a datastructure?
18:36tyler__perferably edn
18:37tyler__i think rich went on a rant about this one time
18:39tyler__piping everything with `awk` is kinda bollocks
18:39technomancyusing strings for everything is the Unix Way
18:40hyPiRionImagine an EDN OS? Everything is functional, piping as well.
18:41hyPiRionExcept pr and pprint, which print to stdout and return nil
18:41technomancymy shell's already in lisp, thankyouverymuch =)
18:41hyPiRionhuh, I wonder how far one would get with such an os.
18:44tyler__its not the shells fault
18:44tyler__its the applications fault
18:44tyler__for having bullshit output
18:44tyler__heh
18:45technomancywell... nature vs nurture
18:45technomancythe application is a product of its environment and upbringing
18:45technomancyif it had been raised in a loving lisping home it wouldn't be exhibiting this dysfunctional behaviour
18:48Rich_MorinI need to spider and parse some machine-generated HTML pages. I've done this sort of thing in Ruby, but never in Clojure. Looking around, I see a number of proposed approaches, but I'd like to know if there is a consensus on the top few, at least. Help?
18:49tyler__(inc technomancy)
18:49lazybot⇒ 48
18:51ravsterI'm trying to make ring use datomic as a session store. The ring docs say that I need to make something that implements the SessionStore protocol. How does this work? I don't understand what they mean by 'protocol' in this context.
18:53hyPiRionravster: https://github.com/ring-clojure/ring/blob/master/ring-core/src/ring/middleware/session/store.clj ?
18:53hyPiRionYou have to implement that protocol.
18:53ravsterhyPiRion: so I just create a new 'protocol' that exposes those three functions?
18:55tyler__peat: lurker
18:55ravsterare protocols a clojure-specific thing?
18:55tyler__;)
18:56peattyler__: creeper.
18:56hyPiRionravster: yep, look at http://www.infoq.com/presentations/Clojure-Expression-Problem for understanding it more thorough
18:56ravsterhyPiRion: will do. Thanks.
18:57hyPiRionThough you can consider it as an interface which you can define outside a "class".
18:57craigbroneed help with a name
18:58craigbrofor a simple package that provides a wrapper around core.logic defrel and generates DB schema and sql from a set of relations/facts
18:58craigbrologisql is my beer-starved brain's first attempt
19:00technomancyhttp://static.gamesradar.com/images/mb/GamesRadar/us/Features/2010/08/Scott%20Pilgrim%20videogame%20references/v6/v6-3-shatterband--article_image.jpg
19:02OscarZas a long time Java programmer, now it seems funny that Clojure seems so natural, so little "bullshit" and boilerplate...
19:04tyler__wooot
19:04tyler__just found an awk script that converts unix column output to JSON
19:04tyler__good enough
19:04tyler__https://github.com/mgrundy/awkward/blob/master/awkward for the curious
19:05llasramWhat's the Clojure/JVM standard way to parse the HTTP 'Accept' header?
19:05technomancyllasram: that's been the one thing I felt like is completely missing in the clojure web ecosystem.
19:06technomancyor maybe there's something I'm just unaware of
19:06OscarZI guess its human that there is always momentum in these kinds of movements... OO programming fixed a bit too much... now Clojure seems to take a step back
19:06OscarZconcentrating on lists and functions..
19:07llasramtechnomancy: Huh, okay. Interesting. Bishop does it, and looks exposes a function to do it. Using just compojure right now, so was hoping for something more common
19:08llasramI'd expect parsing it to be a pretty common need
19:11technomancyI've never needed more than two formats for a given endpoint, so I can get away with (if (re-find #"json" (:content-accepts headers)) ...)
19:11llasramWhat if you get application/json;q=0 ?
19:12technomancyno idea!
19:14tomojwho uses that? people who use webmachine so they can demonstrate their superiority?
19:15llasramThere's some hermit out there who only wants XML, and doesn't want JSON even if there's no alternative. And you'd turn around and give them JSON anyway, just because "who does that"?
19:16llasramNot very ethical. Or polite.
19:17amalloyllasram, technomancy: https://github.com/ngrunwald/ring-middleware-format ?
19:17technomancy"If I gave people what they wanted we would have just built a faster horse"
19:17technomancyamalloy: I'm thinking of just the "HTML vs everything else" question
19:17technomancyhuman vs automaton
19:18technomancyno offense to the humans who prefer json to HTML
19:18llasramAnd I want to know if I need to decompress my gzip'd blob before serving it, or if I can just slap a Transfer-Encoding on it and be done
19:19technomancycan't nginx do that for you?
19:20llasramDetect what I'm serving is gziped and automatically decompress it for the client? I hope not
19:20technomancyoh, I meant do the actual compression
19:20squidzim trying to get started with clojurescript and after following the directions on the cljsbuild lein github readme, I got an exeption. I then tried to use a local version of clojurescript and got another error. Here are the stack traces: https://www.refheap.com/paste/12613 The first paste is when just following the instructions to get the most basic clojurescript project up. The second stacktrace is after I tried cloning a local version of clojurescript and u
19:21llasramtechnomancy: Ah, but I have the opposite problem -- data stored compressed, need to potentially decompress. I could just unilaterally decompress then let my frontend server optionally recompress, but I'd rather not
19:22technomancysorry
19:22llasramnp :-)
19:31jonasacwhats a good way to do auth in a ring app ?
19:31lynaghkjonasac: look into cemerick's friend library.
19:31tazlehm, which class loader does Clojure use to look up classes corresponding java interop macros?
19:32squidzAfter including org.clojure/data.json in my project the json error is gone, but now i'm back at the first exception I pasted
19:32tazleand can I affect it somehow?
19:32jonasaclynaghk: thanks
19:32squidzjonasac: I think friend is supposed to be good, but I havnet tried it out yet
19:32antares_new clojure-doc.org guide is up: http://clojure-doc.org/articles/language/laziness.html, feedback welcomed
19:32tazleI think I saw somewhere that it was supposed to be the context classloader of the thread, but that doesn't seem to be the case
19:33squidzI would really like to try clojurescript but can get it started
19:33Sgeo"Clojure is not a lazy language."
19:33SgeoOk, glad it got that right. I'm happy now.
19:33antares_squidz: looks like another missing dependency. There were some added to ClojureScript recently, I believe: https://groups.google.com/forum/?fromgroups=#!topic/clojure-dev/usE_hrROGvA
19:34antares_Sgeo: happy that it makes you happy :)
19:35antares_squidz: maybe ask on the mailing list? groups.google.com/group/clojurescript
19:35squidzokay the json dependency was easy to figure out but NoClassDefFoundError for com/google/protobuf/MessageOrBuilder is more confusing
19:35jonasacbah, whenever im looking into a clojure library on github i find 10 other libaries i need to check out :p
19:38bbloomjonasac: i'm that way with research papers... damn internet is a bottomless pit. my tree search algorithm needs tuning
19:39antares_squidz: it comes from com.google.protobuf/protobuf-java but I have no idea why ClojureScript may need that
19:39antares_squidz: maybe some other library does
19:41squidzantares_: hm I wish I could figure out. This also means that it should not run for anybody else that tries to use the latest versions I think
19:45jonasacbbloom: reading research paper sound like something that might help you tune that algo , just read the right papers :)
19:46bbloomjonasac: oh, i know. i've been using a neural network to tune my heuristics for 26 years... it might converge by the time i'm 300 years old
19:46jonasac:)
19:48technomancyjonasac: good thing you have this channel to help you decide between competing libraries =
19:48technomancy=)
19:50jonasactrue dat :)
19:50llasramI just throw them all in the same project, walk away for a bit, and see which has emerged victorious
19:53nbeloglazovHi. I have a string that contains clojure code. I now position where starts some s-expression. What is the easiest way to get position where it ends?
19:53nbeloglazovI only came up with solution when I need manually iterate through string counting parenthesis, ignoring inner strings and comments
19:56tazleapparently if I load-file in with-bindings {clojure.lang.Compiler/LOADER my-shiny-loader}, my shiny loader is used
20:01llasramnbeloglazov: What's the broader goal?
20:03mpenetambroseb_: is there an equivalent of "Values" in core.typed: Union of multiple values? I mean syntatically instead of repeating (U (Value :a) (Value :b) ...). If that makes any sense
20:05nbeloglazovllasram: I want to get start and end of an expression in order to be able to higlight whole expression.
20:10nbeloglazovllasram: I'm playing with kibit lib and want to create web page for displaying analysis info of clojure source file.
20:11llasramnbeloglazov: Hmm. Interesting. You should be able to use the clojure reader to extract the info, but I've got to go, so can't engage in exploring the approach at the moment
20:11llasramnbeloglazov: Good luck!
20:12antares_nbeloglazov: take a look at https://github.com/clojure/tools.reader, maybe it exposes some functions will help
20:12nbeloglazovllasram: thanks. But clojure reader seems to give only line and position of expression start point. Not the end
20:13nbeloglazovllasram: hm, I'll take a look, thanks.
20:13ohpauleezllasram: Look at how the line-plugin is processing files.
20:14ohpauleezYou can use all the same hooks, and just expose the appropriate web endpoints
20:14ohpauleezlein**
20:17ravsterIn both the cookie- and memory-store examples for ring-sessions, they don't use the 'store' argument in the functions. Do I need to use it when making a datomic session store?
20:24ambroseb_mpenet: Could you elaborate on Values?
20:25ambroseb_As in some compile-time constant?
20:26mpenetyes
20:26ambroseb_Use case?
20:26mpenethttps://github.com/mpenet/hayt/blob/typed/src/qbits/hayt/types.clj
20:27mpenetnative datatypes on a datastore as kw in clj
20:28ambroseb_Do you mean (Values :a :b :c)?
20:28mpenetyes something like that
20:28ambroseb_Ok, I think you can quote keywords and you don't need to wrap them in Value
20:29ambroseb_And I may allow they raw at some point
20:29mpenetI will try
20:31mpenetperfect
20:31mpenetthanks
20:31ambroseb_great
20:33squidzantares_: It was a proto-buf dependency. I added a org.flatland.protobuf dependency, and cljs now compiles my js
20:34antares_squidz: I am still surprised cljbuild needs a protobufs library
20:35squidzyeah, or if it does, why it isnt automatically required
20:38squidzantares_: anyways, i'm excited to finally have it running enfocus and shorleave here I come
20:39antares_squidz: good stuff
21:05mpenetambroseb_: weird thing here https://github.com/mpenet/hayt/blob/typed/src/qbits/hayt/types.clj#L7 It returns an exception: Cannot parse list but works fine in the repl. I am doing something wrong I guess
21:05ambroseb_mpenet: use t/Option
21:06ambroseb_Option is just an alias, which is imported like a var.
21:06mpenetright, I should have thought of that
21:17bbloomwell this is surprising: ##(let [{x :x} (list :x 1)] x)
21:17lazybot⇒ 1
21:18bbloom,(let [{x :x} [:x 1]] x)
21:18clojurebotnil
21:18bbloom,(let [{x 0} [:x 1]] x)
21:18clojurebot:x
21:18bbloomseems that seqs are mapified...
21:18hiredmanhuh
21:18amalloythat was added in...1.4, i think
21:19ambroseb_This was to support fn parameter destructuring right?
21:19ambroseb_or rest arg destructuring rather.
21:19bbloom,(macroexpand '(let [{x :x} :in] :out))
21:19clojurebot(let* [map__182 :in map__182 (if (clojure.core/seq? map__182) (clojure.lang.PersistentHashMap/create (clojure.core/seq map__182)) map__182) x ...] :out)
21:19bbloomambroseb_: ah, that makes sense
21:20bbloomambroseb_: still, somewhat surprising in that it adds a (if (seq? ...) test
21:20amalloyyeah, but that part would have been added in 1.2. i think there was some more-recent change that slightly broadened the scope in which seqs are allowed
21:21ambroseb_bbloom: IIRC rest arguments are always seqs, or nil.
21:21bbloomambroseb_: the surprising bit is the willingness to pay the cost of an extra test on every map destructuring, but i guess it's probably a miniscule part of the cost of lookups
21:22TimMcI just learned about map destructuring of vectors from cemerick's book. :-)
21:22amalloyfwiw it looks like i'm wrong, the only stuff to touch that recently has been optimizations and bugfixes
21:23bbloomapparently there is a bunch of little destructuring secrets
21:23ambroseb_I've never seen map destructuring of sequences documented.
21:23bbloomfor example amalloy basically just schooled me on the fundamental syntax of destructuring maps that i apparently didn't understand at all lol
21:24amalloyi think i know everything there is to know about destructuring, but i'd be excited to be proven wrong
21:24TimMc&(let [{x 3} "hello"] x)
21:24lazybot⇒ \l
21:24bbloomin general, i'm thinking about this interaction between predicates, binding, and syntax.... there's destructuring, pattern matching, unification, then other things are similar in other domains, stuff like XPath and CSS Selectors, and all this other stuff
21:25bbloomi'm wondering if there are some common bits that can be generalized so that one can invent new pattern-matching-like constructs as needed & reuse some machinery
21:25amalloy&(get "hello" 3)
21:25lazybot⇒ \l
21:25amalloywhew. TimMc had me worried that the string was being coerced into a vector somehow
21:25bbloomheh
21:26TimMcNo, I was mistaken about the applicability of that form.
21:27TimMc&(let [[x] {:a 1}] x) :-(
21:27lazybotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
21:27bbloomso i was looking at Prismatic's Graph/Plumbing, & they have a specialized new destructuring syntax tuned for trees of maps with keywords as keys
21:27bbloomthe fnk things
21:27bbloomhttps://github.com/Prismatic/plumbing/blob/master/src/plumbing/fnk/README.md
21:28TimMc&(let [{x :a & rest} {:a 1 :b 2}] x)
21:28lazybot⇒ 1
21:28TimMcamalloy: Check *that* out!
21:28TimMc(Yes, I'm being sneaky.)
21:29amalloycute
21:29hiredman,(let [{x :a & rest} {:a 1 rest 2}] &)
21:29clojurebot2
21:29TimMc:-)
21:30TimMc&(let [[:as [:as [:as foo]]] [0 1 2]] foo)
21:30lazybot⇒ [0 1 2]
21:32TimMc&(let [[x :as a & don't mind me] [0 1 2 3]] [x a])
21:32lazybot⇒ [0 [0 1 2 3]]
21:33TimMc&(let [{:keys [a b]} {:a 1 :b 2}] [a b])
21:33lazybot⇒ [1 2]
21:34TimMc&(let [{:keys [a b & c]} {:a 1 :b 2}] [a b])
21:34lazybot⇒ [1 2]
21:34TimMc&(let [{:keys [a b & c]} {:a 1 :b 2}] [a b & c])
21:34lazybot⇒ [1 2 nil nil]
21:34TimMcWhoops, forgot which window I was in. Those first two :keys things weren't meant to demonstrate anything. :-)
21:35TimMcIt's a good thing I didn't start having an intimate conversation with lazybot or something.
21:37hyPiRion,(let [{:keys [a b c] :or {a b, b 2}} {:c 1}] [a b c])
21:37clojurebot[2 2 1]
21:37hyPiRion,(let [{:keys [a b c] :or {a 2, b a}} {:c 1}] [a b c])
21:37clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0:0)>
21:38hyPiRionordering matter, in other words
21:48FrozenlockI'm using compojure with lib-noir and getting a bunch of these messages printed on the console: "2013-03-15 21:48:34.314:WARN:oeji.nio:javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack?"
21:48FrozenlockIs there a way to correct this?
21:49hyPiRionYeah, the logger is rather verbose
21:49FrozenlockShould I just ignore it?
21:53hyPiRionWell, it basically logs more or less everything, so I'd guess it's safe
21:54FrozenlockBut.. but.. there's the word 'attack'!
21:55bbloomone other odd thing about destructuring is how errors are handled
21:55bbloom,(let [[x] 5])
21:55clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: Long>
21:55bbloommakes perfect sense
21:55bbloomuntil i want to if-let
21:55bbloom(if-let [[x] 5] x)
21:55bbloom,(if-let [[x] 5] x)
21:55clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: Long>
21:56bbloomb/c that's basically a single step pattern match, only it doesnt work :-/
21:56gfredericksbbloom: what do you want that to do? fail?
21:56gfredericksi.e., act falsy?
21:56bbloomgfredericks: well ##(let [[x] nil] x)
21:56lazybot⇒ nil
21:56hiredmandestructuring is not pattern matching
21:56gfredericksnil is seqable though
21:56gfredericksalso what hiredman said
21:57bbloomi understand the difference, i'm just trying to study the minutia of it
21:57gfredericks&(let [[x] 5] x)
21:57lazybotjava.lang.UnsupportedOperationException: nth not supported on this type: Long
21:57bbloomi wonder if it would be desirable for that to return nil
21:58bbloomand what other things can cause destructuring to throw?
21:59gfrederickssets, which I think is odd
21:59gfredericks&(let [[x] "foo"] x)
21:59lazybot⇒ \f
21:59bbloomgfredericks: sets are different b/c that's an error at macro expand time
21:59bbloom,
21:59clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
21:59bbloom,(macroexpand '(let [#{x} 5]))
21:59clojurebot#<Exception java.lang.Exception: Unsupported binding form: #{x}>
22:00gfredericksno I mean the other way
22:00bbloom,(macroexpand '(let [[x] 5]))
22:00clojurebot(let* [vec__251 5 x (clojure.core/nth vec__251 0 nil)])
22:00gfredericks&(let [[x] {:foo 12 :bar 15}] x)
22:00lazybotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
22:00gfredericksI guess it's anything you can pass to nth?
22:00gfredericks&(nth {} 0)
22:00lazybotjava.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap
22:00bbloomseems odd right? heh
22:00gfredericks&(nth "foo" 1)
22:00lazybot⇒ \o
22:02gfrederickswhen I was doing graph theory with graphs as sets of #{a b} I wanted to be able to (let [[a b] #{1 2}] ...)
22:03bbloomi find it annoying when i get that nth not supported error
22:03hyPiRiongfredericks: It makes perfect sense though
22:03gfredericksbbloom: arguably if you're destructuring something not nthable it's a mistake
22:03hyPiRionwhat is the first and second element in a set?
22:03gfrederickshyPiRion: I know, but it woulda been useful to me
22:03gfredericksI shoulda made a macro
22:03bbloomgfredericks: except apparently seqs are coerced into maps, so that mistake is forgiven :-P
22:04gfredericks,(let [{foo :foo} [[:foo 12]]] foo)
22:04clojurebotnil
22:04bbloom,(let [[a b] (seq #{1 2}] a)
22:04clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>
22:04bbloom,(let [[a b] (seq #{1 2}] a))
22:04clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>
22:04bbloom,(let [[a b] (seq #{1 2})] a)
22:04clojurebot1
22:04bbloombraces. i can't count.
22:05bbloomi find it *extremely annoying* when destructuring from arguments throws, since you can't print anything before that. you need to insert a let form
22:06gfredericksdo preconditions run first?
22:06ToxicFrog,(defmacro foo [body] `(fn [line] (str body line))) (macroexpand '(foo ""))
22:06gfredericks,(macroexpand-1 '(fn [[a]] {:pre [(+ 1 2)]} a)
22:06clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
22:06clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
22:06ToxicFrog,(macroexpand '(foo ""))
22:06clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
22:06gfredericks,(macroexpand-1 '(fn [[a]] {:pre [(+ 1 2)]} a))
22:06clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
22:07gfredericks&(macroexpand-1 '(fn [[a]] {:pre [(+ 1 2)]} a))
22:07lazybot⇒ (fn* ([p__13848] (clojure.core/let [[a] p__13848] (clojure.core/assert (+ 1 2)) a)))
22:07gfredericksnope
22:07ToxicFrog&(defmacro foo [body] `(fn [line] (str body line))) (macroexpand '(foo ""))
22:07lazybotjava.lang.SecurityException: You tripped the alarm! def is bad!
22:07ToxicFrogDammit
22:07yedidoes anyone know what the aws channel is
22:07hyPiRion&(let [{foo :bar} :baz] foo)
22:07lazybot⇒ nil
22:07ToxicFrogAnyways, when testing locally this expands to (fn* ([user/line] (clojure.core/str user/body user/line)))
22:07bbloomgfredericks: they can't b/c the preconds can refer to the destructured arg names
22:07hyPiRionoh, right.
22:07ToxicFrogAt which point everything goes horribly wrong because it's [user/line] rather than just [line]
22:07gfredericksbbloom: ah right
22:07ToxicFrogHow do I fix this?
22:08hyPiRionToxicFrog: instead of line, do ~'line
22:08hyPiRionOr even better, do line#
22:08ToxicFrogline# everywhere or #line just in the argument?
22:09ToxicFrogEr, line#
22:09hyPiRioneverywhere you're referring to line#. line will always expand to namespace/line.
22:09gfrederickshow are the syntax colors in clojure-mode determined?
22:09gfredericksare they configurable?
22:11hyPiRionToxicFrog: If you've not read up on gensyms, you should do so before wandering into macros
22:11hyPiRionit'll save you some time debugging later on.
22:15ToxicFroghyPiRion: where do I read up on them? /macros doesn't mention them, /reader mentions them only in passing
22:15ToxicFrogI really wish /macros were more comprehensive rather than most of the macro-writing stuff being documented in /reader.
22:17ToxicFrogAnd now I'm deeply confused: Exception in thread "main" java.lang.ClassCastException: ifirc.core$fn__35 cannot be cast to java.lang.CharSequence, compiling:(core.clj:23)
22:18ToxicFrogOh wait
22:19ToxicFrog'() and () are totally not the same thing!
22:19bbloomToxicFrog: eh, actually...
22:19bbloom,(= '() ())
22:19bbloom&(= '() ())
22:19lazybot⇒ true
22:19bbloom&(= ''''''''''() ())
22:19lazybot⇒ false
22:19clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
22:19bbloom&(= ''() ())
22:19lazybot⇒ false
22:19bbloom() is weird....
22:20amalloyToxicFrog: they evaluate to identical values, but they are not identical forms
22:20ToxicFrogYeah, what was happening was that my macro was evaluating to (def name (...)) rather than (def name '(...))
22:20ToxicFrogWith tragic consequences
22:21bbloomRE: destructuring again, nth isn't the only case it can throw, there is also nthnext, which is basically the same class of problem
22:21amalloyie, there's no function f that could tell the difference between (f ()) and (f '()), but a macro could
22:22ToxicFrogSorry, I should have been more clear, I wasn't referring to literally () and '(), there's stuff in the parens. And '(1 2 3) is not at all identical to (1 2 3).
22:22ToxicFrogAmong other things, the latter is a runtime error~)
22:22bbloom,```````()
22:22clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
22:22bbloom&```````()
22:22bbloompoor little bot
22:22bbloomexponential macro explosion
22:23bbloom&"you alive?"
22:23lazybot⇒ "you alive?"
22:23bbloom&```````()
22:24bbloom&```()
22:24lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/list))))
22:24bbloom&````()
22:24lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core... https://www.refheap.com/paste/12616
22:24bbloom&`````()
22:24lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core... https://www.refheap.com/paste/12617
22:24bbloom&``````()
22:24lazybot⇒ (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core... https://www.refheap.com/paste/12618
22:24bbloom&```````()
22:24bbloomkaboooom
22:24bbloomlocally i get:
22:24bbloomCompilerException java.lang.ClassFormatError: Invalid method Code length 212580 in class file user$eval366, compiling:(NO_SOURCE_PATH:0)
22:27bbloomGoogle Code likes to 500
23:32ToxicFrogGoddamnit, re-matches
23:57yediexcuse my newbness but where does System.getproperty() get the property from...
23:57yedi?
23:57yediare they just environment variables
23:57yedion the machine?
23:58jeremyheileryedi: System.getenv() is for environment variables.
23:58jeremyheilerSystem.getProperty has many sources.
23:58yedihm
23:58jeremyheilerFor one, the -D command line options.
23:59jeremyheilerlike java -Dmy.property=cool Main
23:59yedithis guide (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Java.rds.html) tells me that I should use system.getproperty to get out what RDS's db info