#clojure logs

2011-03-04

00:17joshua__http://stackoverflow.com/questions/5189983/failing-to-upload-items-to-database-using-congomongo
00:19joshua__Spent an hour looking into how MongoDB worked to see if that could be the cause. I'm really stumped. The best I can come up with is that I'm actually submitting to a database other than the one I'm trying to connect to, but I just don't know.
00:24amalloyjoshua__: i don't think anyone will have an easy time answering your question from the information given
00:29joshua__amalloy, adding code
00:31amalloyhm
00:32bartjI am looking to build an interface similar to Google Squared
00:33bartjwould compojure be suitable for this ?
00:33amalloyjoshua__: i'd try adding some debug code to the upload-item code
00:33amalloyeg, if you find that it's nil print something
00:33joshua__amalloy, It is downloading properly. I checked.
00:33amalloyahem, upload. the insert! code
00:35joshua__Good idea.
00:40joshua__I'm so confused. It isn't calling upload-item, but I don't understand why.
00:41amalloyjoshua__: well, now you have something to work with. mongo isn't getting involved at all; see what's happening in the function above it
00:45joshua__So basically a list of two 'items
00:45joshua__properly like I would expect to be..
00:45joshua__is being passed to (map upload-item ..)
00:45joshua__Double checking that upload-item isn't being called
00:46amalloyjoshua__: laziness?
00:46joshua__amalloy, I don't know how.. but maybe?
00:46joshua__How would I check?
00:46amalloyjoshua__: just don't use any lazy function (eg map) for side effects
00:46amalloychange it to doseq
00:47amalloyor wrap it with (dorun)
00:47joshua__Alright so doseq instead of map
00:52joshua__amalloy, thank you, your a genius
00:53joshua__Do you want to post the StackOverFlow answer for me to accept or I can write it up myself if you would prefer?
00:54amalloyoh hm. i guess i should do that. i only recently joined SO :P
00:55joshua__From now on I'll try to be more idiomatic by wrapping side effect calls in doseq. I never realized that their was a good reason to do so before now.
00:56amalloyjoshua__: it also kinda makes me twitch to see an if with no else branch; usually you should use (when) if there's no else. among other things, it helps you notice if you've forgotten the else accidentally
00:59joshua__amalloy, I'm really starting to see why open source coding is the way to go. I get to learn so much more than were I to go it alone.
00:59joshua__amalloy, Thanks for the tips.
01:00pdkanother bonus is when wraps the then form in an implicit do
01:01amacI've always used if expr nil... I'll have to be more aware of that little tidbit
01:02DespiteItAlli've only ever used when-not, but then I'm used to thinking in "unless"es
01:02amalloy&(macroexpand '(when x y))
01:02sexpbot⟹ (if x (do y))
01:03joshua__&(macrodexpand `(defn [x] (+ x)))
01:03sexpbotjava.lang.Exception: Unable to resolve symbol: macrodexpand in this context
01:04joshua__ &(macrodexpand '(defn [x] (+ x)))
01:04joshua__&(macrodexpand '(defn [x] (+ x)))
01:04sexpbotjava.lang.Exception: Unable to resolve symbol: macrodexpand in this context
01:04amalloy&(macroexpand '(defn [x] (+ x)))
01:04sexpbotjava.lang.IllegalArgumentException: Parameter declaration + should be a vector
01:04amalloyhuh
01:04joshua__sexpbot, I'm bad at you.
01:04Despite_you got a extra d in there
01:05joshua__&(macroexpand '(defn [x y] (+ x y)))
01:05sexpbotjava.lang.IllegalArgumentException: Parameter declaration + should be a vector
01:05amalloy&(macroexpand '(defn foo [x] (+ x)))
01:05sexpbot⟹ (def foo (.withMeta (clojure.core/fn foo ([x] (+ x))) (.meta (var foo))))
01:05Despite_also, wtf
01:05joshua__Now I see what I was doing wrng...
01:05joshua__How the heck do I ever get anything done ;p
01:06joshua__Where is the implicit do?
01:06amalloyit's in the expansion of fn
01:06amalloy&(macroexpand '(fn [x] (+ x)))
01:06sexpbot⟹ (fn* ([x] (+ x)))
01:06amalloywell whatever
01:06amachah
01:06amalloyit's in the compiler's interpretation of fn* :P
01:07amacits in there somewhere, I promise
01:07amalloy&((fn [] (println 1) 2))
01:07sexpbot⟹ 1 2
01:07joshua__$((fn [] 1 2))
01:08joshua__&((fn [] 1 2))
01:08sexpbot⟹ 2
01:08joshua__Your right it seems.
01:08amalloyjoshua__: let also has an implicit do
01:09joshua__amalloy, Thank you. Thank you so much. You have no idea how many times I'm using do in my code without need.
01:09amalloyjoshua__: see also doto
01:09amalloy,(doto (inc 1) println)
01:09clojurebot2
01:09clojurebot2
01:12joshua__amalloy, I should probably have a language exploration day where I cruise around looking for things I didn't notice. So many cool functions that I don't use.
01:13Despite_Huh, I thought doto was only for java objects
01:13amalloyDespite_: you can do whatever you want with doto. it just rewrites forms
01:14amalloy&(macroexpand '(doto x inc))
01:14sexpbot⟹ (let* [G__13499 x] (inc G__13499) G__13499)
01:14Despite_yeah, makes sense
01:14Despite_I've just never had need for it
01:17amalloyDespite_: it can be handy for debugging
01:52amalloyjoshua__: for fun, i searched my src/ dir, and while it does contain plenty of (do ...) forms, none of them are in code i wrote :P
01:54joshua__amalloy, very nice.
01:54amalloywhich of course is not actually meaningful. i probably needed local bindings or synchronization for most of them, so they're actually let or dosync
01:55amalloybut you should rarely need an actual do
01:55joshua__amalloy, I figured that was the case. I didn't know about let either so it is pretty much every instance of do that could be a do that is a do.
01:56joshua__amalloy, it worked out though, because it led me to a realization about how functional programming owrks.
01:56joshua__good night everybody
01:57amalloyheh
04:06clgvorganization question: how do I get to run clojure-contrib with clojure 1.3.0-alpha4 by using leiningen?
04:07clgvchanging version string "1.3.0-alpha4" for clojure.contrib in the project.clj doesnt work
04:08robinkclgv: Different namespace.
04:08clgvrobink: so which?
04:09clgvthe information on the contrib sites is kinda sparse or well hidden ;)
04:10robinkclgv: org.clojure.contrib.clojure-contrib/standalone I think.
04:10robinkclgv: You're using Leiningen, right?
04:10clgvyes
04:10robinkclgv: It may just be org.clojure.contrib/standalone. I can check.
04:10clgvok I'll try now :)
04:13clgvrobink: seemed to work. except that the name is a bit odd: standalone-1.3.0-alpha4.jar
04:13robinkclgv: Just org.clojure.contrib/standalone "1.3.0-alpha4"
04:13robinkclgv: Oh, hm
04:13clgvI would have expected "clojure" and "contrib" somewhere in it ;)
04:13robinkclgv: Probably, there's a way to get it in lib/ as 'clojure-contrib-1.3.0-alpha4.jar'.
04:14taliosthats a downside of the way stuart did the split up. contrib is now something like 60+ individual artifacts, or the combined "standalone".
04:14clgvrobink: it's not a problem but odd ;)
04:15robinkclgv: Holdon, I'm playing around. I did manage to get it installed as clojure-contrib-1.3.0-alpha4.jar somehow.
04:16clgvrobink: I won't go anywhere for the next 8 hours ;)
04:16robinkclgv: Heh, 'k
04:18robinkclgv: Oh, looks like I just had it stored as standalone.
04:19robinkclgv: The artifact namespacing is to delineate the full jar (entire contrib API) with individual libraries in the contrib project.
04:20robinkAs indeed, the name of the .jar on build.clojure.org is standalone-1.3.0-alpha4.jar.
04:20robinkThere may be a way to coerce Lein to rename the .jar for you, but that's a question for someone skilled at Lein, which I am not.
04:21clgvok. maybe they should add clojure and contrib somehow - since it might get really strange in a project with lots of jars ;)
04:22robinkclgv: Yes, it can, but I'm OK with the naming in its current state as I have little need of very unique namespacing (don't have a project that depends on another standalone-1.3.0 jar.
04:22robinks/\./\)\./
04:22sexpbot<robink> clgv: Yes, it can, but I'm OK with the naming in its current state as I have little need of very unique namespacing (don't have a project that depends on another standalone-1).3).0 jar).
04:22robinkhaha, didn't know sexpbot would do that.
04:23clgv*g*
04:23robinkOh jeez, it assumes /g.
04:23robink(plus I forgot about the dots in the version number)
04:24robinks/\.$/\)\./ would have been a better regexp
04:25clgvCould not locate clojure/contrib/duck_streams__init.class or clojure/contrib/duck_streams.clj
04:25clgvhmm guess it moved
04:26robinkclgv: Depricated since clojure-contrib 1.2
04:26clgvwhat's the replacement?
04:26robinkclgv: (according to http://clojure.github.com/clojure-contrib/#duck-streams.
04:26robinkAgh I did it again
04:26robinks/\.$/\)\./
04:26robinkSee if sexpbot fixes it this time.
04:26robinkhm, interesting
04:27clgvit cant since you wrote inbetween ;)
04:27robinkOh, OK
04:27robinkclgv: I dunno what the replacement is.
04:36clgv&(doc clojure.contrib.monadic-io-streams/read-lines)
04:36sexpbotjava.lang.Exception: Unable to resolve var: clojure.contrib.monadic-io-streams/read-lines in this context
04:36clgv&(doc read-lines)
04:36sexpbotjava.lang.Exception: Unable to resolve var: read-lines in this context
04:37clgv&(find-doc ("read-lines)
04:37sexpbotjava.lang.Exception: EOF while reading string
04:37Despitemost of duck-streams is in c.core or c.java.io i think
04:37clgv&(find-doc "read-lines")
04:37sexpbot⟹ ------------------------- clojure.contrib.duck-streams/read-lines ([f]) Like clojure.core/line-seq but opens f with reader. Automatically closes the reader AFTER YOU CONSUME THE ENTIRE SEQUENCE. ------------------------- clojure.contrib.io/read-lines ([f]) Lik... http://gist.github.com/854399
05:06raekclgv: duck-streams has been replaced by clojure.java.io: http://clojuredocs.org/clojure_core/clojure.java.io
05:06clgvraek: thanks. got it running with it :)
05:24raekclgv: note that the features that has gotten promoted from contrib into clojure might behave slightly differently
05:24raekclgv: so reading the throught the new docs can be a good idea
05:24clgvraek: reading in the file in lines works.
05:32bennyluare you using throw/ catch?
05:32AWizzArdbennylu: yes
05:33AWizzArdYou too? (:
05:33bennyluAWizzArd, i tried but it lead to massy code - dont you think?
05:33bennyluas in clojure it not so nice to define new exceptions ..
05:34AWizzArdStable programs sometimes do require this chatty code bits.
05:34bennyluwe cannot throw "clojure" objects right?
05:35AWizzArdYou can throw Exceptions.
05:35raek(this is being discussed http://dev.clojure.org/display/design/Error+Handling)
05:35bennyluthanks ill take a look
05:36raekthe jvm exception system requires you to define new types to define new kinds of errors
05:57tsdhHi. I just want to do my first clojure project using leiningen. I did lein new foo, but what's the correct way to specify local jars in the defproject's :dependencies vector?
06:07tsdhI mean, I want to add a jar as dependency that's not available from some repository on the net, but which resides somewhere on my local filesystem.
06:18cinchtsdh: i've never done this, but the lein faq says how to do it https://github.com/technomancy/leiningen/
06:20cinchi hope they add a way to simply drop a jar in the /lib folder
06:20tsdhcinch: You mean, install it into the local maven repo using the command that's issued for non-downloadable deps?
06:21tsdhDropping into lib/ works, but get's erased when doing "lein deps" another time...
06:22cemerickcinch: "It's much better to get the dependency in a remote repository for repeatability reasons though."
06:22cemerickjust dropping stuff into /lib is sooo 2001 ;-)
06:23clgvtsdh: drop the additional jars in the lib folder and set: ":disable-implicit-clean true"
06:25tsdhclgv: Thanks, I'll try that.
06:29bennylutis there equivalance for "contains" in clojure (such that works for seq , vec strings etc.)
06:29AWizzArd~seen rhickey
06:29clojurebotrhickey was last seen in #clojure, 3892 minutes ago saying: ataggart: thanks for that patch! I hope to get some time to look at it soon
06:30AWizzArd$(/ 3892 60.0)
06:30AWizzArd~(/ 3892 60.0)
06:30clojurebot:negative/num-1 + :positive/num-1 = :zero/zero
06:30clgv&
06:30sexpbotjava.lang.Exception: EOF while reading
06:30AWizzArdwow
06:30clgv&(/ 3892 60.0)
06:30sexpbot⟹ 64.86666666666666
06:33clgvException in thread "main" java.lang.NullPointerException, compiling:
06:33clgvhow can that happen in clojure 1.3.0?
06:37AWizzArdclgv: have a look at the stacktrace
06:38AWizzArdThere is maybe some other class missing, or you forgot to add a (:gen-class) to your ns declaration
06:38clgvit fails in some ns-statements. and lein doesnt show the complete one
06:38bennyluthow to check mail? -sexpbot- says that i have new message..
06:39clgv$mail
06:39sexpbotYou have no messages.
06:39clgv-> $mail
06:39bennylutthanks
06:39bennylut$mail
06:41clgvwhere would I need a (:gen-class) except in the ns with my Main method?
06:45AWizzArdclgv: (ns my.namespace (:use ...) (:require ...) (:import ...) (:gen-class))
06:45clgvyes, but I thought I only need it in my main-ns
06:46AWizzArdIn the one that contains the -main fn that you want to be run on startup in your resulting .jar file.
06:46clgvthe other files are normal clojure and do compile in 1.2
06:46clgvyes. there it is
07:02raekbennylut: contains? checks for keys in maps and elements in sets (and does so in constant time). you can use (some #{element} coll) if you want to scan a list in linear time
07:03raekif you need to check for membership often, consider using a set as the data structure rather than a list or a vector
07:03bennylutraek, thanks - i never heard of some
07:03clgverror is: java.lang.NullPointerException: null
07:03clgv at clojure.lang.Compiler$ObjExpr.emitVar (Compiler.java:4482)
07:03clgv clojure.lang.Compiler$DefExpr.emit (Compiler.java:393)
07:03bennylutraek, dosnt vector is realy a map behindt the scenes?
07:05bennylutraek, nevermind i forgot that the values in the map are not hashed only the keys ...
07:11raeka vector has a similar tree structure underneath
07:14raekbut the interface you access it through does not necessarily reveal that
07:14raekcontains? on a vector checks whether an index is in range
07:35clgvWARNING: defn already refers to: #'clojure.core/defn in namespace: Blubb, being replaced by: #'Blubb/defn
07:36clgvis this local symbol override not allowed in clojure 1.3 anymore?
07:37clgvI get the above exception right after this warning
07:37AWizzArdIt seems that it is allowed, but just warns you. You did not explicitly exclude defn in your ns declaration.
07:38clgvbut it directly breaks after this warning
07:39clgvthe override is now modified to do nothing at all
07:39cemerickclgv: probably because you're wanting to use clojure.core/defn after you shadow it with something else
07:40clgvcemerick: it doesnt do anything now. but in general it will call clojure.core/defn explicitly later
07:42clgvI have this running with 1.2
07:45cemerickclgv: Are you attempting to use defn after you shadow it?
07:47clgvcemerick: you mean like (defn f [x] (* x (inc x))) or something?
07:47cemerickright
07:47cemerickthat form will use whatever you shadowed defn to be, not clojure.core/defn
07:49clgvexactly what it should
07:49cemerickso, any exceptions at that point are on you, is what I'm getting at ;-)
07:50clgvthats true. but I am trying to find out why. it works with 1.2 since several months
07:51cemerickpaste your stack trace
07:51clgvok I'll paste the stacktrace where my shadowed defn simply return nil
07:53clgvhttp://pastebin.com/2Nxghj7r
07:54clgvcemerick: I guess you can simply skip to the cause part
07:56cemerickclgv: That's not very helpful. Shadowing defn and using that shadowed version appears to be just fine. https://gist.github.com/cf5a740be05fd99b5342 Perhaps paste what you're shadowing defn with?
07:56clgvI create a macro that shadows defn
07:57cemerickWell, it sounds like it needs to be tweaked for 1.3 then.
07:57clgvprobably. but there is no general bigger change in 1.3 that might lead me directly to the problem?
08:00cemerick1.3 has a number of breaking changes: for starters, vars are no longer dynamic by default and primitive support has been added http://dev.clojure.org/display/doc/Enhanced+Primitive+Support
08:00cemerickclgv: ^^
08:04bennylutcemerick, vars are no longer dynamic?
08:04cemerickbennylut: in 1.3, not by default
08:04clgvyeah. I guess changes related to macros would be the first starting point
08:04bennylutthat means that they cannot be redefined?
08:04cemerickno, redefinition is unaffected
08:05cemerickIf you plan on binding a var, tack ^:dynamic true metadata onto the var's symbol
08:05bennylutah ok.. thanks
08:06clgvcemerick: you know what Compiler.emitVar means semantically?
08:07cemerickThat's an implementation detail. I believe it's specifying a constant referring to a var in bytecode.
08:08clgvhm the strange thing is, that I can "use" the ns where the error occurs in "lein repl" with clojure-1.3.0-alpha4
08:09clgvhmm well I skip it for now
08:18tsdhWhen I want to create a clojure function wrapping some java lib, and on the java side I have methods like X.foo(), X.foo(A), X.foo(A, B) where omitting a paramerter is equvialent to passing null, is there something better than having a foo function with 3 argument lists? I guess, something like keyword parameters would be handy...
08:20AWizzArdtsdh: you can use indeed such keyword args
08:20tsdhFound that: http://groups.google.com/group/clojure/msg/51bb53ca077154f8
08:21naeucemerick: what does it mean that vars are no longer dynamic? Does it mean that we won't be able to rebind them in the REPL by default?
08:21cemericknaeu: right
08:21tsdhAWizzArd: Should I use that, or is something like that in core in the meantime?
08:21AWizzArdtsdh: einfach mit Destructuring: (defn foo [a b {:keys [x y z]}) (prn a b x y z))
08:21naeuinteresting
08:22cemerickActually, redefining a var as dynamic after the fact would be simple.
08:22naeuok, that was going to be my next question
08:22AWizzArdtsdh: Better not use what Rich posted there. That is more like internal stuff and now implicitly available, as you can see in my example.
08:22cemerickThe point is that vars don't need to be dynamic 99% of the time, and there's a big performance hit for supporting it 100% of the time.
08:22tsdhAWizzArd: Ok, I'll try that out.
08:22AWizzArdBut 3 years ago, when Rich posted that, it was a good way.
08:23naeuI'm currently doing a lot of music live coding and redeffing vars is a key aspect
08:23tsdhAWizzArd: But with your suggestion the caller needs to pass an explicit map, right?
08:23cemericknaeu: redefining vars is not affected at all.
08:24cemerickonly using binding and set! are affected
08:24naeucemerick: oh ok, perhaps I don't get what being dynamic means in this context then
08:25naeuso what's the typical usecase for set! on a var?
08:25naeuI don't think I've ever seen that in the wild
08:25cemericknaeu: it's a more esoteric feature :-)
08:26naeu:-)
08:26cemerickThe real power of dynamic vars and binding.
08:27naeuand with binding, I didn't realise that it was actually temporarily changing the var's val, I thought it was just modifying the lexical environment of the enclosed forms such that any reference to the original var would be intercepted by the temporary val
08:27naeuand therefore leaving the original var untouched
08:27dnolennaeu: and it's thread local.
08:28naeusure, so I still don't really get what the difference between a static and dynamic var is
08:28cemerickbinding will fail
08:29AWizzArdtsdh: no, the caller does not have to pass in a map
08:29pyrhi
08:29naeuok, so it's really an implementation issue w.r.t. 'dynamic' vars
08:30AWizzArdtsdh: but right, I forgot a & symbol. The example should be: (defn foo [a b & {:keys [x y z]}) (prn a b x y z))
08:30AWizzArd(foo 10 20 :y 30)
08:30pyrdoes anyone know why (class "foo") yields java.lang.String but (isa? String "foo") or (isa? java.lang.String "foo") yields false
08:30cemericknaeu: https://gist.github.com/a60e9df0af7ccdeac539
08:30naeuyou can still redefine them (which to me has always been the notion of dynamic that I understood)
08:30tsdhAWizzArd: Ah, great, works.
08:31naeubut you won't be able to rebind or set! them without declaring something first
08:31stuartsierrapyr: ` isa?` is not the same as `instanceof` in Java.
08:31cemerickright
08:31AWizzArdtsdh: you can also specify default values: (defn foo [a b & {:keys [x y z] :or {z 88}}] (prn a b x y z))
08:31naeucemerick: cool
08:31stuartsierra,(instance? String "foo")
08:31clojurebottrue
08:31stuartsierra,(isa? String CharSequence)
08:31clojurebottrue
08:32pyrah ok
08:32pyr,(count [1 2 3])
08:32clojurebot3
08:32pyrdidn't know clojure bot :)
08:32naeuwill Clojure 1.3 go through a beta phase at somepoint?
08:32pyrstuartsierra: thx
08:32tsdhAWizzArd: Oh, this is superb! I just found out that passing null to the java method won't do, so I started to write conditionals on the existance of keyword params, which is just as bad as 3 different arg lists. :-)
08:32stuartsierranaeu: yes
08:37stuartsierrahttp://dev.clojure.org/display/design/Release.Next+Planning describes the state of the upcoming release
08:46clgvstuartsierra: not much details over there ;)
08:47stuartsierrayeah, true
08:47stuartsierraCheck the links to tickets, though
08:48clgv19 open tickets looks not too bad - but I don't know how much complexity that small number hides ;)
08:50stuartsierraclgv: The top features for Release.Next are 1) bugs in new numeric stuff; and 2) defrecord improvements
08:53clgvhmm I think I didn't read about it yet - are there developers that work fulltime on clojure?
08:54stuartsierrano
08:55stuartsierraClojure/core aims to put 20% of our work time toward Clojure.
08:55clgvah thanks for that info :)
08:56chouserstuartsierra: so there's only one Clojure book left that doesn't have one of it's authors working for you guys
08:57chouserI don't have a point, just seems worthy of a remark. :-)
08:57stuartsierrachouser: That's Amit R., right?
08:57chouseryep
08:57stuartsierraWhere's he? San Fran?
08:57chouserI think so
08:58stuartsierraSee, too far away.
08:58chouserBut I bet he could use a co-author. What's Bedra doing these days. ;-)
08:58clgv:D
08:58stuartsierraHeh, writing an article about JSVC.
09:00cemerickchouser: we're still resisting the NC evil empire ;-)
09:00cemerickI'd probably just drive people nuts anyway, so it's better if we just stay friends. :-P
09:01chousercemerick: Fogus lasted until about week before his book went to press. You've got a while.
09:01cemerickchouser: I may be fundamentally unemployable.
09:02chousercemerick: hmmm, I guess I could believe that. :-D
09:02cemerick:-D
09:02chouserSo, anyone want to take bets on how long before we see akka for Node.js?
09:02chouserYou've all seen that akka now has Clojure-style STM?
09:03dnolenick
09:03stuartsierrachouser: Yep, they even admit they stole it from Clojure ;)
09:03dnolennot Akka w/ STM (knew about that)
09:03cemerickThe same things that made me make a choice in the rich vs. king dichotomy probably make me difficult to work with in someone else's workplace.
09:03chouseryep. All the benefits of Clojure without the nasty syntax.
09:03cemerickakka seems like it's got everything for everyone
09:05stuartsierracemerick: agreed, it's the kitchen-sink approach
09:06chouserdid they include something that Clojure doesn't?
09:06stuartsierrachouser: configurable thread pools
09:07chouserok
09:07cemericknot exactly a watershed feature
09:08stuartsierrayeah
09:08cemerickstuartsierra: can we get the super-secret skinny on the 1.3/2.0 poll results, or is that super-super-secret?
09:09stuartsierraBasically an even split.
09:09cemerickI should have ramped up that bot more. :-P
09:10stuartsierraBasically, everyone likes Semantic Versioning, but no one likes the consequence.
09:10chouserheh
09:10cemerickUnprincipled sycophants.
09:11stuartsierracemerick: Isn't that the definition of open-source communities? ;)
09:12chouserthere have been breaking changes within 1.x already. Seems like there's no principle to stand on really.
09:12cemerickchouser: nothing of consequence really though, right?
09:12cemerickstuartsierra: Amen, brother.
09:12chouseris this change "of consequence"?
09:13chouserI really have no strong opinion.
09:13stuartsierraTechnically, no public APIs broke from 1.0 to 1.1 and 1.1 to 1.2.
09:13cemerickchouser: In relative terms, I don't know. Do you remember the breaking changes in 1.x?
09:14stuartsierraSome unspecified behavior changed.
09:14chouser"2.0" will make a bigger news splash for about a week. After that, I can't imagine anyone really caring.
09:14chouserI'm pretty sure things were deprecated. ^
09:14stuartsierraDeprecated, yes, but not broken.
09:15cemerickwell, that's what's supposed to happen before they're removed
09:15chouser^ does something completely different
09:15cemerickAnyway, i'm sure Rich already had an opinion and probably won't be swayed in either direction by polls and ML posts.
09:17chouserjust checked. If you have ^ in your code, Clojure 1.0 will act very differently than Clojure 1.2. *shrug*
09:17clgvreading "deprecated", I wonder if there will be some kind of mechanism that warns the programmer that he is using deprecated functions?
09:18stuartsierrachouser: Yes, but that's forward compatibility :)
09:22chouserclgv: in general, warnings are printed, but there's no cohesive mechanism yet.
09:22clgvchouser: I didn't see any when using clojure.contrib.str-utils and others in 1.2
09:23stuartsierraclgv: All of clojure.contrib.* is essentially deprecated now.
09:23clgvstuartsierra: great :P
09:23stuartsierrahttp://dev.clojure.org/display/design/Common+Contrib+Build
09:23chouserclgv: hm, good point. Contrib has been less rigorous about printing deprecation warnings.
09:24clgvhm yeah I noticed when wanting to get clojure.contrib 1.3.0 with leiningen. ;)
09:24clgvbut no problem, I'll stay with 1.2 for the time being until the 1.3/2.0 release
09:30amacanyone know why ring.middleware.wrap-params won't pull :form-params (or any params) out of something like <form name="fname" method="post" action="/myhandler"><input type="text" name="bleh" value="testval"/><input type=submit value="send!"/></form>
09:30amacI must be missing something simple
09:30dnolenstack splitting in GCC, http://gcc.gnu.org/wiki/SplitStacks, any other langs that people have used that implement this?
09:30amacI get the request to the handler just fine, but wrap-params isn't parsing the post form
09:52bennylutis there a way to set! a var defined in let? ( like: (let [x 5]
09:52bennylut(do (set! x 7)
09:52bennylutx)) )
09:53dnolenbennylut: let doesn't define vars. it defines locals. and you can't set locals.
09:53amacyou can recur with updated values though
09:54bennylutamac, recur is a good option, but i will restart all what i done..
09:55bennylutdnolen, so how can i handle state if i need to (not globaly)
09:58amacbennylut: hmm... perhaps wrap your state with an agent to control state? http://clojure.org/agents
09:58dnolenbennylut: you could use an atom. but it's best to see if you can just find a functional solution. not always possible to do cleanly - but that's rare I think.
09:59dnolen,(let [x (atom 5)] (reset! x 7) @x)
09:59clojurebot7
09:59bennylutdnolen, amac, thanks ill take a look in atoms and agents :)
10:01raekbennylut: recur can "jump pack" to a point closer to the recur call than the function start if you use 'loop'
10:02raekbennylut: all this depends on what you are trying to do. using concurrency primitives (atoms/refs/agents/vars) for basic computations is usually unideomatic in clojure
10:03bennylutraek, yes i know - the case is that i want to parse some text and to do lookahead, when some times after "looking ahead" some vars need to be changed...
10:03bennylutbut i think i will use atoms for that
10:04raeklookahead sounds like a perfect fit for (lazy) sequences
10:05raek(if (= (nth elements 3) "foo") (do-one-thing elements) (do-another-thing elements))
10:06bennyluti need to do somthing like (let [x (heavy-calc) y (somthing-depend-on-the-heavy-calc)] and so i want during the "heavy calc" assign y
10:07raekbennylut: can't you just use an if in the right hand side?
10:07raek(let [x (if (neg? x) (-x) x)] ...)
10:07raekthis looks somewhat like assignment, but really isn't
10:08bennylutraek, it not depend on the value of x but durring the calculation of x y can be calced reletivly costlessly ..
10:08raekperhaps you could use destructuring
10:09bennylutdestructuring??
10:09raek(let [[x y] (heavy-calc)] ...)
10:09raekand make heavy-calc return a vector/list of two things
10:09bennyluti didnt know i can do that - this is just what i needed
10:09bennylutraek, great! thank you very much
10:11ev4lgood morning everyone. i think i may be facing a common clojure error, but still haven't figured it out.
10:12ev4li'm intending to use the defvar- macro from 'clojure.contrib.def', but when i require it, the environment whines telling that the 'clojure.contrib.def' namespace is inexistent.
10:12ev4l(throws a ClassNotFoundException)
10:12ev4li suspected the possibility of clojure-contrib not being on the classpath, but it is
10:12raekev4l: that sounds like you do (require clojure.contrib.def) instead of (require 'clojure.contrib.def)
10:13raekClassNotFoundException means that a Java class could not be loaded, and if you don't quote the namespace name, it will be interpreted as a name of a class
10:14ev4lraek: that's it =]
10:14ev4lraek: it worked. I knew that was something stupid...lol
10:14ev4lraek: thx alot
10:14raek(if you have the require in your ns form it should look like (ns foo (:require clojure.contrib.def)) though. i.e. no quote and : before require)
10:14amac_I do crap like that constantly
10:15TimMcchouser: Eep, I think I didn't see #8 before! My bad.
10:15gtrakhmm, damn netsplits
10:16clojurebotdestructuring is http://clojure.org/special_forms#let
10:21clgvwhat is a netsplit anyway?
10:22TimMcTwo IRC servers lose a link, I think.
10:22clgvwhy do they? did they forget to pay their ISPs?
10:22clgv:P
10:23TimMcNaw, just transient network errors.
10:23TimMcWikipedia actually has a decent article on this.
10:25clgvuff
10:25clgvshouldnt have loaded the wikipedia article, eh?
10:28TimMcHow many new tabs do you have open now? :-P
10:30gtrakin counterclockwise, when debugging, what do you guys use for the source lookup path?
10:31thegabbleHi all, I had a newbie question... if I have absolutely no knowledge of Java am I going to find it impossible to pick up Clojure? Would it be better to tackle another LISP/Scheme?
10:32gtrakyou don't know java nor a lisp?
10:32thegabbleI totally missed the Java revolution as my CompSci was pretty much Pascal, C, Ada and professionally it's been Python and Fortran
10:33thegabbleClojure seems really cool so was going to give it a go… but the Java thing scares me :)
10:33stuartsierrathegabble: Java knowledge is not a strict prerequisite for learning Clojure, but to do any real work in the language you will at least need to learn the common Java APIs for things like I/O.
10:33gtrakyou can pick up a working knowledge of java in a couple weeks, read effective java and look over the apis
10:33thegabbleAhhh… that was the feeling I was getting from everything I've read/seen
10:34thegabbleGreat… thanks for the info gtrack & stuartsierra
10:34stuartsierra'welcome
10:35raekthegabble: my experience is that you are expected to at some point learn how to call java methods from clojure. for instance know that when you see http://download.oracle.com/javase/6/docs/api/java/lang/String.html#toUpperCase(), you can do (.toUpperCase "foo") in clojure
10:36raekand that most often, you don't need to know how to write code in java
10:36thegabbleraek: but you do need to know the API's right? so that would be a good place to start
10:38raekthegabble: you don't need to know much at all about the java api to learn the core clojure language
10:38PiskettiI'd like to read that
10:39raekthegabble: but there are areas (for instance I/O) where you usually just use java directly
10:40gtrakactually knowing java well wouldn't hurt you, but depends on your timeframe what's most useful
10:40thegabbleJust started working my way through 'Programming Clojure' and was wondering how much trouble I was getting myself into :)
10:41thegabbleIt's more for fun/trying something new/thinking new ways so time frame is long
10:41thegabbleThanks for the info guys!
10:44clgva strategic thought: I have complex objects that are constructed within a thread each and then will be used unaltered in the main thread. would it be a good choice to implement these objects as deftype and to use transients for their parts which are made persistent! when the thread finished construction?
10:47stuartsierraclgv: perhaps, but remember that transients still aren't mutable in-place.
10:48clgvstuartsierra: that restriction means in detail? does a (transient (vector (range 10))) grow wenn I'll do assoc! ?
10:48clgvI mean when I do assoc in the range 0...9
10:49stuartsierraIt just means when you call (assoc! …) you have to use the return value.
10:49stuartsierraThe transient thing you called assoc! on is no longer valid.
10:49clgvoh.
10:49stuartsierraFor example, you can't do (dotimes [i 10] (assoc transient-thing i ...))
10:50stuartsierras/assoc/assoc!/
10:50sexpbot<stuartsierra> For example, you can't do (dotimes [i 10] (assoc! transient-thing i ...))
10:50clgvin general or in special cases?
10:50stuartsierraIn other words, transients don't give you a free pass on writing your code in a functional style.
10:50stuartsierraYou have to use the transient "!" functions the same way you use their non-transient counterparts.
10:51stuartsierraThey're just slightly more efficient.
10:51clgvok
10:51stuartsierraAnd you can't use an old value once you've called a transient "!" function on it.
10:51clgvthe strange thing is, that I have a case where it worked
10:52stuartsierraSometimes it will, but it's not guaranteed.
10:52clgvyeah I'll change it
10:53stuartsierraRule of thumb: write your code without transients first, then add the "!" characters to make it transient when you're sure only one thread needs access to those data structures.
10:54clgvok. good one
10:55rindolfHi all. My message to the Google Groups did not arrive there yet. I am shlomif@iglu.org.il / Shlomi Fish.
10:56stuartsierranew members are moderated - it will show up as soon as a moderator has a chance to look at it
10:57rindolfstuartsierra: yes, I figured out something like that.
10:58rindolfOK, let me pastebot the message text, in any case.
10:58stuartsierraIt will get to the list eventually, just be patient.
11:00TimMcthegabble: Note that some of the syntax in Programming Clojure is out of date -- nothing major, but something to be aware of. (It was written against Clojure 1.1.)
11:00rindolfstuartsierra: yes, OK.
11:00rindolfhttp://www.shlomifish.org/Files/files/text/clojure-script.mbox - here it is if you're interested.
11:01thegabbleTimMc: Thanks for that, good to know.
11:02TimMcThe only thing that specifically comes to mind is the behavior of ^ for metadata.
11:03TimMcAnyone know if Stu H. hangs out in this channel>
11:05amac_TimMc: all the cool people hang out here ;)
11:05TimMcheh
11:05cemerickTimMc: rarely
11:06TimMcOK. Was just wondering if his book will be updated with notes on 1.2 syntax.
11:07clgvTimMc: would be only worth it if 1.3 will still take a lot of time, I guess
11:21TimMcNetsplit over?
11:23TimMc,ping
11:23clojurebotjava.lang.Exception: Unable to resolve symbol: ping in this context
11:23TimMcOh good.
11:33tsdhHi, I'm suffering from a strange defmulti dispatching problem. Somehow, the dispatch function complains about too many params. But a totally similar defmulti works fine. I've restarted swank, but the error persists. And ideas? http://pastebin.com/UPwvpju3
11:45tsdhAh, got it. A missing & in the parameter list. I needed more than 30 minutes of staring at the code to spot that error. :-)
12:52fliebelIs there a way to make a for parallel?
13:01dnolenfliebel: still plugging away at the logos bug. I think I have the solution but it turned out there are other things that needed fixing as well. I'm amazed that this issue didn't crop up with any of the other programs like flatten-o, append-o or zebra-o.
13:03opqdonutfliebel: not as such. use map or make your own macro
13:06fliebeldnolen: It almost seems one needs to have the precision of a watchmaker to implement miniKanren.
13:09dnolenfliebel: haha, perhaps. but I think this really is the last issue. It's actually the last bit about the original miniKanren implementation I didn't fully understand.
13:09fliebelopqdonut: You know how these executor pools work?
13:10dnolen,(reduce concat (pmap identity (partition 2 [1 2 3 4 5 6])))
13:10clojurebot(1 2 3 4 5 6)
13:10dnolenfliebel: the important thing is that there needs to be enough work. so you need to pick a proper batching size ^
13:11fliebeldnolen: Well, since I have only few cores, a few huge chunks of work seems appropriate.
13:13fliebeldelay…? ##(doc delay)
13:13sexpbot⟹ "Macro ([& body]); Takes a body of expressions and yields a Delay object that will invoke the body only the first time it is forced (with force or deref/@), and will cache the result and return it on all subsequent force calls."
13:14dnolenfliebel: delay will probably be part of my solution to the overflow bug.
13:15dnolendoes anybody else ever feel the need for an interleave that continues after some seqs have been exhausted?
13:16dnolen(weave [a b c d] [e f]) ;; (a e b f c d)
13:18fliebeldnolen: No, but I guess it is useful for interleaving solution streams :)
13:18dnolenfliebel: ;)
13:24opqdonutfliebel: oh, I misunderstood "parallel"
13:24opqdonutfliebel: I thought parallel insted of nested traversal of the sequences
13:24opqdonutsorry
14:22TimMc__OK, is freenode done thrashing yet?
14:22lucianTimMc: maybe it's GCing :)
14:46TimMcMan, I can't even get to the freenode website from here.
14:54amalloyieure: heh, i sent a link to php-repl around to my coworkers. the php programmers are like "meh", but the ruby programmers who have to write occasional php are like "zomg plz give"
15:10ohpauleezamalloy: haha, the first thing I picked up when I had to start doing php at my current job was php-repl
15:10ohpauleezthe same thing happened to me
15:10ohpauleezI was like, "Guys, this is rad, finally, a repl"
15:10ohpauleezand the php devs just shrugged
15:10amalloyohpauleez: facebook's phpsh looks like it has way more awesome features, excep the one critical feature of "it works"
15:11ohpauleezhaha, yes, I found that to be true as well
15:11mattmitchelli'm trying to figure out how to write a test, that uses an external web service as it's datasource. how can i test without actually calling the service. i realize it'd be mocking, but how in clojure?
15:12amalloy$google clojure mock unit test
15:12sexpbotFirst out of 5400 results is: Unit Testing in Clojure
15:12sexpbothttp://nakkaya.com/2009/11/18/unit-testing-in-clojure/
15:12ohpauleezRaynes: I'm working on clj-bitbucket right now, just a heads up if you wanted to roll it into sexpbot
15:12ohpauleezamalloy: ^
15:12amalloyhm, doesn't mention mocking. lame
15:13spewnmattmitchell: There does exist http://richhickey.github.com/clojure-contrib/mock-api.html
15:13amalloymattmitchell: you can use http://richhickey.github.com/clojure-contrib/mock-api.html or https://github.com/marick/Midje
15:13mattmitchellexcellent :) i'll try those out.
15:13mattmitchellthank you
15:13amalloyohpauleez: bitbucket the scm system?
15:14ohpauleezyeah, the api to bitbucket
15:14ohpauleezwhich is like the api to github
15:15spewnMidje looks sweet; I wish I learned about this earlier.
15:15TimMcchouser: Point #8 does seem to cover it, must have missed it before. (Resending because I'm on a stable server now.)
15:19amalloyTimMc: good choice to resend, cause i haven't seen that message yet :P
15:19TimMcYeah, looking back, the channel was suspiciously quiet. :-)
15:19amalloyohpauleez: i'm not interested in bitbucket myself but i've echoed you to #sexpbot so if he's interested he can
15:20ohpauleezcool
15:20ohpauleezamalloy: I also have little interest in it, but I needed it to grab clojure lib stats... so alas
15:20amalloyhah
15:23semperosamalloy: where can I get the php-repl you guys are talking about? I see a few tools upon Googling
15:23amalloysemperos: it's on github
15:23amalloy$google github ieure php-repl
15:23sexpbotFirst out of 14 results is: ieure/php_repl - GitHub
15:23sexpbothttps://github.com/ieure/php_repl
15:23semperosk
15:23semperosthat's the first I found, thx
15:33stuartsierraHey rhickey: https://gist.github.com/855659
15:33stuartsierraThis works, but I don't know if it's usable in practice.
15:34stuartsierraIt depends on how quickly the PhantomReference gets garbage-collected.
15:35TimMcI don't see rhickey...
15:35stuartsierraeh, ok. It was his suggestion.
15:36TimMc(I have JOIN/PART/NICK/QUIT hidden, so... I should fire up my alt.)
15:38TimMcthere
15:42nawkis clojure a Java program?
15:42stuartsierranawk: The compiler is written in Java, yes.
15:42amalloynawk: it's more of a java library
15:43amalloythough "platform for writing programs in java" is more useful than either definition imo
15:43gfrlogyou use clojure to write java?
15:44nawkso I run java.exe clojureComputer.class <clojure_source> to compile a program?
15:44gfrlog(public class Amalloy (public static void main (String args[])))
15:44amalloygfrlog: the output of both languages is jvm bytecode
15:44stuartsierranawk: Where are you seeing clojureComputer.class?
15:44gfrlogamalloy: that's how I would have put it :)
15:46nawkstuartsierra, I didn't. Mmm.. how do I run the compiler than?
15:46nawkit's said to run under the JVM right?
15:46stuartsierrayes
15:46stuartsierraYou can run "java -cp clojure.jar clojure.main" to start the Clojure REPL (interactive console)
15:48nawkstuartsierra, that's what I mean, when I asked if it's a Java program :-)
15:48nawks/mean/&t/
15:48sexpbot<nawk> stuartsierra, that's what I &t, when I asked if it's a Java program :-)
15:49gfrlogI'm sure &t is an emoticon, but I don't know what for...
15:49nawkmeant*
15:49TimMcSome regex engines use a bare ampersand to mean "include match here".
15:49nawkgfrlog: I was using the vim replacement, sorry my bad
15:49gfrlognawk: I know; I was making a worthless joke
15:50TimMcSed might not, or might want it escaped, or might use \0, etc.
15:50TimMcah
15:50gfrlogTimMc: that right there is a good summary of why I can't ever figure out how to use a regex in bash
15:51TimMcI always have to build up my regexes a piece at a time because of that.
15:51gfrlogI just open up a ruby prompt most of the time
15:52gfrlogif that's not sufficient, I convince myself that I don't have to do whatever I was trying to do
15:57tsdhHi. Does contains? only work with clojure data types? At least (contains? [(vertex g 1)] (vertex g 1)) ==> false
15:57jweissyou could make it work with other datatypes using protocols.
15:59tsdhjweiss: Ah, ok. I'll have a look at that. But IMHO at least its docstring should mention that it won't just work for anything.
15:59tsdhah, everything.
15:59TimMctsdh: contains? is a little weird I think
15:59jweisstsdh: well, i am not sure how it works, but you'd at least have to have some kind of "equals" implemenntation
15:59TimMc&(contains? [3 4] 3)
15:59sexpbot⟹ false
16:00TimMc&(contains? [3 4] 0)
16:00sexpbot⟹ true
16:00jweisswow that *is* weird
16:00TimMctsdh, jweiss: It looks at keys, not vlues.
16:00stuartsierra"contains?" works on sets and maps, not sequences
16:00jweissright, those are indexes
16:00technomancyshould have been called contains-keys?, but too late for that now
16:00stuartsierraindeed
16:00tsdhOh, that makes it clear.
16:01tsdhSo what's the proper membership check for seqs?
16:01jkkramer,(some #{2} [1 2 3])
16:01clojurebot2
16:01jweissi think you use some
16:02tsdhOh, what an obvious name! :-)
16:02TimMc&(.contains [3 4] 3)
16:02sexpbot⟹ true
16:02TimMc&(.contains [3 4] 0)
16:02sexpbot⟹ false
16:02TimMcHow about that?
16:03gfrlog(defn seq-has? [el coll] (boolean (some #{el} coll)))
16:04nawkokay, I see how it being a "platform for writing programs in java"
16:05jweisshow is it a platform for writing programs "in java"? You're not writing them in java :) you're writing them to be run on the jvm perhaps.
16:07gfrlogjweiss: I pointed that out too 10 minutes ago
16:08jweissah yes you did :)
16:09jweisssorta like saying you're hiring a chinese translator so you can write letters to your chinese girlfriend in chinese.
16:09gfrlogthat is a strange thing to say
16:10jweisshehe
16:10technomancyexcept the word "java" means about 4 distinct things, including a stock ticker
16:10jweissi suppose it could be put better than that
16:10gfrlogtechnomancy: very good.
16:10gfrlogI suppose we ought to stop using the word 'Java' then
16:10gfrlogwhat'll we call the language?
16:10jweiss yeah but "writing programs in java" narrows the meaning a bit
16:11technomancytrue
16:11jweissi think i'd name it "Ceremony"
16:11gfrlogchurch?
16:11jweisschurch is good
16:12jweisslots of repeating yourself in both
16:12amalloyTimMc: i think hava's regex flavor uses \0 as "include match here"
16:12gfrlogamalloy implicitely suggests calling it 'hava' apparently
16:12amalloys/hava/\0(java)
16:12sexpbot<amalloy> TimMc: i think 0(java)'s regex flavor uses \0 as "include match here"
16:12amalloydamn
16:13amalloys/damn/$0 it all
16:13sexpbot<amalloy> damn it all
16:13TimMc\o/
16:14gfrlogoh I have a name suggestion
16:14gfrlogStatic Void
16:16TimMc>_<
16:16dsantiagoIs there some way to prevent a symbol from being namespace resolved in a syntax-quote?
16:16gfrlogwith ~' maybe?
16:17amalloyyeah that's the one
16:17dsantiagogfrlog, nope, fraid not.
16:17gfrlogamalloy endorsed it stronger than I did. it's his fault.
16:17amalloydsantiago: gfrlog is totally right. if it isn't working you have some other issue
16:18dsantiagoHmkay.
16:18amalloy&`[a 'a ~'a]
16:18sexpbot⟹ [clojure.core/a (quote clojure.core/a) a]
16:18dsantiagoSo, if I have nested syntax-quotes, how do you make that work?
16:19amalloy&``~'~'a
16:19sexpbot⟹ (quote a)
16:19amalloy&``~~'a
16:19sexpbot⟹ a
16:19gfrlogmy head is hurting
16:19dsantiagoAh, yes, there we go.
16:19dsantiagoThanks!
16:19amalloy$google macro writing macros amalloy
16:19sexpbotFirst out of 144 results is: Clojure: macro-writing macros
16:19sexpbothttp://hubpages.com/hub/Clojure-macro-writing-macros
16:19gfrlog&``a
16:19sexpbot⟹ (quote clojure.core/a)
16:20amalloydsantiago: my article on the topic. doesn't address your specific issue but is probably good reading anyway
16:20gfrlog&'`a
16:20sexpbot⟹ (quote clojure.core/a)
16:20dsantiagoYeah, I'll read this.
16:20dsantiagoI was looking at the Clojure wikibook, which has some good explanation of syntax-quote and unquote.
16:21amalloydsantiago: link? there are some things i have to puzzle out every time, like the order in which nested unquotes get resolved
16:22dsantiagoamalloy: http://en.wikibooks.org/wiki/Learning_Clojure/Reader_Macros
16:23gfrloghmmm...those references to core functions like (clojure/deref ...) should be (clojure.core/deref ...), right?
16:23gfrlogany reason I shouldn't change it?
16:23gfrlogI see it uses clojure.core down the page
16:24amalloygfrlog: yeah, you probly should. though there's not much point; you could structure your requires so that `foo resolved to clojure/foo
16:24gfrlogyes
16:24gfrlogwait really?
16:25gfrlogthe reader pays attention to your namespaces requires?
16:25amalloy&(require '[clojure.set :as set])
16:25sexpbot⟹ nil
16:26amalloy&(use 'clojure.set)
16:26sexpbot⟹ nil
16:26amalloy&`union
16:26sexpbot⟹ clojure.core/union
16:26amalloyhm
16:26gfrlogwait maybe I'm asking the wrong question...do these things get resolved to vars?
16:26amalloy&`intersection
16:26sexpbot⟹ clojure.core/intersection
16:26gfrlogI would think so....
16:26TimMcamalloy: Weird...
16:26amalloyi guess i can't make it work right
16:27amalloyi thought there was a way to do it, but i could be wrong
16:27gfrlog,(read-string "'a")
16:27TimMc&(require '[clojure.contrib.math :as m])
16:27sexpbotjava.io.FileNotFoundException: Could not locate clojure/contrib/math__init.class or clojure/contrib/math.clj on classpath:
16:27clojurebot(quote a)
16:27gfrlog,(read-string "`a")
16:27clojurebot(quote sandbox/a)
16:27gfrlogooh interesting
16:27gfrlog&(read-string "`a")
16:27sexpbot⟹ (quote sandbox11264/a)
16:28amalloygfrlog: syntax-quote necessarily has to be aware of your imports, otherwise it would turn `(reader f) into myns/reader instead of clojure.java.io/reader
16:28gfrlogbut imports can be changed dynamically
16:28TimMcWhoa... I didn't realize the difference was important.
16:28TimMcI thought syntax-quote was just if you needed unquote.
16:29gfrlogTimMc: yep it's weird
16:29amalloyTimMc: that is the case in common lisp
16:29TimMcAh, OK.
16:29amalloyclojure gives you namespace resolution and automatic gensyms in syntax-quote
16:29TimMcI learned PLT Scheme.
16:30TimMcIs Clojure different from most lisps in that regard?
16:30amalloyas far as i know, yes
16:31TimMc...and there it is on http://clojure.org/lisps, which I probably should re-read every week.
16:31TimMc"syntax-quote does symbol resolution, so `x is not the same as 'x"
16:31TimMcShould that be namespace resolution instead of symbol resolution?
16:32TimMcI don't think I would have understood it until today.
16:32amalloyTimMc: if there's a difference, it's not interesting enough to merit a change
16:33gfrloghow do you know it's not interesting if you don't know what the difference is?
16:33amalloyheh
16:33TimMcNew approach: Read all those clojure.org pages, but this time stop and figure out anything I don't understand immediately.
16:34amalloygfrlog: the resolution being talked about is "resolving symbols into namespaced symbols". both terms seem accurate to me
16:34TimMc"The read table is currently not accessible to user programs" <-- starting with that.
16:34gfrlogamalloy: very good
16:34gfrlogamalloy: I never should have said anything. I am ashamed.
16:35TimMcIs this talking about reader macros?
16:35amalloyTimMc: yeah
16:35amalloyi think so anyway
16:38devn_'lo all
16:38fliebelhi devn
16:38devn_oh no my nick changed so now i need to part and rejoin :(
16:39amalloygod i want (partial) and some sort of non-verbose map/array syntax in php please
16:40fliebelHah! I found a way to make for parallel. I made the return value a anonymous function, and wrapped it in (pmap #(%)) :D
16:40gfrlogamalloy: write the clojure bootstrap code in PHP, complete the clojure-in-clojure project, and there you go
16:41amalloygfrlog: pharen sounds like an easier approach
16:41gfrlogamalloy: ah, but first you would have to know that pharen exists!
16:41fliebelHow does the future/agent threadpool work? Is it fixed at cores+x, or will it reach in the thousands if asked to?
16:41amalloyfliebel: send vs send-off
16:42gfrlogfliebel: I think it's fixed...cores+2 maybe?
16:42fliebelamalloy: I'm mainly concerned with future for now.
16:42stuartsierrafliebel: there are 2 thread pools
16:42amalloythe future pool is unbounded, agents have a fixed pool and a bounded one; pmap and friends make sure to create at most N futures at once
16:43sritchie_hugod: hey, I think I'm going to start working on this hadoop crate later today. I wanted to ask, though, have you used crane at all, or do you have some sense of what that project is trying to do that pallet can't?
16:43sritchie_pallet seems pretty mature
16:43fliebelstuartsierra: A post by raek suggest agent and send-off share pools, what is the other one?
16:44stuartsierraNo, 'send' uses a fixed-size pool. 'send-off' and 'future' use an unbounded pool.
16:45fliebeloh, right...
16:46hugodsritchie_: I haven't spent much time with crane recently, so you'll have to ask a crane user :)
16:47hugodsritchie_: tbatchelli has been working on the hadoop crate
16:48sritchie_hugod: cool, didn't see his fork
16:48nawkAnother noobish question, is there an open specification for the clojure language, so that others can use on platforms other than the jvm?
16:48hugodsritchie_ I don't think he has pushed his mods yet
16:48nawks/use/write or implement/
16:48sexpbot<nawk> Another noobish question, is there an open specification for the clojure language, so that others can write or implement on platforms other than the jvm?
16:49stuartsierranawk: not yet
16:49stuartsierraThere is an active CLR/.NET port.
16:49sritchie_hugod: okay, maybe I'll send him a note, or wait to see what he's been working on
16:49amac_isn't there a clr version of clojure?
16:52tbatchelli1sritchie_, I will be trying to finish it up this weekend
16:53fliebelI've heard people consider languages without a formal spec immature :(
16:53sritchie_tbatchelli1: I'm new to pallet, but I'm at the point in my current project where I have a need to spin up a hadoop cluster, and log in to a repl on the master node
16:54nawkI am looking to learn my first functional language, at the moment comparing: haskell, racket, clojure, erlang. My prof keeps telling me about racket but I am thinking about going to something more popular like haskell
16:54sritchie_tbatchelli1: so! I'd love to help, if needed
16:54nawkwhat do you guys think?
16:54TimMcnawk: Clojure, duh. :-P
16:54nawkhah
16:54amalloynawk: did you see the sign on the door when you came in?
16:54TimMcnawk: Racket is a pretty good first language.
16:54tbatchelli1sritchie_, I'll definitely need another pair of eyes on it
16:55devnfliebel: hola
16:55dnolennawk: any of those 4 would be very good. haskell will probably be the most challenging by far.
16:55tbatchelli1sritchie_: I'll ping you when I have something relatively tested
16:55fliebeldevn: olah, got your nick back?
16:55devnfliebel: indeed :)
16:55devnsetting up my new nas...
16:55sritchie_tbatchelli1: great. I'll be here, or sritchie on github. following you now
16:57nawkTimMc: yea, he was showing me how I can construct my own language constructs (i.e., extending the language features) on the fly
16:57TimMcnawk: Who was?
16:58ossarehgreets clojurians
17:00fliebelFinal version, making for parallel: (apply concat (pmap #((apply juxt %)) (partition 32 (for))))
17:00ossarehTimMc: nawk's professor.
17:00TimMcah
17:00fliebelBrouch time down from 227241 to 138864 :)
17:01nawkTimMc: nvm. I will go with racket if I find there are open projects out there that uses it. So far, I am getting the impression that the learning curve for haskell is steep, as the first functional language
17:01dnolennawk: if you want to see someone who has really dived _deep_ into Haskell *and* Scheme, you should check this out: http://okmij.org/ftp/
17:01TimMcnawk: Racket (previously "PLT Scheme") is in pretty wide use in education and research.
17:01TimMcnawk: Big set of libs.
17:04dnolenthese peeps seem to be doing commercial Racket work, http://untyped.com/
17:07amalloyman, who wrote this wikibooks stuff on reader macros? it's mostly accurate, but a lot of the english is mangled
17:10nawkdnolen: thanks. But I think I need to find a beginners/intro site on the fundamentals.
17:10sritchie_hugod, tbatchelli: are there any example crates that require a master node, and a number of slave nodes
17:10sritchie_?
17:11nawkthe language (e.g.monad) used in that okmij site assumes prior knowledge
17:11TimMcnawk: htdp.org
17:12dnolennawk: Haskell - Learn You a Haskell ..., Racket - How To Design Programs
17:13TimMcThat book (free to read online) introduces structure-driven functional programming very nicely.
17:13dsantiagoAnyone have any insight on how to make a zipper do a postorder tree walk instead of preorder?
17:14nawkTimMc: thanks. I was kinda overwhelmed with the wiki article on functional programming
17:14dsantiagoI have the feeling I'm going to have to learn everything about zippers and write a new version of clojure.zip/next for myself.
17:15nawkdnolen: yo man, that "Learn you a haskell" site is exactly what I need
17:16nawkI was reading the wiki definition on Lambdas, and I was like "wtf"
17:16TimMcWikipedia is terrible for stuff like this.
17:16TimMcIt is basically written by aliens.
17:17amalloyTimMc: especially the wiki on unfold
17:17nawkhah
17:17amalloyit's so awful there's a note at the top "this article contains too much technical jargon"
17:18nawkamalloy, haha: it's another way of saying, "go away"
17:18dnolennawk: I highly recommend picking up the Little Schemer / The Seasoned Schemer, the predecessor for tutorials that drop serious CS in an approachable cute fashion. Not available online, but well worth having a physical copy.
17:18sritchie_dnolen: seconded
17:18amalloyall this nonsense about hylomorphisms and catamorphisms
17:19nawk.dict hylomorphisms
17:19amalloy$dict hylomorphism
17:19sexpbotamalloy: noun: The doctrine that every physical substance is the sum of its component matter and the form taken by that matter.
17:20TimMccatamorphism: A cat-preserving operation.
17:24sritchie_hugod: do you have any recommendations for sample projects, pallet or otherwise, that require a master node, with access to a number of slave nodes?
17:24sritchie_hugod: I'm wondering how that would work with the converge command
17:24hugodsritchie_: I posted a very simple exampl on the mailing list today
17:25hugodsritchie_: also https://github.com/pallet/pallet-examples/tree/master/webapp-haproxy-nodes/
17:26sritchie_hugod: great, joined the mailing list. I'll look for that post
17:26TimMcWikipedia's editor culture involves a serious obsession with jargon.
17:29TimMcAlso, I should correct myself: It is not written *by* aliens, it is written *for* aliens.
17:29amalloyyou're thinking aliens would put in some effort to translate?
17:31nawkTimMc: well, I want to learn something w/o being discouraged after reading the first paragraph
17:31gfrlogwhat's faster, a struct-map or a small vector?
17:31gfrlogor a cheetah?
17:32TimMcgfrlog: I can generally get a vector into bed faster than a small vector.
17:32TimMcs/small vector/struct-map/
17:32sexpbot<TimMc> gfrlog: I can generally get a vector into bed faster than a struct-map.
17:32TimMcI've never dated cheetahs.
17:34TimMcnawk: Are you familiar with algebraic data structures?
17:35TimMcnawk: https://secure.wikimedia.org/wikipedia/en/wiki/Algebraic_data_type
17:35TimMcgfrlog: Are you asking about creation, access, what?
17:35nawkTimMC: as in data structures that allow you to perform operations on?
17:35nawkfor example, vector additons
17:35nawk?
17:35gfrlogTimMc: hmm. I guess destructuring and creating
17:36gfrlogsay I'm doing something that would make sense as a struct-map, but I use a size-3 vector instead cause it's simpler to type
17:36gfrlogand am wondering if that's a bad idea performancewise
17:36nawkA=(1,2,3), B=(2,3,4); A+B = (3,5,7)
17:36TimMcnawk: Look at the link. It eventually wanders off into type theory, but the top of the article might be useful. You can use it as a way of reasoning about immutable data types.
17:37TimMcHTDP covers this a bit, but I don't think it explicitly uses the term "algebraic".
17:44amalloygfrlog: i think it's probably faster to use the vector anyway, but seriously if there are three elements don't even worry about it
17:45TimMcgfrlog: Write whatever will introduce fewer bugs.
17:45amalloyalso struct-maps are deprecated anyway. if you want convenience use maps or vectors; if you want performance use records. struct-maps are a compromise that is more appealing than useful
17:47gfrlogamalloy: good point
17:48gfrlogamalloy: the reason 3 elements makes me worry about it is because I saw an explanation of how vectors are implemented that makes me think some 32 slots are being created or something wasteful like that
17:48amalloy*shrug* 32 slots are indeed being created
17:49amalloyand the same will happen if you use a hash-map
17:49gfrlogstruct-map has special slots though, doesn't it?
17:49gfrlog(and records?)
17:50amalloyprobably, but i bet they also allocate an empty map to hold extra keys
17:50gfrlogamalloy: I'd hope they keep it null until you actually add something
17:50amalloy$source struct-map
17:50sexpbotstruct-map is http://is.gd/u4dU5R
17:50amalloy(pardon me while i go digging)
17:51gfrlogI'll come too
17:52amalloygfrlog: looks to me like it creates a persistentarraymap to hold the "special" slots
17:53gfrloghow are records implemented? actual classes with member variables?
17:53amalloyso, yes, there are special slots, but it doesn't allocate "exactly enough" to hold those either
17:53amalloyyes
17:54gfrlogthat would be much faster, right?
17:54amalloygfrlog: for creation or lookup?
17:54gfrlogyes
17:54amalloythe lookup is maybe three times faster
17:54amalloylast i checked
17:55amalloycreation probably is substantially faster
17:56amalloyoh, of course the faster lookup only applies if you type-hint your records and get at them with (.member obj) instead of (:member obj)
17:56gfrloghmm
17:57gfrlogcan you destructure a record like a map?
17:57amac_is there a performance benefit to using partial instead of a regular anonymous fn?
17:57amalloygfrlog: yes. amac_: no, partial is slower
17:58amalloygfrlog: but if you destructure the record like a map you get no performance benefits
17:59gfrlogyeah, that's what I figured
17:59gfrlogare records the ones with mutable fields?
17:59gfrlogI'm just going to go read the thing
18:00hiredmansince partial doesn't close over values the compiler could in theory lift them into static methods
18:00amac_hmm, having a hard time seeing the usefulness... what's a good use case for partial? will partial return if enough (but not all) args are provided?
18:01amalloyhiredman: but partial will still have to call apply
18:02gfrlogamac_: http://twitter.com/gfrlog/status/38726503944552448
18:02amac_err, I guess partial doesn't have an arg arity, my question doesn't make sense - sry
18:03amalloyamac_: (partial + 10) is arguably easier to read than #(+ 10 %), and certainly easier than #(apply + 10 %&); you also can't nest #(...) forms
18:03amac_ooooooooooooooooooooooooh, thats how to nest #()
18:03amac_that *is* useful
18:03hiredmanamalloy: the fn partial returns can be a multifn just like partial is so it doesn't have to apply for all arities
18:03amalloyhiredman: good point
18:04gfrlogamac_: when I want to nest #(), I use (fn [] ...) for the outer ones
18:04amalloyamac_: sunil wrote a version of partial that *does* have fixed arity, and returns a further partial if you don't pass it enough args
18:05amac_gfrlog: still trying to wrap my head around your tweet
18:06gfrlogamac_: it is short for:
18:06gfrlog(defn generate-unique-id []
18:06gfrlog (let [a (atom 0)]
18:07gfrlog (swap! a inc)))
18:07gfrlogthe atom is used to keep track of the last id returned
18:08tomojthat doesn't look very useful :)
18:08amac_it is beautifully short
18:08gfrlogtomoj: why not?
18:08tomoj&(repeatedly 10 #(let [a (atom 0)] (swap! a inc)))
18:08sexpbot⟹ (1 1 1 1 1 1 1 1 1 1)
18:08_ulisesyou're always inc'ing 0
18:09_ulises^^^ that
18:09amalloyuh
18:09gfrlogI may have mistyped something
18:09gfrlogI know the tweet version works
18:09gfrlogoh yes I remember
18:09amalloygfrlog: you nested your scopes wrong
18:09gfrlogamalloy: yup
18:09amalloy(let [a (atom 0)] (defn ...))
18:09gfrlogmy apologies to all
18:09gfrlogthat's what I get for writing code directly into IRC off the top of my head
18:10amac_the tweet works
18:10amac_:)
18:10gfrlogyeah I checked that before tweeting it :)
18:10tomojusing partial there is neat
18:11gfrlogsometimes things get crazy short but you can't see how to do it until you cross your eyes
18:13Raynesohpauleez: https://gist.github.com/855885 :p
18:16gfrlogwhere does the clojure community stand on comma usage?
18:16gfrlogI like using them in any context with implicit pairs
18:17ohpauleezRaynes: haha, sounds good
18:17tomojgfrlog: e.g. in let-bindings?
18:17amalloygfrlog: there's a reason they're optional. you use them where you want em
18:18technomancygfrlog: not really necessary if you have each pair on a separate line. on the same line I could go for it though.
18:18amalloyi usually write my code with spaces and then s/ /,/g so that nobody else can read it
18:19gfrlogtomoj: that's one example; also maps
18:19gfrlogtechnomancy: true
18:20amac_,(map,#(char(+(int%)1))[a,b,c])
18:20clojurebotjava.lang.Exception: Unable to resolve symbol: a in this context
18:20amac_fuck spaces.
18:20amalloyamac_: int%
18:20gfrlogyeah NASA is so 20th century
18:20amalloystill needs a separator
18:21amac_,(map,#(char(+(int%)1)"abc")
18:21clojurebotEOF while reading
18:21amac_goddam brackets
18:21amalloy&(let [int% (constantly 10)] (#(int%)10))
18:21sexpbotjava.lang.IllegalArgumentException: let requires an even number of forms in binding vector
18:21amalloywhoa really? i could swear % was legal in symbols
18:21amalloy&'int%
18:21sexpbot⟹ int
18:22amac_,(map,#(char(+(int%)1))"abc")
18:22clojurebot(\b \c \d)
18:22amac_theeeeeeeeeeeeeeere we go
18:24gfrlogamalloy: maybe it got added in edge-clojure along with the apostrophes?
18:24amac_all that to say the application of whitespace is very liberal in clojure, and its easy to make things ugly
18:24gfrlogI realized a bit ago that being a programmer has completely changed my mental bindings for the ' character
18:25amalloy&((fn[[?<&,%*+,$*|]](?<&,%*+,$*|))({[^:<?>,'*$][+(+(*)(*))(*,3(*))]}['*$]))
18:25sexpbot⟹ 5
18:25gfrlogfrom an apostraphe to a single-quote
18:25amalloyamac_: stolen from fliebel and chouser several weeks ago
18:25gfrlogapostrophe*
18:25amac_that code?
18:25amalloyyeah
18:26amac_I came up with that ugliness independently, I was going to put it on the back of an ipod
18:27amac_nifty way to do a rot13 that no one would understand
18:29amac_oh jesus, I didn't see the code you posted
18:30amac_that is... special
18:31amalloyheh
18:31amalloywant to decompose it yourself, or shall i tell you what i discovered it to boil down to?
18:32amac_I'm trying to figure it out
18:32amac_it hurts
18:34TimMcamalloy: You cheated, there's a 3 in there!
18:34TimMc(Or they did, rather.)
18:35amalloyTimMc: i think representing 3 without any numbers would have made it a little too clear what the rest of the code was doing :P
18:35TimMc,(+(*)(*)(*))
18:35clojurebot3
18:35amalloyindeed
18:44amac_ok i'm stuck
18:45amalloyamac_: hints are $1.50
18:45TimMcamac_: Mind if I post a version without gratuitous use of weird characters in symbols?
18:45amalloyTimMc: just gist it
18:45amalloythen he can follow if he wants
18:45TimMcOh, wait, I shouldn't step on amalloy's profits.
18:45amalloy(as can any lurkers)
18:49TimMchttps://gist.github.com/855925
18:50amalloy*chuckle*
18:57gfrlog$findfn [5 4 3 2] [5 4 3]
18:57sexpbot[clojure.core/butlast clojure.core/drop-last clojure.core/pop]
18:57gfrlog$findfn (list 5 4 3 2) (list 5 4 3)
18:57sexpbot[clojure.core/butlast clojure.core/drop-last]
18:57gfrlogI support abbreviating butlast to blast
18:58amac_(I snuck a look at TimMc's code snippet
18:59TimMcHelp, I'm trapped in a sexpr!
18:59amac_curious why the fn ignores the first and last element of the vector without looking like fn [_ [a b c] _] ...
18:59amalloy))))
18:59amac_)
18:59gfrlogoh that's what sexpbot means...
19:00gfrlogI guess I'm an adult now
19:00amalloyheh
19:00amalloygiven the Common-Lisp convention of using p instead of ? (eg listp), i've always been baffled by the survival of the term sexp
19:01amac_sexpression doesn't really roll off the toungue
19:01amalloyeven s-exp
19:01amalloywould be fine
19:02technomancyI've seen sexpr
19:02TimMc"secks-per"
19:02shachafamalloy: And not loop?
19:02TimMc"ess-expression"
19:02amalloytechnomancy: sure, or sexpr
19:02amalloyshachaf: that one doesn't really stand out to me cause we americans never talk about the loo
19:02gfrloghow about 'the-birds-and-the-bees-pression'
19:03amalloyplus loop is an actual word already unlike sexp
19:03TimMc(sexp) => 't
19:03shachafsexp is an actual word in a LISPer's vocabulary. Hence its survival. :-)
19:06amac_oooooooooooooooooooooooooh, I get how its pulling the val out now
19:06amac_stupid useless meta
19:06TimMchaha
19:07TimMcMetadata is orthogonal to comparison semantics!
19:07gfrlogdoes clojure.test have an assertion that an expression doesn't throw an exception?
19:08TimMcgfrlog: What's the point?
19:08TimMcOh, clojure.test
19:08TimMcWell, same question.
19:08amalloygfrlog: if an exception is thrown, the test will fail. why declare it?
19:09gfrlogamalloy: that there is a good point.
19:09TimMcThere's a way to fail if an exception *wasn't* thrown.
19:09gfrlogI guess the purpose of the test is clearer
19:09gfrlogif I say (is (happy-times))
19:09gfrlogit looks like I expect (happy-times) to return true
19:09gfrlogwhen really I'm just checking that it doesn't throw anything
19:10TimMcNo need for (is ...)
19:10gfrlog(deftest happy-times-test (happy-times)) ?
19:10amalloyTimMc: i think the "is" counts as an assertion for the summary
19:10TimMcShould work.
19:10gfrloghmm
19:10TimMcAh, good point.
19:11amalloy(deftest happy-times-no-exception (happy-times))
19:11gfrlogvery good
19:11amalloyi think you actually don't want the (is), because then if happy-times returns false or nil you'll fail
19:12TimMc(defmacro succeed [&exprs] `(do ~@exprs (is true)))
19:12gfrlogamalloy: right
19:12gfrlogTimMc: nice
19:12amalloynice, though i'd do (is (do ~@exprs true))
19:12gfrlogare there any crypto wrapper libraries for clojure?
19:13TimMcamalloy: Good call.
19:13tomojtesting that code doesn't throw an exception seems strange
19:13TimMcI think c.test also tells you how many test forms were run as well.
19:13gfrlogtomoj: yes, I was surprised to even hear myself ask
19:13TimMcI wouldn't actually use that succeed macro myself.
19:13tomojmaybe if it's hard to actually test the code?
19:14gfrlogtomoj: I think that's why I did it; heavily iterated numerical stuff
19:14TimMcRan 28 tests containing 72 assertions. 0 failures, 0 errors.
19:14tomojor if all the code does is conditionally throw an exception?
19:14gfrlogwhere the easiest way to get the expected value is to just run the code I just wrote anyhow
19:14tomoj...huh?!
19:14tomojoh
19:14tomojright :)
19:16gfrlogI repeat my crypto question in case it got lost up there: any wrapper crypto libraries for clojure?
19:16gfrlogwould such a thing be appreciated if it doesn't currently exist?
19:16gfrlogclojure.contrib.crypto?
19:16clojurebotcompiling clojure is rarely necessary to do yourself.
19:18TimMcclojurebot: That was... cryptic.
19:18clojurebotPardon?
19:18amac_BCrypt everything
19:18TimMcgfrlog: What crypto primitives do you plan on using?
19:19amac_jBCrypt exists, perhaps sexifying a library for it
19:19gfrloghashing personally; but I would think symmetric and asymmetric algs would be useful too
19:22TimMcWhat kind of hashing?
19:22TimMcMD5? SHA256?
19:22gfrlogyes, that sort of thing
19:23tomojI'd mostly appreciate the byte-array->hex-string function I'd expect to find there
19:23tomojhashing is easy
19:23swartformatting strings isn't too hard either
19:23gfrlogtomoj: I'd appreciate two functions -- one that returns byte arrays, one that returns hex-string, and both taking any reasonable kind of argument and doing reasonable things with them
19:24gfrlogon that note, it's not-being-on-irc-anymore-time
19:25tomojformatting strings?
19:27swartI mean is a wrapper library really necessary? there's a ton of stuff for java out there. if all you want to do is convert a byte-array to a hex string, how much code would it take?
19:29TimMcThere's a small but annoying amount of Java verbosity involved in getting a simple hash.
19:29tomojmine is about 7 lines, slow, stupid, and ugly
19:31johnmn3DAE type out a really long function or set of functions, run it, and the get really suprised when it works the first time... and you didn't even have to debug it?
19:31Thamster_and then 2 months later you realize there was a logical error not a compiler error in it?
19:32Thamster_just kidding
19:32Thamster_hey clojurerers
19:32Thamster_riddle me this
19:32TimMc"Parameter declaration clojure.core/deref should be a vector"
19:32Thamster_how do i write the following lisp expression in clojure
19:32TimMc^ ...why is Clojure suddenly dying when trying to compile my code?
19:33Thamster_(DEFINE SQUARE (LAMBDA(x) (* x x)))
19:33johnmn3(def square (fn [x] (* x x)))
19:33amac_(defn square [x] (* x x))
19:33Thamster_must there be the square brackets?
19:33johnmn3yea
19:34Thamster_i know there are like 10 different define macros
19:34johnmn3binding forms use a vector [...]
19:34Thamster_oh :(
19:34TimMcThamster_: Clojure has reader support for (lists), [vectors], and {maps}
19:34Thamster_i guess these aren't my father's parentheses
19:34TimMc...and uses them syntactically.
19:34johnmn3it actually makes it easier to read, I think.
19:34amac_,(#(* % %) 3)
19:35TimMcclojurebot: ping?
19:35amac_that doesn't use square brackets
19:35TimMc&(#(* % %) 3)
19:35sexpbot⟹ 9
19:35amac_did I kill clojurebot?!
19:36Thamster_haha , it was like hey no square brackets … forget this!
19:36johnmn3yea, you could use:
19:36Thamster_amac_: was hoping to define something to use later though
19:36johnmn3(def square #(* % %))
19:36Thamster_aha!
19:36Thamster_now we're talking
19:37johnmn3little sugar
19:37amac_square brackets are part of a healthy diet
19:37Thamster_thanks johnmn3
19:37johnmn3little non-fat sweetner
19:37tomojTimMc: something like (defn foo @bar) ?
19:37TimMcThamster_: More importantly, Clojure has abstract notions of "collection" and "sequence" which accept maps, lists, vectors, whatever.
19:38TimMctomoj: Why do I want that?
19:38tomojyou don't
19:38tomojI meant, something like that would cause your error
19:39TimMcOh!
19:39TimMcThanks, now I understand the error message.
19:39Thamster_hey johnmn3 how would i do the same for multiple params?
19:39amalloyThamster_: #(* %1 %2). but omg don't :P
19:39tomoj&'@foo
19:39sexpbot⟹ (clojure.core/deref foo)
19:40Thamster_amalloyirc of course not , scouts honor
19:40johnmn3(def mulitply #(* %1 %2))
19:40Thamster_honour*
19:41johnmn3it's much better to do:
19:41johnmn3(defn multiply [x y] (* x y))
19:42Thamster_yeah i just don't think i'm ready for square brackets
19:43amalloyhaha
19:43Thamster_i'm going through a lisp tutorial and clojure is way easier to install and square brackets diverge too far from the examples
19:43TimMcI'm writing a HOF that takes a function of Point2D->Point2D and composes it like (comp vtow f vtow) with functions that take a point between world and view coordinates.
19:43amalloyTimMc: do you mean for one of those to be wtov?
19:44TimMcamalloy: yup
19:44TimMcWhat's a good way to name this function?
19:44TimMcI'd love to use something like pt-op%view
19:44tomojI was thinking about functions like that earlier with (comp char inc int)
19:45tomojfeels like elegance lurking out of my reach
19:45TimMc:-)
19:45johnmn3like what?
19:45johnmn3whats that do?
19:46TimMcIt's like you're transforming the function from one vector space to another, to use a linear algebra comparison.
19:46amalloyit kinda feels like there is a monad underneath all this
19:46TimMcheh
19:46tomojI was thinking of haskell too
19:46amalloysomewhere
19:47amalloyjohnmn3: he has a function that operates on...ip addresses, say
19:47tomojI guess what bothers me is that the concept of going into a new space and back isn't really encoded there
19:47amalloyand he has functions for converting between IPs and domain names
19:47tomojthe two functions on either side could be anything
19:48amalloyand he wants to make a version of his function that works with domain names, by converting to an IP, running the existing function, then going back to a domain name
19:48TimMcOh man! I've already got functions to take both locations and offsets to and from view coords... why not also take functions to and from?
19:48TimMcSounds like I need multimethods
19:48johnmn3oh
19:48amalloyexcept his actual use case involves math
19:48johnmn3,((comp char inc int) /3)
19:49tomojthen, what, dispatch based on whether its view or world?
19:49johnmn3&((comp char inc int) /3)
19:49sexpbotjava.lang.Exception: Invalid token: /3
19:49johnmn3&((comp char inc int) \3)
19:49sexpbot⟹ \4
19:49johnmn3is what I meant
19:49TimMc&((comp char inc int) \space)
19:49sexpbot⟹ \!
19:49johnmn3I like it
19:50johnmn3But it feels like threading
19:50TimMctomoj: Dispatch on what kind of thing I am manipulating: Point, Vector, or function.
19:50tomojoh :/
19:50TimMcI really want to annotate points and such with which coordinate system they are in.
19:51tomojbeen thinking about stuff like that too, with minecraft's 4 or so coordinate systems
19:51tomojdon't see an elegant way to deal with it
19:51tomojalso sparse vs dense vectors
19:51TimMcThat's just me being Java-ish, though. I'd notice right away if I were using view coordinates in a world-expecting function.
19:51tomojmaybe not so bad with only two representations but with 4 my ideas are all messy
19:52TimMctomoj: Not familiar with Minecraft. Is there a canonical world coordinate frame?
19:52TimMcIf not, pick one.
19:52tomojthat might work
19:53tomojbasically did that with my sparse vs dense vectors too, the result being that as soon as you add, you get dense, which is unacceptable
19:53amac_Minecraft is an amazing timesink
19:55TimMclolwut... I just reworked my code so that I can drag the canvas, not just elements on it... and the canvas dragging works fine, but somehow the elements are now being dragged in the wrong direction.
19:55greghsubtraction is hard, use addition instead :)
19:56TimMcI'm using addition in both places!
19:56amac_then you're adding wrong.
19:56TimMc(loc-from-view (pt+ (loc-to-view old) delta))
19:57TimMcwhere delta is (pt-diff cur old)
20:04amalloyTimMc: different coordinate system for points within the canvas and whatever the canvas is sitting on?
20:05TimMcamalloy: I should clarify -- I do not actually drag the canvas, I drag the viewpoint that the canvas displays.
20:06TimMcI think I just have to sit back and work out what I want to happen.
20:11TimMcIn paredit, how do I kill just the next form?
20:11amalloyC-M-k
20:11amalloy(which is actually a plain emacs binding, whether or not you have paredit on)
20:11TimMcGreat, thanks.
20:11TimMcunderstood
20:12amalloy(all this has the fun side effect that you can use it when editing, say, PHP or XML too)
20:13johnmn3so...
20:14johnmn3I'm trying to write a follow up to my blog post, but I need to squeeze some more performance out first.
20:15TimMcWhat is the post on?
20:15johnmn3http://sexp.posterous.com/a-whole-lotta-automata
20:15johnmn3the follow up is about using parallel to make it go faster
20:15amalloyoh cool, i remember reading that
20:15johnmn3yea, automata is a fun topic
20:15amac_plz ping when updated
20:16johnmn3but at the end, I show where I'm experimenting with pmap, etc.. and I'm not really getting any major performance jumps
20:17johnmn3you'd think an automaton would be a simple case where it's easy to break the problem down into smaller pieces, but I'm not sure why it's not making a difference.
20:18amalloyjohnmn3: the pieces are probably too small
20:18TimMcI'm not sure how parallelism would help here.
20:18TimMcWhat amalloy said.
20:18amalloyit costs resources to start up a new thread, to glue together the results of N threads...
20:18johnmn3100,000 items, split 10 ways
20:18TimMcWith a really large world, vector computing might help, though.
20:19johnmn310,000 items per thread
20:19amalloyeven so, the time to do 10k arithmetic operations doesn't seem very large
20:19amalloysyscalls are expensive
20:19amalloybut i could be wrong
20:19johnmn3I've tried 10,000,000
20:19johnmn3and 100,000,000, split 10 ways, 4 ways, 100 ways
20:20amalloyhuh
20:21johnmn3chunkify takes the horizontal state string and splits it according to your desired chunk size
20:21TimMcjohnmn3: How long does it take for one iteration, no parallelism?
20:21TimMcwith 100M
20:22johnmn3mmm. give me a few minutes.. I'll spin the project up.
20:23tomojyou parallelize for each iteration separately?
20:24TimMctomoj: Each column depends on the last value of its neighbors.
20:24TimMc*values
20:24johnmn3I take a whole time step (say, 10,000,000 wide) and break it into large chunks, then pmap over that
20:25DespiteItAllI still don't see how that would be enough cpu time to make pmap worth it
20:25tomojand then combine all the answers into one big vector and repeat?
20:26DespiteItAllbut hard numbers would definitely help
20:26johnmn3tomoj: right
20:26tomojvectors aren't good at combining :(
20:27amalloytomoj: yeah, but to get the random access later surely it's worth it
20:27DespiteItAllmight be better to work with lists, stitch them together, then convert to vector
20:27DespiteItAllhow long does that conversion take anyway?
20:27johnmn3well, if 10,000 items take 1 second under non-parallel conditions, should 100,000 items still take 10 seconds (with 10,000 item chunks) if paralleled?
20:27tomojseems like there's got to be a better way given the problem
20:28tomojdon't really need random access, do you?
20:28johnmn3lists got slower for me.
20:28amalloyyeah, i was thinking about that too tomoj
20:28johnmn3forgot why, cause I'm conjing, or something
20:28amalloyyou could maybe memoize a lookup-in-previous-list
20:28amalloyto let you keep working with vectors
20:29amalloyer, work with lists but get fastish access
20:29johnmn3memoizing shouldn't help, if the input is seamingly random.
20:30johnmn3for the whitespace on the sides, it'd help.
20:30johnmn3if the cache lookup is faster than an 8 element hash-map
20:30amalloyjohnmn3: to look up element 100000 in a list, you have to look up items 1-99999
20:30amalloyso memoizing could help
20:30johnmn3?
20:31amalloysuppose you didn't convert to a vector at all
20:31johnmn3nth on a vector is faster than a list, right?
20:31TimMcjohnmn3: Have you explored whether transients are any faster?
20:31amalloyjohnmn3: of course
20:31amalloybut creating the vector is crazy slow
20:31johnmn3TimMc: I should
20:32amalloyand if you could simulate random access on a list by memoizing, building up a vector-ish thing as you go, it might be faster
20:32johnmn3what do you mean by using memoize?
20:32dnolenjohnmn3: have you tried using a JVM profiler ?
20:33johnmn3dnolen: no, not yet. I should though.
20:33amalloyjohnmn3: (def get-nth-subseq (memoize #(nth % previous-generation)))
20:34amalloyexcept that instead of using nth, you (a) find the furthest into the list you've looked so far and start from there, and (b) return a whole subseq, not just a single element
20:34dnolenjohnmn3: yup. Otherwise you just end up guessing.
20:35johnmn3what is memoize returning there?
20:35johnmn3what are the chances you have the same data?
20:36amalloyjohnmn3: it's starting to feel like getting my point across is not worth the effort given that i don't actually know this will help
20:37tomojI've got one agent with always nil state which dispatches to itself with a delay. seems silly. better way?
20:37johnmn3amalloy: there might be a way to treat the data more like a stream
20:44johnmn3almost up with the project, had to pull it down on this new vm
21:08TimMcHaha, my subtraction *was* backwards... but my intuition regarding viewpoint dragging was also backwards... I think.
21:11tomojbut they didn't cancel out?
21:11TimMctomoj: They canceled out for the canvas dragging, sure.
21:11TimMcviwpoint dragging, excuse me
21:11TimMcBut any time I tried to drag an *object* in the view, it moved in opposition!
21:12TimMc(Whereas befor my edits, they hadn't.)
21:14TimMcOK, beautiful.
21:17gfrlog,(((constantly constantly) constantly) constantly)
21:20gfrlog&(((constantly constantly) constantly) constantly)
21:20sexpbot⟹ #<core$constantly$fn__3551 clojure.core$constantly$fn__3551@1182c98>
21:21johnmn3does anyone know how to read the output of visualvm?
21:21johnmn3I have an overview tab, monitor tab, threads tab, sampler tab, and a profiler tab.
21:23dnolenjohnmn3: you'll probably want to profile the CPU
21:23johnmn3under the sampler tab, org.netbeans.lib.profiler.server.ProfileServer.notifyClientOnResultsAvailability () is taking up 97.4% of the time
21:24johnmn3under the Profiler tab, java.util.concurrent.ThreadPoolExecutor$Worker.run () is taking up 85% of the time.
21:25johnmn3looks like there are only 2 thread pools too
21:31johnmn3running again. Does it sound wrong that 95% cpu time is spent in java.util.concurrent.ThreadPoolExecutor$Worker.run ?
21:37johnmn3strange
21:37johnmn3running non-parallel now. sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run = 75% now
21:38johnmn3and clojure.lang.LineNumberingPushbackReader.read = 18%
21:38johnmn3it's using boxed Numbers.add and Numbers.Lt too
21:41DespiteItAllI think you have to ignore the rmi stuff. I think that's an artifact of the profiling.
21:43johnmn3okay. and I see now that adding profiling causes the program to take around 1100 to 1200% longer
21:43johnmn3so don't user large numbers
21:44DespiteItAllyeah, it's more about relative times. Boxed arithmetic is an easy target to eliminate.
21:44johnmn3but for some reason, the automaton is thrashing hard on the LineNumberingPushbackReader
21:44johnmn3is that an artifact?
21:44DespiteItAllThat's interesting
21:45johnmn398% on the last go round
21:45DespiteItAlllet me look at your code again, I have no idea where that would be coming from
21:45DespiteItAllyou're using visualvm?
21:45johnmn3yea
21:45DespiteItAllyou can take a snapshot, then look to see where in your code that's getting called
21:46DespiteItAllit's like snapshot -> hotspots -> call trace, I think.
21:46johnmn3there's code up here: git://github.com/johnmn3/automata.git
21:49DespiteItAllwhat function are you profiling?
21:51TimMctomoj, johnmn3, amalloy: I ende up defining "isomap" <https://github.com/timmc/CS4300-HW3/blob/master/src/timmcHW3/utils.clj#L88-92&gt; for that isomorphic transform HOF. Very simple, but it seems useful.
21:51tomojclojure for your homework? lucky
21:52TimMcindeed
21:52TimMcChoice of languages.
21:52amalloytomoj: he just names his programs cryptic numbers so that it looks like they're homework
21:52TimMcHere's an example of usage: https://github.com/timmc/CS4300-HW3/blob/master/src/timmcHW3/core.clj#L439
21:52johnmn3I don't know what I'm doing. I just launched visualvm, then did a lein repl, load-file, (ns automata.par), and ran some tests on par and non-par... visualvm sees the application start up and I just open it from there and view it.. not sure how to do more specific profiling yet
21:53DespiteItAllright, I'm just wondering what exactly you ran when you saw all that pushbackreader activity
21:53johnmn3oh, sec
21:54tomojload-file would be an understandable culprit
21:54tomojonly if that's about all you were profiling..
21:54johnmn3(def initial-conditions (core/make-initial-conditions 10000))
21:54johnmn3load-file doesn't run anything automatically
21:54johnmn3(time (take 20
21:54johnmn3 (drop 490
21:54johnmn3 (last
21:54johnmn3 (core/run-steps 10 rules/rule-90-stepper initial-conditions)))))
21:56johnmn3does anyone think it would be a bad idea to farm the chunks in the par version out to agents? isn't the same thing going on with pmap anyway?
21:56DespiteItAllit's really helpful to understand what pmap is doing, where its weaknesses are, etc
21:57johnmn3with pmap, I was seeing 2 threadpools with around 50 to 100 threads at any given time, each
21:57DespiteItAllthis talk helped me a log http://clojure.blip.tv/file/4645227/
21:57DespiteItAlllot
21:57johnmn3I thought it used fixed size threadpools
21:58DespiteItAlland made me wish the fork-join stuff was mainlined already
21:58johnmn3yea, I watched that. It was quasi-inspirational for me to delve into par for this automaton
21:58DespiteItAllYeah, I saw the same thing with pmap. When you're consuming as much as you can, it just spawns threads like crazy
21:58DespiteItAllthat's contrary to every description I'd read of it
21:59johnmn3yea, I thought I read that it uses a fixed size thread pool.. rather, it looks like a fixed number of threadpools
21:59amac_n
21:59johnmn3and I have a quad-core intel = 8 visible threads to the OS.. and only 2 threadpools?
22:00DespiteItAlli think the number should be procs + 2
22:01johnmn3I wonder if the threadpool is jacking me up though.. cause I've seen all 8 OS procs pinged out when running pmap over the automaton, while looking at window's task manager.
22:01johnmn3erm, s/threadpool/profiler
22:01amalloyjohnmn3: if you actually wait on the pmapped list entry there should be a fixed number of them
22:02amalloybut if you consume them all and then wait on them all, it can't help but give you loads of future objects
22:03DespiteItAllmy conclusion is that it's difficult to use pmap correctly
22:03amalloynot sure if that's your issue as i haven't looked at the code, but it seems worth mentioning
22:03johnmn3amalloy: not sure if I understand. say I have a 1000 item set, I break that into 100 item sets, in a 10 item set. If I pmap across that, the function should be applied to 100 items, for each thread in parallel, right?
22:04johnmn3not "set" in the clojure.set sense
22:04johnmn3a vector
22:04amalloyjohnmn3: you were asking about having too many active futures, where you expected a fixed threadpool
22:04johnmn3k
22:05amalloy(vec (pmap foo (range 1000))) has to return to you a vector of 1000 (future ...) objects
22:05amalloyand futures run on an unbounded pool
22:05TimMcI'd like to dispatch on arity & type -- any easy way?
22:06johnmn3TimMc: dispatch on function with multi-methods
22:06amalloyif you instead did something like (let [results (pmap foo (range 1000))] (doseq [x results] @x) results) i think you would have far fewer actually-active threads at once
22:06TimMcjohnmn3: I know about multimethods but I'm not sure what you're saying.
22:07johnmn3amalloy: how many futures result from (vec (pmap foo [(range 1000) (range 1000)])) ?
22:07TimMcWait... can the dispatch function... count the args?
22:07amalloy2
22:07johnmn3TimMc: what ever you want it to do, it's a function
22:07TimMcfascinating
22:08TimMcAlas! I want a different return type on one of these. Oh well.
22:08johnmn3amalloy: so that's what I'm doing.. I'll take a 1000,000 element sequence and split it ten ways, then pmap on it.. should that spawn 10 threads?
22:08amalloyheh. multi-methods, the fantastic clojure construct that allows any logic in the dispatcher...except arithmetic!
22:08amalloyjohnmn3: yeah, sounds like ten to me
22:09johnmn3right, that's not what I'm seeing. it's strange
22:11johnmn3what do the different colors of the threads mean in visualvm? yellow, red, green..
22:12DespiteItAllshould be a key there. active, waiting, sleeping
22:12amalloythey're like bananas: yellow ones are ripe; the green ones you should leave on the tree for a while
22:12johnmn3:)
22:12DespiteItAllred is what the hell kinda banana do you have
22:12amalloyindeed!
22:13johnmn3so, I think the LineNumberingPushbackReader is just the repl sitting idle
22:13DespiteItAllheh
22:13DespiteItAllI think you may be tracing the wrong process?
22:13DespiteItAllare there two clojure processes?
22:13johnmn3what do you mean? no, just one
22:14johnmn3and jline.consoleRunner
22:14DespiteItAllOk, that must just be how I launch mine
22:14amalloythat's part of some comedy sketch i remember. bananas are like traffic lights but the numbers mean different things: "Green means whoa, slow down a little; Yellow is yeah, go right ahead; Red means where the hell you get that banana from"
22:14DespiteItAllI think it's vimclojure doing it
22:14DespiteItAllMitch Hedberg, RIP
22:14johnmn3whats it doing?
22:14DespiteItAll"My buddy asked me if I wanted a frozen banana, I said no, but I want a regular banana later, so yes"
22:15amalloyDespiteItAll: oh, neat. i never actually heard his show; someone just told me a couple of the funny bits
22:15DespiteItAlloh god, find his cd's ASAP. best show i've ever been to.
22:17johnmn3deref takes up 0.3% cpu time
22:17amalloyer, looks
22:17johnmn3it's all the same in cyberspace
22:17clojurebot9
22:17johnmn3all character strings
22:18amalloythanks clojurebot
22:18amalloyi wasn't sure what number was most appropriate for this conversation but you've cleared it all up
22:18DespiteItAllheheh
22:18TimMclol
22:18TimMc^ I only say that when it's true.
22:18johnmn3DespiteItAll: I never found a "hotspot" option
22:19DespiteItAllHrm, just a sec
22:19DespiteItAlldid you take a snapshot?
22:19TimMcclojurebot: testing42 is <reply>42
22:19TimMcyada testing42 yada
22:19amalloyTimMc: he doesn't jump on every message
22:19johnmn3hmm. KirinDave's irc client is hosted on amazonaws.com? DespiteItAll: yea, then what?
22:19amalloy~testing42
22:19amalloytesting42?
22:20amalloymeh whatever
22:20TimMcI wonder what it triggered on.
22:20amalloyTimMc: he's set to trigger randomly
22:20johnmn342
22:20amalloyin addition to some specific intentional triggers
22:20TimMcAnd just spew random?
22:20amalloywell i didn't write it obviously, but my understanding is he interprets 0.5% of all messages as if they were addressed to him
22:21amalloyand does his best to answer them
22:21johnmn3clojurebot: what?
22:21TimMcweird
22:22TimMc#apache, last time i was there, had an *amazing* helper bot.
22:22TimMc"fajita" would answer about 25% of the questions that people would come in to ask
22:22TimMcI think most of them never knew it was a bot.
22:22KirinDavejohnmn3: My internet connection sometimes plays caching games because AT&T sucks.
22:22KirinDavejohnmn3: I tunnel through an EC2 instance to alleviate these issues
22:23johnmn3mmm
22:23KirinDaveCrazy as it sounds, going through EC2 is better than going through a broken cache run by AT&T
22:24TimMcKirinDave: You might also get better latency, weirdly enough.
22:24johnmn3what do you mean a cache? like an optimizer?
22:24DespiteItAllOk, I'm in linux but it should be the same. At the bottom of the snapshot window there are tabs for call tree, hot spots, combined, and info
22:24johnmn3I wonder if I'm running through a cache
22:25DespiteItAllhot spots gives me the same sort of info as the main profiler. but I can right-click on a function and choose either backtraces or call-tree
22:25johnmn3DespiteItAll: which tab are you in? for a given snapshot, I have "overview" "Monitor" and "Threads"
22:25johnmn3hmm
22:25TimMcjohnmn3: If the cache isn't broken, you wouldn't be able to tell without using timing info.
22:26DespiteItAlljohnmn3: oh I think there's two different "snapshots". Are you hitting the snapshot button from the profiler window?
22:26johnmn3yyyyea, I think
22:26johnmn3I'm taking a snapshot while it's running
22:27DespiteItAllWeird. When I do that, I get a snapshot on the left side that's under the main process. The tabs on top are then overview, monitor, threads, profiler, [snapshot]
22:27johnmn3while it's running, from the toplevel menu, I'll click "Applications" and "application snapshot"
22:28DespiteItAllahhh, do you have "profiler snapshot"?
22:28johnmn3what version are you running?
22:28johnmn3yea, I do have a profiler snapshot
22:28johnmn3do that?
22:28DespiteItAllyeah, try that
22:28DespiteItAllI'm running 1.2.2
22:28johnmn3aaaaah
22:28johnmn3there it is
22:29johnmn31.3.2 here
22:29DespiteItAllWhen profiling, I have a few buttons. a trash can, an arrow, "snapshot", and some disks. I just hit that snapshot button.
22:29johnmn3ah
22:29DespiteItAllI should updat4e
22:29johnmn3for realz
22:29johnmn3you running fedora?
22:29DespiteItAllubuntu
22:29DespiteItAll9.04 or something
22:29johnmn311.04 has 1.3
22:30DespiteItAllI don't like change :)
22:30johnmn3yea, that's ancient
22:30johnmn3:)
22:30DespiteItAllit's not my fault they're determined to make every new version suck more than the last
22:30DespiteItAllanyway, I gotta run. Good luck profiling!
22:31gfrlog,(alias 'a 'b)
22:31gfrlog&(alias 'a 'b)
22:31sexpbotjava.lang.NullPointerException: Expecting Symbol + Namespace
22:31johnmn3DespiteItAll: thanks!
22:31gfrlog&(doc alias)
22:31sexpbot⟹ "([alias namespace-sym]); Add an alias in the current namespace to another namespace. Arguments are two symbols: the alias to be used, and the symbolic name of the target namespace. Use :as in the ns macro in preference to calling this directly."
22:31johnmn3wow.. way too many futureTasks
22:31TimMcjohnmn3: I have a pristine Install/Live CD pair pack of Ubuntu 5.10 :-)
22:32johnmn3interesting though, to drill down into the call stack. TimMc: that you're running?
22:32TimMcNaw. I'm on 10.04 or something.
22:33TimMcWas on 9.04ish for a while because of a FS corruption bug they still haven't fixed in an intermediate release.
22:34johnmn3I can't help my self.. I'm running the new 11.04 with unity in a vm
22:34johnmn3I used linux as my primary OS for... 6 or 7 years
22:35johnmn3then I bought this new envy 14
22:35johnmn3with one of those new "hybrid graphics cards" ... and I decided to just leave win7 on there
22:35johnmn3Linux can't do anything with these new hybrid graphics cards.. frustrating
22:37johnmn3does anyone know how to set the number of threadpools in clojure, for agents?
22:37johnmn3*threadpool* or something?
22:42amalloythe...number of threadpools? do you maybe mean the number of threads in the pool? either way though i don't think there's an easy way to do it; i think your best bet is dealing with j.u.concurrency yourself
22:47gfrlogI am thinking it would be convenient to have a pr-str function where lists are either converted to vectors or quoted :-/
22:48johnmn3something made me think that threadpools have only one active thread at a time. and the pool manages timeshares between the threads, and you have multiple pools for multiple procs
22:48johnmn3looks like most of my time is spent on deref
22:49johnmn3and creating vectors
22:50johnmn3amalloy: I guess it makes more sense what you said, given the term "fixed size threadpool"
22:51amalloygfrlog: it kinda would, wouldn't it, now that you mention it
22:53amalloy&(use 'clojure.walk)
22:53sexpbot⟹ nil
22:54amalloy&(let [f [1 '(2 3 [1])]] (postwalk #(if (seq? %) (vec %) %) f))
22:54sexpbot⟹ [1 [2 3 [1]]]
22:54amalloygfrlog: good enough?
22:57gfrlogoh sorry
22:57gfrlogum
22:58gfrlogthat looks fantastic
22:58gfrlogthanks.
22:59gfrlogI need to get more familiar with clojure.walk I think.
22:59amalloyi have a transform-if in my little toolbox which would be well-suited for that
22:59amalloy(postwalk (transform-if seq? vec) f)
23:01gfrlogon that note -- g2g lol rofl l8ers bye
23:01gfrlogs/g2g lol rofl l8ers bye/goodnight
23:01sexpbot<gfrlog> on that note -- goodnight
23:02amalloygfrlog: https://github.com/amalloy/amalloy-utils/blob/master/src/amalloy/utils/transform.clj#L3 if you want to steal it
23:02amalloyhah! got it before he left
23:07gfrlogamalloy: you may have got it before I left, but it immediately was lost off my screen and it took me several minutes on the IRC log sites to retrieve it because apparently it is tomorrow in certain time zones already.
23:07amalloyheh
23:07amalloyyeah, i figured as much. i was going to tweet it for you actually
23:07gfrlogmakes me think the n01se.net thinger must be in argentina
23:08gfrlogyou can tweet it anyway, then the people who do social graph analysis will think we're slightly more popular and influential
23:08amalloygfrlog: other way round, surely? like england or something
23:09gfrlogamalloy: I'm in eastern US and it's still an hour from midnight. One hour later puts it farther east, which is either the eastern half of south america or maybe someplace in canada or iceland or something
23:10amalloygfrlog: yeah you seem to be right, there. i'm even worse at geography than i thought
23:11gfrlogoh then this will be fun: Which US state is closest to Africa?
23:11amalloybecause it's fun, i'm going to assume hawaii
23:11gfrlogno, but if you picked several more fun states you might get it
23:11gfrlogjust bounce around a bit at various extremes
23:12amalloyum, alaska? can i wrap around a pole or something?
23:13gfrlogno, it's not that drastic of a trick
23:13gfrlogmore of a bending...
23:14gfrlogokay okay fine
23:14gfrlogMaine it is
23:14amalloywho knew
23:15tomojalong the surface?
23:15gfrlogyeah
23:15gfrlogit's completely obvious if you look at a globe
23:15gfrloggoogle earth would do as well
23:15gfrlogthe standard projection completely distorts it
23:17gfrlogokay. Let's try this again
23:17gfrlogno sneaky links at the last second
23:17gfrlogbye
23:18amalloywhoops. accidental empathic /part there i guess