#clojure logs

2013-08-30

00:03gdevyou put the util back in futile
00:03futilegdev: I'll take that as a complement.
00:04futilepun intended
00:23futileGeneral question: What's a good way to save any kind of request (even POST requests), such that after you login, you can replay it exactly?
01:15murtaza52hi, I have two pred fns - fn1 and fn2, I want to create a fn which returns true if any of these pred is true
01:15murtaza52is there an idiomatic way to combine them
01:16callen(some? (map ...)) ?
01:20murtaza52callen: how will some work, it takes only one pred
01:29`cbpmurtaza52: maybe
01:29`cbpum
01:30jkkramermurtaza52: some-fn
01:32`cbpoh i didnt know about some-fn i was gonna suggest (map (comp (partial some true?) (juxt fn1 fn2))) :-)
01:33`cbpwithout the map i guess
01:35murtaza52jkkramer: thanks
01:41murtaza52needed hep regarding lighttable
01:41murtaza52how do I see the doc of a fn in lightatble
01:42murtaza52in repl I can do (doc some), however this doesnt work in lighttab;e
02:55supersymmurtaza52: you first need to require clojure.repl namespace
02:59murtaza52supersym: Yup this that. That displays it in the console, however is there an inbuilt way.
03:03rurumateOk, I have a cloujurescript repl in emacs' inferior-lisp buffer connected to "lein trampoline cljsbuild repl-listen". How to get autocomplete working? Thanks!
03:04murtaza52(take 3 (iterate + 1)) -> (1 1 1)
03:04murtaza52shouldnt the output be (2 3 4)
03:05murtaza52The doc for iterate says (f (f x))
03:05metellus,(+ (+ 1))
03:05clojurebot1
03:05rurumatemurtaza52: what is (+ (+ 1))
03:06rurumatemurtaza52: you mean (iterate inc 1)
03:06murtaza52rurumate: thanks!
03:06murtaza52,(take 2 (iterate inc 1))
03:06clojurebot(1 2)
03:07ordnungswidrig,(take 3 #(partial (+ 1)))
03:07clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: sandbox$eval167$fn__168>
03:07ordnungswidrig,(take 3 (iterate #(partial (+ 1))))
03:07clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core$iterate>
03:08metellus,(take 3 (partial (+ 1)))
03:08clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
03:08ordnungswidrig,(take 3 (iterate #(partial (+ 1)) 0))
03:08clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval283$fn>
03:08ordnungswidrig,(take 3 (iterate #(partial (+ % 1)) 0))
03:08clojurebot(0 1 2)
03:10ordnungswidrig,(take 3 (iterate (partial (+ 1)) 0))
03:10clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
03:10rurumateIs there a good emacs mode for editing clojurescript?
03:10ordnungswidrigrurumate: why not clojure-mode?
03:11metellusordnungswidrig: &(take 3 (iterate (partial + 1) 0))
03:11rurumateordnungswidrig: autocomplete doesn't work, don't know why
03:11metellus,(take 3 (iterate (partial + 1) 0))
03:11clojurebot(0 1 2)
03:11ordnungswidrigmetellus: thanks. I'm confused, early in the morning
03:11ordnungswidrigrurumate: ah. I don't know, never did much clojure-script.
03:13TEttingerwhy (partial + 1) ? it's the same as inc
03:15SegFaultAXDid I miss something? ##(take 3 (range))
03:15lazybot⇒ (0 1 2)
03:15metellusI assumed that the first was a toy example to show that iterate didn't do what the person expected
03:16rurumateis it possible to build fibonacci using iterate?
03:17SegFaultAX,(take 10 (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1]))))
03:17clojurebot(0 1 1 2 3 ...)
03:18rurumateSegFaultAX: neat
03:19TEttinger##(nth 100 (map first (iterate (fn [[a b]] [b (+ a b)]) [0 1]))))
03:19lazybotjava.lang.ClassCastException: clojure.lang.LazySeq cannot be cast to java.lang.Number
03:21rurumatenth is the other way round
03:21TEttingeryeah, I was testing in privmsg. ##(nth (map first (iterate (fn [[a b]] [b (+ a b)]) [0N 1N])) 500) needs BigIntegers too
03:21lazybot⇒ 139423224561697880139724382870407283950070256587697307264108962948325571622863290691557658876222521294125N
03:21SegFaultAXTEttinger: Just use +'
03:21SegFaultAXIt will auto-promote
03:21TEttingerwhaaaat
03:22rurumateoops
03:22TEttingerwhen did it stop autopromoting?
03:22TEttingerwith normal ints I mean
03:23rurumateis this a performance thing?
03:23SegFaultAX1.3
03:23SegFaultAXI think
03:23rurumate+' is not on http://clojure.org/cheatsheet
03:23TEttingeryeah, http://clojuredocs.org/clojure_core/clojure.core/+' doesn't list it on 1.2 but yes on 1.3
03:23SegFaultAXrurumate: So?
03:24rurumateSegFaultAX: I'm a cheat sheet guy, so this affects me
03:24SegFaultAXrurumate: Usually you don't need auto-promoting... until you do.
03:24TEttingeronly if you need arbitrary precision
03:24SegFaultAXLike for cute one line demonstrations of fibonacci and factorial.
03:26TEttingerwhat's the typical way of demonstrating factorial? ##(reduce *' (range 1 100)) ?
03:26lazybot⇒ 933262154439441526816992388562667004907159682643816214685929638952175999932299156089414639761565182862536979208272237582511852109168640000000000000000000000N
03:26SegFaultAXTEttinger: Or apply *'
03:26rurumate+' is also not here: http://clojuredocs.org/quickref/Clojure%20Core
03:26rurumateis there any page that lists all core functions
03:27SegFaultAXrurumate: core.clj
03:27TEttingerrurumate, that is odd. people have been talking about fixing up clojuredocs, it's just not written in clojure
03:28TEttingerI think it's... django?
03:28SegFaultAXRails
03:28TEttingerouch
03:28rurumateat least there should be some document that's generated from core.clj somewhere
03:28SegFaultAXUgly rails at that.
03:28TEttingerrurumate, there is
03:29TEttingerhttp://clojure.github.io/clojure/clojure.core-api.html
03:29TEttingerhttp://clojure.github.io/clojure/clojure.core-api.html#clojure.core/+' since 1.0
03:29TEttingerwait that's not right
03:30TEttinger+ is claimed to be added in 1.2
03:30TEttingermust have switched it with +'
03:31SegFaultAXNo, that's right.
03:31SegFaultAX+ was renamed to +'
03:31TEttingeryeah, makes sense
03:31SegFaultAXBecause + isn't auto-promoting.
03:31TEttingerany more!
03:40djcoinSegFaultAX: Can't recall precisely the whole auto-promoting, it means converting an int to a double for example ? So with if you do (+ 1.0 3) you get an error ?
03:41SegFaultAXdjcoin: Not quite
03:41SegFaultAXIt means promoting integers to larger data types before overflow.
03:41djcoinAlright, thanks :) I had this in mind to
03:41SegFaultAXSo like int to big int.
03:41djcointoo*
04:24rhg135Can someone please explain the make-node argument to clojure.zip/zipper
04:24rhg135I don't understand what it should return
04:25SegFaultAXWhoa http://www.davidgcohen.com/2013/08/29/a-shocking-accelerator-story-that-youll-need-to-read-twice/
04:25SegFaultAXDon't stick your startup in crazy.
04:28ucbI'm in need of a lib to write a TCP/UDP server. I guess Aleph is the one to go for first. Are there any alternatives out there?
04:30clgvucb: do you really need the TCP/UDP level directly or do you just want to build a non http/rest protocol for your software?
04:30ucbclgv: latter :)
04:33clgvucb: oh right netty came to my mind - this is what aleph uses as well^^
04:34ucbclgv: I did think of netty, but I'd rather not deal with the low levels until I absolutely have to. That's why I thought of aleph. IIRC there's a clojure wrapper for netty as well, right?
04:34clgvucb: just to mention an unconvential idea. I built a message passing communication on top of RMI. after writing the RMI layer I didnt need to touch it at all but just exchange messages as clojure maps
04:34ucbthat is a great idea
04:35ucbunfortunately I have to interface with python
04:35clgvucb: oh right I didnt ask the platform question ;)
04:35ucbheh, no worries
04:35ucbI think I'll just go ahead and get started with aleph
04:36clgvusb: well I'd try aleph as high level library before testing a "pure" netty wrapper
04:36ucbthanks for the comments though
04:36ucbyeah
04:37clgvusb: another quick remark to the RMI idea. javas RMI also has options to expose a CORBA interface afaik, so that could be the cross-plattform option for that idea..
04:37clgvbut I dont know if anyone really wants to use corba these days ;)
04:38ucbheh
04:39SegFaultAXWhat are you building?
04:40ucbI'm writing a replacement for graphite's relays
04:41clgvucb: what is graphite?
04:41xsynhttp://www.huffingtonpost.com/2013/08/29/mindful-parenting-carla-naumburg_n_3825425.html
04:41SegFaultAXclgv: It's a stat collection service.
04:41SegFaultAXVery awesome.
04:41ucbclgv: http://graphite.wikidot.com/
04:41ucberk, probably not the most up to date, but you'll get the idea
04:41SegFaultAXrhg135: It creates new nodes from existing ones.
04:42ucbSegFaultAX: yeah. Thing is, the relays don't quite cope with our load unfortunately :(
04:42clgvusb: oh nice. just had a look at the screenshots of the web interface
04:42SegFaultAXucb: Is this more than a statsd-esque aggregator?
04:42SegFaultAXHow many measurements per second?
04:42ucbSegFaultAX: the relays?
04:43SegFaultAXh, relays.
04:43ucbIIRC we're doing a ~3K/s (can't remember from the top of my head)
04:43SegFaultAXOh*
04:43ucbyeah, we're not replacing graphite, just the relays
04:43SegFaultAXstatsd doesn't replace it, it's just a pre-aggregator.
04:43SegFaultAXIt buckets measurements into 10 second intervals.
04:44ucbyes, sure
04:44ucbI guess I misinterpreted your question :)
04:44rhg135I read that but is it OK to return just the sequence of children?
04:44ucbthe relays only do re-routing
04:44SegFaultAXrhg135: Depends on what you're zippering I guess.
04:44SegFaultAXrhg135: Look at how the other zippers are implemented.
04:45rhg135Where's some?
04:45SegFaultAXucb: Sure. Still, that's a pretty decent volume. :)
04:45SegFaultAXrhg135: Look at the sauce for clojure.zip
04:45rhg135K
04:46SegFaultAXucb: How many caches?
04:47SegFaultAXAnd are you using prefix shards or something more complicated?
04:47ucbprefixed shards and we have 8 caches IIRC
04:47ucbI haven't worked on this for months, so the details are hazy :/
04:48ucboh, one thing that was a big bin in performance was to stop sending plain text to the relays
04:48SegFaultAXHow granular are your retentions?
04:48ucband instead pickled batches
04:48SegFaultAXYea of course.
04:48SegFaultAXUDP all the things.
04:48ucbheh
04:48ucbwe're using TCP
04:48ucbperhaps we should move to UDP
04:48SegFaultAXOuch.
04:48SegFaultAXThat doesn't help.
04:49ucbwe're dropping data anyway :/
04:49SegFaultAXI've often wondered if it would be viable to re-write carbon in whisper.
04:49ucbwe're currently dropping (because the relays aren't coping) ~100/s
04:49SegFaultAXIn clojure
04:49ucbit should be in principle
04:50ucbthing is, you might as well write it without preserving compatibility
04:50SegFaultAXI meant to say "write it in clojure and abandon whisper"
04:50ucbyeah
04:50SegFaultAXHonestly, this is basically riemann with history.
04:50SegFaultAX(Something I've been waiting for for a very long time)
04:51SegFaultAXaphyr y u no make riemann durable!
04:51ucbheh, we're fwding from riemann to graphite
04:51ucbalso, crazy startup story that one
04:51SegFaultAXHmm?
04:52SegFaultAXIsn't he at Factual?
04:52SegFaultAXAlso, you're using Riemann is a frontend? I'm jelly, can I see your panel?!?!?!
04:52ucbFactual? what?
04:52rhg135Ah now I get it.
04:52SegFaultAXI thought aphyr was working at Factual.
04:52ucbwe don't have a dash in front of riemann, we're using it just for metrics and alerts for now
04:52ucbright, no idea
04:53SegFaultAX01:28 < ucb> also, crazy startup story that one
04:53SegFaultAXThought that was about aphyr
04:53ucboh, right, no. It was about that blog you linked.
04:53SegFaultAXOh dude, I know. Wtf.
04:54SegFaultAXI was in the founders den a few years back
04:54SegFaultAXThat was pretty fun.
04:54ucbnice
04:54SegFaultAXYou work in SF?
04:54ucbnope, I'm in the far north of UK
04:54ucbthink North. North of that.
04:54SegFaultAXFar norf. FTFY
04:55ucbbloody esta
04:56freiksenetsome clojure 'type inference' fun: http://techblog.zenrobotics.com/2013/08/clojure-puzzler-2.html#comment-form
04:56SegFaultAXAlright, off to bed.
04:56SegFaultAXNight!
04:56ucbnight!
04:57SegFaultAXucb: You should get approval (if you need it) to open source your graphite relay replacement.
04:57SegFaultAXThat could be really really useful.
04:57ucbSegFaultAX: that's the plan
04:58ucbSegFaultAX: some bits of it are already open, like the pickler and the consistent hashing
04:58SegFaultAXWell that's built in.
04:58ucbI'm just putting things now into a /coherent/ application
04:58SegFaultAXSweet.
04:58ucb(or at least trying to)
05:17ucbany suggestions?
05:43lotiafreiksenet: Would love to get an explanation on why
05:43lotiafreiksenet: regarding the puzzler to which you posted a link
05:45vxnI second that. The result is quite surprising.
05:46Anderkent]awayit's because the compiler doesn't infer a common interface for :x and (fn [] ...)
05:46Anderkent]awayin the return of if statement
05:46Anderkentthus it doesn't know what the interface of (if true :x (fn ...)) is, thus it cannot use it to locate the right Thread consturctor on compile time
05:47clgvAnderkent: you'd have to patch it to find the maximum common interface/subclass if that is possible
05:48clgvAnderkent: if that's doable you should file a ticket on jira.
05:48Anderkentclgv: don't think it is
05:48Anderkentnot 'correctly'
05:48Anderkentor rather you'd need union types
05:48clgvAnderkent: but maybe worth a mailing list post
05:48Anderkentbecause say you have function(Runnable c) and function(IFn f) and function(Keyword k)
05:49Anderkentthe most specific overload wins
05:49clgvAnderkent: oh I did not mean that
05:49freiksenetlotia: if type inference only unifies the class name
05:49Anderkentbut you don't know which one the expression is
05:49Anderkentso you cannot decide which fn to use on compile time
05:49Anderkentyou have to use reflection
05:49clgvI meant the inference that both keyword and fn are IFn
05:49freiksenetyeah, but the class is AFunction and Keyword
05:50Anderkentclgv: yes, but you'd have to check that Thread. has an IFn type an no Keyword / AFunction types
05:50freiksenetvars are unified even in weirder name, try (if identity (fn [] 1)) that won't unify
05:50Anderkenti.e. you must verify that the resolution is the most specific overload for either branch
05:50freiksenetso basically if statement gets 'known' type when both branches has same cals
05:50freiksenetclass*
05:50clgvAnderkent: or does that inference work already and you only meant to show that it is not clear which thread constructor to resolve to?
05:51Anderkentno, it's clear which one it should resolve to in this case
05:51Anderkentbecause the only alternative to Runnable is ThreadGroup
05:51Anderkentbut it's hard to solve in the generic case
05:51freiksenetit is all about how if works, not about thread
05:51freiksenetor rather how clojure 'inference' works with it
05:52freiksenetarcatan here can be more comprehensive than I, I guess
05:52clgvfreiksenet: no. there is type inference for "if" in the case of primitives
05:52Anderkentyeah, and the type inference is local, i.e. you need to decide what type (if :x (fn ...)) is before you know you're putting it into Thread., I think
05:52freiksenetclgv: yes, I never denied that. but it works by comparing classes
05:52Anderkentthough you could try to infer it top down
05:53freiksenetand it gives 'type' to if only if they match
05:53clgvfreiksenet: ok^^ yeah the ancestors of the classes are not considered
05:53freiksenetit also works funky with vars
05:53Anderkentfreiksenet: well that's because you can't know the type of the var
05:53Anderkentyuo don't know someone didnt just alter-var-root it
05:54freiksenetyeah, sure.
05:54freiksenetwe'll have a bigger blog post on that subject on monday I think
05:54arcatanif someone writes it :P
05:54arcatani guess i should
05:55Anderkenthuh, keywords can't have metadata?
06:13rurumateHow to resolve a function by string (java reflection style)? Say, I have this string "my.ns/foo" and there is a function foo in namespace my.ns, how to invoke foo?
06:14Anderkentrurumate: (resolve (symbol "clojure.core/+"))
06:15Anderkentthat gives you the function, call it with another paren wrap
06:16rhg135Why the symbol call?
06:16Anderkentresolve takes a symbol
06:17rhg135I mean why use 2 args
06:17rhg135O nvm
06:17rhg135Derp lol
06:17rurumateAnderkent: it works with core namespaces, but not with a namespace I required
06:18rcghttp://clojuredocs.org/clojure_core/1.2.0/clojure.core/read-string
06:18rurumatethe require works, but the resolve returns nil..
06:18Anderkentrurumate: can you post the exact steps you took to refheap?
06:19rurumateAnderkent: oops my bad, the function didn't exist (typo)
06:19Anderkenthah :P
06:20rhg135They keep it interesting ;)
06:20Anderkentrcg: read-string is eval/evil, so don't.
06:21rhg135Yup
06:22rhg135It can eval code
06:25clgvAnderkent: it works with ^:const metadata on vars
06:33Anderkentclgv: right, because :const tells the compiler to substitute the value for any var references
06:33clj_newb_2345where in the world can I find a quality tutorial on datalog? the theory and semantics
06:37fredyrclj_newb_2345: if you find one, let me know
06:37fredyri've been looking as well
06:38clj_newb_2345http://code.google.com/p/clojure-contrib/wiki/DatalogOverview has a borken link to "Functional Relational Programming"
06:38clj_newb_2345let's dig up that paper
06:38fredyrhttp://www-users.cselabs.umn.edu/classes/Spring-2010/csci8211/Readings/datalog.pdf
06:38fredyrthis one is the best i've found previously
06:41clj_newb_2345https://github.com/richhickey/clojure-contrib/tree/2ede388a9267d175bfaa7781ee9d57532eb4f20f/src/main/clojure/clojure/contrib/datalog is really short
06:41clj_newb_2345I'm just going ot read the src instead :-)
06:41fredyr:)
06:43clgvclj_newb_2345: this is new http://www.learndatalogtoday.org/
06:43clgvclj_newb_2345: do yourself a favor and ignore the old clojure.contrib completely
06:44clj_newb_2345clgv: datalog + datomic, nice!
06:49clgvclj_newb_2345: I am starting to use it myself since yesterday ;)
06:52noncomcan i define another macro, instead of (ns) to create namespaces and use it instead of (ns) ?
06:56clgvnoncom: not literally. but you can use data_readers.clj and tagged literals to approximate that
06:58noncomclgv: but i have looked into the source of (ns) - it is simply a macro, there is nothing that i couldn't write.. or not? at the end it refers to RT.load which does all the actual work anyway...
06:59noncomor you mean that a file won't be recognized as a namespace if there is no (ns) ?
06:59clgvnoncom: the reason you can not write your own `ns` is a bootstrap problem
06:59noncomwhat do you mean?
07:00clgvyou need to require the new namespace macro before using it
07:01clgve.g. (require '[my.awesome.namespace :as m]) (m/my-ns ....)
07:02AnderkentHm. What makes ns available before clojure is referred?
07:02clgvAnderkent: the compiler
07:03noncomalright, what if i have several namespaces defined with (ns) where i have (my-ns) and all the other namespaces defined with (my-ns)?
07:03noncomcan't i make (my-ns) as available, as (ns) is?
07:03clgvnoncom: ParsingException: WHAT?
07:03Anderkentif you can ensure the namespace that declares my-ns is loaded, you can do (full.namespace/my-ns ...) without requiring
07:03Anderkentbut that's ... messy
07:04clgvyeah that works^^
07:04hyPiRionYou can probably dump it into clojure.core too, but that's even messier.
07:04Anderkentright
07:04clgvbut then you could just use data literals with the normal ns and make sure the data_literal function is required
07:04noncomso i could make an invasive surgery and register it within 'clojure.core' ?
07:04hyPiRionI'd just... use ns
07:05clgvnoncom: why do you want to do that anyway? (not that I havent been there already ;) )
07:05hyPiRionnoncom: well, yes. You can register it in clojure.core if you really want to
07:06Anderkentyou can even (alter-var-root #'ns) if you *really* want to
07:06clgvAnderkent: btter use some hooking library to easily revert the hook ;)
07:06noncomheheh :) it turns out that i do not need an (ns) macro in the system. i do my own namespaces management and the (ns) macro is only used to require the custom ns-management system which then does all the work. hence, there is always the same (ns) macro call in each ns and it is simply useless to do it that way
07:07Anderkentthat sounds like a bad idea
07:07noncomoh very cool, you suggest some really cool ways
07:07Anderkentnoncom: we're in the daily wtf mode now
07:08clgvnoncom: "your own namespace management" that sounds like duplicating efforts. I have been there for some configuration file format and realized alter that I am better of using regular clojure namespaces...
07:08hyPiRionAnderkent: alter-var-rooting ns would be suicide. Suddenly you require a namespace from a lib and the world blows up.
07:08noncomAnderkent: I understand what you mean, but for the purpose of the current task, I believe this is very good solution. I will use the "custom ns-management system" only in a limited area inside the program.
07:09llasramnoncom: Hmmm. You could write a lein plugin which loads your alternate-ns form before loading any code. For applications, you could add a runtime loader stub like lein-otf's, but for first loading your alternate ns form
07:09noncomwow, one more way!
07:10AnderkenthyPiRion: I know, I was kidding. Really.
07:10noncomi understand why you people are sad about this, but i believe it is really worth in my case. and it will be an isolated case
07:10hyPiRionAnderkent: hah, good.
07:10Anderkentalso, alter-var-rooting a macro in general doesnt seem like a good idea :P
07:11hyPiRionalter-var-rooting in general is dangerous
07:11hyPiRionOnly exception is for memoizing
07:12hyPiRionWell, that's my take on it. You have to know what you're doing at least
07:13Anderkenteh, it has its uses. But mostly in 'this is a messy shortcut so that developers can have it a bit easier' kind of way
07:13Anderkentlike a wipe state button :P
07:13Anderkentbut i was going more towards the need to handle special macro args etc. yourself
07:13clgvnoncom: no one is sad about the idea - just warning you for your own sake ;)
07:14noncomhehe :D... well.. after some time we shall see if it all was worth it :)
07:17clgvserious doubts over here ;)
07:19noncomclgv: could you tell me, how it turned out in your case? waht did you realize after you tried that?
07:20rurumateCan anyone help me with a macro? I'm trying to use another macro inside it, and the compiler doesn't like it.. https://www.refheap.com/18171
07:21clgvnoncom: I tried an own management for config namespaces since I splitted them into several files for reuse. ultimately I noticed that I needed more features which I simply get by using `def` and standard clojure namespaces...
07:22rurumaterun-in-parallel should wrap each form in (future (form)), then call (dorun (map deref) forms) on the resulting list "forms"
07:23hyPiRionrurumate: macros aren't first class functions
07:23hyPiRionfirst class, rather
07:23hyPiRionSo you cannot do (map first-class ...), you'd have to do (map #(first-class %) ...)
07:24clgvrurumate: just use (defmacro run-in-parallel [& forms] `(map deref ~(mapv (fn [x] `(future ~x)) forms)))
07:24hyPiRion(Either way, I don't see why you have a to-future macro, you could use future straight away)
07:24rurumatehmm
07:25clgvrurumate: the keypart is that `mapv` is run at macroexpansion time in this macro and builds the code snippets that wrap the forms into futures
07:25rurumateclgv: that works, nice
07:25clgvrurumate: I used `mapv` to get a vector as result so that clojure does not try to execute the first element as function
07:26clgvrurumate: writing macros bottom-up with macroexpand-1 usage at every step helps to get it right in a short time
07:26rurumateclgv: amazing, you're nesting the `s and ~s
07:27rurumateclgv: but shouldn't x# be used instead of x?
07:27hyPiRionYou'll see it often when you're modifying the forms and reproduce them
07:28clgvrurumate: yeah that could be done in a function as well, e.g. (defn wrap-futures [forms] (mapv (fn [x] `(future ~x)) forms)) (defmacro run-in-parallel [& forms] `(map deref ~(wrap-futures forms))
07:28clgv+)
07:29hyPiRionrurumate: ##(mapv (fn [x] `(future ~x)) '(this (should be) okay, you 'know))
07:29lazybot⇒ [(clojure.core/future this) (clojure.core/future (should be)) (clojure.core/future okay) (clojure.core/future you) (clojure.core/future (quote know))]
07:29clgvrurumate: no it should not be x#, since it is a parameter of the function used in mapv and not some gensym
07:36poutsihey guys, just noticed what I think is a bug in how 1.5.1's REPL handles the timezone of a java.util.Calendar instance
07:36poutsiwhen evaluated it prints it out with the normal timezone offset instead of the DST one even though it's DST now
07:36poutsiso, bugs reports go where? the dev google group?
07:38poutsijust tried the same in the latest 1.6.0 snapshot and it's wrong there too
07:39Anderkentpoutsi: which repl is that? clojure.main? lein repl?
07:41poutsihoom, I'm still mostly at the point where lein is magic. But, I tried 1.5.1 with a lein repl and the snapshot jar I just fed to java -jar
07:43llasrampoutsi: I'd be pretty flabbergasted if Clojure, lein, or any REPL layer was causing that
07:43llasrampoutsi: gist?
07:43poutsisec
07:44poutsiyup, the expected outcome is definitely me having a red face but let's see
07:44Anderkentwell, I wouldn't be surprised if something adds a `print-method` for Calendar objects
07:44Anderkentthey string pretty ugly
07:45Anderkent,(str (java.util.Calendar/getInstance))
07:45clojurebot"java.util.GregorianCalendar[time=1377861700537,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id=\"Etc/UTC\",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2013,MONTH=7,WEEK_OF_YEAR=35,WEEK_OF_MONTH=5,DAY_OF_MONTH=30,DAY_OF_YEAR=242,DAY_OF_WEEK=6,DAY_OF_WEEK_IN_MONTH=5,AM_PM=0,HOUR=11,H...
07:45Anderkent,(pr (java.util.Calendar/getInstance))
07:45clojurebot#inst "2013-08-30T11:21:45.623+00:00"
07:46llasramOh, that makes sense. I skipped learning the Java stdlib date-time stuff, and had forgotten a "Calendar" represents a date-time. You know, wth?
07:47Anderkenthttps://github.com/clojure/clojure/blob/clojure-1.5.1/src/clj/clojure/instant.clj#L169
07:47poutsihttps://gist.github.com/ilkka/6388908
07:47Ember-fortunately finally in java 8 there's going to be a reasonable date api
07:47AnderkentI really wouldn't have guessed to look at instant.clj
07:47Ember-but in the mean time, use joda-time
07:47Ember-and clj-time wrapped on top of joda-time
07:47Anderkentanyway, it just calls (.format utc-format date)
07:48poutsiEmber-: I know, I just hit upon this by accident because of legacy stuff having nothing to do with clojure
07:48Anderkentalso hahaha we too have a 'WTF SimpleDateFormat is NOT THREAD SAFE' comment somewhere in a couple of our projects
07:49Anderkentoh sorry it special cases Calendar
07:50repsacSo I have task that I would like to rate limit, is there any good way to do so?
07:50Anderkentbut still, it just asks String/format to pull out the timezone from Calendar... So if there's anything wrong with it it's javas fault
07:50repsaclike if I could specify a minimum interval between executions in a while loop
07:51Anderkentrepsac: core.async! :P
07:51repsacreally?
07:51repsacWell it's kinda still alpha though
07:51Anderkentwell, yes, it's easy with core.async, but there's simpler solutions too
07:51AnderkentThe most obvious one is to just call thread/sleep in the while loop
07:52clgvrepsac: you want something like a cron?
07:52repsacI guess, I was just thinking there would be some construct intended for this
07:53repsacclgv: well I have a task that I would like to not gets run more often than say once a minute
07:53Anderkenti.e. (while condition (let [start-time (time-millis-now) _ (do-work) end-time (time-millis-now)] (sleep (-> (+ start-time interval) (- end-time)))))
07:54repsacand I would also like to be able to interrupt the task
07:54llasramAnderkent, poutsi: ##(format "%1$tz" (java.util.Calendar/getInstance))
07:54lazybot⇒ "-0700"
07:54llasramWhat the heck is that doing?
07:55Anderkentpulling timezone out of the calendar, obviously!
07:55llasramhaha
07:55llasramthanks :-p
07:55repsacAnderkent: Yeah that's along the lines I was thinking too. I guess I would interrupt the thread to break it out of its sleep?
07:55Anderkentrepz - just set the condition to false
07:55Anderkentit will wake up on its own and exit when interval expires
07:56llasramwoooow -- http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#dt
07:56repsacyeah but I don't want it to wait for the sleep to expire :)
07:56poutsishit, timezones are complicated (news, right)
07:56Anderkentrepsac: eh. You could do that. But why bother?
07:56repsaci think (.interrupt thread) breaks it out though
07:56poutsiis "timezone" even the same as "current utc offset"?
07:57poutsiwhat I mean is, the format "%1$tz" bit pulls out +2 hours
07:57repsacwell if a thread is active but sleeping for like 5 minutes I would not be abl e to shut down the VM gracefully
07:57poutsibut the current correct offset is +3
07:57Anderkentpoutsi: maybe your locale is misconfigured? :P
07:57clgvrepsac: well you can make those threads backgroundthreads
07:58repsacmark it is a daemon? Or how do you make it background?
07:58poutsiAnderkent: possible, but I highly doubt it
07:58Anderkentrepsac: you could also use agents and (shutdown-agents-now) to kill it :P
07:59Anderkenthm actually that doesnt make it easier
07:59jkkramerrepsac: https://github.com/jkk/rate-gate
07:59Anderkentyou still need to block in some thread while waiting to enqueue new job
07:59llasramAnderkent, poutsi: I'm seeing the same behavior. The SimpleDateFormat `Z` format accounts for DST, but for some reason String/format `tz` doesn't
07:59jkkramerthere's a PR to use core.async i haven't merged yet
07:59llasramcrazy
08:00repsacjkkramer: ooh nice
08:00poutsillasram: let's just put it down to java datetime API madness and sweep it under the rug then :D
08:00repsaci'm guessing you wrote it?
08:00Anderkentllasram: poutsi: works for me: "2013-08-30T12:36:32.838BST" "2013-08-30T12:36:35.573+0100"
08:00AnderkentBST is in fact +1
08:00jkkramerrepsac: yes. no guarantees on its robustness or efficency :P
08:00poutsiAnderkent: do you observe DST?
08:01Anderkentpoutsi: BST is summer time, GMT otherwise
08:01llasramAnderkent: For me I get actually *incorrect* tagged literals back out. With the SimpleDateFormat, the correct: "2013-08-30T07:36:20.371-0400", but Clojure print-method: #inst "2013-08-30T07:36:35.122-05:00"
08:01poutsiokay
08:01repsacjkkramer: hehe you need to work on your salesmanship :P I'll have a look at it though :)
08:01llasramSo "same" time, but without the DST applied in print-method
08:02llasramAnd hence an hour off
08:02Anderkentwow that's weird
08:02Anderkentwhat about (format "%1$tFT%1$tT.%1$tL%1$tz" (Calendar/getInstance))
08:02Anderkentthat should be the same as print-method hopefully?
08:02Anderkent,(format "%1$tFT%1$tT.%1$tL%1$tz" (Calendar/getInstance))
08:02clojurebot#<CompilerException java.lang.RuntimeException: No such namespace: Calendar, compiling:(NO_SOURCE_PATH:0:0)>
08:02poutsiif I change that to %1$tZ I get the correct EEST :D
08:02Anderkent,(format "%1$tFT%1$tT.%1$tL%1$tz" (java.util.Calendar/getInstance))
08:02clojurebot"2013-08-30T11:39:21.334+0000"
08:02poutsibut with %1$tz it prints the incorrect +0200 offset
08:02Anderkentwell that's no fun
08:02llasramAnderkent: Exactly, and hence wrong :-)
08:02Anderkentit's on gmt
08:05jkkramerha: http://bugs.sun.com/view_bug.do?bug_id=6286592
08:05Anderkentllasram: poutsi: how about ,(doseq [field [Calendar/ZONE_OFFSET Calendar/DST_OFFSET]] (.get (Calendar/getInstance) field)
08:05llasramjkkramer: Just found that too :-)
08:05Anderkenthrtabf
08:05Anderkentah
08:05Anderkentyou're on java 6?
08:06llasramYes, which is a supported Clojure platform :-p
08:06Anderkenthow silly!
08:06Anderkentreally? It's not even supported by oracle anymore, is it.
08:07poutsiAnderkent: nil
08:08Anderkentyes, that's where hrtabf was from. I forgot to print them :D
08:08Anderkentbut since you've found it already I figured you won't be running it
08:08llasramAnderkent: Yeah, yeah... Unfortunately my company is still on Debian squeeze for production, which doesn't have an openjdk 7 package. I need to get us to wheezy first
08:08poutsiah
08:09wazaaaaaaaسمَـَّوُوُحخ ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ
08:09Anderkentllasram: hm, you run raw debians rather than ubuntu lts?
08:10llasramAnderkent: I've thought about switching, but yah
08:11Anderkenthah, is that the turkish string that crashes osx apps?
08:11Anderkentyeah it is
08:11Anderkentnice.
08:23clgvllasram: manual openjdk instance is not that complicated...
08:23clgvs/instance/installation/
08:25llasramclgv: I looked at backporting the packages, but a lot of dependencies had changed. I'd like to update, but because I'll also need to e.g. make sure our Hadoop cluster is stable under 7 too, I'm not personally in a huge rush
08:25clgvllasram: ah ok
08:48hhenkelHi again, as I described yesterday I try to implement a producer/consumer application. My current plan is to have a config file (I found edn) where I describe the tasks that need to be executed. After reading the config file, I would like to create a Priority Queue which contains the tasks that need to be executed. A pool of threads should then take tasks of the queue and start them as soon as it is time to do so.
08:48hhenkelCurrently I'm failing on such a simple task like looping over my config: http://paste2.org/vxUzyXVp
08:49hhenkelAnyone around who can give me some hints if that would be the correct way to do things?
08:52Anderkenthhenkel: you seem to have double () around println val? Other than that (and using one-armed if instead of when), looks ok
08:52Anderkentwhat is going wrong?
08:54mdrogalisAnderkent: 'armed'. Haven't heard that word used like that before. Neat.
08:55yogthos(defn init-queue [config]
08:55yogthos (doseq [[k v] config]
08:55yogthos (println k v)
08:55yogthos (if (map? v)
08:55yogthos (init-queue v))))
08:55yogthos(init-queue config)
08:55yogthosis probably what you want?
08:56hhenkelAnderkent: I'm getting a null pointer on the second iteration.
08:57hhenkelIs edn and the way I use it a good idea or should I stick to properties?
08:57Anderkenthhenkel: did you fix the double paren? ((println :x)) will give you a null pointer
08:57Anderkentedn is fine for config
08:57hhenkelyogthos: I'll check that.
08:58yogthosit's not tail recursive, but presumably it shouldn't matter for config ;)
08:59Anderkentyogthos: clojure doesnt do tail recursion anyway
08:59Anderkentor rather, only explicit one (with recur)
08:59yogthosright and here you can't recur
08:59hhenkelAnderkent: You're right, the double brackets we're causing the issue. Could you explain why that resulted in a null pointer?
08:59Anderkenthhenkel: (println foo) returns nil. (nil) tries to call null as a function, which throws NPE
09:00hhenkelAnderkent: Ah, okay... ;)
09:02hhenkelOkay, yogthos stuff works fine so far. Now the question is how to add a new task to a queue? First I would have to create multiple tasks as a host could have multiple actions. In my past I used a object for that...how would I do it in clojure?
09:04yogthosit sounds like agents might be what you're looking for? http://clojure.org/agents
09:04Anderkenthhenkel: depends on what your queue is. If it's a ref, then you do (dosync (alter queue conj new-item))
09:04hhenkelIs it correct to have a function that gives me a "task" map and that is added to a sorted map where I'm sorting by the "time" tag (start time) ?
09:05clgvdo I have to tell datomic the type (entity) of a :db.type/ref attribute to be able to insert a complete data tree ?
09:05hhenkelyogthos: I asked for that yesterday and I was pointed to futures...but I realiesed I asked to early for that.
09:05Anderkenthhenkel: that soudns reasonable, but you probably want a sorted-set-by not sorted-map?
09:06hhenkelAnderkent: Yes, I meant that, sorry. That would would do the job as a "priority queue"?
09:07yogthosthere's a few options
09:08hhenkelWhat I currently not getting is, how to work with immutable stuff. I got a map and I want to add or remove something. Do I have to assign the result of the adding / removing function to the old name/ref?
09:08clgvis it possible in datomic to add a tree of entities?
09:09Anderkenthhenkel: you use `alter` in a (dosync) block to do that, when you have to - clojure.org/refs
09:09Anderkentthat will safely change the value in a ref, as long as the modifying function you give it has no side effects
09:09Anderkentusually a couple refs/atoms storing the state is all the mutability you will need
09:13clgvhhenkel: are you sure that you want to implement a priority queue based on clojure's primitive instead of using java.util.concurrent.PriorityQueue?
09:14Anderkentclgv: my impression was this is a toy project to familiarize oneself with clojure... In which case using j.u.c defeats the purpose :P
09:14Anderkentalso, I wish there was a wrapper for j.u.c with nicer api
09:15clgvAnderkent: in that case yes. but for getting the job done j.u.c.PQ schould be used...
09:15Anderkentpeople keep saying that, but it's *really rare* that you need just a queue. j.u.c. is nice in java wolrd because everything is already mutable, so you just put a mutable queue in your state object and everything's fine
09:16Anderkentbut if you want to use clojures primities anywhere, you can't put a mutable object in your state
09:16hhenkelAnderkent: Sorry for asking so basic stuff.... I do (def mymap {:text1 "123" :text2 "456"}), now I got mymap. mymap is a ref? How would I increment the values for example?
09:17Anderkenthhenkel: no, it's not a ref. It's a var. You create a ref with (def myref (ref {})). Then you can (dosync (alter my-ref into {:a 1})) to put stuff in, and @my-ref to get the 'current snapshot' out
09:17Anderkentall your modifications must happen in dosync blocks. Have you read www.clojure.org/refs ?
09:18Anderkentactually
09:18Anderkentstart with http://clojure.org/concurrent_programming
09:18Anderkentit's better as an overview
09:18`cbpmaybe you should get a book or tutorial first. Mutability and coordination are not things you just learn as you go :P. Clojure programming has a nice section on it
09:19hhenkelAnderkent: Yes I tried...but I find it quite confusing...so for sorting then I would also use the ref then?
09:20Anderkenthhenkel: no, you would put a sorted map into a ref
09:20Anderkentyou can put anyhting in a ref, it's just a 'box' that makes things mutable
09:20Anderkentwas the first or second link the confusing one?
09:21clgvhhenkel: condensed example ##(let [q (ref [])] (dotimes [i 10] (future (dosync (alter q conj i)))) @q)
09:21lazybotjava.lang.SecurityException: You tripped the alarm! future-call is bad!
09:21hhenkel`cbp: I got a book...programming clojure - second edition.
09:21Anderkentnyahaha.
09:21hhenkelAnderkent: the one with refs
09:21clgvno threads? :(
09:21Anderkenthhenkel: try the http://clojure.org/concurrent_programming
09:21Anderkentit's a higher level overview
09:22`cbphhenkel: that book has a section called State
09:22Anderkentclgv: also, your thing doesnt really demonstrate stuff, I'd expect q to be anyhwere between empty and all elems at @q
09:22`cbpprolly read that first, also notice it's the 5th section so you need a bit of background first :P
09:22AnderkentI found http://java.ociweb.com/mark/clojure/article.html useful when starting
09:23Anderkentbut I didn't really read any book fully, just started hacking
09:23Anderkentand reading through clojure code
09:23clgvAnderkent: it demonstrates functionality. didnt say that `q` has to be filled completely... ;)
09:23Anderkentbut I had a basic haskell background
09:23clgvit managed to get to 7 here ;)
09:23Anderkentclgv: not very useful when it prints []!
09:23Anderkent[1] for me :D
09:23`cbpbasic haskell -> phd level stuff
09:24Anderkenthaskell was the first real language I learned :P
09:24hhenkelAnderkent: I'll start more reading then... ;)
09:24`cbpI have no clue how people can read their own programs after writing them in haskell =P
09:24hhenkelThanks all for the informations.
09:25Anderkenthhenkel: in general I'd avoid mutable state for the first couple days. You can probably write everything except the state manager in a style like this
09:25Anderkent(defn schedule-task [queue new-task] (...))
09:25clgvhhenkel: another reading hint http://clojure-doc.org/articles/language/concurrency_and_parallelism.html
09:25Anderkentbasically pass your state around and write the code that takes a state and returns a modified one
09:26Anderkentit gets a little tedious if your program grows, but for simple stuff it should be fine :P
09:26clgv`cbp: then consider the perl programs without strict mode ;)
09:26noncomhhenkel: first of all - why you want a ref? you simply want to mutate the map?
09:27Anderkent`cbp: it wasnt industrial haskell, it was simple haskell
09:27Anderkentno custom monads etc :P
09:27clgvnoncom: if he wants to build a queue with clojure data structure used by different threads he needs either an atom or a ref
09:27Anderkentref
09:27Anderkentatoms dont do it
09:27Anderkentwithout incredible ugliness :P
09:28clgvAnderkent: you meant my comment?
09:28Anderkentyes
09:28Anderkentyou'd need to wrap the queue with something that stores 'last popped element'
09:28noncomclgv: oh right
09:28clgvah right the retrieval of an element is not easy with atoms.
09:29clgvI mean combined modification and retrieval
09:29Anderkentor you'd need to do compare-and-set! manually in a loop
09:29Anderkentboth options are terrible
09:29clgvAnderkent: easier with thread-local bindings then ;)
09:29Anderkenthm? how so?
09:30Anderkenta (swap!) that side effect on a thread-local?
09:31Anderkent... that might work lol
09:31clgvyes it does. but that's not very idiomatic either
09:40stuartsierraTimMc: Getting back to DJSON-9 for a moment, I think I'm going to name the option :escape-js-separators
09:43stuartsierraThen I'll release a new version.
09:45TimMcstuartsierra: From :escape-separators?
09:45TimMcSounds good.
09:45stuartsierraTimMc: yes
09:45TimMc/shipit
09:47Anderkentooh
09:47Anderkentthe macroexpansion in core.async
09:47Anderkenti want that pulled out to a separate lib
09:49Anderkentalso, damn, that thing is hard to read
09:50clgvAnderkent: link?
09:50Anderkentwell, basically this bit: https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/impl/ioc_macros.clj#L573
09:51Anderkentexcept generalized so that you can intercept and stop expansion arbitrary forms
09:54clgvhehe
09:56stuartsierradata.json 0.2.3 is cooked
10:06hhenkelclgv: Thanks, I will look at that as well.
10:07hhenkelnoncom: It was recommended if I want to use a sorted-by-map from multiple threads.
10:11stuartsierraAlso closing DJSON-12 as either mistaken or unreproducible.
10:25riggersheesh
10:32shaunxcodehaha the swannodette gazette! I wish that were an actual printed periodical. I would totally pay for it.
10:50noncomhhenkel: yeah, sorry i overlooked that
11:15mdrogalisAnyone alive that's watched Design, Composition and Performance? I've a question.
11:16`cbp~anyone
11:16clojurebotanyone is anybody
11:16`cbp:/
11:16`cbpjust ask the question? :P
11:16hyPiRion~anyone
11:16clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
11:17`cbp=(
11:17Anderkent~everyone
11:17clojurebotGabh mo leithscéal?
11:17futilewat
11:17mdrogalis37:42 of that video. What on earth is he talking about?
11:19futilesimplicity is underappreciated
11:19futile(unrelated)
11:20hyPiRionclojurebot: forget anyone |is|<reply>anyone is anybody
11:20clojurebotI forgot that anyone is <reply>anyone is anybody
11:22ToxicFrogDesign/best practices question. I am writing a program that can read and write data to/from various formats/sources. So the user might invoke it with --to=edn or --from=steam or the like.
11:22futileclojurebot should be rewritten in Rust
11:23futileyou know, for concurrency
11:23hyPiRionfutile: no, it should be rewritten in Node.js because it's async
11:23futilehyPiRion: Rust is the successor to Node.js tho
11:23ToxicFrogIn lua, I'd just have, e.g., a data/ directory containing steam.lua, edn.lua, xml.lua, etc; when it sees --from or --to, it loads the file with the corresponding name. If it can't, it reports an error; if it can, the file returns a table of read/write functions.
11:24ToxicFrogIn clojure, am I right in thinking that this sort of load-by-name is considered unheamy?
11:24hyPiRionfutile: I am joking there. I'm writing a bot in Erlang, actually. I think it's a better fit for this sort of task.
11:24futileToxicFrog: you can still do that in a Clojure project
11:24edannenbehow do i iterate over large (20^75 entries) seq? nth seems to be out of the question
11:24futilehyPiRion: elixir?
11:24Anderkentbut you can just load all of them and dispatch to the right function based on the arg..
11:24ToxicFrogfutile: I know I can, I'm asking if that's considered a good way to do this
11:24futileToxicFrog: oh, sorry
11:24hyPiRionfutile: Erlang, I want to finally "get everything" it has.
11:24AnderkentI'd say don't unless you have a very good reason (for example they're very expensive to load or sth)
11:24ToxicFrogAs opposed to, e.g., :requiring all of them and then having a map { format name => RW functions }\
11:24futilehyPiRion: even the syntax!?
11:25ToxicFrogAnderkent: no, loading is expected to be quite cheap
11:25futileToxicFrog: oh yeah I would use an intermediate name->thing map
11:25`cbpedannenbe: what do you mean 20^75 are you iterating through every atom in space or something?
11:25coventryedannenbe: unless you can come up with a non-inductive definition of the seq elements (a function), random access to the elements of a seq that long seems physically impossible.
11:25ToxicFrogSo the only reason to avoid doing so is to avoid having to manually write out the whole map and the lengthy list of :requires
11:25ToxicFrogUnless clj has some way to say "load everything in this dir"
11:26futileToxicFrog: it sounds like this is a question of whether convention-over-configuration is idiomatic in Clojure, and I would definitely say no
11:26ToxicFrogconvention-over-configuration?
11:26futileToxicFrog: oh boy
11:26futileToxicFrog: ever used Rails?
11:26ToxicFrogBut yes, this is mostly a conventions/best practices/idioms question. I know a bunch of ways to write this, but I want the code to be good, not just functional.
11:26Anderkentfutile: the question is more like 'how is that relevant to what we're talking about'
11:26ToxicFrogI have not.
11:27futileAnderkent: whaa?
11:27ToxicFrogAnderkent: no, I genuinely have no idea what he means by that. I may know the concept under another name but I've never heard that phrase.
11:27AnderkentI don't see how 'convention over configuration' applies at all to the question of whether to dynamically load namespaces
11:27hyPiRionfutile: The syntax is not that bad, imo. But I'm the guy who studies "Unconventional Machines: Design and Architecture", so I may not be the best to ask about syntax
11:27`cbpmdrogalis: I think he's referring to the new tendency of trying to make software development as easy and fast as possible.
11:27AnderkentToxicFrog: it's just the approach of not letting people configure stuff, instead enforcing conventional locations for files etc.
11:28TimMcE.g. Maven.
11:28Anderkentyouwahtnow
11:28futileAnderkent: I might have misunderstood. I thought his question was if it's bad practice to load up a file based on a string given from the cmdline.
11:28TimMcI guess Maven does allow that, but you really need to shovel on the XML.
11:28Anderkentbut everyone loves xml
11:28`cbp~guards
11:28clojurebotSEIZE HIM!
11:28ToxicFrogfutile: that is basically what I was asking, yes.
11:29Anderkentit's like lisp! Except instead of parens you have <configuration><property name="foo!"> ...
11:29futileToxicFrog: I've always found it much harder to work with code that does that kind of thing.
11:29AnderkentD:
11:29futileToxicFrog: In 99.99% of cases like this, I always end up creating some kind of intermediary mapping.
11:30ToxicFrogAnd I'm mostly coming from Lua, where this is a common idiom (and makes it very easy to extend later - just create the file or, at runtime, add another entry to the module preload table)
11:30edannenbecoventry, it's a lazy seq generated by clojure.math.combinatorics , i would only need sequential access tho (ie from start to finish once)
11:30futileToxicFrog: A colleague did something similar, passing data from ClojureScript to Clojure and letting the coincidence of similar data names be the thing that ties it in to actual code, and said it was 'elegant', and I couldn't disagree more.
11:31futileToxicFrog: yeah "easy to work with" is the commonly cited benefit, but in practice I've found it actually makes it more inflexible to change and more likely to introduce subtle hard-to-track-down bugs
11:32ToxicFrogfutile: OTOH, I find it extremely inelegant to have a big map of { "foo" data.foo/io "bar" data.bar/io } that you need to update every time you want to add support for a new data source.
11:33futileToxicFrog: That's the solution I went with in my window manager. Before this decoupling it was extremely hard to change anything about the names or implementation, without breaking backwards compatibility for users. Afterwards, I'm now free to refactor the internals however I want. I think that's always the case no matter how big the map is.
11:33AnderkentToxicFrog: use a multimethod to get an object fullfilling a protocol
11:33futileToxicFrog: In other words, I agree that it seems a bit cumbersome up front, but the decoupling it gives you will save you tons of headache in the future.
11:34ToxicFrogHow was it a backwards compatibility issue?
11:34Anderkentthen you can add methods to the multimethod in the namespace that declares the stream
11:34ToxicFrogAnderkent: I haven't done anything with multimethods or protocols
11:34ToxicFrogGot docs?
11:34Anderkenthttp://clojure.org/multimethods http://clojure.org/protocols
11:35Anderkentyou might not need the protocols if your interface is simple
11:36Anderkentthen the only messy bit is ensuring that the namespaces are loaded
11:37futileToxicFrog: To use your example, if you want to rename those files, your users now have to type something else.
11:37futileToxicFrog: Imagine if you renamed one of the files and several users already had some scripts written that call this thing with certain arguments. They all have to go in and change all the scripts to use the new arguments.
11:37ToxicFrogAnderkent: interface is extremely simple, two functions per data format, take/return a list of maps.
11:38futileToxicFrog: In my example, they started out calling the things SDWindowProxy and later when I decoupled the interface from the implementation they had to rename it to Window (much better name).
11:39ToxicFrogAah.
11:39coventryedannenbe: Have you considered using first and rest?
11:39coventry,(let [s (range)] (loop [i 10 s s rv []] (if (> i 0) (recur (dec i) (rest s) (conj rv (first s))) rv)))
11:39clojurebot[0 1 2 3 4 ...]
11:40futileSometimes I feel like the only one in this channel that doesn't use clojure.math and clojure.logic
11:40`cbpIve never used core.logic either
11:41hyPiRionfutile: you forgot typed clojure
11:41coventrymdrogalis: It sounds like he's saying "Wire shit together with a thought for the people who'll use it," which sounds pretty reasonable.
11:41futileand clojure.async
11:42futileyou can't spell "clojure" without #{\c \o \r \e}
11:42Anderkentclearly we need a project that puts logic, typed and async together
11:42ToxicFrogAnderkent: can I put (defmethods) for the same multimethod in different files?
11:42futileToxicFrog: yes
11:42AnderkentToxicFrog: yes
11:42futileToxicFrog: that's a major benefit of them
11:42clgvToxicFrog: yes, but you need to load those namespaces ^^
11:42futileToxicFrog: implementations can be completely hidden from the user if need be
11:42Anderkentbut watch out for cyclic dependencies
11:43futileclgv: that bit is several times already.
11:43futile*us
11:44clgvfutile: couldnt you use the default implemention to throw or log an error so that you notice you forgot to load some implementation?
11:44ToxicFrogAwesome.
11:44futileclgv: the trick I was told about for working around that is to make sure that any function which can produce multi-method-capable data comes from the same function which requires it
11:44futile*the same file
11:44clgvthat's a good rule ^^
11:45futileI haven't had a chance to put it into practice yet.
11:45futileBut I like the idea.
11:46edannenbecoventry, still very green with clojure so no, gonna give it a try. thanks
11:46AnderkentToxicFrog: https://www.refheap.com/18173 is a structure that works for me
11:47coventryNo worries. Still green myself. There is probably a niftier way.
11:49futileIf I'm ever on a team one day, I think a good idea would be to have the first line of a git commit msg be what it is, and the rest of the lines explain why.
11:49ToxicFrogAnderkent: excellent. Thanks.
11:49futileThat would probably help for searching repos for specific changes, as well as understanding the rationale behind new/very-old ones.
11:50Anderkentfutile: nah, best commits are the ones that go 'WIP' or 'almost done' or 'fuck.'
11:50coventry"Wrote a little code."
11:50Anderkent:D
11:51Anderkent'maybe now?;
11:51hyPiRionOh, I got a good commit from lein I think, let me hit it up
11:51edannenbehttp://whatthecommit.com/
11:52hyPiRionhttps://github.com/technomancy/leiningen/commit/ab080ec
11:52llasramhyPiRion: That is a pretty awesome commit
11:53clgvhyPiRion: harr!
11:53futileAnderkent: hey you've been reading my commits haven't you? https://github.com/sdegutis/zephyros/commits/master?page=11
11:53Anderkentwoo
11:53Anderkenti like
11:53astevejava.lang.NoSuchMethodError: clojure.lang.RT.mapUniqueKeys([Ljava/lang/Object;)Lclojure/lang/IPersistentMap;
11:53AnderkentMy favourite one from the project I worked on
11:53Anderkenthm let me pull it up
11:54llasramfutile: Remind me never to work with you professionally :-)
11:54AnderkentAnd where format-clojure went, rest vanished,for the small hours were rent with the screams of nightmare.
11:54futilellasram: to be fair, it looks more like this now: https://github.com/sdegutis/zephyros/commits/master?page=2
11:54astevehttps://groups.google.com/forum/#!msg/clojure-mongodb/1llpYuBgVA4/zbsI5xQiMnUJ says that my error is caused by trying to run code compiled on 1.4 or higher while running 1.3
11:54futile:D
11:54Anderkentand the other: I am the emacs your whitespace god. You shall have no other formatters before me.
11:54astevelein repl verifies that I'm running under 1.5.1: Clojure 1.5.1
11:55futileAnderkent: ha!
11:55asteveI ran a lein clean and then lein compile; then the lein uberjar
11:55astevehow is it possible that I'm running 1.3?
11:55Anderkentasteve: do `lein deps :tree`
11:55clgvasteve: did you upgrade? do `lein clean`
11:56asteveclgv: I am in the midst of upgrading and I have run lein clean a few times
11:56Anderkentif you're pulling in an evil dependency it might be overriding the clojure version
11:56asteveAnderkent: so I should look for clojure in the tree?
11:56clgvasteve: maybe you have an aot compiled dependency
11:56asteveif I see 1.5.1 I'm safe?
11:56clgvfor that project yes
11:56AnderkentI'm not sure how it marks up stuff being overriden
11:56Anderkentyou can do
11:56lnostdal137.35
11:57Anderkentlein pom; mvn dependency:tree
11:57hyPiRionasteve: Lein should usually take the one you pick, if not you're working with a bad lib
11:57Anderkentto see which ones take precendence
11:57astevehttps://gist.github.com/sannessa/375dc42f566cb2c81417
11:57Anderkenthm, that should always give you 1.5.1
11:58Anderkenthow do you run your jar?
11:58asteveso, I'm attempting to upload the jar to a storm cluster
11:58Anderkentis it possible theres another clojure.jar on the classpath?
11:58astevehmm
11:59coventryMaybe "DEBUG=true lein <args>", and look for an earlier clojure in the output? Lots of spew from that command, though.
12:00Anderkentasteve: I take it it only happens on the cluster and not locally
12:00asteveAnderkent: yes, I'm realizing that I may need to make changes to the cluster
12:00Anderkentif so I'd check stuff like CLASSPATH= or the -cp arg
12:01Anderkentyou shouldnt have to. If it just runs java -jar your.uber.jar then you shuold be totally fine with something else using a different clojure
12:01Anderkentah wait, it's not a remote machine, its like hadoop job processor
12:01hyPiRionasteve: interesting. Could you do [org.clojure/clojure "[1.5.1]"] and check if it changes anything? I would NOT recommend keeping it, just check what it does
12:01AnderkentI'd say just stop compiling your stuff :D
12:02hyPiRionalso, add in `:pedantic? :abort` if you want to ensure the dependencies you specify is not overridden by the other dependencies
12:02astevehyPiRion: it didn't change the tree output
12:02AnderkenthyPiRion: I'm pretty sure they're not being overriden, it's just an issue of the remote jvm running with a different clojure version
12:03futileIs it just me or does anyone else do a whole lot of talking to themselves in their own github issues?
12:03Anderkenti.e. he gets both the uberjarred 1.5.1 clojure and the already loaded 1.3
12:03hyPiRionAnderkent: whacky
12:03hyPiRionfutile: I do it all the time, and check out the Grenchman for same behaviour in our tooling God.
12:04hyPiRionIt's super neat as a "todo" list
12:04futilelol 'Sorry about the name'
12:04Anderkentfutile: I usually try to stop after 3 comments - https://github.com/marick/Midje/pull/237 https://github.com/lshift/cloverage/issues/21
12:04futileAnderkent: you're JacekLach?
12:04Anderkentyup
12:07asteveya, my problem is the remote is currently running nimbus and storm with clojure 1.2 and a very old version of storm
12:07asteveI'm not sure why I didn't think of this earleir :)
12:07Anderkentglad to be of use :)
12:09mdrogalis`cbp & coventry: That makes sense. :) Thanks guys.
12:12asteveAnderkent]away: thanks
12:14sandbagsanyone know how quickly you get approved to post to the clojurescript group?
12:15mdrogalisHold dnolen hostage
12:15bbloomsandbags: posts get approved very quickly & i believe you get real posting privledges after a few approved posts automatically
12:16sandbagsbbloom: very quickly < 1d ish ?
12:16sandbagsmdrogalis: heh ... i guess that'd be my plan B
12:17sandbagsi'm kind of stuck so hoping my post would go through reasonably quick
12:17bbloomsandbags: there are a few volunteers, myself included. i get emails about posts to be approved & usually get around to them within 1 day, but almost every time, somebody else has already gotten to it
12:17sandbagsbbloom: okay, thanks
12:17sandbagsi appreciate nobodies paid to do it, just wanted to set my expectations appropriately
12:17seangrov`sandbags: Hasn't your post already gone through?
12:17sandbagsseangrov`: i couldn't see it just now
12:18bbloomsandbags: there might be one guy who is much faster than the rest of us and if he goes on vacation or something then the rest of us might assume this anonymous person who beats us to the punch will take care of it :-)
12:18bbloomsandbags: i just published it for you :-P
12:18sandbagsbbloom: oh well, there's service for you! thank you :)
12:19sandbagsis it a function of inexperience that Clojure stack traces often seem like gibberish to me (in a way that I don't remember, e.g., Ruby stack traces seeming)?
12:20bbloomcemerick: rock on with the touch carrying!
12:20bbloomtorch* rather
12:20bbloomcemerick: glad to see cljsbuild springing back to life
12:20cemerickI thought that was some kind of hipster football reference for a second. :-P
12:21cemerickbbloom: just housekeeping, for a little while. Getting the idle CPU util down is great to have, tho.
12:21cemerickI'll be putting an 0.3.3-SNAPSHOT out there for people to try, once I have clojars privs from Evan
12:21nDuffsandbags: they're messier than most, but with experience, they're manageable.
12:21sandbagscemerick: is cljsbuild using the FSEvents API on OSX?
12:22nDuffsandbags: ...there are also tools available to filter them down to something more useful.
12:22sandbagsif not that's potentially something i could help with
12:22cemericksandbags: that's for watching files?
12:22sandbagscemerick: yep
12:22sandbagsit's as near zero-cpu as you're going to get on OSX
12:22bbloomsandbags: yeah, bad stack traces are a problem… but even if the stack traces were less ugly, they wouldn't be super useful considering laziness, loop/recur, etc. you're better off with tracing/logging anyway
12:22nDuffsandbags: ...see for instance https://github.com/mmcgrana/clj-stacktrace
12:23sandbagsnDuff: thanks
12:25edannenbecoventry, do-seq seems to be the simple solution to my earlier problem
12:25clgvis there a best practices tutorial for datomic? for example when should you use different partitions for entities?
12:25cemericksandbags: definitely a TODO, though cljsbuild will use the JDK facilities when available. Adding support for platform-specific stuff doesn't make a lot of sense IMO. https://github.com/emezeske/lein-cljsbuild/issues/229 is the relevant issue if you want to dig in.
12:26cemericksandbags: Note that if the impact to the existing codebase is significant (defined by "gives cemerick the willies w.r.t. breakage" :-P), then it'll end up being a 2.x feature.
12:27cemerickAs it stands, the fix I just put in for gh-219 is a significant improvement w.r.t. cljsbuild auto CPU utilization. I'm actually unconvinced by the need for inotify-style watching given the perf I'm seeing of the existing approach.
12:29sandbagscemerick: i'll go out on a limb and assume the Oracle guys are smart enough to base this WatchService on FSEvents when the JVM is on OSX
12:30mercwithamouthdoes anyone have fireplace working in vim?
12:30sandbags"The implementation that observes events from the file system is intended to map directly on to the native file event notification facility where available" seems promising
12:30cemericksandbags: oh, probably. I just meant that I'd only want to see a WatchService-based impl, rather than 3 impls based on some non-JDK native lib approach.
12:31sandbagsi only brought it up because polling is such a horrible solution most of the time
12:31sandbagsesp if you ever work on any decent sized projects
12:31sandbagsi implemented this for a ruby tool a while back although i suspect C modules are easier to integrate with Ruby than Clojure ...
12:31cemericksandbags: well, make sure to give 0.3.3-SNAPSHOT a try, I just optimized the current polling approach significantly.
12:32cemerickCut my `cljsbuild auto` CPU util from 40% to < 1%.
12:32jlongsterdnolen: I'm still having some trouble extending your core.async example. Here's a concrete case: make the (task (.-readFile fs) ...) form take another task as an argument. I'd like for the errors from that task to be propagated up to the supervisor
12:32cemerickmercwithamouth: yes, though I'm not using it at the moment.
12:32ambrosebsmercwithamouth: ya
12:33sandbagscemerick: hrmm not sure what i'm on at the moment but the CPU hit seems relatively negligible
12:33mercwithamouthdarn...i couldn't get it to work for me 2 weeks ago.
12:33mercwithamouthwell...it's working for you all...i'll tinker with it again tonight. do you guys just go emacs?
12:33mercwithamouthor light table(really cool...)
12:33sandbagsthat said, my project is pretty teeny-tiny
12:33cemericksandbags: if that's the case, then why bother with inotify?
12:33dnolenjlongster: sorry I wasn't suggesting using supervisor pattern, just do error propagation
12:34sandbagscemerick: matter of principle, not all projects are going to be tiny, and why use CPU you don't need to?
12:34cemerickmercwithamouth: Nope, been using vim for some months, though I'm using my own fork of fireplace at this point.
12:35cemericksandbags: Meh. What's there, works. If someone can point at a big project that doesn't play nice with auto, then it'll be worthwhile.
12:35mercwithamouthcemerick: hmm fair enough. i could just open a terminal below and open repl up that way
12:35sandbagscemerick: since i spend a lot of time on battery these days CPU has suddenly become very important again :) on my Mac Pro at home I waste it with abandon!
12:36sandbagscemerick: btw it wasn't meant to be a criticism, i just saw a possible place i might contribute something ... which in the Clojure world is a rarity
12:36jlongsterdnolen: since youre sending errors on the same channel as values, I still can't see how you'd propagate, but I'm prob just missing it. an example of the task as an argument would be great (no rush)
12:37cemericksandbags: Of course, didn't take it as criticism. :-) Was just being clear about why my criteria might be for accepting a patch. I'm happy for all the help I can get!
12:37sandbagscemerick: roger that!
12:37dnolenjlongster: make something wires the tasks together via channels, (pipeline foo task1 task2 task3), this effectively how promises work
12:37cemericks/why/what
12:37jlongsterdnolen: sidenote, once we figure out the error handling pattern, I'm eager to port some of core.async's optimizations to js. can't wait!
12:38dnolenjlongster: pipeline should be able to do this though
12:38jlongsterdnolen: oh yes yes, like `forward` in my example? https://gist.github.com/jlongster/6374643 that's basically the conclusion I came to
12:38dnolen(pipeline foo task1 (supervisor task2 ...) task3)
12:38dnolenjlongster: which way cooler than the promise patterns you see :)
12:39jlongsterdnolen: omg, seriously. I'm really excited about it.
12:39sandbagsbtw guys i get about ~5000 warnings from cljsbuild relating to things having no effect as externs (externing jquery-1.10.2)
12:39sandbagsshould i be worried about those?
12:39seangrov`jlongster: You're crazy prolific, always hacking on something interesting
12:40sandbagshere's a sample: https://gist.github.com/mmower/0b158420f02b0c5f7dd0
12:40jlongsterdnolen: it's nice to actually control the flow of things instead of doing a backwards-ass structure for promises
12:40jlongsterseangrov`: hah, really? what makes you say that?
12:40jlongsterI feel small in comparison to some of the guys here :)
12:41seangrov`This, your game programming, outlet, it was actually you that convinced me to do iOS dev with scheme (thoguh I used Chicken in the end instead of gambit), etc. etc.
12:41jlongsterdnolen: wait, is pipeline an existing structure? that's something new right?
12:41jlongsterit'd be nice of the core.async readme actually documented core.async
12:41dnolenjlongster: something new
12:41dnolenjlongster: that needs to be written
12:42jlongsterseangrov`: oh nice! I just really enjoy to hacking on things. those things you mentioned have been over years time, so it's just here and there. glad to hear you're doing cool stuff!
12:42dnolenjlongster: would ben nice but core.async just provides a handful of primitives, just read cljs/core/async.cljs
12:42jlongsterdnolen: ok, I'll attempt it but I'm sure I'll need your input
12:42jlongster(probably over the weekend, not during work today)
12:43jlongsterat least sasy that in the README :)
12:43jlongster*say
12:44jlongsterI say that as somewhat of an outsider to Clojure, of course
12:44dnolenjlongster: heh, it is alpha software after all, not sure if Rich is 100% API, though it sounds like that might be the case.
12:44jlongstertrue
12:46sandbagsi found... well i can't say i found it more clear, but i had better questions, from reading the walkthrough.clj rather than the docs
12:46sandbagsthat reminds me, i have a question i wanted to post about one of the examples in the walkthrough
12:50dnolenjlongster: also even w/ the docs, it's not really enough to get your head around CSP style programming. The best resource is honestly reading Go code.
12:50rasmustomercwithamouth: Are you using the latest fireplace (and leiningen)?
12:51mercwithamouthrasmusto: yup
12:52rasmustomercwithamouth: I usually fire up a `lein repl :headless` in another terminal/screen, and then vim on a clj file, haven't had issues with connection
12:52jlongsterdnolen: definitely, I just mean at least a list of available functions
12:53rasmustomercwithamouth: what problem are you running into? (error message?)
12:53jlongsteralso is CSP really that mind bending? I find it the most natural/intuitive way to do async, much more than anything else (compared to FRP, promises, etc)
12:53mercwithamouthrasmusto: one sec
12:53nDuffHeh.
12:54dnolenjlongster: well I find it mostly natural, but thinking about potential deadlock requires a different frame of mind.
12:55mercwithamouthrasmusto: funny enough...it's working today -_-...before :Eval would give me a crazy message
12:55jlongsterdnolen: good point
12:55mercwithamouthahh i think my issue before was i didn't open a repl within the project
12:55mercwithamouthi'll admit i only played for 10 minutes and ran back to lighttable
12:55rasmustomercwithamouth: ah, good to hear. Sometimes I will have to restart the repl or vim to get it out of some weird state
12:56rasmustomercwithamouth: or do an explicit :Connect
12:59`cbpis there a way to have a map where i care about the order of the values and the values might repeat?
13:00`cbpDo I have to make sure the values are unique in the comparator or something?
13:00mercwithamouthrasmusto: yeah....it's definitely working now =P
13:02`cbpoh clojure-docs to the rescue
13:03mercwithamouthrasmusto: also it seems to be terminal vim only, not macvim, right?
13:03sleetdropdoes ([5 10] 0) means get the first element? and why?
13:03rasmustomercwithamouth: it should work if you use mvim with the right starting directory, (or do a :cd, and a :Connect)
13:04rasmusto,([5 10] 0)
13:04clojurebot5
13:04`cbpsleetdrop: a vector is a function of its indexes
13:04mercwithamouthrasmusto: taking a look.
13:05rasmustosleetdrop: a vector is a function on its "keys", which in this case are indices ^
13:05sleetdropthanks
13:06rasmustosleetdrop: ,({:a 1 :b 2} :a)
13:06rasmusto,({:a 1 :b 2} :a)
13:06clojurebot1
13:06rasmustosleetdrop: the same is true of maps
13:06sleetdroprasmusto:thanks
13:07silasdaviswhich is nicer:
13:07silasdavis(apply merge (map hash-map [[1 2] [3 4]] (repeatedly hash-map)))
13:07silasdavisor
13:07silasdavis(reduce #(into %1 {%2 {}}) {} [[1 2] [3 4]])
13:07silasdavis?
13:07silasdavis(/faster)
13:07silasdavis,(reduce #(into %1 {%2 {}}) {} [[1 2] [3 4]])
13:07clojurebot{[1 2] {}, [3 4] {}}
13:07rasmustosleetdrop: you might see something like this: (:a {:a 1 :b 2}), this is just sugar for doing it the other way
13:09hyPiRion,(reduce #(assoc %1 %2 {}) {} [[1 2] [3 4]])
13:09clojurebot{[3 4] {}, [1 2] {}}
13:10silasdavisyes that is better
13:11hyPiRionoh lord, I am stupid
13:11hyPiRion,(zipmap [[1 2] [3 4]] (repeatedly {}))
13:11clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: PersistentArrayMap>
13:11hyPiRionwhap.
13:11hyPiRion,(zipmap [[1 2] [3 4]] (repeat {}))
13:11clojurebot{[3 4] {}, [1 2] {}}
13:12sleetdroprasmusto: I am new to lisp like language, to many things to remember.
13:12noncomare deftype and defrecord special in terms that they are not entirely written in clojure?
13:12callensleetdrop: you'll eventually develop gills and breathe parens naturally, then you'll be pissed when you're not in the nice warm water.
13:12callennoncom: read the code.
13:12`cbpsleetdrop: the argument for clojure is that there are _less_ things to remember than other languages :P
13:12callen`cbp: it's just familiarity.
13:12rasmustosleetdrop: http://clojure.org/cheatsheet will be very useful, bookmark it :)
13:12ozzloyi'm trying to bring my bluetooth back up without rebooting. i just woke from suspend and now bt is not coming up. i've tried rfkill unblock and service bluetooth restart to no avail. what do? what log can i check for clues?
13:13ozzloyubuntu 12.04
13:13ozzloywoops
13:13ozzloywrong channel
13:13hyPiRionozzloy: heh, wrong channel
13:13rasmustoozzloy: have you tried (bluetooth) ?
13:13`cbp(get-in bluetooth [:logs])
13:14ozzloythanks y'all
13:14sleetdroprasmusto:thanks
13:29functionformsleetdrop
13:29functionform"It get's better!"
13:29functionformgets
13:30functionformBefore I used to think in loops, now i'm mapping/applying/reducing my way to one line glory.
13:30functionformtook me maybe 2 months on off hours using 4clojure.com to get up to speed. seeing other answers is so informative.
13:35clgvozzloy: I gave up on bluetooth under linux ;)
13:45silmawienis there a standard function for doing (if (coll? arg) arg [arg]) ?
13:45coventryWith functions wrapping functions, it would be nice if you could get a parallel traceback of the source locations for the functions in the stack trace. Are there any tools which provide this information? Is it possible, in principle?
13:46silmawieni.e. convert non collection args to a 1-item collection
13:49futileseeing_is_believing seems like a really cool alternative to the nrepl.el workflow
13:49futilehttps://github.com/JoshCheek/seeing_is_believing
13:50futile(for Ruby though)
13:50futileI wonder, would this be so hard to do in Clojure?
13:50callenfutile: it already exists, tools.trace
13:50callenjust...use it.
13:50futileoh
13:50futileyeah but does it have its own lightning talk demo too?
13:50futilere: http://vimeo.com/72195902
13:51coventryDidn't an early version of light table do this? (Don't know about later versions.)
13:51bjavim's slimv does this with <Leader>t
13:51bjapresumably so does SLIME in emacs
13:52callenjust tried to install a single and only package - cabal-dev, and it failed.
13:54dnolensilmawien: no such function exists, and in your case it seems like you want vector? not coll?
13:57silmawiendnolen: ok thanks, and yes that sounds right
14:00`cbpmm does lein upgrade work from 2.3.1 -> 2.3.2? It seems to just hang
14:00tsantosThe clojure puzzler today sure is odd. I have no idea why the fail case is the fail case: http://techblog.zenrobotics.com/2013/08/clojure-puzzler-2.html
14:01coventrytsantos: I haven't followed it, but there was some discussion of it earlier today: http://clojure-log.n01se.net/#04:56
14:02callen`cbp: worked for me. reinstall if you must.
14:02upwardindexI'm generating svgs using hiccup. The fact that I'm using identical ids for gradients is getting me in trouble, is there a workaround?
14:02`cbpcallen: maybe its just a windows issue.. like usual
14:03`cbpIll get a mac soon and stop complaining :P
14:03tsantoscoventry: how did you search the chat history and generate a URL like that?
14:04callen`cbp: good call :)
14:05`cbpOh it finished, well it only took it like 30 mins
14:06coventrytsantos: searched for zenrob, moused over the LH margin next to sender name, which displayed time of the message. Clicked on that.
14:06tsantoscoventry: ah, thx
14:13silasdavisif I have a set which I generally don't care about the order of, what is the best way to consume it in a consistent order within a particular scope
14:14silasdavisso that (zipmap set (map func set))
14:14silasdavisiterates set in the same order in both positions
14:14silasdavis?
14:16`cbpsilasdavis: that will work, it doesnt switch order every time you use it :P
14:16silasdavis`cbp, yeah i sort of know it will work, but it feels like a weak guarantee
14:16silasdavisI'd rather make it explicit
14:16seangrov`What do I want to test for vector, list, etc? I thought it was seq?, but that doesn't seem to work
14:17seangrov`,(seq? [{"name" "test-a-riffic!", "source" "testing"}])
14:17clojurebotfalse
14:17silasdavisI suppose I could (let [s (seq set)] (zipmap set (map func set)))
14:17coventryseangrov`: Ran into the same thing this morning. There is a sequable? in clojure.incubator.
14:17silasdavisuh except with s substituted
14:17`cbpsilasdavis: seq is implicit though in both zipmap and map
14:18`cbpsilasdavis: You could just add a comment :P
14:18`cbp"hey trust me this will work!"
14:18`cbp..consistently!
14:18dnolenseangrov`: sequential?
14:19rasmustosequibble
14:19hyPiRiona hash map or a set is not sequential, although they are seqable
14:19coventrydnolen: thanks.
14:19seangrov`dnolen: That works, thanks
14:20`cbpseangrov`: maybe this can help? https://github.com/yogthos/Selmer/blob/master/src/selmer/filters.clj#L39-L51
14:21dnolencoventry: seangrov`: also CLJS has seqable?, but in this case I think what you really want is sequential? which is more specific.
14:22seangrov``cbp dnolen: Yeah, sequential looks right - I want to guard against a few conditions. Got a bug with strings being passed rather than vectors/lists, and also with hashmaps, etc.
14:22seangrov`Converting to the erlang-style of "don't correct input, raise an error as soon as possible"
14:22coventrysilasdavis: You don't need it, but you can use juxt for that kind of thing.
14:22coventry,(into {} (map (juxt identity #(* % 2)) (range 10)))
14:22clojurebot{0 0, 1 2, 2 4, 3 6, 4 8, ...}
14:23silasdavis`cbp, it's implicit on each argument separably
14:25`cbpsilasdavis: well referential transparency and all that (seq x) will always return the same thing given the same x
14:25silasdaviscoventry, yes thanks I like that
14:26cmathesoni've been writing a network application in clojure/core.async, but i'm having to use the blocking versions of all the core.async functions/macros since java io is blocking.
14:26cmathesonwhich leaves me with the problem of multiple threads trying to write to the same socket at once
14:27cmathesonwhat is the proper clojurey way to avoid that? (normally i would just put a lock on the socket output stream)
14:28dnolencmatheson: any reason to not use NIO
14:28dnolencmatheson: or something else that provides non-blocking behavior like Netty?
14:28cmathesondnolen: not really, i'm super unfamiliar with the java ecosystem and i wasn't really sure how to work with nio (seems like everyone uses netty)
14:29cmathesonmaybe i should be using netty, does it play well with core.async? i guess it shouldn't matter that it has its own thread pool
14:29swarthycan anyone take a look at this 3 line paste and tell me if there is a better way https://www.refheap.com/18179 ?
14:30dnolencmatheson: I don't see why there would be any issues using it w/ core.async, but I haven't tried it myself or anything.
14:31justin_smithswarthy: (defn in? [x xs] (some #{x} xs))
14:32justin_smithor does the result explicitly have to be a boolean?
14:32llasramswarthy: `some` already returns the logical true predicate value, so you don't need the `not=` -- the value will already be either `true` or `nil`
14:32cmathesondnolen: ok thanks, i'll look into switching to netty. i guess i could look at clojurescript/node too
14:32justin_smith,(not (empty? (filter #{:a} [:a :b :c])))
14:32clojurebottrue
14:32swarthyjustin_smith: and llasram: thanks!
14:33hyPiRion(doc empty?)
14:33clojurebot"([coll]); Returns true if coll has no items - same as (not (seq coll)). Please use the idiom (seq x) rather than (not (empty? x))"
14:33justin_smithllasram: it does not return true/false but the thing that was truthy/falsy
14:33dnolencmatheson: there's also http://vertx.io/
14:34llasramjustin_smith: ##(some nil? [1 2 3 nil 5])
14:34lazybot⇒ true
14:34justin_smithllasram: ##(some #{:a} [:a :b :c])
14:34lazybot⇒ :a
14:35llasramjustin_smith: Sure, if you do that. That's why I didn't advise them to use the set idiom :-)
14:35hyPiRionit returns the first truthy value when calling f on an element in the coll
14:35cmathesondnolen: thanks. so many choices...
14:39swarthyso with regard to (doc empty?) I don't want nil if the item doesn't exist in the coll, I want false
14:39hyPiRion(boolean (seq ...))
14:40swarthyexcellent thank you
14:40functionformnil and false are both falsey
14:40swarthybut nil != false, how would I test for both cases
14:40hyPiRionbut nil is not false
14:41swarthyhey hyPiRion, https://www.refheap.com/18179
14:42swarthyif I take away 'boolean' func
14:42swarthyi get the opposite results
14:42llasramswarthy: You don't want the `seq` in there
14:42hyPiRioner, well, you'd only want (some #(= % elt) coll) there
14:43swarthyokay but if its not there then some returns nil
14:43swarthywhen I want false
14:43hyPiRionoh right, that was the thing
14:43hyPiRion(boolean (some ...))
14:43xeqi&(boolean (some {:d} [:a :b :c]))
14:43lazybotjava.lang.RuntimeException: Map literal must contain an even number of forms
14:43xeqi&(boolean (some #{:d} [:a :b :c]))
14:43lazybot⇒ false
14:43swarthy&(boolean (some #{:a} [:a :b :c]))
14:43lazybot⇒ true
14:44swarthyexcellent
14:44xeqi&(boolean (some #{nil} [nil]))
14:44lazybot⇒ false
14:44hyPiRion,(boolean (some #(= % nil) [nil]))
14:44clojurebottrue
14:44xeqi(inc hyPiRion)
14:44lazybot⇒ 21
14:45hyPiRionthe dangers of nil punning, brr
14:45onrAnyone here using IntelliJ IDEA?
14:45xeqihyPiRion: the dangers of a type system that allows nils
14:46swarthythe only problem hyPiRion is that this: https://www.refheap.com/18179 doesn't work and I don't konw what I'm messing up
14:46hyPiRionswarthy: remove the seq again
14:46swarthyokay, so i have to have two tests then?
14:46swarthybecause if i remove seq then look for a val not in seq
14:46hyPiRionnono, here's the thing
14:47nDuffonr: might be better to ask the real question.
14:47nDuffonr: if your real question is how popular IntelliJ is for Clojure, then we can point you at the survey.
14:47hyPiRion(some f coll) returns the first (f x) which is truthy, or nil otherwise
14:47hyPiRionboolean converts nil and false to false and anything else to true
14:47onrnDuff: you seem angry, maybe i should avoid intellij at all.
14:48rasmustohow do I do that bot thing? ~anyone ?
14:48hyPiRionswarthy: so (defn in? [x items] (boolean (some #(= x %) items))) is sufficient
14:48onrrasmusto: &(...)
14:49nDuffonr: Polling / popularity-contest questions are a good way to hurt signal/noise ratio on IRC. It's not really a matter of "angry".
14:49justin_smith,"hello"
14:49clojurebot"hello"
14:49swarthyhyPiRion: excellent, thank you very much for your help. I understand what is happening now.
14:49justin_smith##"hello"
14:49rasmustoonr: no, the canned response to "does anyone" questions
14:49hyPiRionno problem
14:49xeqi~anyone
14:49clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
14:49llasramWhat's that work-around for the JVM suppressing SIGPIPE?
14:50rasmustoxeqi: ty
14:50llasramMy process is hanging around, pretending to pump bytes to a `less` process I've already quit...
14:51hyPiRionllasram: I thought the JVM gave up when it got a sigpipe? In either case, you could use beckon to modify the signal handling.
14:51onrnDuff: i wouldn't care that much
14:51nDuff...about what? IntelliJ? IRC etiquette?
14:52hyPiRioner, github's slow here, but https://github.com/hyPiRion/beckon should work, I *think*
14:52hyPiRionfor handling signals, that is.
14:52llasramhyPiRion: Ooh, looks nice. Let's have a try...
14:55llasramhyPiRion: Ouch -- UnsupportedClassVersionError
14:55hyPiRionBoo
14:55llasramhyPiRion: *Now* I'm feeling some pain from still being on JVM 6
14:56hyPiRionYeah, sorry, I should compile those with 1.6, but I tend to forget from time to time
14:56hyPiRionsec.
15:00silasdavisis there a standard higher order function that just returns the second argument
15:00silasdavis(identity n)
15:00lazybotn has karma -1.
15:00silasdavisor soemthing
15:01hyPiRion#(second %&) is a cheap one
15:06hyPiRionllasram: try it now, with 0.1.1
15:07llasramhyPiRion: Trying...
15:07hyPiRionIf it doesn't work now I'll flip a table or two
15:07silasdavishyPiRion, anything better than #(first %&) ?
15:07hyPiRionI wish
15:08hyPiRionnot afaik
15:08llasramsilasdavis: I've ended up carrying around functions I call arg0, arg1, and arg2. Not great, but not the end of the world either
15:08llasramhyPiRion: No exceptions!
15:09llasramYour tables are safe!
15:09hyPiRionwuhuu
15:09swarthyhow would you use #(second %&) ?
15:10Raynes(ノಠ益ಠ)ノ彡┻━┻
15:10hyPiRion,(#(second %&) :one :two :three :etc)
15:10clojurebot:two
15:10hyPiRion(comp second list) also works.
15:10llasram&(reduce #(second %&) [1 2 3])
15:10lazybot⇒ 3
15:10llasram^^ THat's where I've wanted it
15:10swarthyGreat, that makes sense.
15:12amalloyi dunno, #(second %&) seems like it would rarely be more readable than (fn [a b] b)
15:12amalloyespecially if you can give meaningful names in the lambda
15:12ztellmancallen: a logging library named after a paramilitary organization?
15:14llasramhyPiRion: And not only doesn't throw an exception, but also solves my SIGPIPE problem!
15:14llasramhyPiRion: Thank you muchly
15:14swarthyamalloy: as a newbie i agree. I made sense of that in a second, the other version required asking. Then again some things are not made for beginners.
15:15hyPiRionllasram: oh, no problem. I have no idea why I wrote that library in the first place, so good to see that it's useful for something :p
15:15callenztellman: after a book about lumberjacks, but you know, I can go with that too.
15:15callenztellman: that company isn't named Blackwater anymore, they're Xe now.
15:16callenthey wanted something hippies couldn't pronounce.
15:16ztellmanha, I'm behind the times
15:16ztellmanI had to go to a security convention in Vegas once, for work
15:16callenThe library was an excellent excuse to abuse robert-hooke.
15:16ztellmanthey had dudes with what I assume were real submachine guns at each corner of the booth
15:16TimMccallen: Next they'll be named "Puppy Kisses". No one can protest against that!
15:16callenThe Korma stuff is solid but I kinda need somebody to help me shake out the c.j.j parts.
15:17ztellmanright next to the guy giving out free t-shirts if you touched an electric fence that had a little lemon slice attached to it by a string
15:17ztellmanthat was a weird time
15:17callenztellman: not that uncommon in that sort of context, you just need a corporation with a manufacturer FFL or NFA stamps.
15:20llasramhyPiRion: So have we decided that single-component namespaces are ok? I thought the translation to packageless Java classes made them... unadvised, but beckon is no the first recent library I've seen do it
15:20llasrams,no,not,
15:22tsantosParedit question: What's the command to delete the outer parens. Emacs won't let me ## ((+ 1 2))
15:22lazybotjava.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn
15:22amalloytsantos: (|(+ 1 2)), M-r
15:22coventrytsantos M-r while on the second '('
15:23tsantosthanks! It's been driving me nuts.
15:24llasramOr M-s if you just want to bust out the level outside the cursoor
15:25amalloyi usually forget to use M-s
15:27tsantosmessing around with split and raise… I'm getting raise but split's behavior is very odd
15:45hyPiRionllasram: well, library.core is not something needed here, because the library itself is so small
15:46hyPiRionI guess multi-namespaces make more sense when working with larger projects, but when you have "library.core" only, I feel the ".core" is a bit useless
15:47`cbpisnt the issue with single part namespaces that you cant use them from java?
15:47llasramhyPiRion: My understanding was the `.core` was just a convention to have *something*. With just `library`, JVM clojure generates classes like `library$function-name`, right? Package-less and sad
15:47llasram(and globally visible without ability to explicitly import)
15:50stuartsierrayes
15:50stuartsierraWhich is why you should use a package-prefix instead of naming everything 'core'
15:56TimMcI don't actually know what the issue is with single-segment namespaces, but I keep telling people not to use them.
16:05futileztellman: your tuples lib looks generic enough to fit into the core lib as an implicit optimization when creating small vectors
16:05futile*to fit into clojure as
16:06futiletsantos: also M-s
16:06amalloyTimMc: the default package is just really hard to use, particularly from java
16:07amalloyso creating piles of classes that live in it is rude
16:27ztellmanTimMc: was that for the readme, or the code itself?
16:27hyPiRionor the name or something
16:27ztellmanyeah, to hell with that name
16:28callenhttps://github.com/rixmann/clojure.otp dis gon b gud
16:29callenTimMc: how does 'black.water' strike you? It used to be blackwater.core :P
16:30ucbcallen: have you toyed with quasar/pulsar?
16:30ucbcallen: it's got some behaviours as well
16:32grassclipanyone here want to answer a question?
16:32ztellmangrassclip: ask and see
16:34grassclipso this works (get [10 20 30] 1) and returns 10. Is there something like that which works (get [10 20 30] [1 2]) which would return [10 20]?
16:34ztellman,(map #(get [10 20 30] %) [10 20])
16:34clojurebot(nil nil)
16:34ztellmanwhoops
16:35ztellman,(map #(get [10 20 30] %) [0 1])
16:35clojurebot(10 20)
16:35grassclipbingo. thanks a lot
16:36hyPiRionoh what, clojure otp
16:36hyPiRionthat's ages ago tho
16:37ucbhyPiRion: pulsar/quasar has otp behaviours now IIRC
16:37coventry,(map [10 20 30] [0 1])
16:37clojurebot(10 20)
16:37mattmossthrowdown
16:37hyPiRionah, neat. Not that I've felt the need for it though.
16:39grassclipcleaner one. thanks
16:41ztellmancoventry wins
16:53coventryWhere do I get my code golf trophy?
16:53callenucb: not yet.
17:00TimMcztellman: Not the name, the single-segment namespace.
17:00TimMcnag, nag, nag
17:00ztellmanwho's going to use this outside of clojure?
17:00ztellmanthat's my normal criteria: if it's only useful to clojure folk, a single segment namespace is ok
17:02ztellmansee also byte-streams and potemkin
17:02bbloomi like that
17:02bbloommainly b/c i hate multi-segment namespaces :-P
17:02RaynesYou're a bad person.
17:02bbloomi try
17:02stuartsierraI'm just a sadist who likes making people type more.
17:03bbloomstuartsierra: i don't mind the typing, we got aliases for that. i mind navigating folders when authoring the library :-P
17:03callenbbloom: black.water is just black/water.clj, not much to navigate.
17:03bbloomsrc/extrathing/annoys.me
17:04callenITT: bikeshedding
17:04stuartsierrabbloom: That's why I write everything in org-mode :P
17:09coredhello
17:10coredwhy is that there's use and require to load libraries ? it's seems the same to me, at least at the moment
17:11callencored: well they're not identical, but they're not fully orthogonal either.
17:11callencored: people have been mumbling about getting rid of use in favor :require :refer :all
17:12coredcallen: getting rid, like removing it from the language?
17:12callenrkneufeld: kinky.
17:23hyPiRioncored: more like deprecating. It won't dissappear for some time I guess
17:23coredhyPiRion: I see
17:37TimMcztellman: I *suppose*.
17:37callenlastlog ztellman
17:37callensigh.
17:37TimMcbbloom: I use src/org/timmc/... just for you.
17:37TimMcAt least I have short domain.
17:39clj_newb_2345besides the people at relevance
17:39clj_newb_2345has anyone else in the world managed to grok pedestal?
17:40shaunxcodeif I ever get around to putting up my new blog I promise you an article on such grokage
17:45futileGo has an interesting solution to platform-specific code.
17:45callenclj_newb_2345: are you working on complicated bidirectional client/server web applications?
17:45futileI wonder how its pros/cons compare to feature-expressions.
17:45clj_newb_2345callen: yes
17:46callenwell. then Pedestal is potentially a credible solution but OTOH, if you want to build something like that but cannot understand Pedestal, then it might be time to simplify what you're trying to make.
17:46callenclj_newb_2345: #pedestal exists - you know.
17:46clj_newb_2345by definition, aaaren't all websites either (1) static, (2) bi-directional web apps, or (3) should be [2], but the programmers suck
17:46callenno.
17:47shaunxcodeI think what callen is saying is that if you are trying to grok clojure web dev period pedestal may not be the place to start directly. Pick up ring on its own, compojure etc.
17:48callenshaunxcode: thank you for interpreting.
17:49gtrakpedestal's overkill until you really need a cohesive uniform async and message-passing bus, imo? json-rpc works fine for our single-page app and is also flexible.
17:50gtrakrpc-style, anyway, not the spec specifically
17:56clj_newb_2345http://www.learndatalogtoday.org/ is fucking badass
17:56callengtrak: I'm of the same opinion.
17:57gtrakours evolved to a compromise point between json-rpc and REST..
17:57callenclj_newb_2345: oh man, that is cool and I need it! I have coworkers to teach datalog to! Thank you for sharing :)
17:57gtraki guess we could implement it in pedestal just as well as in compojure, not sure.
17:57clj_newb_2345someone else showed it to me last night
17:57clj_newb_2345I didn't get a chance to start playing with it today, but it's awesome
17:58callenclj_newb_2345: I'm testing Datomic for something at work, so this is very useful. :D
18:11futileyeah I'm gonna be using Datomic soon at work too so http://www.learndatalogtoday.org/ might very well be helpful
18:26clj_newb_2345datalog is fucking badass; why did no one team me datalog earlier?
18:27seangrov`clj_newb_2345: What're you using it for?
18:29clj_newb_2345this is going to be my web 3.0 facebook/google killer
18:29clj_newb_2345the exercises are so fun
18:30gtrakclj_newb_2345: have you considered php?
18:30gtrakit's really good for making websites :-)
18:31tcrayfordanybody ever see an error like this out of clojure? "yeller.unique_priority_map.PersistentUniquePriorityMap cannot be cast to yeller.unique_priority_map.PersistentUniquePriorityMap"
18:31tcrayford?
18:31gtrakclassloader boundary?
18:32tcrayfordI don't think so :/
18:32tcrayford(unless I don't know what you mean by classloader boundary)
18:33tcrayfordassuming test.generative doesn't do anything weird with classloaders, at the least
18:33gtrakhuh
18:34tcrayfordthis results from just running the test.generative main script from the command line with lein
18:34gtrakI've only seen errors like that across classloaders.. is there anything special about the client code vs the called code?
18:34tcrayfordsomething like this:
18:34tcrayfordlein with-profile ci run -m clojure.test.generative.runner "test/yeller/unit/"
18:34tcrayforddon't think so
18:35tcrayfordit went away after a lein clean, lein compile *offending-source-file*
18:36gtrakinteresting
18:36gtrakhere's an example: http://stackoverflow.com/questions/2371967/java-getting-class-cast-exception-where-both-classes-are-exactly-the-same
18:38tcrayfordyeah, that makes sense
18:45futile"In the last century, their race grew weary of such traditional names, therefore library authors resorted to creative means, such as naming them a sound that could only be pronounced audibly, or a color itself, as opposed to the name of the color."
18:56clj_newb_2345anyone else wish core.match uses datomic style pattern matching?
18:57callenclj_newb_2345: if wishes were horses, beggars would ride.
18:58gtraknot if I wish for more wishes. they would be buried in horses.
18:59TimMcfutile: imma name my next library c̷͉̖̤̟͔̰̮̓͌̿̐ľ͍͌̇ͤj̢͎̗͕̰̙̝̓ͥ͐̊̃ͨͣ.̩̟͎ͅc̵̖̞̞͍̓ͦ͊͌ͫo̙̠͈͉̣̺̖ͤr̲̳̒ͮ̈́͛ͅe̠͇̯͖͂́̌̀̾́
18:59futilewhoa
18:59futileimpressive
18:59clj_newb_2345atleast it'll be easier to google than something like "Go" or "A+"
18:59TimMc(I apologize to anyone who now has a messed-up terminal.)
19:00TimMc/clear will remove the offending line from view and C-l will refresh your screen
19:00futileIt's really idiotic that we still use terminal emulators.
19:00futileSurely we can come up with a bette contract than VTxxx. It's the 2010s already.
19:00callen"idiotic"
19:01callenfutile: by all means, invent another terminal protocol nobody will use.
19:01bbloomfutile: my theory on that is that the BEST FEATURE of terminals is immutability. at least, in theory, your shell is a *log*
19:01bbloomfutile: everybody else who has ever tried has made some sort of stupid object shell thing
19:01callen^^ what this guy said.
19:01futileIn order to write a GUI tool that supports "less", you need to emulate at least a VT100.
19:01callenfutile: I'll collect my tears in a bucket for you.
19:01futilecallen: I'm not saying I can do it.
19:02callenI need to write a bayesian filter that filters for conversation about doing actual 'things'.
19:02futilecallen: yep, good old callen
19:03bbloomcallen: if you try not saying anything, maybe the conversations you don't like will just scroll past you and your life will be better
19:05coventryclj_newb_2345: I have worked through the first part of the pedestal tutorial, and I think I grok it. It was tough going, though. I am planning to use it in a couple of weeks, after I've developed some backend components.
19:05callenbbloom: but the log is immutable :(
19:06callenI'm just asynchronously rotating to the IRC channel, checking to see if anybody's doing something other than complaining about things they didn't write, then cmd-tab'ing back to my work.
19:07callenI'm starting to understand why caboose exists.
19:08clj_newb_2345why hasn't anyone written a clojure library that only shows me what I wnat to read?
19:08clj_newb_2345it should use reinforcement learning by looking at how I respond to it
19:08clj_newb_2345and use the webcam to read my facila expressions
19:08clj_newb_2345for approval/disaproval
19:08gtrakI haven't ever used a clojure library that I didn't end up reading every line for
19:09gtrakI just do it upfront now
19:10clj_newb_2345gtrak: what libraries have you used?
19:10gtrakuhh
19:10gtrak:-)
19:12gtrakcompojure... friend... slingshot.. ring, clj-hadoop, cascalog, leiningen (ok I guess not all the way), tools.nrepl, data.csv, cheshire.. nothing too huge.
19:12gtrakbut it adds up
19:13gtrakjust looking through a single project.clj and seeing if I remember looking at the guts..
19:16coventryclojure.core? :-)
19:16gtrakyea ofc
19:16clj_newb_2345WOOT WOOT WOOT
19:16clj_newb_2345finished datalog tutorial
19:16clj_newb_2345where is the confetti ?
19:16callenI'm starting to understand why caboose exists.
19:17callenwhoops, wrong term.
19:17gtrakclj_newb_2345: confetti is you get to read https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj
19:17clj_newb_2345gtrak: I've already read all 128 characters used in that file
19:18gtrakquick, what's the md5sum?
19:18clj_newb_23452392802482042
19:19clj_newb_2345as part of my training for mental mining bitcoin, I can do sha256 coins mentally too
19:19clj_newb_2345the datomic tutorial now finally starts to make sense
19:24clj_newb_2345holy shit datomic licensing is expensive
19:25RaynesWelcome to the wonderful world of proprietary software by people who have a need to make money.
19:25bbloomclj_newb_2345: you've clearly never seen an oracle price sheet
19:25clj_newb_2345no
19:25clj_newb_2345I tend to only use open source software
19:25Raynesbbloom: Expensive relative to <insert something here>
19:25clj_newb_2345datomic starting license
19:25bbloomwww.oracle.com/us/corporate/pricing/technology-price-list-070617.pdf‎
19:25clj_newb_2345is more expensive than my macbook pro 17
19:25RaynesNot necessarily expensive relative to <insert highest priced database ever>.
19:25`cbpso many mcchickens you can buy instead
19:25RaynesMine too.
19:25RaynesBecause mine was free.
19:25s4muel"In devops we are face fiscal cliff every year when Oracle license is up for renew." - @devops_borat
19:25RaynesBecause my company owns my computer ;p
19:26gtrak$47k a cpu?
19:27clj_newb_2345if someone wrote a datomic clone
19:27clj_newb_2345woudl they get kicked from #clojure?
19:27seangrov`I wish thye were more evil abotu datomic
19:28seangrov`Wow, typos
19:28bbloomlol what a weird thought: "They make good software and I like them, but I wish they made good software and I *didn't* like them, so I could clone their software and be a hero"
19:28seangrov`But really, let me "scale up" a bit more and get good and locked-in, then ask me to pay
19:29seangrov`Otherwise I'm nervous about even getting started
19:29gtrakyou'll have to pay in hardware if you use a bad architecture
19:31clj_newb_2345alternatvely
19:31clj_newb_2345they could make datomic ree
19:31clj_newb_2345and charge for the support
19:31clj_newb_2345like, say, Red Hat
19:32sandbagsanyone here able to help with with my clojurescript+core.async problem https://gist.github.com/mmower/88353e592f169bef7df9 ?
19:33sandbagsi'm kinda stuck and really have no idea what might be wrong
19:33callenI just used core.async blocking take and async put to make a safe (no global mutable state) test case. :)
19:33callenvery pleasing.
19:38sandbagsseems the problem is nothing to do with using <! inside a (loop ...)
19:40sandbagsi don't see how this is working for anyone ... or what i am doing that's so horrendously stupid
19:41dobry-denAnderkent]away: return the rc in click-chan
19:41dobry-densandbags: *
19:42sandbagsah, did i miscopy something... let me see
19:42sandbagsyerp
19:42sandbagsthanks dobry-den
19:43sandbagsdobry-den: that certainly is more correct, but doesn't seem to have affected the error i am getting
19:43abpsandbags: you need (:require-macros [cljs.core.async.macros :as m :refer [go]])
19:44dobry-denoh yeah
19:44dobry-denthat got me for a while
19:44sandbagsabp: that's odd, i seem to get getting "go" from cljs.core.async
19:44sandbagsat least, i copied that from somewhere
19:44sandbagsdid it change?
19:45dobry-densandbags: i wrote my first cljs app last week and this is what i've got https://github.com/danneu/speed-reader/blob/master/src/cljs/speed_reader/core.cljs
19:45sandbagsah, that seems to have eliminated the error i was seeing, thanks abp
19:45dobry-deni see that i have go from both async and macros. i imagine the :require 'go' i just forgot to take out
19:45sandbagshow very odd
19:46dobry-deni imagine it catches most people
19:46abpsandbags: it's a macro, so you certainly need to use :require-macros in cljs
19:47abpprobably cljs doesn't check if everything refer'd exists..
19:47sandbagsabp: interesting, so you need to know what are functions, and what macros
19:47sandbagspresumably any macro you use must be require-macro'd?
19:47futilewat
19:47dobry-denthat's how i see it
19:48abpat least I don't see go in https://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async.cljs
19:48sandbagsabp: it's most probable that (not knowing about require-macro) i was copying something else i had seen and just assumed i was doing it correctly
19:48sandbagsseems a bit of a bind having to require func & macro separately
19:48dobry-denhttps://github.com/clojure/core.async/blob/master/src/main/clojure/cljs/core/async/macros.clj
19:49sandbagshrmm... is don't see a macro predicate
19:50abpthere we go http://dev.clojure.org/jira/browse/CLJS-569
19:51sandbagsanyway, abp, dobry-den many thanks
19:51sandbagsat least i am debugging less inexplicable errors now :)
19:52clj_newb_2345can datomic free edition be used in commercial products?
19:52dobry-densandbags: i have various classes of cljs+async errors fresh in memory from using it last week
19:52sandbags:)
19:54sandbagsdobry-den: you like domina?
19:55dobry-denyeah
19:55dobry-dennot that i have many preferences. ive never even written a client-side js app before
19:56dobry-deni found it really easy to fake it til i made it with core.async though
19:56sandbagsme either, i dislike JS so always try and ensure someone else writes it :)
20:18mihneadbhow would I use enlive to select only the direct descendants of the given element?
20:18mihneadbsomething like (select elem [:> :a])
20:18mihneadb^ that one doesn't seem to work
20:19mihneadbit works when I go one up and I do (select parent-elem [:something :> :a])
20:22sandbagsokay i have my first cljs+core.async app working : i can go to bed a reasonably happy man!
20:23sandbagsthanks again for your help abp and dobry-den
20:25juliangindiI've been reading a lot about Clojure and making my way through 4Clojure but can't seem to truly "grasp" the language. Any suggestions or advice?
20:28gdevhow long have you been using it?
20:30mihneadbI want to do generate a map by applying a function over a sequence - should I use for, or something else?
20:30juliangindiI have been reading "Clojure Programming" and working with 4Clojure for a couple of weeks. I am looking for a larger "toy project" as well
20:31llasrammihneadb: There are a few common idioms depending on context. Usually either `reduce` or `(into {} (map ...)`
20:31mihneadbllasram: for the into version, I guess the mapped function has to return a two-value collection, right?
20:31mihneadbor should it be an actual map?
20:32llasrammihneadb: A sequence of pairs (as vectors), yeah
20:32mihneadbllasram: sweet, thank you
20:34gdevjuliangindi, depending on how much time you dedicate to it, you should "get it" in about another month and a half
20:34callengod that test code was fucking sweet.
20:34mihneadbllasram: is there an easier way to make a vector out of two elements other than (vec (list 1 2)) ?
20:35gdevjuliangindi, what are the primary languishes you code in?
20:35llasrammihneadb: ##(vector 1 2)
20:35lazybot⇒ [1 2]
20:35mihneadbah damn it
20:35mihneadbI was trying with vec
20:35mihneadbthanks!
20:35juliangindiI program primarily in Python and JS with Node
20:36gdevcallen, I've been trying to document blackwater. we need to talk
20:37callengdev: are you working from the current version?
20:38callengdev: I added some documentation.
20:38llasrammihneadb: Oh, wait, or even just literally ##[1 2]
20:38lazybot⇒ [1 2]
20:38mihneadbheh
20:38mihneadbnice
20:38mihneadbty
20:38mihneadbI was trying to do something like #([% %])
20:38callengdev: I also changed the library substantially from 0.0.3 to 0.0.5
20:39llasrammihneadb: Oh, yeah, for that one a somewhat-common idiom is ##(map #(-> [% %]) (range 5))
20:39lazybot⇒ ([0 0] [1 1] [2 2] [3 3] [4 4])
20:39mihneadb(into {} (map #([% %]) [1 2 3])) << this wasn't working
20:39gdevcallen, oh lol I haven't even set up my gitconfig upstream >_<
20:39mihneadbuh
20:39mihneadbok
20:39mihneadbthanks llasram
20:39callengdev: git remote add upstream git://github.com/bitemyapp/blackwater
20:40gdevcallen, danke ;D
20:41callengdev: I have the highest variance in code quality of libraries from early versions to later versions of anybody I know, you've really gotta keep up on those pulls while the library is still young.
20:42mihneadbllasram: and if I have two map results that I want to return as just one seq, what's the idiomatic way of doing it?
20:43llasrammihneadb: Not 100% certain what you mean. Maybe `juxt`?
20:43llasram&(map (juxt inc dec) (range 5))
20:43lazybot⇒ ([1 -1] [2 0] [3 1] [4 2] [5 3])
20:43mihneadbllasram: I'm looking for the equivalent of append in scheme, I guess
20:43mihneadb++ in haskell
20:43gdevcallen, yeah I went ahead and set up a cron job to pull every hour =D
20:44mihneadbllasram: concat!
20:44mihneadb:D
20:44llasramYep!
20:45callengdev: that's...scary.
20:45llasramInteresting
20:47dobry-denWhat's the best way to (File. _) a folder that's in the same folder as the jar that's accessing it?
20:47llasramdobry-den: Just put the file in the JAR to begin with, so you can access it as a resource?
20:47TimMcHere is a thing I don't understand: If I run (#(%foo) 5 6 7) at the REPL, I get the expected exception. (Three, actually.) If I then hit enter again, I see "567". Why?
20:48callengdev: so have you seen the current state of the code / docs?
20:48gdevcallen, grokking out right meow
20:49llasramTimMc: Must be some sort of buffering in your REPL. In nrepl.el, I get (Exception, Exception, 5, 6, 7, Exception)
20:49llasramWhich makes "sense" -- parse ends up in a funky state twice, sees 5 6 7 as separate forms, then exception again on the "unexpected" `)`
20:50llasramRight?
20:50dobry-denllasram: the idea is to drop blog.jar into a folder that also contains a 'posts' directory and it will serve them (markdown files)
20:50mihneadbis there some sort of pretty-print function in clojure? for json printing
20:50gdevcallen, yeah, where them doc strangs at?
20:50TimMcllasram: Yeah, *that* seems legit.
20:51llasrammihneadb: You can pretty-print Clojure data with clojure.pprint/pprint
20:51callengdev: well, they're not everywhere.
20:51callengdev: just in the important parts. look at the README. https://github.com/bitemyapp/blackwater
20:51mihneadbllasram: I d like to pprint json data
20:51gdevcallen, I'm gonna need them...everywhere
20:51callengdev: I have no problem doing that - but why?
20:51gdevcallen, wanted to use marginalia on it
20:51callenoh, margle-gargle.
20:52llasrammihneadb: cheshire's `generate-*` functions can take a `:pretty` option which pretty-prints the results
20:52mihneadbllasram: I was looking at data/json
20:52mihneadbthanks
20:52callenI'll do some more clean-up then.
20:52gdevcallen, I'm a maintainer of that liberry so I'm kinda biased ya know ;D
20:53callengdev: I didn't know that. I marg-i-nized Selmer :P
20:54llasramdobry-den: Hmm. Interesting. You can certainly use `io/resource` to get a `jar:` URL for a resource in your JAR. From there you could take the URL apart to find the path of the JAR
20:54llasramdobry-den: There might be a better solution though -- that seems relatively hacky
20:57cmatheson /exit
20:58gdevcallen, yeah I saw that =D
20:59gdevjuliangindi, are you Julian25 on github?
20:59juliangindiyes i am :)
21:01gdevjuliangindi, what about on 4clojure?
21:01callengdev: for the love of god, change the newlines to unix for `lein marg`
21:01Rayneslol
21:01callengdev: nothing pisses me off faster than, "fatal: CRLF would be replaced by LF in docs/uberdoc.html"
21:01gdevcallen, that will be in the next release at the end of the year #waterfall
21:02juliangindigdev: I'm juliangindi on 4clojure…just started
21:03callengdev: I might kill you.
21:03gdevRaynes, should I unassign you from this one? https://github.com/gdeer81/marginalia/issues/73
21:04callengdev: https://rawgithub.com/bitemyapp/blackwater/master/docs/uberdoc.html
21:04xeqidobry-den: are you running the jvm from the directory the jar is in?
21:04dobry-denxeqi: No
21:06dobry-denI found solutions to get the path of a jar using .getClass(). is there a class that's always present in a Clojure app that I can rely on to call ClassName.getClass()?
21:07callengdev: 0.0.6, marg docs are up.
21:08gdevcallen, it's so...so beautiful. :')
21:08callenit's one of the simplest libraries I've ever written. :|
21:08callenI don't see why everything needed a doc string.
21:08callenIt doesn't even really explain anything.
21:08callenIf anything needed explained, it's that damn robert.hooke magic.
21:08callenmost people won't understand wtf (add-hook ...) is.
21:09gdevcallen, that's not marg's fault, its up to you to make it understandable ;)
21:09callengdev: I'm just saying the literate approach isn't always the highest value thing in the world.
21:09Raynesgdev: Oh God yes please.
21:11mihneadbIf you only need AOT for your uberjar, consider adding :aot :all into your
21:11mihneadb:uberjar profile instead.
21:11mihneadbhow do I do this^ ?
21:11mihneadbI can't find a sample
21:11mihneadbonly found :uberjar-name
21:11TimMcIn your project map, add :profiles {:uberjar {:aot :all}}
21:11mihneadbthanks!
21:11TimMcor something like that?
21:12gdevRaynes, probably should close this issue since the lein plugin kinda obviates the need for a standalone command line version amirite?
21:12TimMcOr use lein-otf. :-D
21:12mihneadbTimMc: will look into it, thanks
21:13callenTimMc: pretty glad you made that :)
21:13gdev"otf is not a task, did you mean this? lein wtf"
21:13xeqidobry-den: clojure.lang.RT ?
21:15gdevcallen, well if you want it to be enterprise-ready it's gonna need a lot of documenstration =/
21:15TimMccallen: How do you find it useful?
21:17TimMcI wrote it mainly because I find AOT overcomplicating and distasteful, but I don't actually have a practical use for it.
21:20callenTimMc: I just like the option of it handy.
21:20callengdev: :|
21:22qz_is there any idiomatic way to process sequences with lookahead/skip? say i have list of strings and need to merge strings starting with 'A' with next string?
21:38TimMcqz_: Something with (partition 2 1 (concat [nil] ... [nil])) and treating the last element specially.
21:39qz_TimMc: but how do i skip element after merging?
21:39callenSelmer cheated by using an actual peek :P
21:41dobry-denxeqi: haha yes thanks.
21:41TimMcqz_: Or loop/recur with peeking.
21:42dobry-den(-> clojure.lang.RT .getProtectionDomain .getCodeSource .getLocation .getPath)
21:42callen,(-> clojure.lang.RT .getProtectionDomain .getCodeSource .getLocation .getPath)
21:42clojurebot#<AccessControlException java.security.AccessControlException: access denied (java.lang.RuntimePermission getProtectionDomain)>
21:42dobry-denhaha
21:42dobry-denjailed
21:48TimMcqz_: Did you understand the loop/recur suggestion?
21:53qz_TimMc: reading about loop/recur, never used it before
21:59dobry-denqz_: so you want ["Apple" "Ace" "Bonk" "Animal" "Ancient"] -> ["AppleAce" "AnimalAncient"]
22:01dobry-denI meant to add a "?"
22:01dnolendoing sensible async error handling in JS/Node.js looks comical in comparison to this - http://gist.github.com/swannodette/6385166
22:02dobry-denqz_: If that's what you want, check out partition-by (http://clojuredocs.org/clojure_core/clojure.core/partition-by) which will split a coll any time pred changes.
22:05dobry-dendnolen: tight
22:06dnolendobry-den: yep, you can just use <? to convert an async error into an exception locally
22:26dnolenupdated with some comments - http://gist.github.com/swannodette/6385166
22:27dnolenconverting async errors into exceptions looks like a sweet little pattern
22:52SegFaultAXValue of Values is just such a damn good talk.
22:53bbloomSegFaultAX: the new talk is out too: composition, design, & performance
22:58SegFaultAXbbloom: Yea, I watched it the other night.
22:58SegFaultAXbbloom: One of his more meta talks. Strange, but extremely enjoyable IMHO.
22:59bbloomyeah, saw it at clj/west, really liked it
23:04dobry-denHow can I do something like this? (let [person {:name "Chuck"}] (read-string "[:h1 (:name person)]")) -> [:h1 "Chuck"]
23:05TimMchttp://www.learndatalogtoday.org/chapter/3 suddenly introduces tuples, collections, and relationships all very suddenly. I was following the tutorial nicely up until that point.
23:06SegFaultAXdobry-den: You'll have to do eval. But why?
23:07TimMcSounds like someone wants templating with databinding.
23:07dobry-denYeah, that's it
23:07dobry-denSegFaultAX: thanks
23:08TimMcdobry-den: You probably do not want eval.
23:09TimMcWhenever you think you do, it's usually time to take a step back and think about how you've structured things.
23:09SegFaultAX(inc TimMc)
23:09lazybot⇒ 46
23:10crocketDoes clojure provide such modularity concept as OSGi and Jigsaw?
23:10dobry-denTimMc: Basically I'm writing a blog system like Jekyll where index.hiccup has access to a 'config' map so index.hiccup can just contain "[:h1 (:title config)]"
23:11SegFaultAXdobry-den: If you're creating templates that need to be eval'd as normal code, why not just use eg Selmer?
23:12TimMccrocket: Ask nDuff about OSGi, I think.
23:12crocketOSGi is tied to JVM.
23:12crocketClojure escaped JVM as ClojureScript.
23:14TimMcdobry-den: You'll also want to html-encode whatever value you get out of the data structure.
23:16TimMcI generally disrecommend hiccup because it does not HTML-encode values by default, which makes it unsuitable for general-purpose web development.
23:20ddellacostacan't get the basic first steps (http://palletops.com/doc/first-steps/) with pallet working. UnknownHostException ("ec2.ap-southeast-2.amazonaws.com")
23:20ddellacostaanyone have any experience with this? #pallet seems kinda dead
23:20SegFaultAXTimMc: Disrecommend? Is that a word?
23:20TimMcIt is when I use it.
23:21SegFaultAXHeh
23:21SegFaultAXddellacosta: I really have no idea how people use pallet.
23:21SegFaultAXThe documentation is less than worthless.
23:21ddellacostaSegFaultAX: and here I thought I was going to make my AWS shizzle all efficient and stuff
23:21SegFaultAXddellacosta: Ansible, yo.
23:22dobry-den,(let [x 1] (eval (read-string "(+ 1 x)")))
23:22clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
23:22dobry-denIt does not see x in that context.
23:23ddellacostaSegFaultAX: hmm, bummer, I was hoping to do this in Clojure. *sigh*
23:23SegFaultAXddellacosta: Totally not worth it IMHO.
23:23tbatchelli_mddellacosta: http://palletops.com/doc/faq/jclouds-aws/
23:24llasramdobry-den: AFAIK there's no way to e.g. `eval` with some sort of existing lexical context
23:24SegFaultAXThat's a good example of how useless the docs are.
23:24llasramdobry-den: If you want to define something in normal code which is then available in an `eval`ed form, you need to e.g. hang it off a var w/in a namespace
23:24SegFaultAXHaha, the comment on that page is amazing.
23:26SegFaultAXddellacosta: Anyway, the jvm startup time is just too damn slow when you're trying to rapidly iterate ops stuff.
23:26ddellacostatbatchelli_m: thanks, but it barfed again. It just doesn't seem smart enough to properly construct a ec2 URL
23:26SegFaultAXClojure makes for a really shitty scripting language. Ansible is really stupidly easy to get going.
23:27SegFaultAXOnce you grok the core concepts, it goes really fast.
23:27ddellacostaSegFaultAX: I'm slowly, painfully starting to agree with you
23:27ddellacostaI really would rather use Pallet
23:27SegFaultAXSource: I've been head down in Ansible for the last 2 weeks straight.
23:27SegFaultAXddellacosta: I wanted to as well. I mean not necessarily pallet, but at least something like it.
23:27SegFaultAXIt doesn't appear to exist.
23:28llasramSegFaultAX: I'm not sure slow JVM startup is really a factor.... I mean, e.g. Puppet and Chef use persistent daemons to do all the heavy lifting
23:28SegFaultAXAnd after using chef and puppet for years, I came upon the glory of Ansible. And I've been quite happy.
23:28SegFaultAXllasram: Ansible is push based.
23:28llasramSomewhat unconvinced that that's a selling point :-)
23:29SegFaultAXllasram: It's /a/ selling point. It also lacks the soul-crushing complexity of Chef.
23:29SegFaultAXAnd the documentation doesn't make me want to slaughter kittens.
23:30llasramhaha. Honestly haven't used Chef. Went with Puppet for semi-arbitrary reasons several years ago, and haven't had significant reason to re-evaluate
23:30SegFaultAXAnyway, Python is one of the de facto scripting languages in the ops world. Along with perl and bash. So it's a natural choice.
23:32llasramHmm. So the ansible model is essentially sets actions to take on sets of systems, vs the puppet/chef model of declarative state?
23:32SegFaultAXllasram: Puppet is a significant improvement over Chef, but it's still very very complicated.
23:32fkeyin clojurescript, is there a way to get at the parsed expression tree? i created a parser but was wondering if there is a more succinct way to do things...
23:33SegFaultAXllasram: Essentially yes, plays are just lists of tasks applied to sets of hosts.
23:33SegFaultAXllasram: With the (incredibly important) constraint that all operations are intended to be idempotent.
23:33llasramHmm. Interesting.
23:34SegFaultAXllasram: Also, if you really must have an agent based CMDB, ansible has a pull mode.
23:35SegFaultAXBut the default and most popular workflow is push based.
23:36llasramSegFaultAX: You've convinced me it might be of interest :-). I will definitely look more into it later
23:37SegFaultAXllasram: In fairness, if your infrastructure is already built around one of the other popular options (chef, puppet, salt, whatever) then whatevs.
23:37SegFaultAXBut for building out new infrastructures, the relative simplicity is a huge win.
23:38llasramSegFaultAX: Indeed (re: already built), but there is always The Future (tm)
23:48technomancyI could never get over the facepalm of having a completely new language to learn with puppet, even if the design is otherwise better than chef.
23:48SegFaultAXChef's DSL is equally wtf.
23:49technomancythe semantics are awful, but at least the syntax is widely understood
23:49SegFaultAXWell yea, I guess it's better that it reuses block syntax.
23:49SegFaultAXAnsible avoids both of those problems by using plain old YAML.
23:49llasramtechnomancy: In fairness, they tried to add an internal DSL version, but nobody used it, I assume because the external DSL is just much more compact.
23:51technomancyadding another option might be nicer when writing, but you still have to learn to read both
23:51SegFaultAXtechnomancy: What does Heroku use internally to manage infrastructure?
23:52cemerickYAML can be characterized as "plain old"? Hum.
23:53llasramtechnomancy: Eh. I think I'd prefer s-exps for everything at this point, but it's honestly not that much to keep around in your head.
23:53technomancySegFaultAX: chef is used for some really low-level stuff (thankfully nothing I have to touch) but we have another system similar to what we expose to customers for managing apps running on "raw" ec2 nodes
23:53SegFaultAXcemerick: Fair. Code = Data = Code is a feature for ansible.
23:53llasramNow that I've offloaded all spacial reasoning to GPS devices, I've got pleeenty of room for extra programming language syntaxes
23:54cemerickSegFaultAX: I was only saying, it's not like YAML is ubiquitous or something. XML or JSON or INI can be "plain old", but...YAML?
23:55SegFaultAXtechnomancy: Neat.
23:55TimMcWhy, back in my day...
23:55SegFaultAXcemerick: YAML is pretty common in the Ruby world.
23:55SegFaultAXParticularly in Ruby land.
23:55SegFaultAXErr Rails
23:56cemerickNot sure that counts for much.
23:56SegFaultAXcemerick: It's just a matter of perspective. I see yaml is being fairly common. In other spaces, other formats are more common.
23:57llasramTimMc: You had moose hides! Lucky you. In my day moose hadn't evolved yet and we needed to use mammoth hides, which of course you needed to shave first
23:57xeqicemerick: I don't think I've ever touched an ini. they can't be "plain old"
23:57SegFaultAXAnsible uses INI.
23:58SegFaultAXFor inventory files.
23:58fkeyD: (cljs.reader/read-string ... ) is exactly what i needed lol