#clojure logs

2011-09-04

00:02amalloytechnomancy: hey, glad to see i'm not the only one getting use out of clojurebot's "zip" spiel
00:03technomancyamalloy: making clojurebot earn its keep
00:04amalloy(def clojurebot (memoize technomancy))
00:05technomancyhehe
00:13technomancycemerick: not ignoring your post to the lein list; I promise. =)
00:14technomancyjust too much stuff in that post for me to address with my strangeloop talk still hanging over my head
00:15technomancythat said, having a separate list of repos for deployment vs deps sounds great and I'd take a patch for that even before 2.0 without much further discussion
00:15user317is there an equivalent to haskells . operator? so i can do something like (x . y z) === (x (y z))
00:15technomancy(doc comp)
00:15clojurebot"([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc."
00:15cemerickWhew, I thought my 'r' key was going to break from the ⌘-R keystrokes every 5 minutes… ;-)
00:15technomancyuser317: ^^
00:16technomancyhehe
00:16technomancyuser317: I think anyway, I haven't used haskell myself
00:16amalloygive the man a cigar
00:16cemericktechnomancy: I'll see what I can do about the separate deployment repos sooner rather than later.
00:16user317hehe, the blind leading the blind
00:17technomancythat'd be super
00:17amalloy&(let [f (comp inc +)] (f 5 6))
00:17lazybot⇒ 12
00:17cemericklooking forward to it
00:17technomancycemerick: it's one of the workshops on sunday rather than a regular talk
00:17technomancyand it's on Emacs =)
00:17user317so (x (y z)) === ([x y] z) ?
00:17cemerickah, that's why I didn't notice (on both counts! :-P
00:17technomancyI'm sure you'll be in the front row taking notes
00:18amalloyuser317: no
00:18cemerickI didn't sign up for any workshops. Nothing really tickled my fancy.
00:18user317oh i see, nm
00:18cemerickAt least, not enough to be away for the entire weekend.
00:18amalloy(x (y z)) === ((comp x y) z)
00:18technomancyI might have gone to the machine learning one if it hadn't been in the slot immediately preceeding mine
00:18user317yea, makes sense, its my second day playing around with clojure, i still get easily lost in the syntax :)
00:20user317so are record access functions, functions?
00:20user317(:foo bar), is ":foo" a real function?
00:20amalloy&(fn? :foo)
00:20lazybot⇒ false
00:20amalloy&(ifn? :foo)
00:20lazybot⇒ true
00:20cemerickuser317: keywords (and symbols) implement IFn, the root function interface in Clojure's backend. So, yes, they are functions.
00:21cemerickYou could implement a Clojure function in Java or Ruby or Scala, if you so chose to.
00:21user317ok, cool
00:21user317is ruby on java heavily used?
00:22cemerickquite, yes; JRuby, that is
00:22user317cool, i haven't used ruby in a loooong time, glad its still kicking around, i always thought it was cleaner then python
00:29user317so is this a bug in lein? when i run an interactive shell and rerun the test command it doesn't build my sources if i change them
00:30user317also, it hangs when it cant resolve a symbol
00:30technomancyuser317: there's a (require 'foo :reload) call in tests in the latest release
00:31technomancythere may have been a bug where it was missing in an earlier version
00:31cemericktechnomancy: FYI, I think I'm probably 80% through a spike of a deploy-to-central plugin.
00:32cemerickIt would've been a one-afternoon job, but the bleeding got too bad near the end. Had to send for medics.
00:32technomancycemerick: cool, so something that handles signing and the rest?
00:32user317cool, thanks, ill check it out
00:32technomancyuser317: lein interactive is certainly not as well-tested as the integration with various editors though
00:33cemerickmvn's (via the ant tasks) is doing all the heavy lifting. There's (IIRC) some very nasty skeletons around the gpg signage that central expects; not using mvn's gpg plugin as dictated by the OSS parent POM is not something I have a lot of interest in exploring. ;-)
00:34technomancyah, gotcha
00:40cemerickhrm, maybe it was older versions of maven that fell down on the signing…
00:40cemerick"Maven 2.1.0 and 2.2.0 produce incorrect GPG signatures and checksums respectively." Nice!
00:42amalloycemerick: signatures are for sissies anyway
00:42cemerickamalloy: duly noted!
01:38user317is there partial function application?
01:39user317duh, partial :)
01:50user317how do i transpose a list of lists? not just (map list ls1 ls2) but (map list (list ls1 ls2))
01:52amalloy&(doc apply)
01:52lazybot⇒ "([f args* argseq]); Applies fn f to the argument list formed by prepending args to argseq."
01:53amalloyi was going to say, doesn't haskell have apply? but i guess it can't
01:53user317yea, it cant, unless you use generics
01:54user317which, imho, if you are you are doing something wrong :)
01:58user317&(map (partial apply list) (list '(1 2 3) '(4 5 6)))
01:58lazybot⇒ ((1 2 3) (4 5 6))
01:58user317oh wait, nm
01:59user317&(apply (partial map list) (list '(1 2 3) '(4 5 6)))
01:59lazybot⇒ ((1 4) (2 5) (3 6))
02:04amalloyuser317: not that using lists is a crime or anything, but vectors have a more convenient literal syntax. plus, using lists for (mostly) code and vectors for (mostly data/bindings) provides useful visual cues
02:05amalloy&(apply (partial map list) [[1 2 3] [4 5 6]]) ;; easier to write and read
02:05lazybot⇒ ((1 4) (2 5) (3 6))
02:11user317amalloy, thanks, ill keep it in mind, i think my code looks like its translated from haskell :)
02:11user317do lets get evaluated or are they only evaluated if the branch is taken
02:11amalloypoint-free style loses something in the translation; clojure's syntax doesn't make it as pretty
02:13user317yea, i think so, but i am starting to like it, like the chains of static typing have been lifted :)
02:13amalloy*chuckle*
02:13amalloyalas, hoogle has abandoned you
02:13user317its like riding a volvo vs a motorcycle at night drunk and without a helmet
02:14amalloyhm. which language is which, here?
02:14user317well, haskell is really safe
02:14user317on accasion your program blows up in memory for no reason, but beyond that once you compile you are basically done
02:16amalloyi've only dabbled in haskell, but the number of clojure programs that are Right The First Time is a lot higher than, say, java or C programs
02:17user317yea, i think thats common to functional languages all around
02:17amalloyi'm happy to believe that this is even more true for haskell, but having made a living with C, Java, and now Clojure, i'd say Clojure is the best at being predictable
02:17user317haskell is lazy evaluated, which makes reasoning about memory usage really difficult
02:18amalloynot just memory, but stack too, right?
02:19user317yea, its a similar problem, the stack or the heap blows up when you have some infinite data structure that you are trying to evaluate completely
02:19user317like a foldl on an infinite list vs a foldr
02:20amalloyyou can get into similar situations with clojure's lazy sequences
02:20amalloyeven though the language itself is eager, the laziness of sequences, while useful, is occasionally surprising
02:20user317yea, i am sure, its a great abstraction though, unfortunately nothing is bulletproof
02:21amalloyclojurebot: haskell?
02:21clojurebothaskell is Yo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you don't compute.
02:22user317hehe
02:22ambrosebslol
02:22amalloyheh. i haven't heard that one before
02:23amalloyclojurebot: scala?
02:23clojurebot{((x: Any, y: Any) => (f: Function2[Any, Any, Any]) => f(x, y))(1, 2)((x: Any, y: Any) => x)}
02:23amalloygood stuff
02:23cemerickmm, there's that new one…
02:24user317heh
02:25amalloyclojurebot: now you've got me curious. what do you know about python?
02:25clojurebotpython is ugly
02:25cemerickclojurebot: scala is val foo = bar ~-> 45 <~< "Fred" %% x
02:25clojurebotIn Ordnung
02:25user317clojurebot: what do you know about lua?
02:25clojurebotTitim gan éirí ort.
02:25cemerickalmost the same knock against ruby tho…
02:26amalloyuser317: i think we just got lucky that he guessed i was asking about python
02:26amalloyclojurebot: lua?
02:26clojurebotExcuse me?
02:26amalloywell, i guess now's your chance to teach him something
02:27user317haha
02:27amalloy$google funny lua code
02:27lazybot[Loading Lua code dynamically for fun and profit (on-calc Lua editor)] http://www.omnimaga.org/index.php?topic=9178.0
02:29cemerickclojurebot: python is "I think dropping filter() and map() is pretty uncontroversial…" — GvR
02:29clojurebotYou don't have to tell me twice.
02:29hiredmanclojurebot does try and pull the subject of sentences out via parts of speach tagging using https://github.com/dakrone/clojure-opennlp
02:29amalloyhiredman: nice
02:30cemerickI should stop. I'll blow clojurebot's heap if I load up all the winners I've seen from GvR.
02:30amalloyi'd love to teach clojurebot that lua is http://www.facepunch.com/threads/993206-PointMod-Bad-lua-code-PointMod - but this looks like a guy who could write bad code in any language
02:30amalloydoesn't clojurebot have a database backend???
02:30lazybotamalloy: How could that be wrong?
02:30wdkrnlsHi, I am trying to setup SLIME. I installed lein, elpa, swank-clojure and slime packages as well as clojure-mode, but slime never connects.
02:30hiredmanyes
02:31cemerickamalloy: joking, my man, joking :-)
02:31amalloyhiredman: sorry, i guess with lazybot on /ignore you don't get the joke. he jumps in to respond in the positive if you end a question with ??? (and ?? is negative)
02:31cemerickheh, I didn't get the joke either :-P
02:32cemericklua's used as the scripting lang for so many gaming engines that there's a *lot* of bad lua out there to mock, if one is so inclined.
02:32amalloyah, my highbrow humor is lost on the #clojure crowd
02:33cemerickThe extra two ?s make it highbrow?
02:33cemerickMaybe that indicates a british accent?
02:33hiredmanI've been thinking it might be interesting to figure out the subject of sentences and keep per subject markov models for generating responses
02:34amalloy"i want to concat two lists into another list? please, anyone help me, is it possible???" - i've just noted that people who ask a question with three ???s are usually crazy, so giving them a bot response seems appropriate
02:36cemerickMaybe reply with, "Why, yes, Prime Minister!"
02:36cemerickProbably too on the nose.
02:37amalloycemerick: happy to add that to the list of positive responses :P
02:39user317does apply come from lisp?
02:40amalloyyes
02:41amalloyeventually, everything but fortran comes from lisp
02:47currentBHi everyone, I kind of have a design related question:
02:48currentBI'm building a sort of toy shopping cart web app (based losely on http://kylebanker.com/blog/2010/04/30/mongodb-and-ecommerce/) , using Mongo as a DB, with congomongo to use it from clojure.
02:50currentBso a cart is represented by a mongo document, which would basically translate to a hash map in clojure, with containing a key :line-items, with value [{:name "item1" :price 5}{:name "item2 :price 3} ...]
02:51currentBeh, each line item would also have a :qty also
02:51currentBI'm unsure how to go about updating items, which will need to be done fairly often
02:52currentBis it better to write a few functions the find the items based on :sku (this would also be in each item), update it and return the new vector, and thus update the mongo document
02:53currentBor to go lower level and do it using custom mongo queries
02:53currentBor is this a stupid question and it doesn't really matter
02:53amalloythey both seem like dumb approaches
02:53currentBwhat's a good one?
02:53amalloymake a shopping cart just contain SKUs and quantities
02:53amalloythen you can change the "properties" of a SKU with a single write to one place
02:54hiredmaneventing sourcing seems aim square at that sort of thing
02:54currentBhmmmm
02:55hiredmanthe state of the cart is derived from a series of events starting with create cart id=x, add item x to cart id=x, ...
02:56hiredmanactually the last event sourcing presentation I saw used a shopping cart as an example
02:56hiredmanhttp://www.infoq.com/presentations/Events-Are-Not-Just-for-Notifications
02:56currentBsweet I'll watch that thanks!
02:57currentBand amalloy, do you mean have a mongo doc that just looks more or less like {"sku123" 2 "sku3123" 5}
02:58amalloy*nod*
03:01currentBor I guess something like {"sku123" {:name "item1" :qty 5}...} } to avoid looking up names each time, and stuff like shipping info could be elsewhere
03:02hiredman*shrug* doing a lookup by key (sku) can be made very fast
03:02hiredmanand cached since sku=>item mapping shouldn't change
03:02amalloyi agree. if you want to cache stuff, cache stuff. don't pollute the data model
03:03currentBk
04:25lobotomy_jkkramer: you're right - simply adding (set ... ) to remove-threatening-squares fixed the problem
04:27lobotomy_obviously that should have been returning a set all along - apparently the reason why things still worked is because initially i create a bunch of sets, and i guess those often but not always remained sets :)
05:44lobotomy_hmm, when i'm typing code in emacs, on the status line it shows a completion hint (that is, function definitions with args)
05:44lobotomy_but occasionally it stops showing that. how do i make it resume showing that?
06:15lobotomy_oh, it seems there was a forgotten window with some exception, waiting for input. my bad ;)
06:28NetpilgrimHi. In the code at https://gist.github.com/1191537 the pre conditions are ignored. Could someone look at it and tell me what's wrong with it?
06:49wunkiough, struggling with paredit mode..
06:52aamarNetpilgrim: in the example, you're calling the code with 2 args, and there's no :pre condition on that case.
06:52aamarno, I'm wrong... ignore that.
06:54Netpilgrimaamar: Thanks for looking at it.
06:56raekmaybe defrecord does not "support" pre and post conditions
06:59Netpilgrimraek: I'll look into it.
07:06Netpilgrimraek: You seem to be right. When I define the very same function outside the defrecord (https://gist.github.com/1191537) the pre conditions work.
07:08aamarNetpilgrim: mentioned here: http://groups.google.com/group/clojure-dev/browse_thread/thread/006678a29f02b212
07:09aamareven {:pre [false]} seems not to run, so it does seem like the conditions are just ignored.
07:09aamarextend-type & extend-protocol might be acceptable workarounds?
07:11Netpilgrimaamar: Thanks for the info. This is too bad. extend-protocol will work, but according to JoC the performance is worse than if you put the protocol implementation in defrecord.
07:40kephaleA question to anyone familiar with the destructuring code: is there a way to avoid redundantly typing keys twice if you are supplying default values?
07:40kephalethat is:
07:40kephale,((fn foo [& {:keys [b c], :or {b 7, c 10}}] (+ b c)) :b 17)
07:40clojurebot27
07:41kephalebut sometimes i have a huge map inside the :or clause, and writing the same keywords in :keys seems really redundant
07:44kof4001hello
07:44kof4001I can't get slime interaction to work
07:44kof4001i followed http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html tutorial
07:44kof4001and after lein deps and lein swank
07:44kof4001i fire up emacs
07:45kof4001slime-connect
07:45kof4001it connects, but does not evaluate the input
07:45kof4001even after c-x c-e
07:45kof4001Enter only brings a new line
07:46kof4001it does not evaluate expressions
07:46kof4001Well, I guess its still very early in US
07:46raekkof4001: that tutorial is very outdated
07:47kof4001Where could I get the updated information?
07:47raekI recommend http://technomancy.us/149 or http://dev.clojure.org/display/doc/Getting+Started+with+Emacs
07:48raekhrm, looks like the tutorial you linked to has been updated
07:49raekbut you have a lein project, and you use swank and slime, so that's good
07:50raekno need to compile clojure though
07:54kof4001after i install with lein plugin install swank-clojure 1.3.2
07:54kof4001it does not recognize the M-x clojure-jack-in command
08:15raekkof4001: clojure-jack-in is provided by clojure-mode.el
08:16vini_Hi, I'm trying to install slimv in my vim, but I'm having problems. Here is my configuration (http://pastebin.com/P53FUfk7)
08:17vini_when I type "vim teste.lisp", I have no highlight nor slimv commands.
08:17clojurebotparedit commands is http://mumble.net/~campbell/emacs/paredit.html
09:18gfrlogI've fired up the clojurescript repl twice now and both times it dies and prints "Killed" seemingly without provocation. Is this heard of?
09:19gfrlogmake that three times
09:25gfrlogwoah, and then java hosed up my vm
09:25gfrlog(out of memory)
12:23gfrlogI think I just didn't have very much memory
12:34edwardruggeriDoes anyone have advice about defining helper-functions within a function?
12:34edwardruggeriI could use let and fn, but I have four or five nested functions I want to declare
12:35edwardruggeriI could use defn inside the function, but that exposes implementation details
12:39kephale,(doc letfn)
12:39clojurebot"([fnspecs & body]); fnspec ==> (fname [params*] exprs) or (fname ([params*] exprs)+) Takes a vector of function specs and a body, and generates a set of bindings of functions to their names. All of the names are available in all of the definitions of the functions, as well as the body."
12:41edwardruggeriHmm, thanks keyhole; that might work
12:41edwardruggeriBut I don't know if I want to declare complicated functions inside a let/letfn
12:41edwardruggeriOn the other hand, maybe I misunderstood fn
12:42edwardruggeriLooks like it is not side-effect free; you can supply a name
12:42edwardruggerikeyhole = kephale
12:42kephaledo your helper functions have side-effects?
12:42gfrlogedwardruggeri: I think using let and a bunch of fns is pretty common. what don't you like about it?
12:43edwardruggeriWell, imagine if all this code were written in a let:
12:43edwardruggeri(defn make-fixed-tasks [recurring-task interval]
12:43edwardruggeri (def ival-end (.getEnd interval))
12:43edwardruggeri (defn day-fits [current-date-time]
12:43edwardruggeri (contains? (:days-of-week recurring-task) (.getDayOfWeek current-date-time)))
12:43edwardruggeri (defn make-task-interval [current-date-time]
12:43edwardruggeri (let [task-start-date-time (.withFields current-date-time (:start-local-time recurring-task))
12:43edwardruggeri task-end-date-time (.plus task-start-date-time (get-task-duration recurring-task))]
12:43edwardruggeri (Interval. task-start-date-time task-end-date-time)))
12:43edwardruggeri (defn next-midnight [current-date-time]
12:43edwardruggeri (.withFields (.plusDays current-date-time 1) LocalTime/MIDNIGHT))
12:43edwardruggeri (defn day-fits [current-date-time]
12:43edwardruggeri (contains? (:days-of-week recurring-task) (.getDayOfWeek current-date-time)))
12:43edwardruggeri (defn maybe-add-task [fixed-tasks current-date-time]
12:44edwardruggeri (if (day-fits current-date-time)
12:44edwardruggeri (let [task-interval (make-task-interval current-date-time)]
12:44edwardruggeri (if (.overlaps (Interval. current-date-time ival-end) task-interval)
12:44kephaleaaaaa
12:44gfrlogwhen your let gets too big, maybe it's time to make it all a separate namespace?
12:44gfrlogsince you're concerned about not exposing too many functions
12:45edwardruggeriFair. Thanks a lot gfrlog, kephale.
12:45gfrlogyep
13:33sridwish there was way to find all "clojure projects depending on the FOO library". this would enable me identify projects using core.match so I get to see how real projects make use of (match ...)
13:48fliebelsrid: I think you might be able to execute a smart search query on GitHub
13:53TimMcgit clone git://github.com/* :-P
14:11SaturnationIs there a way to refer to Java this in a :gen-class?
14:15TimMcSaturnation: I think the value of "this" is passed explicitly as the first argument to class methods.
14:19Saturnationthat make sense
14:21SaturnationTimMc so the next question is can I implement a constructor in clojure?
14:21TimMchttp://clojuredocs.org/clojure_core/clojure.core/gen-class
14:21SaturnationThanks!
14:22Saturnationwas reading that, but hadn't gotten there yet... :)
14:22TimMcSaturnation: Although, I think :gen-class in the (ns) statement is preferred.
14:23fliebelUhm, I have the idea cake submodules aren't really working :(
14:29fliebelhttps://github.com/flatland/cake/wiki/Subproject-Dependencies
14:31fliebelSo, I added subproject.masai = /Users/pepijndevos/git/masai to the jiraph project, and updated the jiraph project.clj to reflect the version in the masai project.clj, but it still tries to fetch it from clojars.
14:33fliebelIn fact, it seems to completely ignore my .cake/config file.
14:36fliebelCan I add something clearly visible in there to confirm that?
15:10kirasi have mostly used vim/emacs/cake/leiningen for clojure so far, but decided to try counterclockwise. this may be the wrong place to ask and this question may have been answered several times before, but i haven't had much luck finding an answer so far, so hopefully someone here can help me. basically, when using lein/cake and version control, i don't have to put .jars in the repository, since lein and cake can gather dependencies. is
15:10kirasthis true for whatever counterclockwise clojure projects are using as well?
15:12kirasmaybe i phrased that poorly... basically, if i'm using counterclockwise, do i need to put .jars in version control or is it possible to have whatever build system is in use (ant? maven?) gather those automatically, like lein and cake do?
15:14jeremyheilerWhy would you not just use lein or cake? It looks like counterclockwise isn't meant for dependency management.
15:16mindbender1
15:18kirasjeremyheiler: i'm not sure what you mean, exactly. are you saying not to use counterclockwise at all, or are you suggesting using counterclockwise together with lein/cake?
15:19jeremyheilerI didn't say not to use counterclockwise. I took a look at the counterclockwise website and it doesn't look like depenency management is a goal.
15:22kirasi didn't mean to imply that counterclockwise would handle dependency management itself, just thought that maybe whatever system it was using to build projects might do it and i just wasn't aware of how to use it yet.
15:25jeremyheilerAh, I see. Are you able to point the "build path" in counterclockwise like you would with a normal Java Eclipse project? If so, you could just point it to whatever directory the build/dep management system you use. Either way, it might be better to ask on their user group: http://groups.google.com/group/clojuredev-users?pli=1
15:30kirasjeremyheiler: that may work. i've never really done any java coding before, so my knowledge of java/eclipse/etc. isn't really there. there's actually a guide to using lein with counterclockwise, but i wasn't sure i wanted to go that route since i have a feeling there isn't much IDE support for it yet.
15:30sridre - finding '(match ...)' use in github. how would you refine this? https://github.com/search?type=Code&amp;language=Clojure&amp;q=%22%28match+%22&amp;repo=&amp;langOverride=&amp;x=0&amp;y=0&amp;start_value=1
15:54michaelr525hey!
15:54gfrloghey!
15:54jeremyheilerhey!
16:12akovis there anyway i can 're-'use a namespace so i can change code then interact with the updated code without restarting my repl instance?
16:13michaelr525akov: you just have to define it again, or (load-file) if it's in a file..
16:15raekakov: (require 'the.name.space :reload)
16:15akovthe require thing does it, thanks guys
16:15raekthere is also :reload-all
16:21michaelr525The architecture described here seems like a good generic design for collecting lot's of data and producing reports from it. I'm talking mostly about the batch part. http://www.readwriteweb.com/hack/2011/01/secrets-of-backtypes-data-engineers.php
16:22michaelr525What do you think?
16:41kjeldahlWeird. "lein repl" works fine. "lein run" runs fine. "lein test" fails with error about "initialize" already refers to something else, although none of the test code pulls in modules differently from the rest of the code (or have anything named initialize). Any special behaviour I need to know about when using clojure.test?
17:03kjeldahlDefinitively something wonky with clojure.test; renaming the intialize method in a model source file solves it. Considering I never use that module without pulling it in with ":as something", it seems clojure.test somehow disregards the namespace when pulling things together. Oh well.
17:06ibdknoxkjedahl: can you gist your ns declaration for that test file?
17:08kjeldahlhttps://gist.github.com/1193515 Both betapp modules have an initialize method when it doesn't work. Renaming initialize to matches-initialize in the betapp.models.matches makes it work of course.
17:08ibdknoxkjeldahl: you shouldn't use those
17:08ibdknoxkjeldahl: you need to require them
17:09kjeldahlI think I tested that as well, but I'll give it another try.
17:09ibdknoxkjeldahl: when you do (:use) you're essentially telling the compiler to put all of the symbols in those files into the context of this one
17:09ibdknoxkjeldahl: which means all of those "initialize" functions will collide
17:10kjeldahlLooks like you nailed it, thanks. Sloppy of me.
17:41TimMcHmm, I think the example in https://github.com/swannodette/match/tree/ under "As Patterns" is wrong.
17:42TimMcShouldn't that return [:a1 2 [1 2]]?
17:47TimMc(I tried testing it, but match errors out.)
17:48amalloyTimMc: looking at it, i agree, but i don't know anything about match really
19:56amalloyhah. 1.3 added funcall, except they called it deliver and pretend it's for use with promises: (defn deliver [promise val] (promise val))
19:57amalloyi guess that was the 1.2 impl too, i just never noticed
20:11TimMcamalloy: That would be awesome for use in an obuscated clojure contest.
20:12amalloy&(deliver inc 1)
20:12lazybot⇒ 2
20:12amalloyGENIUS
20:12TimMc&(apply inc 1)
20:12lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Integer
20:12TimMc:-( oh right
20:13amalloyTimMc: but it's easy to define funcall in terms of apply
20:14amalloy&(let [funcall (fn [f & args] (apply f args))] (funcall inc 1))
20:14lazybot⇒ 2
20:34gfrlogbest I could get is (def funcall (comp (partial apply apply) (juxt first rest) list))
20:34gfrlogwhich is of course terrible
20:35amalloygfrlog: i see you've reached a valuable conclusion about point-free style
20:36gfrlogamalloy: so what is juxt used for then? :P
20:38amalloyc'mon, how can you not love ##(map (juxt identity (partial * 2)) (range 5))
20:38lazybot⇒ ([0 0] [1 2] [2 4] [3 6] [4 8])
20:39gfrlog(for [x (range 5)] [x (* 2 x)]) has 94 fewer characters
20:39amalloyfor less trivial functions than (partial * 2), i use that all the time
20:39amalloyand i've pulled (juxt identity foo bar baz) into (decorate foo bar baz)
20:40gfrlogThere should be a convenience method that lets you juxt all the function-vars in a namespace
20:40gfrlogamalloy: I bet there's a good pop-psychology name for that one
21:27mudgehey, I'm doing some work with sockets and I found that Clojure has several IO libraries that seem similar so I was wondering which one I should use for my case
21:29mudgethere's clojure.io.java, there's clojure.contrib.duck-streams, there's clojure.contrib.io, which one should I use for writing sockets?
21:30amalloydon't use anything that has "contrib" in it, if something else will do
21:31mudgeamalloy, so then clojure.io.java
21:31amalloywell. c.j.io
21:32mudgewhat's c.j.io ?
21:32amalloyclojure.java.io
21:32amalloyyou're getting the order wrong
21:32mudgeoh i see, yea
22:13tomojhttps://gist.github.com/1a5f9767b2733e7a81b8 - getting a "Cannot set property 'Unicode' of undefined" error here on nodejs. any ideas?
22:13tomojthink this must be part of the standard clojurescript output?
23:53technomancyamalloy: whoa I never noticed that about deliver
23:53technomancyI totally would have used that in my bbq directions