#clojure logs

2013-03-17

00:00lynaghkRich_Morin: I don't think those directions are correct
00:00lynaghkRich_Morin: Clojure/West is happening downtown, in NW Portland. Your directions point to a hotel on the East side of the river.
00:02Rich_MorinYow - good catch!
00:03lynaghkRich_Morin: taking the train is a good idea, though--just make sure you take it over the river =)
00:13Rich_Morinhttp://pastie.org/6578249 - this looks better...
00:26bbloomlynaghk: https://www.refheap.com/paste/12649
00:26bbloomlynaghk: that's just one tiny example of some working rewrite combinators
00:27bbloomlynaghk: basically, any function that returns nil "fails" and then any other function that returns a map "succeeds" and then there is a big library of combinators made out of composing those pieces. things like rewrite until a fixed point, rewrite from the bottom up, rewrite from the top down, stop rewriting when some condition is met, etc
00:42bbloomlynaghk: decided to publish progress so far: https://github.com/brandonbloom/retree
00:46tomojshould be easy to write something that makes analyzer output less insanely huge?
00:46technomancytomoj: smaller defns? =)
00:46tomoj(rewrite &env (everywhere #(when (:env %) (dissoc % :env))))
00:46bbloomtomoj: :-)
00:46tomojexcept that's too naive..
00:47bbloom#(when (:op %) (dissoc % :env))
00:47technomancyif
00:47technomancyhttp://p.hagelb.org/9grin.gif
00:47bbloomtechnomancy: nah, it should be very clear that nil is being returned otherwise :-)
00:48bbloomanyway, there are conditional combinators too
00:48Raynestechnomancy: Psh.
00:48RaynesLinking to Christopher Eccleston.
00:48RaynesThat's Doctor Who heresy.
00:49bbloomsomething like: (everywhere (choice (contains? :env) #(dissoc % :env)))
00:49bbloomignoring the fact that clojure.core has contains?
00:49Raynestechnomancy: http://24.media.tumblr.com/829ff0fe4c6edff85f3371f409a87f4a/tumblr_mguw0yxEaS1s3s9i1o1_500.gif
00:50bbloomtomoj: i'm still learning how to work w/ these combinators, but i think there is one that is like everywhere top-down but stops when it does a rewrite, but continues for all siblings
00:51bbloomso it would eliminate :env from any AST form, but it wouldn't eliminate it from :info sub forms or anything like that
00:51bbloomhaven't wrapped my brain around all this yet :-P
00:51tomojlooks pretty cool
00:52bbloomtomoj: thanks :-)
00:52bbloomnotice the phase 2 of the master plan: https://github.com/brandonbloom/retree/blob/master/src/retree/core.clj#L6
00:52bbloominstead of returning functional combinators, i want all the non-primitives to return AST nodes
00:52bbloomand then i want an older version of retree to optimize the ASTs of newer versions of retree ;-)
00:52bbloommwahaha
00:53tomojI understood phases 1 and 3
00:54ambrosebsbbloom: looks cool! Where does this fit with the ASTs? Would a consumer use this to generate :children etc, like you suggested previously?
00:54john2xhow do I test ring sessions? I'm using lib-noir's noir.session with memory-store, and I can put!/get! in the handler, but I'm lost on how to get! the session atom in the test function.
00:54tomojthe AST would be your own invented AST?
00:54bbloomtomoj: basically: phase two produces an AST, which is just a tree of maps and then the "compile" function just produces a tree of function combinators. phase 3 would actually produce and compile code
00:54tomojor jvm.tools.analyzer-like?
00:55bbloomambrosebs: this is for any type of tree rewriting, especially ASTs :-) some examples include dead code elimination, deforestation, etc
00:55bbloomambrosebs: the kiama code base has some examples
00:56ambrosebsbbloom: Ahk sweet!
00:57bbloomambrosebs: would be awesome if we could do deforestation of (->> coll (map ...) (map ...) (reduce ...)) :-)
00:57bbloominlining, etc too!
00:58ambrosebs*looks up deforestation*
00:59bbloomambrosebs: short version: (-> (range 5) (map inc) (map dec)) is the same as (-> (range 5) (map (comp dec inc)))
00:59bbloomcan even go further and eliminate known pure functions like (comp dec inc) to identity
00:59bbloomand then (map identity) to identity
01:00ambrosebsbbloom: ah. I remember reading a Haskell paper on something like this.
01:00bbloomor to `seq i guess
01:00bbloom:-P
01:01callenbotanyone here work on message-passing stuff before?
01:01bbloomi was addressing lynaghk with this though b/c i think it will also be useful for his grammar of graphics
01:02bbloomand i have top secret evil schemes too ;-)
01:02tomojI see some semantic editor combinators in there, but not many paths
01:02bbloomhuh?
01:04bbloom(btw, clojure is sooo much less verbose than scala... ::hug::)
01:08tomojI mean, the (*-in [...]) style is only there in the leaf editors
01:10bbloomtomoj: still not 100% sure what you're saying... trying to say that there are some assoc, update-in, assoc-in, etc type functions that are missing? yes :-) phase ZERO is to reach feature parity with the kiama library... then i'll clojure-ize it more fully
01:11tomojno, I mean it just looks like a completely different manner of composition
01:16bbloomtomoj: you mean how it uses the #() syntax for the actual changes? yeah. that's sorta the point: clean interop with normal clojure code. shouldn't need to have a totally different standard library for transformations. although, there will be the most common stuff in there to simplify common patterns
01:17bbloomcould for example do (:require [retree :as rt]) then (rt/everywhere (rt/dissoc :env))
01:17tomojI just mean.. operations with semantic editor combinators tend to look like (op-in [lots of composition] #(some simple f %))
01:18tomojer, with SECs the op is always update
01:18tomojbut rewrite just takes a function
01:18tomojmaybe the application order is just different
01:19tomoj(I mean (op-in t ...) of course)
01:21bbloomtomoj: ooooh, you're talking about your lib...
01:21bbloomhaha dude, we were totally talking past each other
01:21bbloomwhat's the link to your lib again?
01:22tomojI think I refheap'd something once, I don't actually have a lib
01:24tomojI think I like building up a single rewrite strategy like you do better
01:28bbloomtomoj: not my idea :-P stollen shamelessly from the fine folks who work on kiama
01:30bbloomentertainingly enough, i stumbled across kiama when i was working on fipp, since they implement the same pretty pritner algorithm. however, they went with a lazy implementation, which is very awkward in an eager language like scala. i presume that kiama implemented the algo before the paper on the strict/generators approach was published
01:30bbloomre-stumbled upon it again this weekend while i was looking for a better way to do some rewriting
01:31bbloomand, even more entertainingly, they have attribute grammars too! which i was just talking about in here... but i didn't study their implementation yet: https://code.google.com/p/kiama/wiki/Attribution
01:32tomojhmm, #(rewrite (all (all inc)) %) == (update-in* % [all all] inc)
01:32tomoj(all (all inc)) solves one problem I posed today
01:34bbloomhim so what does (all (all f)) do ?
01:34bbloomhmm*
01:34bbloomi guess it does all children of all children?
01:34bbloomso rewrites down skipping a level?
01:34tomoj(= [[2 3 4] [5 6 7]] (rewrite (all (all inc)) [[1 2 3] [4 5 6]]))
01:34tomoj(if you add a vector? clause)
01:35bbloomyeah, the vector? clause is planned :-P haha
01:35tomojhttps://www.refheap.com/paste/5cec0e559e2d3519f5b7160ef
01:35tomojsome other problems I wrote down so far
01:36bbloomhmm, wanna think through them?
01:36bbloomby line number:
01:36bbloom#10 is just pass
01:36tomojdoes zipping have any place in retree?
01:36bbloom#13 is (all #(inc 3))
01:36tomojif not most of those will be irrelevant
01:36bbloomzipping as in zippers or as in (map x y) ?
01:37tomoj(map x y)
01:37bbloomyou could use down-up to zip and unzip
01:37muhoois there some way in clojurescript to introspect objects to find their methods/etc ?
01:38tomojOH, down-up?!
01:38bbloomhttps://github.com/brandonbloom/retree/blob/master/src/retree/core.clj#L191
01:38muhooit's really handy in clojure to be able to look in the repl to see wtf a java object actually is and what methods it has. it'd be great to have it in clojurescript for javascript
01:38tomojI was reading something about down/up recently
01:38tomojdidn't recognize it when I saw down-up
01:38bbloomtomoj: ?
01:38bbloomlol i have no idea that down/up was a thing, lol
01:38bbloomdown-up is basically pre AND post fix
01:39bbloomer pre and post traversal
01:39tomoj"continuations and transducer composition"
01:39tomojmaybe it's just a coincidence
01:40bbloom*gulp* heady title right there, haha
01:40bbloomWHAT HAVE I GOTTEN MYSELF INTO!?
01:40bbloom:-P
01:40tomojprobably not the same thing
01:40tomojwell shit everything is the same thing
01:40bbloomhaha
01:40bbloomwell, transducers are like reducers with state
01:41bbloomin theory, you can store state in the tree via down/up
01:41bbloomie you add a state accumulator and then remove it when you're done
01:41bbloombut i'm sure there is a better/different way
01:42bbloomi also want to have every combinator automatically record rewrites into metadata
01:42bbloommaybe optionally
01:43bbloomthis way, you could have an after-the-fact debugger
01:43bbloomyou could step-backwards through the rewrites :-)
01:43bbloomcould have an undo combinator too!
01:44tomojhmm
01:45bbloomi'm also thinking about how to handle dynamic restarts of rewrites. ie if something external changes the tree, can you cause the rewrites to restart from wherever they depended on the data that changed
01:45bbloomno idea if that is feasible or not
01:46tomojif that works, almost fully compiled down to raw DOM, with this thing optimizing itself..
01:46tomoj:)
01:47bbloomtomoj: hahaha shhhh you're extrapolating from my other projects
01:48bbloommy secret evil master plans must stay secret for a bit longer!
01:49tomojI wouldn't be surprised if we wind up faster than some popular bare-metal-optimized js libs
01:52bbloomyeah, it's actually quite amazing how much persistent data structures buys you
01:52bbloomkiama does an absurd amount of copying to do it's rewriting
01:53bbloomand then it has this weird "same" function that attempts to do reasonable equality, but without immutability, there is no reasonable equality
01:53tomojhave you read any of the generic programming literature around folds/traversals?
01:54bbloomno
01:54tomojoh, well, it passed before my eyes, not sure I can say I read it. feels very related to kiama though
01:57tomojwhich protocol will be the basis for all/one?
01:57bbloomhuh?
01:57bbloomoh, you mean for identifying "children"?
01:57tomojI mean, will it just be a closed dispatch like clojure.walk? or will there be a protocol?
01:57tomojyeah
01:58bbloomi dunno yet
01:58tomojand rebuilding
01:58tomoj?
01:58tomojI think that might be the same protocol I've been trying to think of lately
01:59bbloomhere's the kiama Rewritable trait: https://code.google.com/p/kiama/source/browse/src/org/kiama/rewriting/Rewritable.scala
01:59bbloomit basically is closed dispatch for standard case classes, tuples, maps, seqs, etc
01:59bbloomand then if you have a custom type & want it to be rewritable, you inherit that trait
02:00bbloomit's basically count/seq/into
02:00tomojIReduce and IEmptyableCollection aren't enough?
02:00bbloomdunno yet, i punted on even the vector case for tonight
02:01bbloomwill revisit after clojure/west
02:02bbloomone other thing to consider is that you may have a tree of maps where each map has a :children key and you might want to somehow override (ie dynamic var) the tree navigation
02:02bbloomfor example, consider Raynes' laser
02:02bbloomit operates on XML nodes which have attrs and content
02:03bbloombut i think it might be sufficient to say "OK, just don't use the everywhere combinator inappropriately" and not allow customization of children relationships
02:03bbloomdunno yet
02:04tomoj(partial fixed-point (comp all (at :content))) ?
02:04bbloomsomething like that
02:04bbloomi'm past the point of thinking though, so i'm gonna go to bed. you gonna be at the conference?
02:05tomojno :(
02:05tomojnext year
02:05bbloombummer :-/ oh well, then we'll chat about this next week sometime when i get back to it
02:05bbloomgnight all
02:09tomojthanks for releasing retree
02:10tomojnot bblöom: is the rate at which a dynamic value (!) will be sampled a reasonable use of metadata?
02:10tomojI hardly use metadata except for vars and type-hints since I usually decide that it should really just be data
02:44hiredmanbbloom: kiama looks a lot like zippers
02:47hiredmanat least the traversal and tree rewriting bits, the main thing lacking when using zippers for rewriting is the sort of repeated pattern matching
03:43drorbemet
03:49Raynes
05:18holohi
05:20mzelinkahello
05:21holohow do i find which lib uses x dependency? i know x, but i can't use lein deps :tree, because x artifact cannot be downloaded
06:08carloccishould I use openjdk or oracle?
06:09carlocciI don't care for the license, but I actively dislike the prince of darkness
06:33NeedMoreDesuCan I get future's thread?
06:34Hali_303hi! is there a function similar to eclipse's "organize imports" in emacs?
06:36scottjHali_303: I don't think so, but maybe checkout slamhound
06:37scottjcarlocci: most things work fine on both
06:38Hali_303scottj: looks interesting,t hx!
06:40NeedMoreDesuI want a way to check if some future is current thread.
07:15pdmctHi, can someone help me understand what is happening with the following?
07:15a_runhi, a newbie to clojure
07:15a_rundo i need JDK to use clojure or is JRE enough ?
07:16pdmctI am trying to map a map into a function but I can't understand what is happening to my data structures'
07:17pdmctHere is the code: (let [data (get @events (first (keys @events)))] (log/info "draw1" (apply str (concat "events:" @events))) (log/info "draw1" (apply str (concat "key: " (first (keys @events))))) (log/info "draw1" (apply str (concat "data: " data))) (unify data (fn [{:keys [host service metric ranges measures markers]}] (log/info "draw2" (apply str (concat "host: " host "service: " service "
07:17xeqipdmct: can you use refheap.com or make a gist?
07:17pdmcthmm, sorry that doens't look do good
07:17pdmctok
07:18xeqia_run: I believe you only need a jre for clojure itself
07:18a_runxeqi: thanks
07:19pdmctok, here is the code and the output https://www.refheap.com/paste/12654
07:20pdmctI don't understand why data is the way that it is -- it looks like a list of vectors
07:22pdmctI should add this is actually clojurescript
07:23xeqi&(concat "data: " {:x 1 :y 2})
07:23lazybot⇒ (\d \a \t \a \: \space [:y 2] [:x 1])
07:23xeqi&(apply str (concat "data: " {:x 1 :y 2}))
07:23lazybot⇒ "data: [:y 2][:x 1]"
07:23xeqiwhen you do the concat to print it out it converts from a map to a seq of key value pairs
07:24xeqi&(apply str "data: " {:x 1 :y 2})
07:24lazybot⇒ "data: [:y 2][:x 1]"
07:24xeqi&(str "data: " {:x 1 :y 2})
07:24lazybot⇒ "data: {:y 2, :x 1}"
07:24xeqithere we go
07:24xeqipdmct: ^
07:25pdmctxeqi: ok, thanks ... this has sidetracked me -- I'm not getting any value for host and service -- which is why I have the logs -- and I am not sure why
07:26pdmctxeqi: I don't really understand what (fn [{:keys [host service ...]}]) is doing -- and it doesn't seem to work
07:27xeqiwhere does `unify` come from?
07:27xeqicore.logic?
07:27clojurebotidiomatic clojure uses dashes to separate words
07:27xeqiclojurebot: thanks, you're awesome
07:27clojurebotI'm no man, and she's no lady!
07:27pdmctxeqi: no a visualisation framework C2 (clojurescript) -- I think it is basically does (unify data f) -> (map f data)
07:29pdmctxeqi: I don't fully grok how the functions arguments are extract from the map (data)
07:30xeqiyou don't need unify/map here
07:30xeqiyou could just call the function directly
07:31xeqi&((fn [{keys [x y]}] [x y]) {:x 1 :y 2})
07:31lazybotjava.lang.RuntimeException: Unable to resolve symbol: x in this context
07:31pdmctxeqi: I know it only has one element in the map -- once I get it working the map will have many
07:31xeqi&((fn [{:keys [x y]}] [x y]) {:x 1 :y 2})
07:31lazybot⇒ [1 2]
07:33xeqithe :keys destructuring looks at the keys in the map argument and binds the symbol of those keys to the corresponding value in the map
07:33pdmctxeqi: I don't undertstand how that works, is it positonal or does :x map to x ?
07:33xeqi:x maps to the x symbol
07:33xeqi.. the value of :x in the map get bound to the x symbol
07:33pdmctok, thanks
07:34pdmctso looking at the code -- if (unify data d) is actually (map f data) -- can you see why the values for host and service are nil?
07:35xeqibut right now with the (unify data ...) it tries to (map ... data), which converts the data map datastructure into a seq of k/v pairs
07:35pdmct*d f
07:36xeqi.. simplified examples of whats its doing:
07:36xeqi(map (fn [x] x) {:x 1 :y 2})
07:36xeqi&(map (fn [x] x) {:x 1 :y 2})
07:36lazybot⇒ ([:y 2] [:x 1])
07:36xeqivs
07:36xeqi&((fn [x] x) {:x 1 :y 2})
07:36lazybot⇒ {:y 2, :x 1}
07:38xeqipdmct: you could either remove the unify/map and call it directly, or make (get @events (first (keys @events))) return a vector of maps
07:38pdmctok, got it ... map applies the fn to each element of the map
07:38Glenjaminhi everyone, i'm using a lib that uses clj-http for oauth, and it's not quite working - is there a way to get debug output from a library i'm calling?
07:38xeqipdmct: each key value pair
07:38pdmctso I could just wrap it in vec?
07:38pdmctxeqi: yes, thats what I mean by element a K,v pair
07:39xeqiI'd do what makes sense for the data model, does an event have multiple data points?
07:40pdmctyes @events will be a map of "name" : {event data} pairs
07:43xeqiI'd prolly do something like https://www.refheap.com/paste/12655
07:44xeqiGlenjamin: thats going to be specific to the library
07:45Glenjaminit doesn't look like it's got anything built-in
07:45Glenjaminin other dynamic languages i'd probably usually open it up and hack in a debug output line
07:45Glenjaminor monkey-patch something
07:45Glenjaminor use a stepping debugger
07:46Glenjaminany of those doable in clojure?
07:47xeqihacking debug output difficulty will depend on your setup, not too difficult using nrepl.el and a repl, but would be harder for others
07:47pdmctxeqi: k thanks ... will give it a try
07:47xeqimonkey-patching is doable with &(doc with-redefs)
07:48xeqior the robert.hooke library
07:48xeqi&(doc with-redefs)
07:48lazybot⇒ "Macro ([bindings & body]); binding => var-symbol temp-value-expr Temporarily redefines Vars while executing the body. The temp-value-exprs will be evaluated and each resulting value will replace in parallel the root value of its Var. After the body is executed... https://www.refheap.com/paste/12656
07:48xeqiritz or eclipse has a stepping debugger, but I've not used them yet
07:51Glenjamincould you give me some pointers on hacking debug output in with the repo?
07:51Glenjaminrepl even
07:53xeqiGlenjamin: with nrepl.el you can M-. into the source of what you're calling, edit it, and C-c C-k to compile that file and use the debug version. In a pure repl I think you'd have to manually (in-ns ...) and then you should be able to (defn ..) the function you want to change, though could require a lot of copy paste
07:54Glenjaminah, i see
08:04Glenjaminxeqi: managed to get somewhere with in-ns and def on the repo, cheers!
08:04Glenjamindamn autocorrect s/repo/repl/
08:06tickingany thoughts on how to idiomatically update multiple subpaths of a nested datastructure at once? say (update-in {:a [{:b 1}, {:b 2}]} [:a n :b] inc) -> {:a [{:b 2}, {:b 3}]}, problem is zippers don't work with maps, update-in only works on one path, tree walkers don't have the appropriate information at walk time, and deconstructing an entirely new datastructure while updating at the same time is tedious and error prone ^^
08:08ambrosebsticking: you mean update them simultaneously with the same function?
08:08tickingambrosebs yeah
08:09ambrosebsticking: I often use the (-> map (update-in [:a] fn1) (update-in [:b] fn2)) idiom, but it's not "simultaneous".
08:11tickingambrosebs, the above would also only work on a flat non nested map if I see this correctly
08:12ambrosebsticking: not sure what you mean.
08:14tickingambrosebs the code updates two elements of the map on the top level, say on a structure like {:a 1:b 2}, while the above data structure is nested {:a [{:b 1}, {:b 2}]}
08:16mpenetyou can use for + reduce with an update in fn
08:16mpenetex: (reduce (fn [path] (update-in map path) )(for [x xs y x ...] [x y]) map)
08:17mpenetnot quite, my example is a bit wrong (the trailing map), but you get the idea
08:17mpenetcgrand wrote something about that a couple of years ago
08:21banisterfiendhi, does anyone here know about lighttable? i know it's written in js/html5 but it's in a webview, what's the framework? cocoa? qt?
08:23mpenetambrosebs: I managed to get check-ns to hang for a very long time (minutes, with jumps to 100% cpu), I tried to quickly annotate a very small project with few deps to isolate the issue, but same result. Could you have a look? https://github.com/mpenet/knit/tree/typed
08:24tickingmpenet, so you're basically iterating all paths at once?
08:25mpenetyou construct a vector of path with for, then use it with reduce to apply update-in to your original map
08:26tickingmpenet, I see thanks, sounds like an interresting approach
08:26mpenetwell my example work with assoc-in, not update in, you would need to construct vectors or args to update-in, but same thing
08:26mpenet[[:foo :bar :baz] inc 1] etc
08:26carlocciscottj: thanks
08:27mpenetcgrand post was "flattening reduce", same approach for a different problem
08:27mpenethttp://clj-me.cgrand.net/2010/01/19/clojure-refactoring-flattening-reduces/
08:30ambrosebsmpenet: are you on master?
08:30mpenetambrosebs: "0.1.7"
08:30ambrosebsI've probably fixed this, try 0.1.8-SNAPSHOT.
08:31mpenetI'll give it a try
08:31ambrosebsYou'll need to lein install it.
08:31mpenetnp, I have a local copy for greping around :)
08:31ambrosebsmpenet: It's a bit unsatisfying. What's actually happening is that jvm.tools.analyzer evals each form after analysing it, and it evals check-ns infinitely.
08:32mpenetquite funny
08:32ambrosebsmpenet: It sucks, but that's the only way I can figure out to make sure require's and use's are actually run at the right time during analysis.
08:33mpenetright
08:33ambrosebsmpenet: I've added a flag that tracks which namespaces are currently being checked, and to just return if already in progress.
08:33mpenetit seems to work now, thank
08:33mpenets
08:33ambrosebsmpenet: great
08:34ambrosebsmpenet: I'll release 0.1.8, that's a pretty critical fix.
08:34mpenetyep, good idea
08:34ambrosebsmpenet: I'm in the middle of adding fn keyword argument support :)
08:34tickingmpenet, ah I see, thanks that should do the trick ^^, I wonder why noone has wraped that in a macro
08:36tickingbanisterfiend, what do you wanna do? It doesn't seem written in qt the dylibs normally associated with qt are missing
08:36ambrosebsmpenet: does core.typed noticeably increase startup time for your app?
08:36mpenetambrosebs: I noticed about kw args, I am waiting for it.
08:37mpenetabout startup time, mostly the reflection warnings slow things a little, but no big deal
08:37tickingbanisterfiend, it looks like they use https://github.com/rogerwang/node-webkit
08:37mpenetambrosebs: other than that, I don't really care since this happens at compile time anyway. As long as it is not incredibely slow
08:38ambrosebsmpenet: I'm really not too sure how slow it is. I don't know how to AOT compile core.typed either.
08:38ambrosebsmpenet: good to hear anyway.
08:39mpenetambrosebs: on knit, it's barely noticable, on hayt or alia it could be different, but I havent managed to successfully run check-ns on them yet, I am just using the repl and dummy fns until recently
08:39carlocciI would like to try out clojure: what is a web framework I can dabble in?
08:41carlocciI was reading about noir, only to discover it as somehow deprecated
08:42jonasaccarlocci: there is something called http://www.luminusweb.net/
08:42jonasacit uses lib-noir i think
08:43jonasacbut just mixing and matching the libraries you need is pretty straightforward compared to other languages :)
08:45carloccithanks, I'll check it out
08:45mpenetambrosebs: I just realized I made a tons of error with HMap, and should use APersistentMap instead most of the time, again ann.clj is really helpfull to understand how things work.
08:45carloccijonasac: what do you mean, compared with other languages?
08:46carloccithe problem is that I would like to learn the language as I go, so I think a little bit more constriction would be helpful in the beginning
08:51ambrosebsmpenet: There's also a common misunderstanding with Seq*, Vector* vs. ISeq and IPersistentVector. You almost always want the latter.
08:51mpenetambrosebs: yup, took me a while to get that too
08:52ambrosebsIt's not really documented anywhere unfortunately.
08:53clojure-newHello, i have to files: proj.core and proj.util, how can i use proj.util from proj.core?
08:53clojure-newproj.util defined like that (ns proj.util) (defn...)
08:54thm_proveris there a language, embedded inside of clojure, that (1) does not have access to Java, (2) is similar to Clojure, and (3) has lightweight coroutines? (i.e. does not require an entire java thread)?
08:54clojure-newWhen i trying to (ns proj.core (:use proj.util)) i'm getting file not found exception.
08:56markmcconachieHey, any recommendations for learning materials for clojure?
08:57mpenetambrosebs: am I missing the obvious here? https://gist.github.com/mpenet/854ebc2a644fd68f77a7
08:58ambrosebsmpenet: that's core.typed being a bit too strict.
08:58clojure-newIt's a leiningen genrated project.
08:58ambrosebsmpenet: Perhaps casing :a to a Keyword might help?
08:58mpenetambrosebs: but even if I use an union of values, it seems to fail
08:58mpenetkeyword returns the same error
08:58ambrosebsok I'll have a look.
08:59mpenetambrosebs: I was trying it here: https://github.com/mpenet/knit/blob/typed/src/qbits/knit.clj#L18
09:00mpenetahhh, maybe I need to namespace qualify it? since it's declared in another ns?
09:00mpenetwell, no it would work on my short example :/
09:01ambrosebsmpenet: is it important to know that looking up :ns gives you a NANOSECOND, rather than a TimeUnit?
09:01mpenetambrosebs: I want to restrict the possible values, and I would have to reuse this on kw args later
09:01ambrosebsrestrict which values?
09:01mpenetthat's why I didn't go for HMap (if I understand)
09:01mpenetkeywords
09:02mpenetno I don't want to check that :ns = TimeUnit/NS, just that the user doesnt use nanosec
09:02mpenet:nanosec
09:03ambrosebsRight, you probably want '{:ns TimeUnit, :us TimeUnit, ...}
09:03mpenetambrosebs: that's what I tried to say earlier, I will need this alias on kw args in another function later
09:04mpenetthat is why it is not a HMap
09:04clojure-newOh, i see. I can't use '-' in filenames. (ns bla-bla) => bla_bla.clj
09:04mpenetin the schedule fn
09:05clojure-newIs there workaround for that? Sinc it's ugly to have underscores in anything.
09:05ambrosebsmpenet: you've lost me. :/
09:07corecodeclojure-new: i think that is related to the jvm
09:08clojure-newcorecode: Yeah, i think so too, but i don't know how to fix it.
09:08corecodedon't
09:08corecodeaccept it
09:08corecodemove on
09:09john2xhow do I test a Ring handler that requires authentication?
09:10gfredericksauthenticate with it? or use (with-redefs ...) to stub your auth function if you don't want to test that.
09:10gfredericks(with-redefs [authentic? (constantly true)] ...test the other stuff...)
09:11Glenjamindoes anyone know of an easy way to generate an absolute url from a ring request map?
09:14Glenjaminaha, full url is in ring.util.request-url
09:15tickingmpenet, looks like this approach only works properly with statically known indices, not when they are calculated from the size of a vector for example
09:26jimkcarwhere does the contrib zip-filter library now live?
09:30tickingjimkcar, clojure.data.zip?
09:32tickingjimkcar, https://github.com/clojure/data.zip/ and in case of doupbt http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go it contains a list of what migrated where ^^
09:56_tornhi - question about sequential destructuring
09:56_tornwhy would you want to use ":as foo" when you can just refer to the thing you're destructuring from?
09:57_tornI mean, :as creates a local binding -- but why is that useful?
09:57jjttjjif the thing you're binding is a longish expression?
09:58_tornah right
09:59jjttjjand to not repeat yourself in general i guess. Like, the same reasons you would be binding the thing in the first place, but not you can do that and more in one compact line
09:59xeqijohn2x: it sounds like you might want a cookie jar, I'd recommend looking at https://github.com/xeqi/peridot or https://github.com/xeqi/kerodon
10:00_torndoes :as always grab the whole thing?
10:00jjttjjyup
10:01jjttjj_torn: this always was extremely useful for me getting used to destructuring: http://blog.jayfields.com/2010/07/clojure-destructuring.html
10:02_tornthanks for the link
10:03john2xxeqi: cool, thanks! curious, why make the 2 of them? at a quick glance, they seem to be very similar. (I think I'll go with peridot)
10:04xeqijohn2x: peridot adds a cookie jar and a couple other nicities on top of ring-mock
10:04xeqikerodon adds html parsing and interaction like a human
10:04xeqiperidot is better for api level stuff, like a edn or json api
10:04xeqisince its not html based
10:06john2xah got it. it seems peridot is exactly what I'm looking for.
10:06Glenjaminis there a guide to "idiomatic" indentation for clojure somewhere?
10:07borkdudeGlenjamin yes: https://github.com/bbatsov/clojure-style-guide
10:07Glenjaminexcellent, thanks
10:07borkdudehow do you add an entry like ~style ?
10:08borkdude~anyone
10:08clojurebotanyone is anybody
10:08borkdude~anybody
10:08clojurebotanybody is anyone
10:08borkdudelol
10:08borkdude:)
10:08xeqiclojurebot: style is https://github.com/bbatsov/clojure-style-guide
10:08clojurebotIn Ordnung
10:08xeqi~style
10:08clojurebotstyle is https://github.com/bbatsov/clojure-style-guide
10:09borkdudexeqi tnx
10:09xeqihmm... not sure if thats the right way, but it seemed to do something
10:10jonasendnolen: ping
10:17jimkcar@ticking thanks. that was it.
10:21tickingjimkcar, np ^^
10:21ScorchinWhat's the recommended way to create functions that take optional parameters? e.g. (get-users) and (get-users 12)
10:23skelternet(get-users [] (blah blah ) [numusers] (blah blah blah)) ?
10:23tickingScorchin I'd probably go with a multibody function (fn ([] 0) ([n] n))
10:24Scorchinthanks
10:24dnolenjonasen: pong
10:25jonasendnolen: anything that I need to do to get the core.logic.unifier patches applied?
10:26jonasenor have you not had time to look at them yet?
10:26dnolenjonasen: nope, they look good. Just want to cut 0.8.0 first
10:27dnolenthen I'll apply it, and see if there are other similar fixes that should go into 0.8.1
10:27jonasendnolen: ok. I tought you released that already
10:27dnolenjonasen: no not yet.
10:28Glenjamincould someone help me out with laying out this macro? I can't figure out how to make it readable! https://gist.github.com/glenjamin/548670fe5855c7943d81
10:28jonasendnolen: I'd like to release my new lib to clojars but I'll wait for 0.8.1 as it depends heavily on the unifier
10:31dnolenjonasen: new lib looks cool
10:33skelternetGlenjamin: I got nuttin' for the formatting.
10:33jonasendnolen: I'm very happy with how it turned out. It'll replace the kibit rules as it is much more powerful. No more need to write monstrosities like https://github.com/jonase/kibit/blob/master/src/kibit/rules/misc.clj#L65
10:33skelternetGlenjamin: I think it is as readable as is
10:34skelternetGlenjamin: unless we can break that function out some how.
10:36Glenjaminskelternet: that's what i'm wondering, it feels like i'm doing too much in the let binding
10:38edwGlenjamin: I just commented. It seems like the code that is supposed to simplifies things just makes things more complicated.
10:39Glenjamindoes the binding resolve to the original function?
10:39Glenjamini just assumed doing that would recurse and break >.<
10:40edwThe value is evaluated beforehand.
10:42edwI just commented again. In general you should do as little work in the macro proper.
10:42dnolenjonasen: hehe, that's good to hear :)
10:43edwGlenjamin: You could even put the LET over the LAMBDA, er, DEFMACRO.
10:44Glenjaminthats much clearer!
10:45edwGlenjamin, thanks, but you should also make sure it works.
10:46Glenjamini can follow what's going on nwow - so should be able to sort it
10:46Glenjaminwill probably pull the map out as its going to get more complex when i change insecure to a custom truststore
10:48Glenjaminhrm, thats infinitely recursing
10:52edwGlenjamin: One more try in your comments.
10:59Glenjaminedw: getting issues when using the macro now, i've updated the gist to something that'll run the the repl
10:59ScorchinAnyone used betamax to mock clj-http requests? If so, do you know how you're supposed to handle 'accept' headers? e.g. my clj-http request looks like this: (client/get url {:accept :json})
10:59Glenjaminit says this: IllegalArgumentException No matching ctor found for class http$eval332$f__333 clojure.lang.Reflector.invokeConstructor (Reflector.java:163)
11:00ScorchinMy betamax mock works fine without the {:accept :json}, but I'd like to provide the accept header
11:02edwGlenjamin: your original post function takes zero arguments.
11:03edwAlso, with your http-extras, the ^:private is annotating the value and not the var.
11:21Glenjaminedw: sorry to keep bugging you, but i don't really understand what the No matching ctor error is trying to say - i've fixed the things you mentioned, but still getting that error when calling the macro
11:22Glenjaminare the vars in the let binding available in the scope of the expanded macro when used this way?
11:23edwLet me check something out…
11:27Glenjaminyeah, seems to work when i move the let back inside the macro expansion
11:32edwGlenjamin: please consult my latest comment.
11:33Glenjaminedw: awesome, makes sense
11:34Glenjaminany idea why it can capture orig-http, but not f?
11:36edwGlenjamin: I updated it yet again, just to show it in action.
11:40jjidojjttjj: I saw this link you sent earlier about destructuring
11:40jjido(let [{the-x :x the-y :y} point]
11:40jjido (println "x:" the-x "y:" the-y))
11:43jjidoI like how it reads. Makes me think the syntax I use in my language may not be as readable. Are there downsides to the syntax?
11:54Glenjaminedw: weirdly, when i tried that latest version, it didn't work with the real http/post - works with the let inside the macro and is still pretty readable, so going to stick with that
11:55Glenjamincheers for all the help!
12:08bbloomhiredman: kiama relies on scala's pattern matching by type. my plan with retree is to omit pattern matching entirely from the base library, so that a pluggable pattern matching system can be used
12:09bbloomhence my questions about the nth exceptions with destructuring.... i kinda wish it didn't do that, so that there was a cheap free when-let style pattern matching baked in... *shrug* oh well
12:10bbloommy thought is that there are other useful syntaxes for patterns, such as CSS selectors or XPath queries that can be encoded as EDN and plugged into retree
12:10bbloomdepending on the type of tree you're rewriting
12:12ravsterhello all
12:32clojure-newDoes clojure.jdbc provide sql injections protection?
12:33clojure-newwith-query-results results ["select * from bla where ?" evil-code]
12:33clojure-newIs it secure?
12:37tomojclojure-mode's indentation of hiccup bugs me
12:48augustlanyone got a favorite "getting started with Clojure repls in emacs" article? :)
12:51tickingaugustl, the nrepl.el github page has a list of all the commands^^https://github.com/kingtim/nrepl.el
12:51tickingaugustl, also if you are a newcomer to emacs I highly recommend emacs-live it's a pretty good emacs starter kit
12:52tickinghttps://github.com/overtone/emacs-live all you do then is go to your project do an M-x nrepl-jack-in
12:54tickingand then you get your regular repl, like your used to know, or you can evaluate forms in files via C-M-x and other various commands ^^
13:03augustlticking: thanks :)
13:04augustlswank is the old one, and nrepl is new and shiny, right?
13:07tomojbbloom: it occurs to me that the parts of the one/all protocol I was thinking about are basically the children/make-node arguments to zipper
13:09tomojI wonder if it's a coincidence that both things are called "zipping" -- given zippers a b you can implement (map f a b)-style zipping?
13:12tickingaugustl, yes, nrepl.el uses clojures nrepl facility directly
13:17augustlinside a -main function invoked via "lein run", is it possible to read out the leiningen environment somehow?
13:17augustlwhat I really want to do: start a nrepl server in that main function when I'm starting with "lein run" and the development profile, but not when running it with java -jar
13:18tickingaugustl you could simply run it by lein repl
13:18tickingand then M-x connect-nrepl
13:20tomojanother workaround would be to have two -mains in two namespaces and set :main to the repl one in the dev profile?
13:22tickingyeah right repl won't start the main
13:22tickingsorry, wait a sec
13:23augustlticking: I want to connect to a repl that lives inside an existing process, not a "lein repl" process
13:23augustltomoj: trying to figure out how to call a -main from another -main :)
13:23tickingaugustl yeah right
13:24augustlI guess it's easier to put the actual call to a separate function and call that from both -main functions
13:24tomoj:injections [(require 'com.example.foo)] :repl-options {:init (com.example.foo/-main)} ?
13:25tomojwhy care whether it's a "repl" or "run" process, as long as it's running your -main?
13:25augustlyay, epheremal ports works
13:26augustltomoj: the problem was that my current -main contains lots of logic, that I would need to invoke from the other -main for dev. But putting the logic elsewhere makes more sense
13:26tickingyou could also use clojure.main with the --repl flag and a --main provided
13:27tickinghttp://clojure.org/repl_and_main
13:27tomojhmm, is that how you use :injections?
13:27tomojor would you just do {:repl-options {:init-ns com.example.foo :init (-main)}}
13:27ticking*but I don't know how that would work out ^^
13:29augustlI think it's better to just have two different mains with no logic other than dispatch
13:29augustlwhere the "main" main only starts the system, and my dev main starts a repl, the system, and whatever
13:35augustlis it possible to have nrepl in emacs automatically reconnect?
13:38tickingaugustl, as in disconnect then reconnect?
13:38tickingfor your case I don't think so
13:38tickingyou could though write an elisp function that polls that for you ^^
13:39tickinghttps://github.com/kingtim/nrepl.el/pull/56
13:39tickinghrm
13:49augustlI guess I'll rarely stop the repl process when doing actual dev
14:01augustlhow can it be that simply importing something causes side effects? Importing org.lwjgl.opengl.Display causes a box to appear in the OS X dock, even if I don't call anything.
14:03augustland no, I don't have any (def foo 123) that could cause side effects when compiling :) All my calls are inside a function
14:25bpraugustl: i don't know what's necessarily going on in your particular case, but I've found that importing anything that depends on java.awt.* will cause the dock (app switcher) to show a generic application icon
14:28bpraugustl: for cli apps (or libraries) i've found that putting ["-Djava.awt.headless=true"] into your :jvm-opts in your project file can fix that
14:28bpraugustl: if your app does need a GUI, i'm not sure if that will work. I've nvr tried it
14:32augustlbpr: ah, that's probably it then. I guess lwjgl uses awt to draw the window
14:32augustlbpr: the gui will load even if I just start a "lein repl" :)
14:32augustlso it's a bit annoying..
14:32bpryup
14:33bpri've had it pop up during a build (ie. lein uberjar).
14:38augustlon a slightly related note, anyone got a opengl library for the JVM to recommend? lwjgl is good enough, but much larger than what I need (I only need OpenGL itself)
14:50augustlrefs lets you do coordinated writes to multiple refs. Is there also a way to do coordinated reads from refs? If I sequentially read @foo, @bar, @baz, I might values from different transactions/writes, right?
14:50augustls/sequentially read/sequentially deref
14:51jjjddd0Hi all, what is the recommended session middleware for a luminus app? There are lots of middlewares avail. out there but I don't really understand what is different about them ?
14:53jjjddd0Eg. ring/wrap-session, noir.session, sandbar/wrap-stateful-session... etc
14:53augustlwhat's a luminus app?
14:54ravsterwhat do they mean by "post-order traversal of form" in the docs for a post-walk?
14:55augustljjjddd0: I use the build-in session stuff in ring, if that helps ;)
14:56jjjddd0augustl: thanks! http://www.luminusweb.net/
14:59augustljjjddd0: I use cookies for session storage, too
15:09edtsechjjjddd0: luminus uses lib-noir internally, you can use noir.session http://yogthos.github.com/lib-noir/noir.session.html#var-get-in
15:10jjjddd0edtsech: thanks! I just realized that the luminus site had a lot more documentation that I though
15:14tyler__i just had the realization that url query string are a lot like logic programming e.g. http://example.com/some/resource/where?a=1&amp;b=2
15:14tyler__looks a lot like [:find ?a ?b :where [1 ?a] [2 ?b]]
15:14tyler__wonder if i can take that somewhere
15:18tomojhow do you represent [?a :foo ?b]?
15:26smnirvenanybody out there use crypto-password?
15:28dnolenjonasen: ping
15:30smnirvenanybody else trying to get crypto-password 0.1.0, and finding that there's only a snapshot version on clojars?
15:33jonasendnolen: hi
15:37dnolenjonasen: patch applied! as far as LOGIC-118 I think prep* should be fixed.
15:40jonasendnolen: I thought prep* should only handle ?x and (foo bar . ?y) and relying on walk-term to do the actual tree walking
15:51dnolenjonasen: prep* takes any expression, so I think it should handle it
15:51Glenjaminhi guys, i'm trying to figure out a nice way of handling errors in a compojure app without cluttering my routes - are there any good examples of open source sites I can look at?
15:52smnirvenGlenjamin: do you mean exceptions or errors?
15:52Glenjaminany error conditions i guess, but specifically exceptions at the moment
15:53Glenjaminfor example, i'm making an http request inside a let binding, if it fails i'd want to show a friendly page specific to that route - but putting a try..catch inside the binding is ugly, and putting one around the whole route seems a bit heavy handed
15:53smnirvenI use a wrap-exceptions middleware
15:53smnirvenin my "controller" code, I validate parameters, for example
15:54smnirvenand if there's a problem, throw an ex-info with a specific response code and message
15:54Glenjaminand have the middleware decode that into a specific method?
15:55Glenjaminmy exact example is calling request-token in an oath workflow - if it fails I'd rather show a "sorry, we can't connect" than the generic "unexpected error" page
15:55smnirvenhave the middleware catch any exception, and check for any ex-data that was specified when the exception was thrown
15:55jonasendnolen: I'll take a second look
15:56jtoy_hi all!
15:56smnirvenGlenjamin: https://github.com/clojure/clojure/blob/master/changes.md#24-clojurecoreex-info-and-clojurecoreex-data
15:58Glenjaminso i'd have my oauth/authorise function catch the raw http error and turn it into something my app can handle, but doesn't that lead to binding the app to the various exception types?
15:58Glenjaminbinding in the coupling sense, i mean
16:01smnirvenGlenjamin: you mean binding the app to the specific kinds of exceptions that could get thrown by the http client?
16:02Glenjaminyeah, it might just be the way i'm looking at it
16:02smnirvenI would have the code that calls oauth/authorize wrapped in try catch (make sure you catch Throwable, not Exception)
16:02smnirvenin the catch throw a ex-info
16:03smnirvenwith specific instructions for the middleware
16:04Glenjaminsmnirven: ok, cool - that makes sense
16:04Glenjaminthe other case that comes to mind is if on a "save" action, theres a database connection failure
16:05Glenjaminyou'd usually want to preserve the context, and redisplay the form to try again - i guess in that case just wrap the route in try..catch?
16:06Glenjamini suppose i could do some sort of let-catch macro if i run into that
16:07smnirvenGlenjamin: https://gist.github.com/smnirven/5183366
16:07smnirvenGlenjamin: that's akin to what I do
16:11amalloyGlenjamin: if you're using a reasonable http client, you can tell it to return an error-map instead of throwing an exception
16:12Raynesclj-http can make this happen.
16:12Glenjaminclj-http is what i'm using
16:12Glenjaminit's the translation of http code -> application error with context that i'm trying to piece together
16:13Glenjamini'll gist an example, it's quite plausible i'm over-thinking it
16:14Glenjaminhttps://gist.github.com/glenjamin/81983d5a18a96e022196
16:15Glenjaminmultiple bindings in let with complex failure conditions, in general i've always tried to keep try..catch scoped as tightly as possible
16:16Glenjaminso an exception on the DB call would want to be handled differently to failures on external http calls, but still specific to the route
16:17Glenjamini guess the idea is to wrap up those calls behind something that captures the domain, and turn them into exceptions with context for the domain that the controller can decide what to deal with?
16:23smnirvenGlenjamin: here's what I would do, combined with that middleware thing I showed you earlier https://gist.github.com/smnirven/986ffd6ef66010df9d79
16:24Glenjaminright, that makes a lot of sense
16:24Glenjaminthanks!
16:24smnirvenno prob
16:25FrozenlockIs there an 'official' tool to make logs with ring/compojure?
16:25smnirvenclojure.tools.logging
16:25smnirvenFrozenlock: https://github.com/clojure/tools.logging
16:26Frozenlocksmnirven: Thanks!
16:46clojure-newHello.
16:47brehautclojure-new: hi
16:47FrozenlockWelcome.
16:48clojure-newGuys, can you try to guess why this happening? I have string, and i'm trying to insert it in h2 db, rowtype is varchar, println prints string just ok but when it inserts string in db, string becames like this:
16:48tyler__can you add tagged literals after cloure has already started?
16:48clojure-newaced000573720020636c6f6a7572652e6c616e672e50657273697374656e745374727563744d6170da82a8a2fdf1ac2f0200044c00055f6d65746174001d4c6
16:48clojure-newI'm just don't know how to debug it...
16:49clojure-newWhen i'm switch type from varchar to carchar(1024) i'm getting this:
16:50clojure-newException in thread "main" org.h2.jdbc.JdbcSQLException: Value too long for column "DESCRIPTION VARCHAR(1024)": "'aced000573720020636c6f6a7572652e6c616e672e50657273697374656e745374727563744d6170da82a8a2fdf1ac2f0200044c00055f6d65746174001d4c6... (10060)";
16:50brehaut~helpme
16:50clojurebotA bug report (or other request for help) has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it's awfully hard to help you.
16:50brehautclojure-new: guessing doesnt help anyone
16:50brehautclojure-new: your best bet is to put a snippet on refheap or gist and link to that.
16:51brehautclojure-new: however, it is nearly clojure west so a lot of people who might be able to answer your question may not be here atm
16:53tyler__why would i use a tagged literal instead of just calling a function and passing in args?
16:53tyler__im not grokking their utility
16:53dnolentyler__: tagged literals are about data exchange
16:53tyler__....
16:54tyler__like over the wire data exchange?
16:54brehauttyler__: say i send you a blob of edn data, and i ahve tagged something as an #inst. your code might use java.util.Date etc, but mine uses jodatime. tagged literals mean that you dont have to worry about my implementation decisions, and we can still agree on a format for a specific datatype that wasnt originally in the transfer format specification
16:55tyler__brehaut: ah brilliant
16:55tyler__so its for people using my data who aren't me
16:55brehautalternatively future you in a different project
16:56tyler__brehaut: future me is not me ;)
16:56brehautor the same project when you internal implementation changes
16:56hyPiRionEssentially it means that it's "boxing" and "unboxing" for you, so that you don't have to handle it yourself.
16:56ivaraasentagged literals is the best thing since smoked bacon
16:56clojure-newOh, i've figured it out, my string wasn't string at all, sorry for desturbance. :)
16:56tyler__everytime someone says "box" now i think of monads heh
16:56brehautclojure-new: lol. not a problem
16:57brehauttyler__: shake that!! monads are not boxes
16:57tyler__brehaut: i know i never said it was voluntary
16:57brehautlol fair
16:57ivaraasenbrehaut: yeah, they're burritos
16:57brehautin this community they are writing desks
16:59tyler__speaking of joda time, why doesn't #inst natively use joda it seems everyone uses it. maybe its complecting rather than composing
16:59tyler__but you could just add it to clojure.core and that fixes that ;)
17:00brehauttyler__: big long mailing list thread about exactly the that exists :P
17:01tomojadd a dependency on joda time to clojure.core??
17:01lazybottomoj: Definitely not.
17:01tomoj(inc lazybot)
17:01lazybot⇒ 15
17:02tomojheh, lazybot always has your back on incredulous stares
17:03hyPiRionreally??
17:03lazybothyPiRion: Definitely not.
17:03tyler__is this a predicate function?
17:04tyler__doh
17:04tyler__is this a predicate function??
17:04lazybottyler__: Uh, no. Why would you even ask?
17:04clojurebotI don't understand.
17:05tyler__do the bots use core.logic to do the nlp?
17:05brehautno
17:05hyPiRionno
17:05Bodiltyler__: Nothing but core.logic would be powerful enough to match #"\?\?$"
17:06tyler__heh
17:06brehaut#"\?{2,}$" ;)
17:06brehautquestion???
17:06clojurebottufflax: there was a question somewhere in there, the answer is no
17:06lazybotbrehaut: Oh, absolutely.
17:06Bodilbrehaut: Whatever, showoff. :)
17:06brehautBodil: im pretty sure it has different answers for different numbers of questionmarks
17:07brehaut(negative and positive)
17:07tyler__does it????
17:07brehautfoo!!
17:07brehauthuh, maybe its only 2 and 3 now
17:07tyler__are you sure???
17:07lazybottyler__: Yes, 100% for sure.
17:07tyler__ok
17:08Bodilwho is best pony???
17:08lazybotBodil: Oh, absolutely.
17:08brehauta??
17:08lazybotbrehaut: Definitely not.
17:08BodilThat wasn't very exciting. :)
17:08amalloyBodil, brehaut: just 2 or 3
17:08brehautsorry
17:19technomancytyler__: #inst not using joda was a horrible mistake IMO
17:21ivaraasenBodil: loving Catnip btw
17:23Bodilivaraasen: Thanks!
17:23brehauttechnomancy: an extension of java.util.Date being a horrible mistake?
17:33ravsterwhat does "No acceptable resource available" mean when trying to use liberator? I have my route as " (GET "/" [] (l/resource :handle-ok {:body "hello world"}))"
17:33manud#sml
17:35ravsterI'm trying to move my project to using liberator, and I don't understand why in the docs it says to use resource at some points and defresource at others.
17:45tieTYT2i'm just getting started with clojure. Sometimes in my repl the prompt becomes " #_=>" and seems to stop responding. How do I get rid of this?
17:46hiredmanthat is a feature of the repl library lein uses, not of clojure proper
17:46brehauttieTYT2: that means that you have an incomplete s experession
17:46brehauteg if you open a list, vector, map, set or string and dont close it
17:46hiredmanbasically it means you hit enter on a incomplete expression
17:47tieTYT2how do I get back to the user prompt?
17:47tieTYT2i don't care if this errors
17:47brehautclose the expresssion
17:47hiredmanmost likely a missing quote or missing bracket
17:47brehaut^C may also get you back in reply
17:47tieTYT2i typed ) like 5 times and ' a few times
17:47metellusthere's also ] and } and "
17:47hiredmanit will never be '
17:47brehautand }
17:47tieTYT2^C exits out and it take a few seconds to startup again which is kind of annoying
17:48hiredmanclojure does use ' in matched pairs for anything
17:48hiredmandoesn't
17:48smnirvenanybody use rotary for dynamodb?
17:50tieTYT2this seems to happen when I paste multi-line code into the repl
17:50tieTYT2even if it's valid
17:50tieTYT2i'm following this example: http://java.ociweb.com/mark/clojure/article.html#Vars
17:50tieTYT2the first defn is causing it
17:51hiredmanI doubt it
17:52tieTYT2i can paste it in at any time and get it to change my prompt
17:53hiredmantieTYT2: do you hit enter after that?
17:53tieTYT2no
17:53hiredmanwell do that
17:53tieTYT2ah ok that fixes it
17:53hiredmanbecause it is mutliline input
17:53hiredmanthe first line is not a complete expression
17:53tieTYT2i guess it needs a blank line
17:53tieTYT2oh i get it
17:53tieTYT2the weird thing is that it gives me the prompt before I hit enter
17:54tieTYT2so it made me think that it processed that line
17:55ravstergah, even the most basic hello world isn't working with liberator for me. I'm doing "(GET "/" [] (l/resource :handle-ok "hello world"))", which is basically what the example is. Any ideas?
17:58thm_proverdoes ":when" in domonad (in contrib.moands) require a monad that supports m-zero and m-plus?
17:59brehautthm_prover: im pretty sure it required m-zero
18:00brehautthm_prover: m-zero represents the failure state / implicit else branch of the :when
18:01thm_proverbrehaut: awesome! that explains alot, I was wondering wtf happened when ":when (...)" failed
18:01brehautha yes
18:02thm_proverbrehaut: "When he heard this, he left very sad, because he was a man of great wealth." <-- is this because in clojure, it's not clear who owns what?
18:02brehautthm_prover: thats a quote from the bible
18:03thm_proveryes, but I was trying to make sense of it in the context of concurrency
18:03thm_proverand didn't realize there were two followsup lines
18:04brehautthe wealth is mutable state in technomancy's version
18:04tyler__i was playing with a bot and my buddy who knows about edn but didn't realize it was as subset of clojure. he was like "how do you get your output to convert to edn" and i suddenly had pity for everyone who's code isn't data
18:06thm_proveris m-seq just "(reduce >>= ...) " ?
18:07brehautits been a long time since i used it but yes i think so
18:08brehautthm_prover: (source m-seq) ;)
18:08brehautthats clojure.repl/source
18:10thm_proverbrehaut: nice, thanks!
18:12tyler__im 4clojure i think we should rename the diffculty from easy-hard to simple-difficult because this one is supposedly "easy" but i have no clue how to do it
18:12tyler__s/im/on/
18:12tyler__s/simple-difficult/simple-complicated/
18:24tgoossensparedit sometimes really screws up (probably me)
18:27tieTYT2i don't know what I'm doing yet, but if I type "lein classpath", it includes clojure-1.4.0 instead of 1.5.1 which I just downloaded. Is this something to be concerned about?
18:28tieTYT2it's using a clojure-1.4.0 from my local maven repository. I assume it downloaded that on its own
18:31tomojsuppose you have a bunch of integers in some known bounds, but the distribution of the integers within the bounds is not known. you have a function which takes an integer k and returns a seq of the integers greater than or equal to k. can you draw approximately uniform samples (with and/or without replacement)?
18:31ryanfdoes emacs paredit have a command for "move the current form to the left/right in its containing list"?
18:31ryanfvim paredit doesn't seem to, and that's like the main thing I was expecting it to do
18:31tomojuh, without just going and counting everywhere
18:31brehauttieTYT2: you dont download clojure versions yourself, you specify them in your dependancies. if an older version is being used its because a lib you depend on is forcing it
18:31tomoj..or pulling in the whole seq into a vec and using rand-nth
18:33tieTYT2brehaut: i see. So the project.clj is using 1.4.0. Why does it do that by default? Shouldn't it use the latest by default?
18:33brehautbecause the default is based on a template that ships with lein; a newer lein will use a newer template, but 1.5 is only a couple of weeks old
18:34brehauttieTYT2: its a fairly safe assumption that if you dont know how to change the project.clj dependancies to a newer version of clojure, you probably dont know enough clojure to need the newer version
18:35tieTYT2brehaut: i see. Well i've been learning clojure for 2 hours now. Should I concern myself with this? I created a clj script that puts a manually downloaded clojure-1.5.1.jar file in the classpath when it runs. But lein seems to be using 1.4.0. I don't knwo what trouble i could get myself into by doing this
18:35st3fani'm having problems with println .. when i run code from the nrepl, println works fine, *except* when I println from a map or for .. not sure what is happening
18:36brehauttieTYT2: well thats wrong. lein manages it for you
18:36brehautit being the classpath
18:36tieTYT2brehaut: I'm just following this tutorial: http://java.ociweb.com/mark/clojure/article.html#Vars
18:37tieTYT2it told me to use the clj script, but it didn't tell me how to make the clj script. I googled separately and found a version on the web but it asks for the path to the clojure.jar
18:37st3fanmaybe i should use a real logging framework
18:37brehauttieTYT2: a clj script is a very old way of using clojure. use lein as the front end and stop using the script
18:38tieTYT2ok i'll delete that, thanks
18:38amalloyryanf: sorta, although "the current form" is too vague to act on. in (foo (bar (|baz) (blah)) (bam)), what is the current form? baz, (baz), (bar (baz (blah))), and (foo (bar (baz) (blah)) (bam)) are all "current"
18:39xeqitieTYT2: theres some more current attempts at guides to clojure at http://clojure-doc.org/articles/content.html
18:39amalloythe command you probably want to look at is transpose-sexps
18:40tieTYT2xeqi: should I read this instead?
18:41tieTYT2this does seem to be a better tutorial
18:41thm_prover_is there a way to get lightweight clojure threads / coroutines via algo.monads in clojure?
18:42ryanfamalloy: I guess that's true. I wouldn't mind having to have the cursor on the outermost paren though
18:42ryanfbut yeah that sounds promising, I'll look into it, thanks
18:42brehautthm_prover: im suspicious that monadic coroutines would not be what you want in clojure; the lack of tail call removal impedes that kind of thing
18:43tgoossenscan someone think of useful clojure constructs / libraries for what i'm trying to do: simulator for robot. It must be able to execute a command which must be interruptable at any point.
18:43thm_prover_is there no way to combine it with trampolines ? :-)
18:43companion_cubethm_prover_: in which logic do you prove theorems? :]
18:43thm_prover_Coq
18:43companion_cubeI see
18:46thm_prover_brehaut: how about http://www.intensivesystems.net/tutorials/cont_m.html ?
18:46brehautthm_prover_: you'd want to ask jimduey or pehaps hiredman whether they blow stack or not
18:47thm_prover_hiredman: ^
18:50thm_prover_brehaut: holy sh** the article I was reading is by jim duey
18:50brehautyes
18:51brehautthats why i said to ask him :P
18:51brehauthe's also the single most enthused about monads person in the clojure community
18:52xeqitieTYT2: I haven't kept up with the documentation project, but I'm sure antares_ would enjoy hearing any feedback since you're in the target demographic (new to clojure)
18:53st3fangrr i now switched to logging .. when i simply (myfunction) then I see my info logging go to *nrepl-server* but when i (def foo (myfunction)) nothing is logged
18:53st3fanwhat. is. going. on.
18:54thm_prover_brehaut: I think the only thing I can do to make my work mmore black magic, is to use continuation monad together with minikaren
18:59tyler__how do i make a for unlazy?
18:59tyler__or eval all results
18:59brehauttyler__: use doseq
18:59Glenjamindoes anyone know of a library that provides a macro for catching exceptions based on matched ex-data?
19:00tyler__ah looks like i have to wrap it in a vector
19:01ryanfusing midje, is there an idiomatic way to store intermediate results so I don't have to include all of the setup in each fact?
19:01xeqiGlenjamin: slingshot ?
19:01xeqihttps://github.com/scgilardi/slingshot
19:02Glenjamini'm using clj-http, which throws an (ex-info), afaict slingshot needs me to be using try+/throw+
19:02brehautthm_prover_: fwiw, i recall that algo.monads' state-m has a couple of things that would be functions in haskell implemented as macros to get around the stack frame limits
19:03ryanfoh, I can use def inside the (fact) call. that helps.
19:03tyler__brehaut: my function returns a value though, it looks like doseq is ignoring return value
19:03brehauttyler__: is the value a sequence?
19:03xeqiI though try+ worked with normal throw
19:04tyler__brehaut: yes
19:04xeqialso, clj-http mentions compatibility with slingshot https://github.com/dakrone/clj-http#exceptions
19:04brehauttyler__: doall then
19:04Glenjaminxeqi: ah, you're right
19:05thm_prover_brehaut: does continuation passing style transforms give me co-routines?
19:05thm_prover_if so, this soudns like the type of thing that should already be available as a mcro
19:05thm_prover_*macro*
19:05brehautthm_prover_: CPS gives you everything ever
19:05brehautthm_prover_: as coroutines are a subset of everything ever, yes they can
19:05thm_prover_I heard it solves the halting problem in O(1) time
19:06brehauteverythign ever was implicitly within the scope of computable things
19:07Glenjaminxeqi: in fact, i was completely wrong - it's using throw+
19:10benedikti'm missing "clojure-jack-in" from emacs
19:10benedikti have clojure-mode
19:11thm_prover_brehaut: have you played with https://github.com/swannodette/delimc ?
19:12scottjbenedikt: deprecated I believe in favor of nrepl-jack-in
19:12benediktscottj: i dont have that either :P how do i get it?
19:12scottjbenedikt: gogole nrepl.el
19:13hyPiRion$google nrepl.el
19:13lazybot[kingtim/nrepl.el · GitHub] https://github.com/kingtim/nrepl.el
19:13hyPiRion^
19:13brehautthm_prover_: not in a very long time
19:13benediktscottj: pulling it from the marmelade repo
19:15ryanfif I have a structure like (def foo {:a [{:b 1} {:b 2}]}), is there a function s.t. (____ foo [:a :b]) returns [1 2]
19:15ryanfor similar
19:18benediktscottj: thanks
19:19thm_prover_https://github.com/swannodette/delimc <-- why is (@cont3 10) 15 rather than 13 ?
19:25dnolenthm_prover_: I should probably just get rid of delimc, mostly was an experiment porting Common Lisp to Clojure
19:26thm_prover_dnolen: what would you recommend?
19:26thm_prover_I just want lightweight threads / coroutines in Clojure :-)
19:31dnolenthm_prover_: probably not going to happen. I think most of the coroutine stuff built on top of delimited continuations in Lisp ended up performing terribly.
19:31dnolenthm_prover_: I looked into that stuff quite a bit when I was writing delimc
19:32thm_prover_so I want to simulate lots of micro threads
19:32thm_prover_and for agents, I end up writing "state machines"
19:32thm_prover_when I'd really prefer to write litle threads that block
19:32thm_prover_does Clojure basicaly not suppor the actor model?
19:32scottjryanf: not built-in afaik, for that specific case (((fn [m [a b]] (map b (a m))) foo [:a :b])
19:32thm_prover_dnolen: ^
19:33SegFaultAXdnolen: Don't get rid of it. Just make sure the documentation (README, wiki, whatever) reflects what it is accurately.
19:33Bodilthm_prover_: You can use Akka from Clojure.
19:33Bodilthm_prover_: Just saying. :)
19:33ryanfscottj: oh, ok, thanks. I ended up just doing (map :b (foo :a)) and not worrying about generalizing it
19:33dnolenSegFaultAX: sure
19:34SegFaultAXdnolen: I say this as someone who has dumpster dived through quite a lot of your code. :) Currently working through core.match
19:35dnolenSegFaultAX: heh, cool!
19:35thm_prover_Bodil: please excuse my ignorance: how does Akka work with Clojure? how does Akka avoid clojure code from being full java threads?
19:35SegFaultAXDumpster dived had the wrong connotation there. I just mean reading deeply through lots of your projects.
19:35SegFaultAXNo offense meant :)
19:35Bodilthm_prover_: I don't know much about Akka, only that it's got Clojure bindings. :)
19:40thm_prover_dnolen: what was your final conclusion on clojure / coroutines?
19:40dnolenthm_prover_: sounds like a fun experiment, I don't see how it could really be practical or usable
19:41dnolenthm_prover_: I could be wrong tho, I didn't really pursue, I kind of stopped after I read the results of various papers.
19:48eggheadhey clj/west guys -- do we need to do anything special for the ground kontrol stuff tonight or just show up?
19:48RaynesGiven the word 'kontrol' in the name I assume you need to be using KDE.
19:49BodilRaynes: http://25.media.tumblr.com/tumblr_m9xw9cYPmK1rbg79no1_500.gif
19:49dnolenegghead: I imagine just show up
19:50BodilRaynes: You coming, btw?
19:50eggheadcool :)
19:51RaynesNo.
19:51BodilRaynes: :(
19:51eggheadalright, headed to the st paddys day stuff over at kells then ground kontrol, cya around #clojure
19:51hyPiRionRaynes: Oh, good! We can make some Clojure app or library while everyone else is attending ClojureWest
19:52hyPiRionBecause, you know, I suspect we may be the only ones not attending =|
19:53RayneshyPiRion: Sure. I was thinking of doing a Space Alert mission generator. amalloy can consult.
19:53RaynesYou start, I'll hop in with bug fixes.
19:55seancljwestsee some of you in portland tonight i expect... just heading out to the airport...
19:56hyPiRionBug #1: Implement the Space Alert mission generator.
19:56hyPiRion(Enhancement)
19:56RaynesYou've won this battle hyPiRion, but you shall not win my war.
19:56clojurebothyPiRion: Probably because it is using the IRC protocol directly -- the equivalent of you putting /say in front of your messages.
19:57hyPiRionheh
19:57hyPiRionThank you clojurebot, that cleared everything up.
20:02xeqi<- also missing c/w
20:04RaynesIt's interesting how the people missing c/w are coincidentally the coolest in the community.
20:04SegFaultAXIt's also interesting that the organizers would decide to schedule it concurrently with an even bigger conference.
20:05seancljwestwhat conference is that SegFaultAX ?
20:05SegFaultAXseancljwest: PyCon
20:05RaynesI don't think we have much overlap there.
20:05seancljwestwell, the conference proper ended today
20:05seancljwestwhat's left are the sprints
20:06xeqi.. is pycon really a whole week?
20:06seancljwestand i bumped into a couple of clojurians at pycon
20:06seancljwest13-21 are the official dates xeqi
20:06SegFaultAXxeqi: It's a huge community. Lots of stuff going on.
20:06seancljwestbut that includes tutorials, workshops, sprints
20:06seancljwestthe conference itself was friday-sunday
20:06seancljwestand today was mostly "poster sessions" rather than a full day of sessions
20:07seancljwesttavis rudd gave an awesome talk today - and he'll be speaking at c/w too
20:08seancljwestpycon was awesome :)
20:08seancljwest2,500 people - it sold out
20:09seancljwestok, airport bound... laters :)
20:10SegFaultAXRaynes: In what way do you mean?
20:10RaynesIn the way I said.
20:10Raynes:p
20:11RaynesI doubt there is a huge amount of overlap of people going to pycon who want to go to clojure/west and vice versa.
20:12SegFaultAXPerhaps.
20:20TimMcIs there a way I can mock or intercept System/getenv for testing purposes?
20:21SegFaultAXTimMc: Is wrapping System/getenv an option?
20:21TimMcI suppose.
20:22jonasachmm no matter what i put into (javadoc) i just get the api for String, strange
20:22scottjjonasac: maybe you're passing a string, and it takes a class?
20:23scottjjonasac: yeah http://clojuredocs.org/clojure_core/clojure.java.javadoc/javadoc
20:25jonasacoh right :p
20:32jonasacshould have figured
20:32jonasacprobably an indication that i should take a break :p
20:49dnolenrecursive featurec http://github.com/clojure/core.logic/commit/d5eda7d7f89443b449d7955a76e72828561082f6, re: hiredman
20:54TimMcdnolen: Because there's no internet?
20:56dnolenTimMc: heh no, just few distractions (for me)
21:14technomancyerlang factory is this week too
21:14hiredmandnolen: exciting
21:16scottjno distractions like glare from other passengers open windows, announcements by pilot/flight crew, electronic turn-off mandates, getting up for someone else to go to the restroom, drink/food/snack service, skymall offers, babies, turbulence, ? :)
21:19scottjfor me its more a matter of few options than no distractions.
21:20hyPiRionyeah, I should've been at erlang factory, because I need it to learn it within the next 5 days
21:21dnolenscottj: heh, well put
21:25ambrosebsdnolen: massive congrats on 0.8.0! Really exciting :)
21:26dnolenambrosebs: thanks!
21:27ambrosebsdnolen: what's on the menu for for 0.9.0?
21:28dnolenambrosebs: hrm, figuring out how to do polymorphic constraints. Bunch of performance stuff, and hopefully another constraint domain(s) CLP(Set|HashMap)
21:29ambrosebsdnolen: nice
21:33dnolenambrosebs: yeah I don't think I'd be happy nearing 1.0 w/o a polymorphic constraint story. it's seems pretty tricky to me at the moment.
21:34dpwrightHello.. I'm a bit confused about clojure and Java booleans
21:35brehautdpwright: how so?
21:35dpwrightI am getting a java.lang.Boolean back from korma, and I'm given to understand that they always evaluate to true in if statements and that I should use "boolean" to coerce it to a clojure boolean
21:36dpwrightbut (type (boolean (java.lang.Boolean. true))) returns java.lang.Boolean
21:37ambrosebsdnolen: what is a polymorphic constraint?
21:37dpwright(I think it was a stack overflow thread on "common mistakes for clojure programmers to avoid" or something where I read that java booleans evaluate to true)
21:38dnolenambrosebs: we don't want to get into a situation where we have things like (fd/!= ...) and (!= ...) etc.
21:39dnolenambrosebs: it would be nice to dispatch to the right constraint implementations once a parameter becomes instantiated.
21:40dnolenambrosebs: but because we might "run" backwards it kind of complicates things. It's no longer the case that just dispatching on the type of the first argument is all that useful.
21:41ambrosebsI don't understand what you mean by trying to avoid fd/!= and !=?
21:41dnolenambrosebs: if (!= x 1) where x is assigned to some interval should dispatch to fd/!= instead of inefficient disequality
21:42ambrosebsdnolen: ah makes sense. So it's multiple dispatch on a volatile runtime type :/
21:43dnolenambrosebs: this is something I toyed around with when I started cKanren work but it just seemed like too much work at the time.
21:43dpwright...actually, there's a comment on that stackoverflow thread saying that it's working in clojure 1.4, so maybe it's just an old version thing. Turns out the problem that led me to wondering about bools was caused by something unrelated
21:43dnolenambrosebs: it kinds of seems like you would need predicate dispatch for it to work ...
21:44dnolenambrosebs: since you would want the system to be open, but very efficient based on type of and the level of instantiation of the constraint parameters.
21:44dpwrightsince (type true) returns java.lang.Boolean, I guess there's no such thing as a "clojure boolean", and they are just java.lang.Booleans?
21:44ambrosebsdnolen: yea...
21:47amalloydpwright: indeed
21:47hyPiRionOh, the booleans
21:47hyPiRion,(false? (Boolean. false))
21:47clojurebotfalse
21:49dpwrightright, and yet
21:49dpwright,(false? (boolean (Boolean. false)))
21:49clojurebottrue
21:50hyPiRionI think it's because
21:50hyPiRion,(identical? false (Boolean. false))
21:50clojurebotfalse
21:50hyPiRion,(identical? false (boolean (Boolean. false)))
21:50clojurebottrue
21:50dnolenambrosebs: we may be able to get away with a much lighter version of core.match in core.logic since it really doesn't need to be general - just types and level of instantiation - this only about constraint parameters.
21:51ambrosebsdnolen: interesting.
21:51dpwrightso the type is the same, but the value representing false is different
21:52dnolenambrosebs: the core.match algo really isn't that much code, most of that code is crazy stuff like extending the matcher and optimized matching for all the different datatypes. I don't think we need to do that at all here.
21:52dpwrightis there a reason for that? pretty sure this conversation has been had many times before, but maybe I just haven't found the right blog post for it or something
21:54ambrosebsdnolen: are you implying building a more specific predicate dispatch system on top of a stripped down core.match?
21:54dnolenambrosebs: yeah
21:55ambrosebsdnolen: is the core.match algorithm still relevant for pred disp?
21:55dnolenambrosebs: oh, should be clear we don't need full pred dispatch here.
21:55dnolenambrosebs: it's really just optimized pattern matching that allows future extension.
21:55ambrosebsok
21:55muhooU+1F4A9 pile of poo: https://www.refheap.com/paste/12674
21:56dpwrightoh wait, clojure "false" represents the java constant java.lang.Boolean/FALSE, whereas (Boolean. false) is just the value false of type boolean
21:56dnolenambrosebs: I think for core.logic we just assume the matches are disjoint - I think we can get away with that ...
21:56dpwright,(identical? false java.lang.Boolean/FALSE)
21:56clojurebottrue
21:57dpwrightthink I get it now -- thanks hyPiRion for pointing me in the right direction
21:57hyPiRiondpwright: That's essentially what it boils down to.
21:57dnolenambrosebs: heh good discussion, this has clarified how I think I might want to tackle this ...
21:58ambrosebsdnolen: haha nice
21:58tomojlattice-kanren looks intriguing
21:59dnolentomoj: it does ... don't really understand it yet though :)
22:01tomojit looks like the time type in conal's reactive is an example of a domain in their sense
22:02tomojI guess any sensible time type would look like that
22:19muhooany idea how i can turn a BufferedImage into something that i can feed to a ring response :body?
22:20antares_muhoo: converting it to bytes or a stream should work, not sure what's the best way, though
22:21muhooantares_: sounds reasonable, but i don't see any way to do that. alas, my java-fu is lacking
22:22antares_muhoo: http://stackoverflow.com/questions/649186/how-to-get-an-inputstream-from-a-bufferedimage
22:22muhoodisco, thanks!
22:22antares_muhoo: so, ByteArrayOutputStream sounds like what you need
22:22muhooOkThankYouForThat
22:55muhoodone https://www.refheap.com/paste/12675
23:09myeSince handling bytes in clojurescript doesn't seem to be directly supported, the best alternative is probably a vector with ints, right?
23:10brehautmye: how do you mean? primative bytes are handled fine. its only unsigned bytes that are problematic
23:11brehaut,(byte 100)
23:11clojurebot100
23:11brehaut,(map byte [127 128 129])
23:11clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Value out of range for byte: 128>
23:12myebrehaut: trying that in my clojure*script* repl: is tells me (byte) isn't defined
23:12brehautoh, clojurescript is different
23:12brehauttheres only numbers
23:12brehaut(in javascript)
23:12brehautexcept where there arent
23:12brehautdepending on the browser you are targetting you can get typed arrays
23:12brehautand i think you can get real bytes there
23:13myehm, yeah, for portability of code that runs in clojure and cljs having a fallback for bytes would be nice, if that's possible
23:14myethe clojure code could be more efficient probably, but I'll have to do with whats in cljs then. (I want that code to generate URLs in both the browser and server side)
23:15muhooiirc in javascript all numbers are floats (!)
23:15brehautmuhoo, not exactly
23:16brehautmuhoo: modern runtimes treat them as ints if you perform certain operations on them, converting to float only when necessary
23:16brehautand you can convert them back with some bitwise ops
23:17brehaut(this is the premise of emscripten and asm.js i believe)