#clojure logs

2012-06-26

00:00uvtcWell I never! ... I just did a search at github, and had to choose the search language, and ... I couldn't believe my eyes, but Clojure was *not* listed at the top with the "Popular" languages. It was down in the "Everything Else" category of all places. Harrumph!
00:01cgag_i don't understand it either
00:03cgag_xeqi, looks like you were right, they're all clojure-agent-send-off-pool-0
00:03brehautuvtc: but this is irc, you shouldnt let that stop you
00:03michaelr525good morning
00:05brainproxyanybody know of an attempt to implement the sockjs protocol with clojure / clojurescript
00:05cgag_i'm pretty new to anything concurrent, but it seems pretty weird that they'd all end up on the same thread
00:05brainproxygoogling aruond but haven't found such a thing yet...
00:05cgag_is that like socket.io?
00:06wingybtw how is clojure handling concurrency? threading?
00:07brainproxycgag_: yeah, sockjs is quite similar to socket.io
00:07cgag_as i asked that i realized i don't really know anything about socketio either
00:08xeqicgag_: from what I can read, the send-off-pool is an expandable thread pool, but there must be a queue length before it will spawn a new thread
00:08brainproxythe idea is to provide a uniform interfaces on the client and server for sending and receiving messages over a stateful connection
00:09brainproxyif websockets is available, taht is used, but if not then ajax push, jsonp, forever iframe, or xhr is used to achieve the same effect
00:10brainproxyhowever, the api is transport agnostic, i.e. it works the same whatever transport is transparently and dynamically chosen when a client connects
00:12cgag_that does sound like it'd be nice to have
00:12michaelr525how should I go about finding what failed this compilation, leiningen doesn't print the end of it: https://www.refheap.com/paste/3319
00:13michaelr525from the stacktrace i understand that it failed loading one of the libraries, but when I try to manually compile the last printed library it compiles just fine..
00:13cgag_from what i've read about aleph, it tries to model everything using a single abstraction (channels)
00:14cgag_normal requests
00:14cgag_websockets
00:14cgag_tcp
00:14cgag_https://github.com/ztellman/lamina if you're interested
00:23brainproxycgag_: i definitely intend to study aleph/lamina sometime soon... what I know so far suggests it could be a good basis for implementing a sockjs-work-a-like
00:25wingyis clojurescript a good web language .. it seems that clojure is not built with web development in mind?
00:26wingy(perhaps me only not used to seeing html + clojure syntax)
00:26brehautwingy: ‽
00:26Rayneswat
00:26taliosHTML isn't a good web language, so why should clojurescript not being so matter :)
00:26brehautwingy: what do you mean by 'web language'
00:27brehauttalios: lol
00:27RaynesWeb development is probably what Clojure is used most for.
00:27RaynesAnd Clojurescript compiles to Javascript.
00:27taliosbrehaut - I delurk for moments like these.
00:27cgag_xeqi, i just rewrote it using an agent and they still get sent to the same thread
00:28wingycan clojure handle as much users connected as node.js?
00:28michaelr525please help, how to find out the source of this compilation error: https://www.refheap.com/paste/3319
00:29cgag_https://www.refheap.com/paste/3320
00:29wingyis it spawning a new thread for each http connection?
00:29brehautwingy: it depends
00:29cgag_i think that's how jetty handles it
00:30brehautwingy: unlike node.js clojures webstack doesnt implement its own webserver
00:30wingyi see
00:31michaelr525wingy: you can'
00:31michaelr525can't compare node.js to clojure
00:31RaynesSure you can. It's easy.
00:31michaelr525node.js is a framework written in javascript
00:32michaelr525clojure is a language
00:32michaelr525framework != language
00:32RaynesYou should tell that to rails. :p
00:32brainproxyi don't really like thinking of nodejs as a framework
00:33mboehPeople tend to use 'node.js' to refer both to the V8-based runtime and the libuv-based IO/web stack
00:33brainproxyit's basically a runtime built around v8, which brings to javascript many of the things the JS language just doesn't provide on its own
00:33brainproxymeaning facilities for working with the filesystem, network, etc.
00:35mboehRaynes: We do everything we can to keep people from conflating ruby and rails. It's hard work :P
00:38cgag_i've seen quite a few people getting lectured on the difference
00:38cgag_you guys do good work
00:39mboehcgag_: Heh.
00:44cgag_i thinking of getting into the rails game, i want to start freelancing and unfortunately i don't think clojure has too much demand at the moment
00:45mboehFunny, I'm just getting into clojure after doing ruby for ~10 years
00:46michaelr525please help, how to find out the source of this compilation error: https://www.refheap.com/paste/3319
00:48cgagi think we'd have to see some code, i can't get much out of that besides nullpointerexception
00:49michaelr525i cloned this: https://github.com/metadaddy-sfdc/facebook-template-clojure
00:49cgag10 years of ruby, impressive
00:49michaelr525and then run: lein compile
00:49michaelr525https://github.com/metadaddy-sfdc/facebook-template-clojure.git
00:50mboehIt's taking some work to adapt my head to clojure, I feel like it's calcified a little
00:50wingyi feel that i rather look at clojure code than javascript
00:51wingyits an ugly mf .. inconsistent as hell and all that shit
00:51wingysomehow clojure attracts me .. i don't know quite what
00:51michaelr525cgag: i don't understand why lein cuts the stacktrace instead of printing the whole thing
00:51cgagmboeh, i think that's just how clojure is
00:52xeqimichaelr525: that is the whole stack trace
00:52mboehwingy: It's a much more elegant way to get access to the JVM and the Java library ecosystem (than Java)
00:52cgagwingy, yeah, me too, it's always seemed weird to me how turned off everyone seems to be by lisp
00:53mboehwingy: And nothing node has or will have for years rivals the Java ecosystem in maturity
00:53wingycgag: perhaps the ()
00:53wingycan't whitespace indentation be used instead?
00:54wingyit seems that you intend for each ()
00:54michaelr525xeqi: thanks!
00:54wingyindent
00:54michaelr525xeqi: but why does it print ... 48 more at the bottom?
00:54cgagwingy, yeah that's what i mean though, i've always kind of liked the parens
00:55mboehThe C-expressions don't bug me in Clojure. I've come to the conclusion that they're the best approach for functional languages
00:55xeqiit refers to the 48 lines of stacktrace above
00:55clojurebotExcuse me?
00:55xeqiI don't konw why java does it that way
00:55michaelr525oh
00:55michaelr525interesting
00:56mboehI like Lisp syntax a lot more than Haskell's, for example
00:56michaelr525so, how do i go about debugging this shit to find out why it fails? :)
00:57mboehbut I do like the few bits of syntax Clojure adds for sequence literals
00:57amalloywingy: nobody wants to have to indent (+ 1 2) as + RET TAB 1 RET TAB 2
00:57xeqithats a hard one
00:58mboehnot having a literal syntax for hashes/maps drives me bonkers
00:58xeqidoes just running `lein run` work?
00:58michaelr525yeah
01:04wingytrue
01:04wingyhaha
01:05michaelr525xeqi: actually on lein 1.7 when I 'lein run' it prints the compilation stacktrace but then goes on and runs the app. but on lein 2.0 it stops after the compilation error
01:08xeqidid you write to the .env file?
01:10JulioBarrosFoolishly :) tried to update my project, did a lein clean and now I get "Caused by: java.io.FileNotFoundException: Could not locate ring/middleware/head__init.class or ring/middleware/head.clj on classpath:"
01:10JulioBarrosAny ideas anyone?
01:10xeqiJulioBarros: what version of ring are you including?
01:11JulioBarrosI'm trying to use noir and friend ... so am not sure.
01:11RaynesMy bet is that he just updated to noir 1.3.0-beta10.
01:11RaynesHe is the second person to report that today. Damn it. Looking into it.
01:11JulioBarrosRaynes: yes. yes. I did.
01:11michaelr525xeqi: nope.. didn't write to the env file
01:12RaynesI broke everything yesterday. Decided you all shouldn't use Noir.
01:12Raynes;)
01:12michaelr525but it's for heruko, as far as i understand
01:12JulioBarrosCool. Thanks. :)
01:12JulioBarrosAny workaround? Beta9?
01:12xeqithe .env is for running locally
01:13RaynesJulioBarros: You can hop back to beta9 or wait 5 minutes while I figure out what is wrong and push beta11.
01:13JulioBarrosRaynes: Thanks.
01:13xeqiheroku uses the env vars from the config:add section
01:13michaelr525i changed the source and replace the env var references with strings
01:13michaelr525replaced
01:14michaelr525and it is actually working fine so far, just this compilation error pops up when i try to create a war file using 'lein ring'
01:16uvtctechnomancy: nice followup on the ML re. docs! Thanks.
01:17michaelr525xeqi: from the stack trace i understand that it fails when it is trying to loading something referenced from clj_facebook_graph.auth$loading__4784__auto__.invoke(auth.clj:1)
01:18michaelr525which in turn loaded because it's refernced from facebook_template_clojure.core$loading__4784__auto__.invoke(core.clj:1)
01:18michaelr525so i checked out clj_facebook_graph and compiled it and it compiled just fine
01:20RaynesJulioBarros: Can you paste your project.clj on refheap for me?
01:20clj_newb_209435besides apple's 17" mbp, is there any decent 17" laptop?
01:22JulioBarrosRaynes https://www.refheap.com/paste/3322
01:25uvtcclj_newb_209435, these folks have nice laptops http://laclinux.com/gnu/Laptop , though no 17-inch ones listed. Maybe they could get you one though?
01:25RaynesJulioBarros: Give me the output of `lein classpath`.
01:26JulioBarrosRaynes https://www.refheap.com/paste/3323
01:27RaynesJulioBarros: What version of lein?
01:27JulioBarros2
01:27RaynesWhich preview?
01:28JulioBarrosLeiningen 2.0.0-preview6 on Java 1.6.0_33 Java HotSpot(TM) 64-Bit Server VM
01:28RaynesYeah, this isn't a noir problem.
01:28xeqiJulioBarros: `lein deps :tree` ?
01:28RaynesThe problem is that some of your dependencies has a transitive dep on an old version of ring that didn't have that middleware and for some reason it is ending up on the classpath instead of the new verison.
01:28Raynesxeqi: Already did it ^
01:28xeqiah
01:29RaynesJulioBarros: Find which of your deps uses a ring-core version older than 1.1.0 and add an :exclusion to it.
01:29RaynesJulioBarros: I had the same problem just now with refheap and amalloy's mongo-session and adding the exclusion fixed it. I'll talk to techomancy about it tomorrow.
01:29RaynesAFAIK, the newer version should be preferred.
01:30amalloyRaynes: no, because maven is stupid
01:30JulioBarrosRaynes: lein deps :tree -> https://www.refheap.com/paste/3324
01:30JulioBarrosRaynes: Thanks. I'll look for the dep.
01:30Raynesamalloy: I'm not sure why this would be happening all of a sudden right now with that version of leiningen though.
01:30amalloythere's no particular bias for newer versions, only for the one specified in your project.clj vs by some dependency
01:31RaynesJulioBarros: Looks like friend is the culprit.
01:31RaynesJulioBarros: Your deps :tree output shows it.
01:31amalloyit could be because lein2 uses aether, but more likely the lein version doesn't make a difference
01:32Raynesamalloy: Okay, fair enough. Update your library.
01:32RaynesThis exclusion is an eyesore.
01:32Raynesamalloy: Also, this doesn't happen with lein1. It fetches the right ring core. *shrug*
01:33RaynesOr at least something closer. 1.1.0 vs 1.1.1, which is the newest.
01:33RaynesI guess dependency resolution is random.
01:33RaynesWhich is excellent for a dependency manager, right? Right? RIGHT>
01:34RaynesAnyways, I'm off.
01:37JulioBarrosRaynes: Thank you. That did it.
01:50gerthi all - `range` has an (optional) "end" parameter, that is exclusive. So (range 1 5) returns (1 2 3 4). Could anyone tell me what the rationale is behind that? I would expect to see (range 1 5) to return (1 2 3 4 5)...
01:51michaelr525i think it's there to motivate people to ask this question :) I've seen it asked a few times before
01:52michaelr525though i don't remember the answer
01:52michaelr525hehe
01:52michaelr525maybe it has something to do with zero base/one based
01:52wingylight table looks so cool
01:53wingyoh no .. its using flash??
01:53lazybotwingy: What are you, crazy? Of course not!
01:53gertthanks michaelr525 :) I'm still puzzled :)
01:54wingyoh no its not
01:54wingythank god
01:58amalloygert: same reasons that substring, etc, have that sort of behavior - it's convenient to know that (range m n) has n-m items, for one thing
02:00xak466hi, i am a complete noob in clojure and I'm trying to do some macro stuff. could someone please look at this pastebin http://pastebin.com/brxfRZHS and let me know what I'm doing wrong?
02:04gertthat's a good point amalloy
02:27antares_kab3wm: you at least need to force evaluation of query in get-results
02:27antares_oops
02:29eckthis is actually a korma question, but does anyone know if there's a way to do a custom operator with korma?
02:29ecki'm trying to get korma to generate postreges' @@ operator for full text search
02:30ecki think i could simulate it with raw but then i need to figure out how to do my own escaping
02:39michaelr525err
02:40michaelr525i traced my compilation problem to this line: https://github.com/maxweber/clj-facebook-graph/blob/master/src/clj_facebook_graph/client.clj#L108
02:40michaelr525it makes the clojure compile to NPE with this stacktrace: https://www.refheap.com/paste/3325
02:41michaelr525can anyone please take a look at that code?
02:57antares_possibly #'clj-http.core/request is not defined because clj-http.core/request no longer exists or is not loaded
02:58michaelr525hmm
02:59michaelr525i removed (defn get..) and it compiles ok
03:02antares_that ns replaces clojure.core/get and does not use :refer-clojure
03:02antares_there should be at least warnings about that during compilation
03:02michaelr525there is a warning
03:03antares_they need to add (:refer-clojure :exclude [get])
03:03antares_so I guess this affects macro compilation
03:03michaelr525oh
03:03michaelr525to add it in the ns declaration?
03:05antares_yes
03:08michaelr525antares_: thanks!!!
03:08michaelr525note to self: next time pay more attention to compiler warnings :)
03:34_ulisesI'm having trouble understanding the differences between midje's :facts and :contents in backgrounds
03:36_ulisesbut perhaps this is to do with me using (facts ...) and not (fact ...)?
03:36_ulisesI mean, more specifically, I start my noir server before each test, and stop it after each test
03:37_uliseshowever, if I start the server using :facts instead of :contents, then the server is started twice (I have 3 checks inside (facts...)) instead of once
03:37Raynesantares_: Hi
03:37antares_Raynes: hi
03:37Raynesantares_: I commend you for supporting mongo URI stuff.
03:38Raynesantares_: If you've ever got 30 minutes and are feeling bored, I'd love a patch to use monger in refheap.
03:38RaynesMy mongo usage is pretty simple, so such a patch shouldn't be difficult.
03:38antares_Raynes: haha, ok, maybe next weekend
03:39Raynes;)
03:39RaynesI do this sort of thing to technomancy all the time.
03:39RaynesHe never actually takes the bait.
03:39antares_I have some loose ends to tie before going on vacation on July 1st
03:39antares_Raynes: you don't know me :P
04:41wingyhey
04:42wingyis the best way to install clojure on mac using brew?
04:42wingyor download it from clojure.org?
04:42taliosbrew's probably the easiest way
04:42taliosalso use brew to install lein
04:43wingycool
05:02wingyanyone having brew install leiningen getting stuck?
05:02wingyseems to not installing
05:10wingyoh i run it as sudo which you cant
05:18wingyis it something wrong with running java 1.7 and lein?
05:18wingyit freezes all the tim
05:18wingye
05:19wingyoh it works
05:19wingyhad to press ENTER since i was running it as root
05:28amalloybrew is maybe an acceptable way to install lein, but i do not recommend running any of that as root. just follow the readme: https://github.com/technomancy/leiningen/blob/master/README.md
05:28RaynesBrew is a fine way of installing Leiningen, if a little pointless.
05:33michaelr525i am hungry
05:33michaelr525maybe wrong channel
05:33michaelr525;)
05:41wingyamalloy_: i installed with no root
05:41wingyit says: Error: Failed executing: /usr/local/Cellar/leiningen/1.7.1/bin/lein self-install (leiningen.rb:12)
05:41wingyim on java 1.7
05:42wingyRaynes: why is it pointless
05:49ro_stwingy: have you tried Installation on https://github.com/technomancy/leiningen/wiki/Upgrading
05:53antares_Just pushed Monger 1.0.0 (final) to clojars: https://github.com/michaelklishin/monger/blob/master/ChangeLog.md, http://clojuremongodb.info
05:56wingyro_st: its recommended to use 2 preview already?
05:57ro_stworks fine for me
05:58ro_stantares_: are you michaelklishin?
05:58antares_ro_st: I am
05:59ro_stawesome :-) i'm the guy who asked about DBRefs
05:59ro_stthanks for monger. awesome bit of kit.
06:00antares_ro_st: ah, hi :)
06:00ro_sti bumped up against the _id for newly-inserted-document issue yesterday. i recommend putting a paragraph into your Inserting guide about it
06:01ro_stknow what i mean?
06:01wingywii
06:01wingyits creating README.md file .. with extension now
06:02wingybut the startup time is slow as hell compared to node.js
06:04antares_ro_st: yes, I am watching google search queries and that one is one of the top
06:04antares_I will add a subsection in Getting Started and Inserting Documents guides
06:04ro_stawesome
06:10wingyclojure can do banking systems?
06:10wingygames like StarCraft 2?
06:11wingycurious about the power and security of it
06:15antares_wingy: there are at least two banks + some groups at amazon using clojure
06:15antares_security is, well, JVM security
06:16_nmmnyeah, imagine java capabilities + more
06:16antares_and I don't think security is defined by the language, although JVM and .NET security models help a lot in some cases
06:16antares_but security flaws are most commonly application problems
06:17wingyhow about games
06:17antares_also, I believe a few trading companies were some of the earliest adopters
06:17wingysince native games and banking is something javascript can never do
06:17wingycoming from javascript
06:17antares_I am not aware of any use in gaming but you can use just about anything on good VMs for game servers
06:18wingyi mean i usually dont see a game written in java
06:18antares_I think Erlang has an edge for gaming on everything else but if you want JVM interop, Clojure is one of top 2-3 choices (given that your team is open to learning new things)
06:18llasramwingy: Minecraft?
06:18wingypopular games like StarCraft
06:19wingy:)
06:19antares_wingy: game clients are not, they are usually C++ core + something like Python, Lua and now increasingly Ruby and JS for logic and DSLs
06:19_nmmnyes, dont really think clojure would be much usefull in gaming
06:19antares_but game servers these days are in just about everything
06:19adbenwingy: not agree http://fivedots.coe.psu.ac.th/~ad/jg/
06:19_nmmnc++ is best choice
06:20antares_there are two reasons for C++: you want to take advantage of the edgiest hardware (this is really only possible with low-level APIs) and you also can't afford GC pauses in some areas
06:21antares_responsiveness is the key for players, at least in "hardcore" games
06:27wingynice thing i dont wanna create games
06:27wingymore like high security systems
06:35ro_stantares_: doesn't simple.com use clojure?
06:36antares_ro_st: I heard that they do now for some things, but they are mostly Scala and Ruby?
06:36antares_not sure
06:37ro_stah ok
06:37ro_stman i wish we had something like simple.com here (in South Africa)
06:37ro_stlooks like a great service
06:39dbushenkohi all!
06:39RaynesWish we had it in the US too. It has been invitation only since the beginning of time itself.
06:40dbushenkowhen I create a noir project with leiningen 2, then set the noir version to 1.3.0-beta10, it throws exception: Exception in thread "main" java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64, compiling:(codec.clj:1)
06:40dbushenkowhat's wrong with it? when I set the version to beta4, it runs ok
06:42ro_stdoes lein2 deps fix it?
06:43dbushenkono...
06:46ro_stquickest is probably to file a github issue
06:56dbushenkoro_st, do you able to create a noir-1.3.0-beta10 project?
06:56ro_sti haven't tried :-)
06:56dbushenkocan you give it a try? it's easy: lein new noir myapp, then go into myapp and set the noir version to 1.3.0-beta10
06:57dbushenkothen just 'lein run' in this directory
06:59wingyare there many clojure devs world wide?
06:59ro_stdbushenko: that's with lein 1
06:59wingyis it easy to hire people
06:59ro_stwingy: better to find polyglots and train em up
06:59dbushenkoro_st, no, I'm using lein2
07:00dbushenkowingy, yes, especially if telecomutting is an option for you
07:01dbushenkowingy, are you hiring?
07:03wingynope
07:03_nmmndefine many, wingy
07:03antares_wingy: at this point, it is not too hard. Last couple of clojure conferences in US and Europe had hundreds of attendies, I think
07:05wingy_nmmn: when i wanna hire, then i succeed
07:06_nmmndepends how much you can spend ;]
07:19dbushenkoguys, does anyone have troubles compiling a noir application of noir-1.3.0-beta10 ?
07:19clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
07:21antares_wingy: you won't get 50 applicants but those 5-10 that you will are likely to be pretty good.
07:23_nmmnagree, you dont look at big/cheap mass, but rather highly skilled people set
08:18clojure-newcomerhi guys, I am getting a load of failed requests load testing a composure restful web service with minimal concurrency and requests… its the simplest of hello world examples… any ideas ?
08:18clojure-newcomer*compojure
08:20clojure-newcomerI am using ab, and setting concurrency to 5, requests to 50
08:23antares_clojure-newcomer: are you on OS X?
08:23clojure-newcomerhi, yes I am
08:23antares_OS X has broken ab which drops connections with concurrency level > 5 or so
08:24antares_you have to build it from source
08:24clojure-newcomernuts
08:24clojure-newcomerthanks for the heads up
08:24clojure-newcomermaybe I'll break out curl loader
08:24mccraigtechnomancy: i'm seeing '; Evaluation aborted.' in slime-repl for some exceptions with lein-2 & lein-swank-1.4.4… the exception is stored in *e, and is a java.lang.Exception according to (.getClass *e) : is this a known problem ? i couldn't find a current bug report...
08:25antares_clojure-newcomer: https://gist.github.com/2046014
08:25clojure-newcomerantares_: thanks!
09:12tyre77if I'm taking in three strings to a function and want to make them integers, how do I reassign them to those variables
09:12tyre77I can do this to get ints: (map read-string (lat lng dist))
09:14tyre77but now how can I get their values back into lat lng and dist?
09:15duck11232,(Integer/parseInt "7")
09:15clojurebot7
09:16tyre77will that reassign the var?
09:18duck11232in clojure, you don't really re-assign variable. You could let assign that to a different variable (passobly with the same name)
09:19duck11232(fn [lat long] (let [lat (Integer/parseInt lat) long (Integer/parseInt long)] {:lat lat :long long}))
09:24hyPiRionduck11232: Or even better: (fn [lat long] {:lat (Integer. lat), :long (Integer. long)})
09:25ro_stmidje-mode for emacs is awesome!!
09:26maaruksspeclj ?
09:26duck11232,(Integer. "4")
09:26clojurebot4
09:26duck11232There was a problem with (Integer. ) but I can't remember what it was.
09:27ro_sta question about :use vs :require. it seems i have to alias ns's when using :require, where with :use i can just refer to it and have all that ns's symbols arrive. is there a way to use :require without aliasing?
09:27mmajchrzakHi is there any mature web framework for clojure ?
09:27ro_stor perhaps i misunderstood cemerick's advice yesterday
09:28ro_stdefine mature?
09:28duck11232ro_st: My problem with midje-mode is that it still can't pick out a single fact if it's not at the top level. All my tests are wrapped in a macro that sets my test environment. midje-mode still runs the entire namespace
09:28ro_stwell tested and widely used? probably noir
09:28maaruks(:require clojure.set)
09:28ro_styeah i noticed that. i had my fact forms grouped into (facts …)
09:29mmajchrzaknoir is like sinatra for ruby right ?
09:29ro_stmaaruks: thanks. i had the ns inside a vector before
09:29ro_stmmajchrzak: kinda
09:29duck11232Compojure is like sinatra, I think. I don't know what noir is like
09:30ro_sttrue. and ring is like rack
09:30duck11232it's all layers
09:30ro_styup. compositions of simple functions.
09:31mmajchrzakDo you know any real world web application written in noir ?
09:31ro_stmmajchrzak: http://dev.clojure.org/display/community/Clojure+Success+Stories
09:32ro_sthttps://www.readyforzero.com/ is on Noir
09:32ro_stas mentioned at the top of the readme here https://github.com/ibdknox/noir
09:32maarukslondonclojurians.org
09:33ro_stman i wish i could attend something like that
09:33ro_stthat's the price you pay for living in a flyspeck coastal town :-)
09:33ro_stduck11232: don't you use (background) for configuring your test env?
09:34duck11232I used to use background, but it wasn't setting my environment appropriately
09:34ro_steg, mine is (before :facts (do (set-test-db) (add-fixtures)) :after (clear-fixtures))
09:34ro_stah
09:34ro_stin this case it's with Monger, which works a charm
09:35duck11232https://github.com/duck1123/jiksnu/blob/54b6f546a9640111967a209b0d4e6ee58521c461/test/jiksnu/test_helper.clj
09:37ro_stcrikey duck1123. this is a LOT of code. how long you been at this?
09:37duck1123quite a while
09:37duck1123I'm building a social networking application. I have one running at renfer.name
09:38ro_stcucumber-clojure as well. nice
09:38maaruksI want to connect from slime to my clojure program. I guess I need to include swank-clojure and start it somehow. Any idea how to start swank from clojure code ?
09:38duck1123I think this project will be 2 years in october. (or is it 3?)
09:38ro_stmaaruks: lein swank
09:38ro_styou need lein-swank deps'd in
09:39ro_stduck1123: you must really be feeling the :require every-damn-thing pain!
09:39duck1123or call the start-server in your code, like so https://github.com/duck1123/ciste/blob/master/ciste-service-swank/src/ciste/service/swank.clj
09:39maaruksgreat, thanks
09:40duck1123I've developed patterns for what to require, buyt yeah, it can be a pain. I've been going through lately and trying to get rid of the last of my naked uses, but there is just so much code
09:42ro_sti wonder why clojure-mode doesn't have magic in it to clean imports up
09:42ro_stwouldn't that be nice :-)
09:42duck1123there's slamhound
09:42tyre77@duck1123 okay I have this: (defn boundaries [lat lng dist] {:lat (Integer. lat), :lng (Integer. lng), :dist (Integer. dist)}), which returns {:lat 1, :lng 2, :dist 3}
09:42duck1123never had much luck with it though
09:43tyre77that's a hash, right?
09:43duck1123tyre77: yes
09:45tyre77if I use fn instead of defining it like you did, it will just pass them in once and be done?
09:46duck1123right, you don't really need to use let unless you need to store it (and use it multiple times) It's also clearer, but most uses of let can be avoided. In this case, you just want to incorporate it into the end result, so there's no need for let
09:48duck1123I guess that's pretty much true for most languages. You don't really need to assign it to a variable if you're willing to work with one big long complecated statement
09:48tyre77ooooh okay
09:49tyre77I'm sorry, this is completely different than anything I've ever seen, but super cool!
09:49duck1123It takes a bit to break yourself of the habit of "I'll just change this variable"
09:50ro_sti usually use let forms when i want to inspect values at a breakpoint
09:50ro_stor when a value will be used more than once
09:50tyre77so basically my problem is that I'm gettting three strings but have a function that takes them and treats them as numbers
09:50RickInGAro_st: breakpoint? how do I get breakpoints in clojure?
09:51ro_sti use emacs and clojure-mode
09:51RickInGAit has a debugger?
09:51duck1123it's built into the newer swanks
09:51ro_stwhen doing so, you can put (swank.core/break) anywhere
09:51RickInGAwow, I have some research to do!
09:52ro_stit'll act as though an exception was thrown at that point, but the locals are populated
09:52duck1123I've never had much luck with debugging clojure. I just stick with log/spy
09:52ro_styou can even use it in a let form
09:52ro_stit is HUGELY useful
09:53RickInGAhow do you read the values that are stored in the locals? Is there a locals window?
09:53duck1123the last time I tried, it was far less mature. perhaps I'll give it a try tonight
09:54ro_stRickInGA: http://rationalist.co.za/uploads/Screen%20Shot%202012-06-26%20at%203.53.43%20PM-PJGRrrPTE0.PNG
09:54ro_stsimple as that
09:54RickInGAah, I get it... thanks!
09:54ro_stexpand that element in the stack
09:55ro_sti have (swank.core/break) set up as a snippet scb<TAB>
09:55ro_sti use midje facts to get code written, and scb to figure out why i suck at clojure
09:55ro_stand unsuck myself just a little bit :-)
09:56RickInGAmidje facts = bdd?
09:56ro_stkinda
09:57RickInGAI have been using clojure.test, does midje add a lot?
09:57duck1123it adds enough that it's worth it to give it a try IMO
09:57ro_stit's a cleaner syntax
09:57duck1123I love the addition of every-checker
09:58ro_st(fact (code that does something) => predicate)
09:58ro_st(fact (+ 1 2) => 3) ; yep (fact (+ 1 2) => 4) ; nope
10:02ro_stwhat i love is that i'm testing my mongodb api for a collection. i'm generating fixtures, switching to and setting up and tearing down the test database, and testing the api 4 fns with 14 facts in under 100 lines
10:02duck1123midje also has built in support for mocking out other functions
10:16tyre77is there the equivalent of a splat function? I have a list of three things and want to pass the items into a function
10:17foxdonuttyre77: apply
10:17scriptortyre77: apply
10:17foxdonutjinx!
10:17foxdonutyou owe me a Coke.
10:18scriptor:)
10:21antares_ro_st: by the way, anything else you want to see in Monger 1.1?
10:21borkdudejinx or juxt?
10:24ro_stantares_: whoa. way to early to tell. i'm still brand new to clojure, mongo and monger :-)
10:24ro_stas a total newbie, i was able to get started damn quickly. one or two sticky points which reading the docs cleared up
10:26ro_stone thing that i had to experiment with to realise was that you can nest fieldnames in symbols
10:26ro_steg
10:27ro_st(mc/find-maps { :metadata.status "active" }) instead of { :metadata { :status "active" }}
10:27ro_styou might want to include a note about that in your query docs
10:28tyre77god damn it works, thanks everybody!
10:29antares_ro_st: well, the idea is that monger queries work like mongo shell
10:29antares_but ok, I will add a few examples
10:29antares_nesting is typically used with strings but it is fine to use symbols
10:29duck1123Monger has been a very nice library. I just recently finished making the switch after using Karras. Ended up breaking everything and made me realize I didn't have anywhere near enough tests
10:30antares_duck1123: hehe. Let me know if you have any ideas for 1.1, we released 1.0.0 earlier today
10:30antares_also, I encourage everyone to join the mailing list: http://groups.google.com/group/clojure-mongodb
10:31ro_stantares_: what do you have planned for 1.1 so far?
10:31duck1123Do I report things for validateur to you? I expected presence-of to not complain if my value was false, but it did
10:34antares_ro_st: hopefully I will find a way to make monger.factory (not documented because it is almost guaranteed to change) not suck
10:35ro_stwhat does that do, broadly speaking?
10:35antares_and then there are DBRefs support, better support for validations and probably various mongodb 2.2 features I am not aware of yet
10:35antares_it lets you define test data
10:35antares_and seed it
10:36antares_for tests
10:36ro_styum. literally doing that right now
10:36ro_stlemme throw a paste at you
10:36ro_styou can probably poke several holes in it
10:36antares_but I am not too happy about what it ended up being in practice
10:37duck1123you guys might want to check out my clj-factory library
10:38antares_duck1123: I'm aware of it, it's nice
10:43wingywhat is the relation between a form and a function?
10:43ro_sta form is the whole thing, a function is something that can appear in function position (position 0) in a list
10:43antares_wingy: form follows function? ;)
10:44duck1123a form is a series of statements. A function is an object that can be invoked with parameters and executes a form
10:44TimMcSeries of statements? No.
10:44ro_stvalid forms: true [1 2] {:a "thing"} 1 "five" '(3 4) (defn foo [] "bar")
10:45antares_wingy: forms are functions, expressions, special s-expressions (this :is "an" s-expression), basically
10:45TimMcA form is an expression. A (do ...) block can contain multiple forms.
10:45scriptor(if true a b) is also a form
10:45duck1123yeah, should be singular, technically
10:45antares_duck1123: expressions, not statements
10:45wingyok form is the expression
10:45scriptorstay away from the word "statement" though
10:45wingyfunction is the function :)
10:45TimMcForms may be composed of other forms.
10:46scriptorI usually refer to the "if form" in clojure, as opposed to "if statement"
10:46wingyso this is one form: (fn-a :value1) and this is another: (fn-a :value1 :value2)
10:46TimMcright
10:46TimMcand :value is a form as well.
10:46ro_stas is fn-a
10:46wingycrazy that the book im reading isn't giving me the basics like this
10:46TimMcA read'able unit.
10:46ro_stwhich book, wingy?
10:46wingyClojure in Action
10:46ro_stclojurebook.com++
10:46antares_wingy: think of forms as s-expressions for now. s-expressions is anything between parentheses. There are special forms (like do) that Clojure compiler handles, they are not implemented in Clojure. Then there are functions, macros and forms you build from those.
10:46ro_stand joyofclojure.com++
10:46AWizzArdThe words "form" and "expression" are not the same.
10:47TimMcAWizzArd: True, they have different numbers of letters.
10:47AWizzArdAnd meaning.
10:47antares_wingy: that book is a bit outdated. Clojure Programming from O'Reilly is the best in explaining things like that, very high signal/noise ration and it is easy to follow.
10:47TimMcExample of disjunction?
10:47ro_stAWizzArd: the difference, then?
10:47AWizzArdA form is any object meant to be evaluated.
10:48cshell_wYes, Clojure Programming is the best
10:48wingyill read that one later or perhaps before
10:48ro_stwingy: or instead of. don't waste your time with old information
10:48antares_AWizzArd: I am not trying to give the most precise definition, just something for a newcomer to hold on to for now
10:48antares_wingy: "a form is something meant to be evaluated" is a good definition, by the way
10:48antares_function is just one case of that
10:49wingybut that one is from 2011
10:49wingyhow can it be oudated
10:49wingyoutdated
10:49antares_but you can also evaluate numbers, strings, regex patterns, etc
10:49ro_stthat's 20% of clojure's lifetime
10:49ro_stago
10:49antares_wingy: it covers clojure 1.2
10:49AWizzArdIn (let [a 10, b 20] (+ a b)) the parts "a 10" and "b 20" are not meant to be evaluated.
10:49antares_so most of the info is not outdated but enough is to not recommend it
10:49ro_stwingy: trust me. clojurebook.com. go. now.
10:49AWizzArdThose are expressions and subexpressions, but not all of them are forms or subforms.
10:49AWizzArdForms are expressions that you mean to run as code.
10:50wingyro_st: ok!
10:50wingyfuck i hate ditching something .. but ok i trust you!
10:50TimMcAWizzArd: Ah, you are drawing a pre-/post-macroexpansion distinction.
10:50TimMcI can see that.
10:50antares_tutorials and books on young technology often get a bit outdated in 2 years
10:50antares_fortunately, even 1.2 => 1.3 changes are not drastic
10:50RickInGAI read clojure in action, I liked it. I would reccomend clojure programming from oreilly though, hands down. clojurebook.com
10:50antares_and 1.3 => 1.4 upgrade went with only 1 change in 20+ libraries and apps for me
10:50AWizzArdI had an email conversation with Kent Pitman some years ago. He was in the committee that specified Lisp, and he explained me the difference between forms and expressions.
10:51TimMcAWizzArd: I would actually reverse those terms, though. :-)
10:51ro_stwingy: i've read all of clojurebook. it got me solidly into clojure
10:51AWizzArdAnother example was: (defun foo (x) (declare (fixnum x)) (+ x 3)) Here the (fixnum x) is a hint for the compiler, but nothing to eval, so (fixnum x) is not a form.
10:51wingyantares_: how can i have that confirmed?
10:52antares_wingy: confirmed what?
10:52wingythat Clojure In Action 2011 covers the 1.2 only
10:52antares_wingy: I am telling you that
10:52antares_I've read all of the books on Clojure
10:52wingyhow do you know?
10:52wingyok
10:52antares_wingy: I read it and I've lived through 1.2 => 1.3 migration in 2011
10:52antares_that's how
10:53wingyok .. 1.3 pretty new and now we are at 1.4 already
10:53antares_the last chapter in Clojure in Action is genius
10:53wingyoh
10:53antares_but it is not really for newcomers :)
10:53wingyshould i read it?
10:53wingyok
10:53antares_Clojure Programming is a much better choice for newcomers if you ask me
10:53wingy+ its outdated .. ill stick with Clojure Programming then
10:53antares_wingy: once you get comfortable enough to write first simple macros, absolutely
10:54wingyso i should never read this book again since its oudated?
10:54antares_today, it probably will have the opposite effect of confusing you
10:54antares_wingy: no, I am not saying it is not worth reading
10:54antares_it just should not be your first book on Clojure
10:55antares_the Joy of Clojure is another book that is remarkably good but definitely not for newcomers
10:55RickInGAIt is nice having access to different books, each explains things a bit differently
10:55ro_styour first book should be one that is true for today
10:55wingyok .. im on it
10:55antares_what ro_st said, plus, if you start with 1.3, you won't have any problem upgrading to 1.4 and probably 1.5
10:55wingythx for the book recommendation
10:55ro_stCiA and Joy are full of great stuff, but require discernment from the reader to realise when things might not be true any more, or to know how to verify things for yourself
10:56gtrakJoC takes a long time to actually read and understand, I had to backtrack a lot, but it was fulfilling
10:57wingywow it was newly written? 2012
10:58mhansonSo what is the best Clojure book for newcomers?
10:58wingyhttp://www.clojurebook.com/
10:58RickInGAclojure programming
10:58cshell_wClojure Programming
10:58mhansonI'm reading JoC right now and I'm not finding it too confusing.
10:59ro_stwingy: that one was released 6-8 weeks ago. i started with clojure because i saw it on HN
10:59ro_stmhanson: clojurebook.com, definitely
10:59wingypretty cheap
10:59wingy35 dollars
11:03mhansonSweet. Thanks.
11:03ro_sti also highly recommend watching rhickey's simple-vs-easy and are-we-there-yet talks
11:05RickInGAwhat libraries do you use to create clojure web services? compojure?
11:05ro_styes
11:06foxdonutantares_: even Practical Clojure? that one was awful.
11:06ro_string and compojure
11:06RickInGAdoes noir add anything for web services/rest?
11:07borkdudehttp://stackoverflow.com/questions/2578837/comparing-clojure-books
11:07ro_stand i'm using ring.middleware.format to json-ify incoming and outgoing data at the ring handler
11:07ro_stso that all my handlers use clojure data structures internally
11:07ro_stRickInGA: you don't need noir
11:07RickInGAro_st: thanks.
11:08RickInGAat atlanta clojure group last night, folks were suggesting we play with webservices next month, and I thought it was a great idea, but I have no idea where to start.
11:08nDuff...fully agree with the recommendations for Joy of Clojure and Programming Clojure (the O'Reilley book, not the pragprog one)
11:09RickInGAclojure programming = oreilly, programming clojure = pragmatic programers.
11:09ro_sthaving features you want to implement is a great help to focus you, RickInGA
11:09borkdudeeach books has pros and cons.. for example, I like some diagrams from Practical Clojure very much ;)
11:09RickInGAro_st: no doubt
11:10antares_foxdonut: I don't think it was awful, it explained some things pretty well, like some concurrency topics
11:10ro_stRickInGA: feel free to msg with questions if you like. all this stuff is in ram at the moment :-)
11:10borkdudeI find the maze example in clojurebook hard to read, code is really dense, want to split it out into some functions to see what they are doing, but the book could have done that for me
11:10borkdudeetc
11:10treehugRickInGA: web services as in soap or as in rest?
11:10ro_stsoap yuck
11:11antares_RickInGA: compojure or noir
11:11antares_RickInGA: noir does add nice things and has low overhead. I'd probably start with noir even if I had to build a :JSON in, JSON out: kind of service without any Web UI
11:11RickInGAtreehug: Rest, I would think. We are want people to enjoy the meeting
11:11foxdonutnDuff: the pragprog one does have a second edition
11:12borkdudewriting books is very time consuming, I'm happy that people are doing this for us… pick the good parts from all of them
11:13duck1123While it's not as used as much, I'd love if people tried out Ciste for their web apps and gave feedback
11:13RickInGAborkdude: /agree
11:13foxdonutborkdude: +1
11:13foxdonut(inc borkdude)
11:13lazybot⇒ 3
11:13foxdonut*g*
11:13RickInGAduck1123: what is ciste?
11:14duck1123RickInGA: The framework I wrote for my needs https://github.com/duck1123/ciste
11:14treehugduck1123: looks interesting
11:14foxdonutwriting a *good* computer book is *very* hard.. and when it's well done, reading it makes it look like it was easy to write!
11:15duck1123It lets you create views for different formats, but it does assume most of your data is in records
11:15wmealingduck1123, see private message
11:15wingywii now i can read it on my ipad
11:16duck1123I'm working on the next major push and I need to fix the travis build
11:17treehugduck1123: are you pretty happy with jayq versus goog.dom.query? (just looking at the cljs parts atm)
11:18wingywow feels great to have a book that is uptodate .. it even mentions clojurescript
11:18wmealingwingy, which book ?
11:18duck1123you know, I've only done a tiny bit with cljs, jayq was fine for what I needed and at the time, there were issues with query
11:18wingyClojre Programming
11:18wingyby Oreilly
11:18foxdonutwingy: you got the ebook just now?
11:19wingyyeah
11:19foxdonutcool
11:19wingy35$
11:19wingycheap cheap
11:19foxdonutgah, I got it for 1/2 price ;)
11:19wingyhow?
11:19clojurebotwith style and grace
11:20ro_storielly drm-free day wasn't it?
11:20foxdonutI attended O'Reilly's webinar by one of the authors (cemerick)
11:20foxdonutthey gave a coupon at the end
11:21foxdonutstrangely the coupon was good for print or ebook, but not the combo (??)
11:21treehugduck1123: yeah i struggled a bit yesterday with goog.dom.query
11:22borkdudehttp://shop.oreilly.com/product/0636920025139.do
11:23borkdudeHow is Raynes his book coming along (or should I better not ask?)
11:23foxdonutgood question
11:24foxdonuthope he's not yet another victim of the "sure I can write a book!" syndrome
11:24duck1123I keep telling myself I'm going to go back and write some more cljs, but then I tell myself I also want all my cucmber tests passing first.
11:24antares_borkdude: Raynes is an old busy southerner, you better not ask :)
11:24antares_scratch the "old" part
11:24borkdudeantares_ ok, enough to read, so nothing to complain anyway ;)
11:25wingydo you think there will ever be a clojure framework for the frontend?
11:25wingyseems pretty far from now
11:25RickInGAwingy: front end of what?
11:25wingylike ExtJS/Dojo etc
11:25antares_wingy: for Web apps? Noir is that framework
11:25wingyantares_: its a backend framework
11:25antares_wingy: there are various libraries like domina or jayq and binding for ClojureScript
11:25RickInGAclojurescript for ajax, noir for web, seesaw for swing
11:25antares_wingy: Clojure community is not big on building frameworks
11:26antares_peopel build libraries that do not dictate you that much
11:26ro_stohpauleez also made shoreleave available recently
11:26antares_and clojurescript is < 1 year old or so :)
11:26ro_stwhich looks hot
11:26ohpauleezthank you ro_st
11:26ohpauleez:)
11:26ohpauleezlet me catch up
11:27antares_so I don't know, I used CLJS very little so far and the toolchain is only starting to be useful for mere mortals
11:27ro_stohpauleez: how'd your reveal go?
11:27duck1123Whenever a clojure author builds a big framework, they split it up into a bunch of tiny pieces. buecause each piece is useful on it's own
11:27wingyyeah
11:27ro_stthat's the thing you need to realise. you can use just the bits you like
11:27borkdudespinoff libs
11:27wingyi personally think ExtJS is too bloated
11:27wingyalso they have bad programming designs
11:28wingybut their view layer is superb
11:28ohpauleezro_st - awesome. I showed off the demo's I'm working on, which people really enjoyed. Slides are on my blog http://www.pauldee.org/blob
11:28ohpauleezpauldee.org/blog
11:28ro_stblob haha
11:28ohpauleezhahah too much HTML5
11:28ro_sthi. i'm a celleb blobber
11:28ro_stceleb*
11:28ohpauleez:)
11:29ohpauleezwingy: There are a few attempts at creating the compelling story
11:29ohpauleezmost people choose to focus on smaller libraries you can stitch together
11:29ohpauleezwhich makes sense, because that's very natural for Clojure
11:30ro_stohpauleez: i enjoyed your talk that's up on infoq
11:30ohpauleezBecause of JavaScripts limitations, raw JS libraries have to come up with a set of standards, then code from the ground up using those standards, which results in a sort of bloated feel. This just doesn't happen in CLJS
11:30uvtcohpauleez, pretty slides!
11:30ro_sti'd love to see shoreleave in action
11:30duck1123does anyone have much experience with using waltz? How do you like it? (and do you have public code to share?)
11:31wingyohpauleez: yeah ExtJS has its own classes
11:31wingyconstructors etc
11:31ohpauleezro_st, uvtc : If you want, I've been emailing some people the early demo code (that are looking to adopt Shoreleave), PM or send me a message to the email in the slides, and I'll send you the URL
11:32ro_stfor sure!
11:32ohpauleezwingy: Exactly - so in CLJS we don't need that, we get all of that from Clojure. So there are just one off libraries
11:32ro_stthanks
11:32wingyohpauleez: we still need an easy way to create powerful UI though
11:32ohpauleezwingy: C2, Enfocus
11:32wingynot having to start over with HTML and have it work on all browsers etc
11:32wingyc2?
11:33ohpauleezDeclarative library for creating graphics/UIs etc
11:33ohpauleezEnfocus is a CLJS port of Enlive
11:33ohpauleezand Shoreleave promotes the concept of partial renders via Enfocus
11:33treehugwingy: ClojureScript One is frameworky
11:34ro_stwingy, your brain is going to explode soon. just so you know
11:34uvtchahaha
11:34ro_stbut nice explode. not meltdown explode.
11:34ohpauleeztreehug, wingy: Right, so if you want it all bundled up. You can use something like CLJS:One or Shoreleave as the foundation, and then put these graphical libraries on top
11:34RickInGAohpauleez is shoreleave cljs or clj?
11:34ro_stclojure is the most fun i've had programming in 15 years of coding
11:34ohpauleezthe best of both worlds
11:35ro_stRickInGA: it's both
11:35ohpauleezRickInGA: Shoreleave is mostly CLJS, but it lets you do client-server interop
11:35ohpauleezso that you can fall back to compute something on the server if you need to
11:35ohpauleezwhich is the best crutch in the world
11:38foxdonutro_st: +1
11:38ro_stfoxdonut: this week's mad-science is midje-mode and ace-jump-mode :-)
11:39foxdonutheh
11:40ohpauleezSo just a heads up - I've been working on WebCL wrappers for CLJS
11:40cgagwhat's ace-jump?
11:41ro_stcgag: http://dl.dropbox.com/u/3254819/AceJumpModeDemo/AceJumpDemo.htm
11:41cgagoh, easy motion for emacs
11:41RickInGAohpauleez: I had to look up what webcl was.... Wow, nice!
11:41ro_st-ing rocks once you get used to it
11:42cgagi use vim but i'm always being tempted by emacs modes
11:42otfromdoes anyone know where name-with-attributes from the old clojure.contrib.def lives nowadays? It didn't seem to make it into clojure.core.incubator. Googling hasn't helped much.
11:43foxdonut<-- staying with vim
11:43ohpauleezfoxdonut: YESSSSSSSSSSSSS
11:43ro_stnever learned vim. lucky me
11:43ohpauleezClojure: The first Lisp you can do in Vim and not cry
11:44ohpauleezThat said, because of my scheme and CL habits, I'm comfortable in emacs too, but clojure and vim play together so nicely
11:45wingyim coming from node.js, is there any async programming?
11:45foxdonutohpauleez: http://files.myopera.com/bashvi/albums/642917/vi-emacs-final.png
11:45dnolenwingy: there's aleph, you might also be able to easily integrate with vert.x
11:46cgagwhen i say i'm tempted by emacs, i mean i'd be tempted to use evil mode
11:46ro_stwingy yup. see clojure actors
11:46dnolenwingy: but in general the fascination with async programming in Node.js world is unnecessary. You have real threads, real multicore.
11:46Wild_CatI still can't get used to emacs. I'm always unsure why, but something always feels wrong about it.
11:46wingydnolen: but lets say i use netty which is a one thread server
11:46dnolenwingy: it is not.
11:46Wild_Catwhich is a shame because I know it's the most powerful editor in the world, but... It just rubs me the wrong way.
11:46wingyhow do i prohibit thread blocking?
11:47dnolenwingy: you have lots of threads, it probably won't matter.
11:47Wild_Cat...and of course, now that I've seen the lighttable demos, I feel like I can't be bothered to learn emacs anymore. Just coasting by on Eclipse and SublimeText until LT is released :p
11:47dnolenwingy: if you're building a chat server or a game, then yes netty can handle that too.
11:48Wild_Catunrelated question: is there an official coding style guide for Clojure?
11:48Wild_Cat(e.g. how/where to indent, naming conventions and the such... basically, a Clojure PEP-8?)
11:48nDuffwingy: ...the async approach taken by node and friends only gives you value if you're going to be running on fairly limited hardware. On a 24-core machine, using Clojure's native concurrency abstractions with real threads will result in much better results.
11:48dnolenwingy: basically leave Node.js brainwashing at the door ;)
11:49uvtcWild_Cat, if you're using the GUI version of Emacs, it acts a lot like a regular GUI editor: it's got a scroll bar, uses arrow keys, Ctrl-arrow-keys, etc. But with extra magick, like indenting things nicely.
11:49cgagwhat if i want to run clojure on fairly limited hardware?
11:50nDuffWild_Cat: I don't know of anything focused _only_ on code style. Joy of Clojure and Clojure Programming both have a fair bit to say on the topic, and emacs paredit-mode (as uvtc) is nicely opinionated.
11:50cgagthe indentation is one of the only complaints i have with vim/vimclojure
11:50nDuffcgag: If you want to run Clojure on limited hardware, you probably won't be using the Java-backed version anyhow
11:50nDuffcgag: ...and so you might well end up using, say, ClojureScript on node.js.
11:51uvtcWild_Cat, no official style guide I know of. Mostly just align function args vertically, and that's the style. :) Emacs + clojure-mode does this automatically, for the most part.
11:52scriptorcgag: agreed, I sometimes get annoyed at how much I have to un-indent sometimes
11:52cgagi just mean something with like 4 cores and not 24
11:52RickInGAWild_Cat: there is this http://dev.clojure.org/display/design/Library+Coding+Standards
11:52Wild_Catuvtc: I am using the GUI version (with the Emacs Live bundle, which does make it nicer). it's just the general feel of the thing that's off. Most shortcuts are chord sequences, the menu bar is mostly useless and I have to edit mostly-undocumented lisp files to change my defaults. All small things, I know, but combined together they just make the thing unpleasant to use.
11:52duck1123There's a scheme style guide that has most of the rules. Although some don't quite match up
11:53Wild_Cat(I gotta say rainbow parens are awesome, though)
11:53duck1123My rule for indentation is "wherever emacs want's to put it is where it goes"
11:53ro_stM-q in emacs: paredit re-indents the top level form at point
11:54TimMcWild_Cat: Yep, turn off the menu bar.
11:54Wild_Catstill, while I'm trying Emacs -- how do I get a left margin with line numbers?
11:54ro_stWild_Cat: linum.el
11:54uvtcWild_Cat, not sure how much experience you have, but perhaps this tiny guide I wrote might be of use: http://www.unexpected-vortices.com/clojure/10-minute-emacs-for-clojure.html
11:54scriptorthe starter kit has line numbers enabled, right?
11:54Wild_Catuvtc: will take a look, cheers.
11:54nDuffcgag: Ahh. *shrug*; depends on what you're doing -- it's certainly possible to abuse the STM system in such a way as to sink a lot of CPU time (mixing long and short transactions, doing IO within a transaction, ...), and thus lose much of the advantage of your extra cores, but it's also very much possible to _not_ do that.
11:55uvtcTimMc, though, the menu bar might be useful to new users while they're still learning the keyboard shortcuts. Wild_Cat : you can interactively shut it off by doing "M-x menu-bar-mode".
11:56ro_stWild_Cat: github.com/overtone/emacs-live
11:56Wild_Catro_st: already using that ;)
11:56uvtcohpauleez, Oh, you wrote a previous version of etsy. I remember hearing that they currently use a pretty wide variety of languages. Any idea if they use Clojure there?
11:56ro_sti grabbed that, used M-x list-packages to add magit
11:57ohpauleezuvtc: They were at one point, but it was taken out of the stack as they started to standardized
11:57ro_stand linum, and maxframe, and then i added a hook to automatically compile (C-c C-k) and .clj file on save
11:57ro_stoh and i added midje-mode today
11:57cgagthey should have just taken everything else out of the stack
11:57ohpauleez(they mostly use PHP for everything in the app layer now. Few exceptions are made)
11:57uvtcohpauleez, Do you happen to know what they're standardizing on?
11:57uvtcohpauleez, (typed at the same time). Ah, thanks.
11:58ro_stPretty Horrible Programming
11:58ohpauleezthat's because they're leadership is VP on innovation from Yahoo (Chad, was CTO, now CEO) and the Flickr guys
11:58ohpauleezso they're coming from a history of PHP, and it's easy to find cheap, mediocre PHP programmings (warm bodies) to fill the chairs
11:59uvtcohpauleez, they're job listings mention a lot of diff languages, but don't mention a focus. Thanks for the info.
11:59ohpauleezthey're over 250 employees now
11:59uvtcwow.
11:59ohpauleezYou're allowed to explore concepts in any language you want. Final consumer facing stuff has to be in PHP
11:59ohpauleezif you own a whole subsystem you can use whatever you want, but you're encouraged to use PHP
11:59foxdonut"over here we have the riff, and over there we have the raff."
11:59ohpauleezif more than one person has to touch it, PHP
12:02uvtcIt's interesting. If you aren't crazy about Java, but are stuck with the JVM, you can escape via Clojure. If JS isn't your cup of tea but you're stuck on the browser, you can escape via Clojurescript. If you're stuck with PHP, ...
12:03ohpauleezIf you're stuck with PHP, you spend half your day looking at docs to figure out why the hell the core functions contain bugs, and the other half looking for another job
12:03ohpauleezor personal projects
12:03ohpauleez:)
12:04uvtc(I just mean "stuck with the JVM" only in the sense that it's what you're required to work with.)
12:05uvtcMakes me wonder if the future holds a Clojurescript variant that will compile Clojure to PHP.
12:05dnolenuvtc: I doubt it.
12:05ohpauleezuvtc: With the lua backend being worked on, no need for it
12:06uvtcSorry --- I don't see the connection. What would a lua backend have to do with PHP?
12:07ohpauleezyou use PHP for lightweight server-side systems. Assuming you don't NEED the PHP platform, it's just "easy" - well then Lua makes a great alternative
12:08wingyreading my first book about clojure they mentioned that clj is using bottom up approach .. which to me seems pretty right .. unlike CoffeeScript and LiveScript which is top down clj/lisp just dont have to change over time in its syntax..since it has no
12:08wingyone
12:08wingyCoffeeScript comes out, then Coco, then LiveScript .. just like following trends .. what is hot this month
12:09wingybut they all change all the time since they are based on what is hot .. lisps remain the same throughout years
12:09wingysince they got the basic building blocks right
12:09dnolenwingy: syntax-y language seem to inspire to people to focus on syntax over semantics.
12:09dnolenwingy: Lisp semantics have changed quite a bit over the years.
12:10otfromfound it: [org.clojure/tools.macro "0.1.1"]
12:10wingybut not that much as the other syntax langs right?
12:11wingycould one say clojure is a far more safe bet than lets say CoffeeScript that changes this and that in syntax all the time
12:13dnolenwingy: new constructs tend to require new syntax. So where Clojure needs something new, syntax is created for that. But not, old stuff doesn't get changed willy-nilly.
12:15TEttingerwingy: there's sibilant if you just want coffeescript that looks like lisp
12:15TEttingerhttp://sibilantjs.info/#welcome
12:16TEttinger(it also IS lisp, with what I believe are "proper" macros, though I am not sure)
12:16wingydnolen: but there is no syntax in clojure?
12:17wingyyou add macros, functions but the syntax stays the same?
12:17dnolenwingy: macros create new syntax. you have write the forms in a specific way - braces no braces, this first, that first etc.
12:17S11001001@google ISLISP
12:18S11001001eh.
12:18wingyTEttinger: cool you are here too
12:18TEttingerwingy: heh, I am still in #livescript !
12:19TEttingerI love clojure for desktop stuff
12:19TimMcwingy: Clojure's compiler provides a base syntax, but macros (and in a more abstract way, functions) allow you to expand the language.
12:19TEttingerseesaw rules
12:19wingyTEttinger: im having a hard to deciding .. will make up my mind this week
12:19wingyTEttinger: LiveScript got me realizing how much I love FP
12:20wingyTEttinger: btw..check out Light Table .. so awesome
12:20TEttingerit is a very different kind of FP than Clojure IMO
12:20TEttingerwingy, last I checked it was just a REPL
12:20wingyTEttinger: yeah
12:20cgagi haven't gotten around to testing out the playground yet
12:20TEttingeralso, no Leiningen support yet
12:20TEttingerso no projects
12:21wingyits not finished editor yet
12:21wingyjust something you play with .. they will get it final in some months
12:21wingyi hope
12:21TEttingerheck i don't think it can open multiple files yet -- as a tech demo it is nice
12:21wingyit gave me A LOT of new ideas for the app im developing
12:21TEttingerheh good
12:21wingyhow the future looks like
12:21wingywhere we are heading
12:22TEttingerthe future probably uses Twitter Bootstrap haha
12:22the_ignoratidoes anyone know if Korma can do SQL IN?
12:22wingyalso the clojure lang .. i thought if i cant use clojurescript in frontend ill use livescript there
12:22TEttingergood point
12:23TEttingera difference between CLJS and LS is that LS is a lot closer to JS (did that make any sense?)
12:23dnolenTEttinger: wingy: from what I can tell LiveScript doesn't emphasize immutability, so missing out big on what's good about FP.
12:23TEttingeryep
12:23wingyTEttinger: of course
12:24wingydnolen: i have to enforce that myself :)
12:24TEttingerbut CLJS doesn't have any way to benefit from Clojure's concurrency primitives, does it? performace-wise
12:24wingywait a min .. it does?
12:24wingyyou have to use := to change a var outside the scope
12:25TEttingerin LS? yes
12:25wingyyeah
12:25dnolenwingy: you can enforce it but you can't make it efficient.
12:25TEttingerbut that isn't immutable
12:25dnolenTEttinger: not yet.
12:25TEttingeryeah, I just got the feeling that Clojure is a mature language, ClojureScript not so much
12:25wingyi just thought clojure is a good lang for making security heavy apps
12:25dnolenwingy: CLJS ships with all of the standard persistent data structures. So there's no extra work to do.
12:26cgagclojurescript is really young
12:26wingyfuture proof .. i dont think javascript can ever do that on server side
12:26dnolenwingy: don't think Clojure brings anything to the table security wise.
12:26TEttingeryes
12:26wingydnolen: why
12:26wingyi mean isnt java more fitable than javascript on that matter
12:26dnolenwingy: it just doesn't IMO.
12:26TEttingernode.js is kinda a hack, and unless V8 gets faster frequently, it is going to languish in server-side performance
12:27wingyit can do correct calculations
12:27maaruksI need to do setMessageSupplier(this); in default class constructor. How can I get reference to *this* ?
12:27dnolenwingy: I just mean it's not something it innovates.
12:27wingyi can have type checks .. lets say someone does banking .. you dont want to accidently pass in a string when it should be a nr
12:27foxdonutdnolen: I know it's not *required*, but would you say it's valuable to learn how closure works to make better use of clojurescript?
12:28wingydnolen: yeah but by using java its more secure in that matter
12:28wingythan js
12:28wingyjust a thought i had
12:28dnolenfoxdonut: the basic facilities seem useful, tho it's a large library - so mixed bag.
12:30TEttingerwingy: clojure isn't statically typed either. it just has the seq abstraction and things like it that let you pass, say, a vector to a function that normally takes sets, and IIRC as long as that function takes a seq... it will not throw an error, though it may misbehave
12:30foxdonutdnolen: I see. At the very least, I figure it's good to have a basic understanding of using the compiler, since that's an attractive feature of clojurescript-- compile in advanced mode and get a minimal .js file out for production use.
12:30wingyTEttinger: for how long have you been using Clj?
12:31wingydidn't know you were a clj guy
12:31wingynow we can talk in both channels!
12:31TEttingeroff and on? since 1.1 I think
12:31TEttingerso 2010
12:34pendlepantswhat are people doing for env-specific project config? e.g. database config.
12:34uvtcWow, having a Lua backend (via the GSOC pluggable backend that's being worked on) sounds quite exciting. Seems to me that it would allow you to pre-compile your Clojure code, and after that start-up time would be tiny --- and the resulting code would probably run quite fast.
12:35ystaelpendlepants: we have looked at, but not used, drakerlabs/milieu ; it's not difficult to roll your own
12:36dnolenuvtc: well we get a lot of those benefits from V8/Node already. But perhaps LuaJIT will be faster. Easy access to C libs also a plus.
12:37TEttingeryeah LuaJIT is amazing
12:37pendlepantsthanks ystael.
12:37TEttingerspeed on par with C# on Mono
12:37TEttingeron one test I found it outperformed GCC
12:37uvtcdnolen, does cljs + V8 allow easy ffi? It appears that cljs+lua would.
12:38zakwilsonA Lua backend for Clojure? Because it would be easy to make cljs output Lua?
12:38TEttingerhttp://attractivechaos.github.com/plb/
12:38uvtcFor some value of "easy"? :)
12:38TEttingeruvtc, yes
12:38TEttingercljs+lua would be easy
12:38TEttingerno idea about V8
12:39dnolenuvtc: yes I said that :)
12:39uvtcdnolen, thanks for the clarification.
12:39cgagdoes using cljs and node force you to write things in in that callback style if you want to do something like read from a file?
12:40dnolencgag: yep, though that could maybe change in the future.
12:42technomancywould people be interested in being able to specify environment variables in project.clj?
12:42uvtcWill have to look into how one would install a standalone V8, write and run cljs code on it.
12:43TEttingertechnomancy: like system env variables?
12:43technomancyTEttinger: System/getenv, sure
12:43technomancyenvironment variables
12:43TEttinger"PATH": ""
12:44S11001001"PATH": "i/got/your/bin"
12:44S11001001right/here
12:44technomancyI've thought it might come in useful a few times but don't know if it's worth pushing to get into preview7
12:45ibdknoxall I can say is wow: http://www.chris-granger.com/
12:45TimMctechnomancy: That would include JVM modifiers too, right?
12:45technomancyTimMc: you mean system properties?
12:45TimMctechnomancy: That -D stuff
12:45technomancyTimMc: that stuff's already plumbed through
12:45TimMcAh, never mind. Was confused.
12:47uvtcdnolen, sorry for the confusion --- I missed that you wrote "easy access to C libs is also a plus". So, I'm guessing that means cljs+lua means easy access to C libs. And from your more recent reply, it sounds like that's also the case with cljs+V8?
12:47foxdonutibdknox: !!
12:47ibdknoxmore than a month's worth of time
12:47ibdknoxthat's the thing I can't get over
12:48technomancyenv vars for config on the JVM are pretty awkward given you can't change them at runtime
12:48foxdonut\o/
12:48cgagthose are some insane stats ibdknox
12:48technomancyso I'm thinking it's probably best to not bother
12:48cgagcongrats :D
12:50zerokarmaleftibdknox: ST2 called and said stop stealing their thunder
12:50ibdknoxlol
12:50RickInGAibdknox: watching your presentation at bay area ug now. amused that you are wearing a visual studio tshirt
12:51ibdknoxRickInGA: lol unintentionally, just didn't think about it
12:53dnolenuvtc: not the case for cljs+v8
12:55dnolenibdknox: great stuff. From Twitter seemed like it was the first time many people tried Clojure.
12:55ibdknoxdnolen: yeah, I got that impression as well
12:56uvtcThanks for the info, dnolen.
13:02RickInGAtechnomancy: we had our first swarm coding meetup in Atlanta, thanks so much for developing and sharing that script!
13:06technomancyRickInGA: cool; glad that worked for you
13:07RickInGAthere was a lot of noise where we were, but because we were all looking at the same thing, we were still able to talk about what we were working on. Think it would have been a terrible meeting without swarming
13:10technomancyRickInGA: heh; yeah part of why we ended up doing it that way at Seajure is because the location doesn't allow for lecture-type meetings
13:14sandbagshello, anyone help me with a 4clojure problem?
13:15sandbagshttp://www.4clojure.com/problem/6#prob-title <-- my answer is '(:a :b :c) which my repl is telling me is true
13:15sandbagsalternatively [:a :b :c] my repl says is okay
13:15sandbagsand, again, the site rejects
13:15sandbagsah, damn
13:16sandbagsi missed that the [] aren't part of the answer
13:36dbushenkogetting Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64 while using noir 1.3.0-beta10
13:36dbushenkohow to fix that?
13:36uvtcWhy are there sometimes so many different groups for a given project at clojars? For example, https://clojars.org/search?q=clutch has com.ashafa/clutch, org.clojars.toxi/clutch, org.clojars.rje/clutch, etc. My understanding is that they are forks of the canonical clutch project, but what is the typical reason for pushing them to clojars?
13:39uvtcI'd expect that if the forks have improvements, such improvements would end up folded into the canonical project, rather than end up as separate clojars archives...
13:40madsyuvtc: Anyone can push to clojars. Since people can publish any project, the repo falls under your own account/name if you don't cooperate with anybody else
13:40madsyThat's how I understand it anyway
13:41madsySo yes, you might end with a dozen different forks/ports and versions from equally many people
13:41uvtcmadsy, Right. But I'm just curious if I'm missing some reason why folks are pushing those forks to clojars.
13:42madsyThe alternative would be to have some kind of control and moderation in effect, but that falls flat on its own premise
13:43madsyuvtc: Pushing them to clojars as opposed to where? :)
13:43nDuffuvtc: Could be some of these folks don't have their own local Maven repos.
13:43uvtcIf I made some changes to a project that I was using and not asking to be merged with the canonical project, my guess is that I'd just keep my modified project in a local repo, rather than clojars.
13:43madsyYeah, what nDuff said
13:43uvtcMmm.
13:44technomancyuvtc: usually because either the upstream maintainer is unresponsive or they're too lazy to collaborate with the maintainer
13:44technomancyeither way it's caused by a breakdown in the contribution process
13:44nDuffuvtc: Also could be some of them aren't sure how long it'll take to get things upstream -- certainly when I started working with clojure.osgi, I didn't expect responsiveness from aav (who'd been idle 6 months prior)
13:44nDuff(as it happens, aav *has* been responsive, but that was a surprise)
13:44uvtcnDuff, have not yet looked into what's involved in creating a local repo ... unless that simply means installing the project into my own ~/.m2
13:45nDuffuvtc: If you're in a typical corporate environment there are more developers, and a central build machine. Installing something in your ~/.m2 doesn't help any of them but you.
13:45uvtcnDuff, of course, right right. Thanks.
13:46uvtctechnomancy, "breakdown in contribution process". I see. Thanks.
13:47uvtcI see --- there's a section in lein's DEPLOY doc ("Private Repositories") that touches on this.
13:55JulioBarrosPicking up where I left off with my noir/friend project. I got the login/logout workflows to work but I don't think *identity* is being set so the helper functions (anonymous? authorize, etc) don't work. Does anyone have this working? What am I missing?
13:55achengyay: got the go-ahead to setup clojure for co-workers
13:55acheng... but i have a setup issue that i haven't seen before
13:56acheng... lein version works... but if i go to my project (which was created with an older version of lein) and run lein deps, it doesn't work
13:56acheng... java.io.filenotfoundexception could not locate leiningen/hooks/classpath__init.class or leiningen/hooks/classpath.clj on classpath
13:57technomancyacheng: remove the :hooks entry from project.clj
13:57acheng... and after this, lein version doesn't work either! so lein version goes from working to not.... ok technomancy will try
13:58achengtechnomancy: victory! thanks
13:59acheng(sorry, didn't mean to bury the question from JulioBarros above)
14:01achenghmm. failed to collect dependencies for clojure.lang.LazySeq@b1cac087
14:02borkdudethat's a really lame error message, who made that up?
14:02borkdude:P
14:02uvtctechnomancy, it sounds to me like, if a given project at clojars is the canonical one, and it's group-id is not the same as its artifact-id, then that's a bug.
14:03achengpastebin.com/3PjMLEce
14:04uvtc(Er, sorry if I'm restating the obvious.)
14:04technomancyuvtc: it's a workaround to a problem
14:05technomancysometimes a better solution is genuinely unfeasible
14:05technomancyin the case of MIA maintainers
14:06technomancyuvtc: also it used to be hard to publish to S3
14:06technomancyso that's certainly part of it
14:06uvtcIn the case of MIA maintainers, I'm guessing there's a process by which a new maintainer would be added to the group...
14:07hiredman"it used to be hard to publish to S3" whaaaa?
14:07achengadded my dependencies to pastebin.com/BPbfbkWh
14:07uvtcI was about to ask the same thing, hiredman.
14:07technomancyhiredman: s/hard/undocumented/ I guess?
14:08nDuffacheng: Would you mind using a pastebin with fewer ads? They're particularly obnoxious there.
14:08achengsure. where?
14:08uvtc~refhead
14:08clojurebotI don't understand.
14:08technomancyuvtc: there's no outside takeover mechanism for clojars groups
14:09technomancyif a maintainer is truly MIA, then a formal fork should happen
14:09technomancybut you don't want to do that hastily, and sometimes people need changes on a faster timetable
14:09nDuffacheng: personally, I'm a fan of gist.github.com; there's also a Clojure-specific one which intends to eventually reach feature-parity with gist (which is *very* featureful), though I don't recall its name offhand.
14:09uvtc~refheap
14:09clojurebotPardon?
14:10uvtc(misspelt it the first time)
14:11uvtc~pastebin
14:11clojurebotTitim gan éirí ort.
14:13achengrefheap.com/paste/3329
14:14uvtctechnomancy: Hm. For cases where a maintainer is truly MIA though, if you simply removed the older unmaintained artifacts it would burn folks who depend upon on (as you noted yesterday, "releases are forever").
14:16nDuffacheng: Looks like it's seesaw introducing that issue.
14:17technomancyuvtc: of course; no one would ever remove old releases
14:18nDuff...err, strike that, off-by-one
14:18nDuffclj-webdriver, rather.
14:19technomancyuvtc: by a formal fork I mean renaming a la clj-json -> cheshire
14:19uvtctechnomancy, Oh! Thanks for clarifying. :)
14:20nDuffacheng: Moving to clj-webdriver 0.6.0-alpha7 appears to fix things.
14:20achengnDuff: ok will try. how did you go from bouncycastle to clj-webdriver?
14:21technomancyuvtc: I think so far the only time we've needed manual intervention on the clojars DB is for deleting artifacts that were pushed by mistake
14:21nDuffacheng: I'm sure there's something far better that could have been done instead, but this was just process of elimination.
14:22uvtcWas it previously the style to name projects with a "clj-" prefix? Or is that still common?
14:23nDuffuvtc: To distinguish clojure wrappers for upstream projects from the original thing? Seems pretty clear even now.
14:23achenghm. alpha8 supports clojure 1.4 and alpha9 supports Firefox 13.
14:23achengi guess i'll ask semperos (the author)
14:23achengthanks nDuff!
14:23uvtcnDuff, Ack, of course. Thanks.
14:24sendaiI'm wondering how best to write code equivalent to this in clojure: https://gist.github.com/2997724 i could use nested if-let's but that's going to get ugly fast. suggestions?
14:25cgagcondp maybe?
14:26mebaran151hey #clojure, I'm working on a noir app and have multiple items with the same param name (i.e. multiple inputs with the same name), I would like to get these in my map as a hashmap of input names to vectors, but Noir seems to coalesce them into one. Anyway to get the underlying ring request parsing?
14:27sendaithought about condp, but i need the re matches to compute what i return. condp doesn't help me there, does it?
14:27sendaii'd have to do run the regexp twice in that case,i think
14:27uvtcsendai, right, you want those $1 and $2 values.
14:28ystaelthe last example under clojuredocs.org/clojure_core/clojure.core/condp looks promising?
14:28sendailet me look
14:28mebaran151sendai, you can pass the result of condp's test to the next expression via :>>
14:30sendaiyes, that will work. thanks, i hadn't noticed that about condp before
14:30cgagme neither to be honest, i suggested it before i realized you needed the result of the match
14:30cgagthat's good to know
14:32xeqimebaran151: I think you can get the :query-string or :body (url-encoded form) if you wanted to parse them differently
14:32xeqithough I don't htink I understand how you wanted it to end up
14:32mebaran151xeqi: actually found it, form-params from ring-request
14:41mebaran151xeqi: essentially, if I had two input fields with the name "dob" I wanted to get back a params map with {:dob [dob1 dob2]}...
14:44samrati've installed lein-tarsier and slimv. do i still need nailgun installed?
14:46cgagyeah
14:47shawnlewisWhat is "#^<type>" as in https://github.com/richhickey/clojure-contrib/blob/master/src/main/clojure/clojure/contrib/datalog/database.clj line 34? How does it differ from "^<type>"?
14:47cgagi just followed this for setting up vimclojure/tariser: https://github.com/daveray/vimclojure-easy
14:47ChironHi, how to write this in idiomatic way? https://github.com/zznate/cassandra-tutorial/blob/master/src/main/java/com/datastax/tutorial/composite/CompositeDataLoader.java#L133
14:48ChironI let the composite and then called addComponent, then I found I need to let HColumn later
14:49ChironHColumn needs Composite that defined earlier
14:50nickmbaileyhey Chiron
14:50nickmbailey#4377
14:50Chironwhat is this? :)
14:50Chironhey!!
14:50nickmbaileyoh wrong room
14:50nickmbaileyi'll msg you in #cassandra :)
14:50Chironokidokie :D
14:52antares_Chiron: dear god, wrapping hector is a nightmare
14:52aperiodi1samrat: slimv does not require nailgun, or tarsier
14:52antares_Chiron: this is a *very* young project but I'd recommend trying it instead of attempting to mess with hector: https://github.com/clojurewerkz/cassaforte
14:52Chironantares_: tell me about it
14:52antares_hector is just WTFs all the way down
14:53antares_Cassaforte is/will be built around CQL
14:53samrataperiodic: but i couldn't get slimv working....could you help?
14:53xeqimebaran151: ah, like wrap-nested params and fields named dob[]
14:53antares_so it will be similar to clojure.java.jdbc + helper functions built on top of CQL (3.0)
14:53samrataperiodic: i don't see a slimv menu as mentioned in its tutorial
14:53Chironantares_: it is wrap any other lib?
14:54aperiodicsamrat: i can try. what happens when you try to connect to a swank server?
14:54mebaran151xeqi: yep exactly, turns out (ring-request :form-params) was exactly what I needed
14:54samrataperiodic: well lein swank seems to work fine
14:56raekshawnlewis: that is the pre-1.2 syntax for ^
14:56antares_Chiron: just bare Cassadra Thrift
14:56antares_*cassandra
14:56shawnlewisraek: thanks
14:56aperiodicsamrat: ok, have you tried connecting to the swank server using slimv? by default it's ',c'
14:56ivan`I thought Clojure Programming was lying when it said that I must use the return value of the transient ! functions
14:56ivan`now I feel like scanning everything in clojars for bugs
14:56antares_Chiron: it will be pretty useful for expressions with ? and :params early next week
14:57ChironI love CloujureWerks, I found about them three days ago
14:57samrataperiodic: ',c' doesnt seem to be doing anything
14:57xeqiJulioBarros: what does you're credential-fn return?
14:58antares_Chiron: thank you. We just shipped Monger 1.0 and will focus on making Cassaforte useful now.
14:58aperiodicsamrat: how are you installing slimv? dropping it into your runtime path (~/.vim/*), or using pathogen?
14:58samrataperiodic: pathogen
14:58JulioBarrosxeqi a user map from my db.
14:59Chironantares_: Oh, you work for ClojureWerks?
14:59aperiodicsamrat: yeah, i couldn't get slimv to work under pathogen. try dropping it into the runtime path.
14:59antares_Chiron: clojurewerkz is an open source effort. I do not work for it but I started it.
15:00Chironantares_: I have to thank you :)
15:00antares_I authored almost all of the libraries and written all the guides
15:00lowerkeyGreetings
15:00xeqiJulioBarros: using workflows/interactive-from ?
15:00lowerkeyI came here hoping someone could explain lazy sequences to me
15:00lowerkeyI have the following function: http://pastebin.com/NVfU837f
15:01JulioBarrosxeqi: yes, a lot like in your clojars project.
15:01Chironantares_: it looks we both like methodology :)
15:01lowerkeyand would like it to generate a lazy sequence
15:01Chousukelowerkey: it does?
15:02Chousukefor is lazy.
15:02JulioBarrosxeqi: the session gets the identity but not the *identity* ref (as far as can tell)
15:02antares_Chiron: do you need a Cassandra client urgently or can wait till next week?
15:02raekshawnlewis: btw, are you aware that the clojure stuff moved from github.com/richhickey to github.com/clojure years ago?
15:02lowerkeycool. then i guess i didn't need to come here at all. thanks!
15:02antares_Chiron: by next week Cassaforte will be pretty useful, probably even with a short getting started guide
15:02Chousukeheh
15:02lowerkey:)
15:03Chironantares_: will try working on other parts of the project
15:03technomancyantares_: are you trying to beat the record for most databases used in a single codebase? =)
15:03ChironCassandra bugs and undocumented libs already consumed my previous week
15:03raek...and that "monolithic contrib" has been abandoned for almost as long?
15:03shawnlewisraek: yeah, I was interested in reading the datalog source though
15:03shawnlewisraek: which didn't migrate
15:03clojurebotPardon?
15:03raekok, good!
15:04Chironclojurebot: Titim gan éirí ort
15:04clojurebotTitim gan éirí ort is irish for "may your recursive calls always be in the tail position"
15:04technomancyclojurebot: botsnack
15:04clojurebotThanks! Can I have chocolate next time
15:04Chironhaha wicked smart
15:04mebaran151hey xeqi how does nested params work? It might be a less fragile version of what I'm trying to put together
15:04antares_technomancy: haha, actually, Cassaforte is for one of my possible next gigs. We don't use Cassandra for anything currently.
15:04lowerkeyChousuke: So when I call (first (divisors 100)) it will only evaluate until it got two?
15:05Chousukeit should only evaluate one
15:05antares_technomancy: but we do use 4 other data stores. Spyglass was a 2 evenings hack.
15:05Chousukeso.. yes?
15:05turbofailhm... what maven artifact to i need to get ahold of clojure.core.strint?
15:05antares_technomancy: the idea is that because Clojure's sweet spot is data processing, having awesome DB clients is a must for its adoption. the same with docs.
15:05Chousukelowerkey: though chunking may affect things
15:05antares_technomancy: there are no other great ideas behind clojurewerkz, just lots of practical libs and docs
15:05technomancyantares_: gotta catch 'em all!
15:06antares_technomancy: and you can be sure one day there will be an hbase client :P
15:06Chousukelowerkey: lazy seqs produced by clojure functions aren't guaranteed to be completely lazy :P
15:07technomancyantares_: oh, are you doing consulting work?
15:07nickmbaileyantares_: interested in the progress of that cass lib
15:07xeqimebaran151: umm, does http://mmcgrana.github.com/ring/ring.middleware.nested-params.html help?
15:07nickmbaileyi've worked some on clj-hector
15:07antares_technomancy: no but I am leaving my current place in 2 days
15:07nickmbaileybut hector is ….. so java-y
15:08lowerkeyChousuke: Would it be possible to iterate over the divisors function, something like (first (divisors)), (next (divisors)) or should i use (take-nth (divisors 100))
15:08antares_nickmbailey: right, that's why we are taking the CQL (3.0) route
15:08antares_technomancy: then entire July is for OSS hacking, then we will see what I choose to do next
15:08nickmbaileyah, well watch out for bugs in cql3, which is what Chiron has been hitting
15:08nickmbaileybut it is still beta
15:09antares_nickmbailey: well, basic CQL in 3.0 should work just like 2.0
15:09antares_the idea is to just use CQL for everything (possibly under the hood), it can be 2.0 for a while
15:09antares_and target Cassandra 1.0 or even 1.1
15:09technomancyantares_: cool; good luck
15:09nickmbaileyantares_: cool stuff
15:10nickmbaileywatching the project :)
15:10ChironI'm loving the project :)
15:11Chironbelieve me, it was a crazy week with CQL3
15:13lowerkeyhow would i create a backwards range?
15:14metellus,(range 10 1 -1)
15:14clojurebot(10 9 8 7 6 ...)
15:14lowerkeymetellus: thanks!
15:21wingyis there only one AST form?
15:21wingyor does every lang has it's own AST?
15:22antares_wingy: yes, every language has its own AST. Lisps are pretty unique in that it is accessible to you for modifications from the language itself.
15:23antares_wingy: other languages, say, Java, get AST as a data structure from a parser but they cannot really transform or generate themselves as data structures (only as text, which is a lot harder)
15:23nDuff...there _are_ some exceptions -- Boo, for instance, has an accessible AST such that one can write macros for it, but it's far from homoiconic.
15:24winkafaik the python ast thingy is also usable
15:24dnolenwingy: what do you mean? Lisp s-exprs are not really much of an AST, which why they are so useful.
15:24winkon some languages people rely on reflection and dirty hacks to get to it
15:25nDuffwink: Does the Python one allow one to hook in and run transforms during evaluation or module load? My impression was distinctly contrary.
15:25lowerkeyso when working with a lazy sequence, it's better to check if a list is nil, than it is to look if count is zero
15:25antares_wink: you can get AST in most languages but you cannot modify it
15:25antares_wink: at best (in Ruby, for example), you can generate strings and eval them one way or the other
15:26antares_in Clojure you generate data structures
15:26antares_which is radically easier
15:26winknDuff: sorry, never used it. but at least it exists
15:26winkantares_: even getting it can be non-trivial, or at least not as a core language package
15:27dnolenlowerkey: or empty?. rarely a good idea to call count on something unless you know it's counted.
15:28antares_wink: right. But this distinction between "generating text" vs "producing data structures" is exactly what "code is data" is about
15:28antares_wink: that's what I was getting at
15:28ohpauleezdnolen: ping
15:28winkantares_: oh yes, you're totally right :)
15:28dnolenohpauleez: pong
15:28winkI just think AST work is underrated by too many language creators
15:29wingyantares_: you mean wingy
15:29wingyor perhaps you meant wink :)
15:29ohpauleezdnolen: I was going through some of Liskov's Clu stuff - some ideas in there we could steal (the cluster as a protocol) for the CLJS idea we were talking about
15:29ohpauleezstill digging up papers though
15:30antares_errr
15:30lowerkeydnolen: thanks, I'm entirely new to clojure and functional programming
15:30dnolenohpauleez: interesting got links?
15:30antares_wink: sorry, I totally meant wingy :)
15:30antares_stupid tab completion
15:30winkit still was a meaningful answer :D
15:33ohpauleezdnolen: got the original idea from this talk: http://www.infoq.com/presentations/liskov-power-of-abstraction. In CLU, you define all the inputs and outputs of a cluster (a type) - you then use that Cluster to query on the objects themselves
15:34wingythe more i read about clojure the more i love the simplicity
15:34wingyhow the heck can lisp be the lang from 1958 who gets it right
15:34wingylike more than 50 years ago
15:34ohpauleezUsing some mix of protocols and metadata, we could easily put the idea together
15:36semperosacheng: online if you want to discuss here
15:37ystaelwingy: it might be more accurate to say that alonzo church got it right in the 1930s
15:37ldopawingy: because it's grounded in mathematics
15:38wingy:)
15:38dnolenystael: not really
15:38RaynesAnd mathematicses are the baseses of alls the univoyses.
15:40wingyso you can say clojure is more near the way nature works?
15:40wingynot focusing on the human style of thinking
15:40wingybut the nature's way?
15:40wingywith some help to ease things out
15:41dnolenohpauleez: does she say anything specific about the querying bit?
15:41ohpauleezno, most of the talk is about exceptions and and signaling. I've been looking for the querying in papers
15:42ohpauleezdnolen: ^
15:42dnolenohpauleez: well I d/led the user manual will give that and the video a looksee later.
15:43ohpauleezcool
15:50gtrakwingy: I'm convinced there are still tradeoffs in the flexibility
15:50aperiodicsamrat: ... any luck?
15:52gtrakwingy: for instance, I think it's faster to make a mess with lisp, too
15:54uvtcHow can I directly download a jar file from clojars? (Say, using wget.)
15:57xeqiuvtc: look for it in clojars.org/repo
15:58Rayneshttp://clojars.org/repo
15:58Raynesxeqi: Get out of my internets.
15:58dnolengtrak: given the kind of code that's out there in JS, Perl, PHP, Python, Ruby, C, C++, Obj-C & Java etc - that's a bold claim.
15:59uvtcThanks, xeqi!
16:00gtrakhm... dnolen maybe I just feel it's easier for me to make a mess in clojure than java, and I'm thinking kind of a reverse-blub argument. I've seen me some php :-)
16:01gtraksort of a terrifying liberty is what I feel
16:01uvtcand Raynes :)
16:01ldopawingy: if you consider the 'human' style to be piling on language features to make certain common cases easier without thinking too deeply about how those features interact, yeah
16:07dnolengtrak: probably your familiarity with Java talking. It's easy to be scared with something that's not familiar.
16:08gtrakI think there's a lot of subtlety to it, for instance, the distance between abstraction levels is much closer together, the tools you defined at the bottom can be used at the top.
16:10gtrakI think in general languages define a core abstraction that programmers float slightly above and don't stray too far from. I guess that's what I mean.
16:10gtraklisp is not that
16:10dnolengtrak: so does that prevent or enable messes. I've heard horror stories about Israeli military Java code where they had voodoo scripts, code generation, etc, because no sensible meta system.
16:11gtrakah yea, that's definitely one extreme, when meta is necessary
16:12dnolengtrak: it's always necessary unless you're writing toys.
16:12gtrakjust saying there are tradeoffs, there must be some good papers about that somewhere but I'm just talking out of my rear right now
16:13dnolenif you don't have meta - you have "a language designed for large teams" - meaning only large teams can possibly work with something so tedious.
16:13dnolengtrak: I've looked, only anecdotes no facts.
16:13gtrakah ok
16:13gtrakself-induced FUD perhaps :-)
16:14dnolengtrak: in fact, Art of the MetaObject Protocol is the only evidence I've ever seen that only meta systems can actually solve nearly impossible problems and deep backwards compatiblity issues.
16:14gtrakI really like clojure though, it's a good kind of terrifying :-)
16:14dnolenI've never read anything about system without good meta capabilties solving maintenance significant problems.
16:14dnolensignificant maintenance.
16:18wingywhy is clojure using weird names
16:18Raynesseancorfield: Is there a list of contributors to congomongo somewhere?
16:18wingypr-str but read-string
16:20scriptor /join ##nobullshit
16:20scriptorer, nvm
16:21ohpauleezwingy: You can think of (pr-str ..) as behaving like (str ..) so putting the names close helps puts the concepts close
16:22wingyare you guys using a framework like GWT to make frontend apps?
16:22amalloyprint is a human-friendly name that creates human-readable output; pr is an abbreviated name that makes machine-readable output
16:22wingyyeah
16:23S11001001ugh, I want try to be renamed call-with-delimited-linear-continuation
16:23amalloyohpauleez: it doesn't, though. str behaves like print-string
16:23wingyand can one say that lisp wasn't designed for UI interactions
16:23wingyseems to be designed for AI programming
16:23S11001001no
16:24wingywhile OOP is a better fit for frontend UI?
16:24tbaldridgewingy: not exactly
16:24wingyWindows.create()
16:24wingynew Window({title: "bla", size: 100})
16:24dnolenwingy: Interface Builder was originally written in Lisp.
16:25xeqiRaynes: https://github.com/seancorfield/congomongo/graphs/contributors ?
16:25ohpauleez&(str 5)
16:25lazybot⇒ "5"
16:25Wild_Catobject-oriented languages are easy on the brain as far as UIs are concerned. But then again, Clojure supports OO, so...
16:25ohpauleez&(pr-str 5)
16:25lazybot⇒ "5"
16:25ohpauleezit *feels* the same
16:25dnolenwingy: that said how to write UIs functionally is not exactly common knowledge.
16:25Wild_Catbtw, which is considered the cleaner, (.method object) or (. object method)?
16:25amalloy&(str "a")
16:25lazybot⇒ "a"
16:25amalloy&(pr-str "a")
16:25lazybot⇒ "\"a\""
16:26Wild_Catdnolen: I tried writing a GUI in Haskell, and it was a nightmare.
16:26nDuffwingy: (create-window :title "bla" :size 100) seems just as reasonable, though -- yes -- having a clean functional toolkit for GUIs is tricky (it's been done -- there've been some downright excellent ones for Common LISP).
16:26ohpauleezamalloy: I would argue that feels the same too
16:26amalloyWild_Cat: the former, in most cases
16:26Wild_Catamalloy: OK, thanks.
16:26Wild_CatI'm guessing it avoids reflection too, right?
16:26tbaldridgewingy: it's possible to do functional-like programming with UIs. You can kindof do this with XAML and WPF on windows.
16:27oskarthhow can I easily save things things I've evaluated and the results I got with a repl (terminal)?
16:27amalloyWild_Cat: no
16:27amalloythe two forms are identical
16:28tbaldridgewingy: the idea is that you setup reactions between the UI elements. So instead of saying "when slider 1 changes, set the size of this circle to slider.value * 2". You simply say "circle.value = slider.value * 2" and from then on that constraint is automatically recalculated as needed
16:29wingytbaldridge: would be cool with such framework
16:29wingyimpossible for me to know how to do
16:31tbaldridgeAgreed. FRP (functional reactive programming) toolkits exist in other LISPs (racket for instance), but I haven't seen a good one in Clojure yet.
16:36dnolenwingy: you actually end up doing it by hand with events. FRP and things like is about finding a less manual abstraction.
16:39wingydamn i love Light Table. much better than using a typical REPL
16:39Wild_Catwingy: it does look like it's gonna be awesome, yeah.
16:40wingycool that its in Clojure
16:40Wild_Catespecially once it supports Python in addition to Clojure
16:40wingyyou are a pytonist?
16:40ibdknoxI dunno, I think the guy building it is gonna run off with the money.
16:41Wild_Catwingy: yeah. It's been my day job for the past5 years or so
16:41ohpauleezibdknox: I heard that. That's what I've been telling everyone at least
16:41ibdknoxohpauleez: I met him once, he was a total ass to me.
16:41ohpauleezhaha
16:42nDuffibdknox: Is nREPL support for Light Table on the roadmap? Most of my use cases for Clojure involve embedding the runtime inside a larger environment / container.
16:42Wild_Catso under the hood, LightTable is a webkit frame with Noir running underneath?
16:42ohpauleezWild_Cat: Noir and CLJS
16:42Wild_Cator did I completely misunderstand the info?
16:43ibdknoxnDuff: yeah, you'll be able to do that stuff
16:43Wild_CatCLJS? where does it fit in?
16:43ibdknoxWild_Cat: it is technically noir
16:43ibdknoxthough it's talking over websockets
16:43mattmossIt seems to me that emacs, with some modes and such, could do exactly what Light Table does.
16:43ibdknoxso it's not *really* using noir
16:43mattmossI don't understand the big deal about Light Table, except that it's "pretty" I guess, and brings up docs in context.
16:43ibdknoxmattmoss: what I released yesterday? sure.
16:44ibdknoxmattmoss: let me know when you can do everything else I've shown :)
16:44Wild_Catoh, I didn't see that something had been released. Awesome!
16:44mattmossibdknox: Will do.
16:44ibdknoxWild_Cat: CLJS is used for all of the front-end
16:45technomancymattmoss: the main problem with implementing live-tracing is that you either have to do it on top of slime, which is a big legacy codebase controlled by CLers, or implement full nrepl support from the ground up
16:45ibdknoxalso, fwiw, never underestimate the value of pretty
16:45samaaronibdknox: let me know when LT has a paredit mode - that would be a killer feature for me
16:45dnolenmattmoss: fat chance re: Emacs (which I love)
16:45ibdknoxsamaaron: It should materialize not too far down the road I suspect
16:45mattmossI admit not knowing the issues involved. And perhaps I don't understand all that Light Table does (or hopes to) accomplish.
16:46mattmossBut it would be hard to leave behind emacs for something that is not emacs. Ne?
16:46ibdknoxeh, the greater majority of the programming world doesn't use emacs, so *shrug*
16:46RaynesEmacs users will probably keep using Emacs.
16:47RaynesI'm not particularly attached to any given editor, so I'd happily give light table a shot. I definitely want it to have paredit, but beyond that...
16:47Raynes(or something similar to paredit)
16:47wingyjust as long as i dont need to jump between multiple pages for documentation
16:47wingyeverything right THERE
16:47technomancymattmoss: if someone finished nrepl.el I would probably take a shot at implementing live-tracing, hint hint. =)
16:47AWizzArdwingy: there is only so much space…
16:48dnolenmattmoss: depends on what you're doing.
16:48mattmossC-x M-c M-butterfly...
16:48AWizzArdEvery tool will have to make compromises.
16:48cgagIid definitely give it a shot, but i can see it being hard to give up vim bindings
16:48dnolenmattmoss: I could imagine using Emacs for backend code, but something like LightTable for intensive UI / game programming could be pretty sweet.
16:48Raynescgag: Perhaps we can have Vim bindings in light table?
16:48ibdknoxcgag: I'm a vimmer :)
16:48S11001001where is butterfly on keyboard
16:48wingyibdknox: why do you think he is going to run out of money? isn't he having investors by now?
16:48RaynesI was a vimmer for a while. I use evil-mode in Emacs just because I think the keys are somewhat saner in some cases.
16:48cgagha
16:49wingyAWizzArd: and i aint gonna read everything at once .. show what i wanna see at any point of time
16:49mattmossI could do with vim as well... that's been my main mode for years now.
16:49cgagwingy: he said run off
16:49ibdknoxwingy: I was joking. :) He = me
16:49cgagbut also
16:50cgagthat
16:50samaaronI guess given that everyone's spouting about editors, I should throw in a plug for Emacs Live: http://github.com/overtone/emacs-live
16:50wingyibdknox: are you that guy building it?
16:50Rayneswingy: ibdknox *is* the light table guy.
16:50ibdknoxwingy: I am indeed
16:50wingyoh .. didnt know
16:50technomancysamaaron: dude... you need to get on the package.el train
16:50RaynesAnd I'm the light table guy by association, because I'm friends with the real light table guy.
16:50Wild_Catsamaaron: I did take a look at Emacs Live, and it makes Emacs much more usable than the stock version. I can't figure out how to make it run a custom script with additional settings on startup, though
16:50wingylucky me i wasn't talking shit about you :)
16:50samaarontechnomancy: bah, i prefer git submodules
16:50technomancy=(
16:51Raynessamaaron: Get out of my channel.
16:51amalloyi can't think of anything i prefer git submodules to
16:51technomancyI went down that road in 2008, it doesn't end well
16:51Wild_Cat(I want global-linum-mode and start-server in addition to the rest)
16:51samaaronamalloy: a pint of bacon?
16:51amalloyeven just an empty pint glass is better than git submodules
16:51samaarontechnomancy: where does it lead? I'm a happy camper so far
16:52Raynessamaaron: We should make Leiningen use git submodules for dependency management instead of leiningen.
16:52Raynesmaven*
16:52samaaronWild_Cat: send me an email - I'll walk you through the process - I'm still working on documentation
16:52Wild_Catsamaaron: oh, and I want something to auto-strip trailing whitespace on save, but I don't even know whether Emacs can do that in the first place.
16:53Wild_Catsamaaron: sure, will do that now. Thanks.
16:53technomancysamaaron: packages compose, submodules lead to blob-o-code
16:53S11001001Wild_Cat: it can
16:53RaynesWild_Cat: Pretty sure amalloy has code to do that.
16:53samaaronWild_Cat: Emacs Live is set up to do the whitespace autostripping for you
16:53amalloy(add-hook 'before-save-hook 'whitespace-cleanup)
16:53Wild_Catsamaaron: oh, you're right, it does. My bad.
16:53samaaronWild_Cat: https://github.com/overtone/emacs-live/blob/master/packs/live/foundation-pack/config/built-in.el#L65
16:54wingyibdknox: you didnt wanna use Ace since you see them as competitor? :)
16:54wingyand what do you think about cloud9ide
16:54ibdknoxwingy: no, they're not really a competitor
16:55ibdknoxand I didn't use ACE because it's a disaster :p
16:55wingyhow so
16:55wingywhats bad
16:55ibdknoxsetup, customization
16:55samaarontechnomancy: blob-o-code? You mean transitive deps?
16:55ibdknoxthe code base is a mess
16:55ibdknoxI dropped codemirror in and it worked
16:56ibdknoxI then needed to customize it and it was easy
16:56ibdknoxmost new things these days are using CodeMirror
16:56wingyi c
16:56wingynot github!
16:57technomancysamaaron: packages make it much easier to focus on each tool providing independent functionality that can be used in any context
16:58technomancysamaaron: I pushed as much of the starter kit as possible out into independent packages and now I get a lot more feedback/contributions from the wider community
16:58technomancysince it's easy for anyone to just pull in the bits they want
16:58samaaronthat's nice
16:58samaaronso do packages allow for transitive deps?
16:58technomancyyeah
16:59cgagRaynes: did you use nerdtree when you used vim?
16:59technomancybut the main thing is orthogonality
16:59samaarontechnomancy: and what about transitive deps collisions?
16:59cgagif so, what do you use with emacs/evil?
17:00technomancysamaaron: right now the mechanism is pretty primitive; it's a "this version or newer"
17:00Raynescgag: Not really, no.
17:01technomancysince there's no way to isolate or sandbox except for per user I'm not sure if you could come up with anything much better than that
17:01Raynestechnomancy: Maven's apparently isn't much better.
17:01Raynestechnomancy: I've got issues where it pulls in ancient versions of ring when I wish it would prefer the newest version in the transitive deps.
17:01samaarontechnomancy: yeah, so basically for now Emacs Live punts on the deps problem as I wasn't (and probably still not) interested in making a super general, expandable, fits-all-usecases config
17:02TimMc17:01 < Raynes> I've got issues
17:02samaaronI just wanted to release my .emacs.d in a way other people could explore and use
17:02RaynesHeh
17:02wingyibdknox: when do you think we will see complete version which can be used to open/save files?
17:02technomancysamaaron: in elisp super general doesn't mean abstract and extensible a la architecture astronauts, it typically just means doing one thing and doing it well
17:03technomancyRaynes: all you gotta do to fix that is find which joker introduced version ranges and yell at them till they stop; easy peasy
17:03samaaronsure, but i'm not interested in supporting such a wide range of users
17:03TimMcwingy: I would imagine it will be awhile -- I think he's still studying how people interact with a live-eval editor.
17:03Raynestechnomancy: I don't see any verison ranges anywhere.
17:04samaaronwith git submodules I have very tight control of what I'm pulling in
17:04TimMcwingy: There's also #lighttable
17:04wingycool
17:04samaaronand also, most users won't need to know about the submodules, as i only use them for dev work
17:05samaaronbut i will find some time to look into packages.
17:05technomancyRaynes: oh, you mean you're getting an old version just because you didn't declare a top-level dep?
17:08Raynestechnomancy: Yes. Look at refheap's current project.clj. noir 1.3.0-beta10 depends on ring 1.1.1 which depends on ring-core 1.1.1. However, I also depend on mongo-session which depends on ring 1.0.someotheroldcrap, and it gets pulled in instead of the newer version that noir depends on. Because of that, I have to add an exclusion to the mongo-session dep until amalloy stops being lazy and updates his dependencies.
17:09technomancyRaynes: why not add a top-level dependency instead of an exclusion?
17:09RaynesBecause my code isn't the code that depends on it. *shrug*.
17:09RaynesIt feels wrong
17:10amalloyi'm not going to create a new release of all my projects every time any dependency creates a release, and neither are you, Raynes :P
17:10dnolenbbloom: http://www.50ply.com/cljs-bench/, nice looking CLJS graphs for #{}
17:11bbloomdnolen: hah. nice. that's what i expected :-)
17:11Raynesamalloy: Sure I will!
17:11bbloomdnolen: i didn't realize the graphs backfilled new benchmarks
17:12technomancyRaynes: dunno; a top-level dep seems simpler than an :exclusion
17:12dnolenbbloom: he moves over the benchmarks by hand, he doesn't use exactly what we have in the repo.
17:12duck1123Raynes: you're the one that cares what version you get
17:13RaynesWell, I don't really care about any solution. I'm more bothered by the fact that 15 people have reported a noir bug that doesn't exist because of maven's crappy dependency resolution. :p
17:14bbloomdnolen: ah oh. anyway, i'm trying to find a decent chunk of time to put some more elbow grease into reified keywords and symbols. i need to really untangle declaration order to get rid of a bunch of warnings. it's tricky to decide which functions to define in terms of which other functions while bootstrapping core.cljs, especially when you can't use :else in a cond for fear of instantiating a keyword object! :-)
17:15bbloomdnolen: i was also trying to see how painfully slow it would be to make a Character class. similar identical? vs eqiv problem pops up
17:16bbloomdnolen: may be able to utilize a similar whole-program optimization of memoizing Character objects from literals
17:16dnolenbbloom: could be interesting but way lower priority in my opinion.
17:17dnolenbbloom: w/o the keyword patch much more common ops are slow.
17:18bbloomdnolen: yup, i'm aware of where it falls on the priority list. I'm trying to balance the priority list with my own "heh, this sounds fun" approach. it's a nice reprieve from "real" work
17:19dnolenbbloom: :)
17:20bbloomdnolen: regarding common ops that are slow sans keyword patch. you seem to know which those are in your head. can you do me a favor and add benchmarks for them and send them my way? i'll make sure i keep an eye on those when working on it
17:21dnolenbbloom: anything where keywords are used as functions that's not in the (:foo ...) form. because that will go through String.prototype.call
17:21bbloombbloom: ah, so higher order use? like map, comp, etc?
17:22dnolen(map :foo ...) (filter :foo ...) (#(% ...) :foo) etc
17:23bbloomdnolen: gotcha.
17:26cljnewb_029582(cc/POST "/hset-notes" {params :params} ) <-- this can read the params of a POST request.
17:26cljnewb_029582Is there a way to retrieve a GET request params like this as well?
17:28wingydoes FP mean that there should be no classes/objects?
17:28wingyor are the functions still objects
17:28wingyhaving a class
17:28wingyi know that clojure is like that but is that just because it's based on Java?
17:29Luyt_Clojure isn's based on Java... It just runs on the JVM (Java Virtual Machine)
17:29gtraklexical closures live on the heap in other langs too
17:29gtrakmaybe a C struct instead of an object
17:30gtraksame difference
17:30dnolenwingy: there are other lisps that have object like things at the bottom. T, OakLisp. Lots of benefts derived from this design.
17:30dnolenwingy: in fact IMO, a massive improvement to Lisp.
17:31brehautwingy: footnote of http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html
17:31brehauts/footnote/appendix?/
17:31gfredericks(defmacro if [c t f] `(({true (fn [] ~t) false (fn [] ~f)} (boolean ~c))))
17:33wingyso he is combining functions with objects
17:33wingyjust to satisfy both worlds
17:33brehaut‽ no they are isomorphic
17:34wingydamn i learn new stuff here all the time
17:34wingynever a sec of resting
17:34brehautgfredericks: its when all of you americans are flying to the conj
17:35brehautnothing but tumbleweeds and antipodeans here
17:35dnolenwingy: part of of the problem with Lisp isn't there anyway to tweak stuff like cons, car, cdr. Those meanings are traditionally hardcoded. By putting object like things at the lowest level and exposing protocols - those things become configurable.
17:38aperiodicbrehaut: what is NZ the antipode of?
17:38brehauttmciver: i believe that in top hemisphere, you look down antipoedeans, and we look up
17:38brehautaperiodic: common usage?
17:38gtrakdnolen: I think that kinda relates to the abstraction delineation argument... we basically had to say... 'stop! this is your foundation now'
17:39brehautalthough i think spain actually
17:40gfrederickssurely most land is across from water
17:40gfredericksif you are across from land you are one of the fortunate few
17:40gtraktheoretically closures at the bottom is good enough but we have to draw the line somewhere
17:40brehautgtrak: turtles
17:41gtrakwell no, social concerns are the drivers
17:44gtrakin lisp infinity is more accessible :-)
17:44dnolengtrak: I don't follow.
17:44dnolengtrak: delineation bit
17:45gtrakah, well you said the objects exist since we couldn't parameterize the cons's, we can't parameterize them because they're accessible to the programmer
17:46gtrakmaybe they were the wrong abstraction for the bottom, but the ramifications propagate up the levels
17:47gtraksomeone has to come along and create a new thing, then convince everyone else to use it
17:48gtrakanother example... some optimizations might be more suitable for bytecode than lisp forms
17:48gtrakbecause there are more invariants
17:49dnolengtrak: if you mean it wasn't obvious that cons should be polymorphic in the early days ... sure.
17:49dnolengtrak: given the existence of machine oriented lisps, not sure I even agree w/ that. Have you seen Maru?
17:49dnolenor GOOL
17:49dnolen& GOAL
17:49lazybotjava.lang.RuntimeException: Unable to resolve symbol: GOAL in this context
17:50gtrakhmm, that looks cool
18:14SrPxHey guys... maybe it's asking too much but would any of you be kind enough to write the Clojure's equivalent of this very small code? That would be unlightening. I've read all manual and it's still not clear.
18:15SrPxhttp://paste.pound-python.org/show/23488/
18:15SrPxenglightening *
18:18gtrak,(assoc {:hp 0 :pos [0 0 0] :items []} :hp 10)
18:18clojurebot{:hp 10, :pos [0 0 0], :items []}
18:18cgag(def player {:hp 10 :pos [0 0 0] :items [])
18:18amalloySrPx: there's no single equivalent, because the design decisions made in python won't be made in clojure
18:18qbert_hi all, new to clojure, does the repl have any sort of history ?
18:19SrPxcgag: gtrak ty, now how do I update it's position, pos and items values?
18:19gtrakSrPx: make functions, like C or something
18:19gtrakexcept immutable
18:19brehaut(defn damage [char dmg] (update-in char [:hp] #(- % dmg)))
18:19SrPx(defn damage [player,amount] ...
18:20SrPxbrehaut: yay
18:20SrPxupdate-in is an existing function?
18:20brehautyes
18:20gtrakSrPx: it's not in-place, it'll return a new map
18:21brehautSrPx: the block of mutating an existing player is quite difficult to give you a direct translation though as amalloy pointed out
18:22amalloybrehaut: (update-in char [:hp] - dmg)
18:22brehautamalloy: oh yeah, duh. thanks
18:23amalloythis message brought to you by the Lambda Preservation Society
18:24brehautlol
18:24technomancyclojurebot: recite the litany against cons
18:24clojureboteventual consistency is for losers
18:24technomancywhat?
18:24clojurebotwhat is exceptions
18:24technomancyclojurebot: litany against cons
18:24clojurebotlitany against cons is "I must not cons. Cons is the perf-killer. Cons is the little death that brings total obliteration. I will face my cons and permit it to pass over me and through me, and when it has gone past I will turn my GC to see its path. And where it has gone there will be nothing; only I will remain."
18:24SrPxbrehaut: but it's okay, I just have to change the char variable to the updated hash, right?
18:25SrPxbrehaut: can I do it (that is, is this often done in clojure?)
18:25SrPxor there are other ways to deal with this problem
18:25brehautSrPx: thats exactly the problem. 'changing variables' is antithical in clojure (and 'pure' FP)
18:26SrPxantithical?
18:26amalloyantithetical
18:26brehautthanks
18:27amalloybtw brehaut, your blog looks nice now
18:28brehautamalloy: thanks :)
18:28brehautSrPx: in clojure, data is immutable and you cant reassign a variable. you structure your program different as a result. your example is small enough that there is not enough context to suggest what the idiomatic alternative might be
18:28scriptorso, someone mentioned before that there're a bunch of experiments being done with how to architect cljs apps
18:28brehautamalloy: by nice you mean you can read it without sunglasses?
18:28scriptoranyone have any links? The more I try backbone the more jaded I get
18:30SrPxbrehaut: you can't reassign a variable??
18:30lazybotSrPx: What are you, crazy? Of course not!
18:31amalloy(inc lazybot)
18:31lazybot⇒ 6
18:31brehautSrPx: nope. you can redefine a 'def'd var, but that is really only for dev time stuff, rather than in a real program (plus they are global)
18:31SrPxbrehaut: that was what I meant. Just keep redefining with def. Is this wrong?
18:31brehaut(and you shouldnt (re)def something outside of the top level
18:31brehautyes thats extremely wrong
18:32amalloySrPx: yes, very
18:33brehautSrPx: functional programming is about programming without mutation or side effects. You write functions that take some arguments and return a new thing based solely on those arguments. ie if you run the same function a thousand times with the same arguments the return should be the same value
18:33amalloySrPx: a very simple skeleton for a game loop without reassigning anything might look like (reduce (fn [world action] (create-new-world world action)) (initial-world) (lazy-seq-of-input-actions))
18:33SrPxhmm. So an example, a game where I have many players with lots of attributes such as hp, atk, def, inventory. They can each other, gain exp, track what player each other player have killed, login data and so on...
18:34cgagthat's the most relevant bot response i've seen
18:34SrPxamalloy: hmm ? wait
18:34SrPxcgag: ?
18:35cgaglazybot: SrPx: What are you, crazy? Of course not!
18:35scriptorSrPx: in essence, you're creating a new world every time a "change" happens
18:35scriptorin an imperative language, it might be something like:
18:35SrPxcgag: I didn't get it...
18:35scriptornew_world = world; new_world.foo = world.foo+5
18:36dabdI'd like to redefine a function that is in the ns incanter.charts. If I try to redefine it in my ns using (defn incater.charts/heat-map* ...) I get an error saying I can't redefine a function from a different ns. How can I do this?
18:36SrPxscriptor: sure, I think I got this concept, but people just said it is wrong to update the value every 'tick'
18:36SrPxthe variable that points to the value
18:36SrPxI'm confusde
18:36nDuffSrPx: If you want to modify state, that's what all of Clojure's state-management primitives are for -- atoms, refs, agents, etc.
18:37nDuffSrPx: You shouldn't be re-deffing the value; you should be using whichever of those primitives best fits your problem
18:37nDuffSrPx: (if what you really want is to just do an atomic change with no locking or synchronization, well, that's what an atom is for)
18:38nDuffSrPx: ...so, if you're redefining the whole world, an atom might fit; if you have a number of different, associated things that change in ways related to each others, refs might make more sense.
18:39wingywhen should i use #_ and when should i use comment
18:40nDuffSrPx: ...even if what you want really _is_ to modify the root value of a var (ie. what def creates), that's what set! is for.
18:41Rayneswingy: (comment ..) only works for code that actually compiles.
18:41brehautnDuff, SrPx: i think perhaps going down the mutable state escape valves as a clj beginner (especially anything to do with vars) might be a rabbit hole you might do better to avoid till you understand the functional approach better.
18:42cgag#_? Do you mean ;? or is there a block comment literal?
18:42nDuffcgag: #_ is a reader macro for (comment ...), IIRC
18:43nDuffcgag: ...if memory serves, (comment ...), just like #_(...), doesn't make it out of the reader into the compiler.
18:43brehautcgag: #_ is a reader macro to skip the next form
18:44cgagwhile we're on comments, is there any kind of convetion around using ;; vs ; or is that just a style choice?
18:44cgagfrom what Raynes said it sounds like comment does make it to the compiler?
18:44hiredman;; is for block comments
18:44amalloynDuff: no, comment is strictly less powerful
18:44nDuffAhh.
18:44hiredman; is for comments after corms
18:45amalloy&[(comment foo) 1]
18:45lazybot⇒ [nil 1]
18:45amalloy&[#_(foo) 1]
18:45nDuffHeh.
18:45lazybot⇒ [1]
18:45cgagah interesting
18:45amalloyand Raynes's statement wasn't really accurate either. both comment and #_ work only on code that can be read successfully; it doesn't have to compile, though
18:45hiredmanhttp://mumble.net/~campbell/scheme/style.txt
18:46SrPxnDuff: I have to take a look on those yet, I didn't understand well on the first reading.
18:46amalloyhiredman: i prefer http://www.gnu.org/software/emacs/manual/html_node/elisp/Comment-Tips.html for cgag's particular question
18:47SrPxbrehaut: I didn't understand what you said, sorry (I've read it some times and translated on google but it didn't work for the words I don't know)
18:48dabdI am using with-redefs to temporarily redefine a function from another namespace. Is this the correct way?
18:48SrPxDo you guys know Tibia? http://3.bp.blogspot.com/_LpPTq_PHIWI/SxFoQbN63PI/AAAAAAAAAFk/NkqJEjb1Y30/s1600/tibia.jpg Like I said, every player has a pos, inventory, there's a map with the items that are on each position
18:48shawnlewissrpx: This is a great example of the functional-style as related to games: http://java.ociweb.com/mark/programming/ClojureSnake.html
18:49SrPxMy question is pretty much, first, if that kind of game is possible to be done in Clojure, and second, if it's natural to it (that is, would it be harder to program it than in a traditional language like Python - for one that knows clojure well)?
18:49SrPxshawnlewis: let me see
18:50shawnlewissrpx: and here's a version that works with clojure 1.3: https://github.com/shawnlewis/clojure-snake-game
18:50Iceland_jackSrPx: It's possible to do it in Clojure. But the solution will be different from a Python one
18:50SrPxshawnlewis: this is beautiful
18:51SrPxshawnlewis: I like how the code has a minimal syntax, yet you can read any part of the source and it perfectly says what it is doing.
18:52SrPxshawnlewis: it is very different from reading a Java / C++ game
18:52SrPxIceland_jack: Different in "someone who mastered both would do better/faster in python" or "just different".
18:53Iceland_jackThat's a pretty tough call to make
18:54cgagi think it'd be easier for someone who hasn't mastered both to do it in python, if just from a lot of other people having made games in python
18:54frozenlockA little question for mongoDB users: Is there a way to make the equivalent of (merge {:a 100 :b 2} {:a 1000} {:a 10}) => {:a 10 :b 2} but on the server side? (perhaps with a js function?)
18:55shawnlewisHow can I use a macro like (defrecord) at runtime? (If I want be able to generate record types on the fly)
18:57qbert_do ya'll use commas in clojure ? just looking for best practices
18:57frozenlockqbert_: too long to type :)
18:58frozenlockBut it's handy to have them in the REPL
18:58cgagi never really use them, it's always weird going back to ruby and being forced to use them everywhere
18:58Iceland_jackqbert_: I sometimes use them when I'm writing argument vectors or maps that contain many mappings but not many enough to write one-per-line
18:59qbert_ok good to know :)
18:59qbert_frozenlock, I don't know what merge does, it takes the least value of any named variable and merges them into one map ? I use a lot of m ongo
19:00Iceland_jackqbert_: Basically if the same key appears twice
19:00qbert_wait it takes the last named variable or the lowest ?
19:01qbert_sorry, the last key found*
19:01Iceland_jackhttp://clojuredocs.org/clojure_core/clojure.core/merge#example_81
19:01Iceland_jack(you might want to check out merge-with)
19:03frozenlockInteresting, never used merge-with. Seems useful.
19:04qbert_Ahh, frozenlock this should work then , http://pastebin.com/NGibFv9M , and if you haven't stored functions in mongo before, http://pastebin.com/hkwLLB7c
19:04amalloyqbert_: rarely. i sometimes use them as "abbreviations" for a newline: sorta like "the standard way to format this would be a newline, but the code is short and i don't think a newline is needed"
19:04cgagdefinitely a good one to have a mental note about
19:05Raynesqbert!
19:05RaynesThat's like my favorite game ever.
19:05Iceland_jackIt's very handy for merging e.g. recordos of scores ##(merge-with + {"sally" 10} {"sally" 58, "john" 41})
19:05lazybot⇒ {"john" 41, "sally" 68}
19:05Iceland_jacks/os/s/
19:06frozenlockqbert_: thanks! Is there a big benefit in saving directly in the db, rather than sending the function each time?
19:06nDuffqbert_: Could I ask that you avoid pastebin.com (being full of ads)? Both http://refheap.com/ (maintained by Raynes) and gist.github.com are both more featureful and ad-free.
19:06qbert_frozenlock, not performance wise just for code clarity
19:07RaynesI'm fueled by fundraisers, baby.
19:07qbert_nDuff, sure, I only use pastebin because I never took the time to look for a new one
19:07technomancynDuff: you should see if you could get lazybot to auto-nag for pastebin too along with riddell.us and friends
19:07lazybotThe riddell.us tutorials are much more highly-ranked on Google than they deserve to be. They're old and way too complicated. If you're trying to install Clojure...don't! Instead, install Leiningen (https://github.com/technomancy/leiningen/tree/stable) and let it manage Clojure for you.friends
19:07frozenlockqbert_: ok thanks! Using congomongo, I'll probably send the function each time. This way everything is in the same .clj file
19:07technomancyRaynes: probably safe to drop that one now, eh? ^
19:08qbert_Raynes, looks slick man
19:08RaynesI'd hate to discriminate against pastebins.
19:08amalloytechnomancy: is it? did the google rankings change?
19:08technomancyamalloy: he finally took it down
19:08amalloy!!!
19:09technomancyyeah, we should get lazybot to do a little dance too
20:05technomancyweavejester: hey, I've been circling back to ragtime, have a few thoughts
20:06weavejestertechnomancy: Go ahead, but I'm a little sleepy, so I can't guarentee any insightful feedback :)
20:07technomancyI was just thinking about stripping things down to two things: sql files in a dir and clj files
20:08weavejestertechnomancy: Wouldn't those be libraries that depend on ragtime?
20:08technomancyI was looking at integrating ragtime into a project I'm working on and felt a bit of abstraction overload; it seems like most projects are going to get by fine with just that
20:08weavejestertechnomancy: I was kinda taking the "ring" approach, in that you probably don't want to use ragtime directly, but want to wrap it in something
20:09weavejesterBut that something is likely going to be opinionated
20:09weavejesterSome people might want files
20:09technomancyI realized I just want two things: 0) functions to give me {:id/:up/:down} maps given a directory and 1) a function to filter out a seq of migration maps to just the ones that need to be run to reach a target migration level
20:09weavejesterOthers might want to declare it in a clj file
20:10weavejester1 seems generic enough to include in ragtime
20:10weavejesterI'm not 100% sure about 0… perhaps as a separate package...
20:11technomancyhere's what I want to be able to write in my app:
20:11technomancy(doseq [m (r/migrations-for (r/merge (r/sql-from-dir dir) (r/clj-from-dir dir)) target)] (m))
20:13technomancymerge composes migration sets in a way that wraps complementary .clj/.sql migrations in a transaction
20:16technomancyanyway... I knocked out a prototype in ~70 loc: http://p.hagelb.org/ragtime.lite.html
20:18technomancyso the disadvantage here is it assumes sql for both transactions and storing the list of applied migrations. but the simplicity is nice.
20:18weavejestertechnomancy: Sorry, got called away for a moment
20:19weavejesterI wonder whether sql-from-dir and clj-from-dir are the right solution...
20:19weavejesterThey seem similar...
20:20weavejesterLike if you had a "from-dir" function
20:20technomancyyeah, I'd be more inclined to factor that out if it were more than 10 LOC =)
20:20weavejesterI'm wary of putting too many specifics into ragtime itself, or at least the core library
20:21weavejesterSome people would want to split their migrations up into files in a directory
20:21weavejesterBut others wouldn't
20:21weavejesterI don't think the core should prefer one way over another, in the same way that Ring doesn't have anything to say about routing per se
20:21technomancywell the thing is this kind of stands on its own without the existing ragtime.core
20:22weavejestertechnomancy: Wouldn't it require ragtime.core and ragtime.sql?
20:22weavejesterBuild on top of it?
20:22technomancywell, what I've got here is standalone
20:23weavejesterDon't you need… for instance… a migrations SQL table to keep track?
20:23hiredmangiven that sql migrations are a subset of clojure migrations (because clojure canexecute arbitrary mysql) is there a reason not to make migrations a set of namespaces full of clojure functions?
20:23technomancyit's there at the top
20:24technomancyhiredman: I realized the reason I like separate .sql files is for syntax highlighting
20:24weavejesterhiredman: ragtime kinda does that. Each migration is a map consisting of :id, :up and :down. The :id uniquely identifies the migration (so we don't run it twice), the :up and :down are functions
20:24weavejesterragtime.core is independent of SQL or databases
20:25hiredmantechnomancy: you can put you sql in another file and slurp it in your migration function
20:25technomancyweavejester: anyway, I guess you could say this prototype is an experiment to see whether writing other functions like sql-from-dir and clj-from-dir is good enough as an extension point
20:25hiredmanyour
20:25weavejesterragtime.sql adds functionality to maintain a list of applied migrations in a table
20:25steveo_do any of the prismatic guys hang out here? And if so are they going to open source the flop, store and graph libraries anytime soon?
20:25technomancyrather than extending the ragtime.core protocols
20:26weavejestertechnomancy: I'm all for experiments :)
20:26SrPxSo I noticed calling a function with a wrong number of arguments is a error. Can I change this behavior so that instead it calls (partial func my_args) ?
20:26dnolenSrPx: nope
20:26SrPx)'=
20:26SrPx*okay
20:27technomancypros: bringing your own map-producing function is much simpler; cons: it locks you into ragtime.lite's way of storing the applied migration list
20:27technomancysteveo_: going my their history I wouldn't hold your breath
20:29weavejestertechnomancy: What do you mean? The applied migration list is a protocol function in core.
20:29steveo_damn, they look so cool
20:29weavejestertechnomancy: In ragtime.sql the protocol is implemented to store it in a table, but that's not mandatory...
20:30technomancyweavejester: right, but my hack I pasted doesn't use that part; it all lives in ragtime.lite
20:31weavejestertechnomancy: Oh right!
20:31weavejestertechnomancy: Sorry, I misunderstood.
20:33technomancyI'll give it a spin with this small app I'm putting together
20:33technomancyprobably shouldn't call it ragtime.*, but I started there and got carried away =)
20:33weavejestertechnomancy: Let me know how it works out
20:33gfredericksif you want a namespace called ragtime.*, do you have to put it in src/ragtime/_STAR_.clj?
20:35technomancysrc/rock/_STAR_.clj
20:35gfredericks:)
20:37brehaut,(use 'rock.*)
20:37clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate rock/*__init.class or rock/*.clj on classpath: >
20:37gfrederickswoah
20:37gfredericks,(use 'rock.-*)
20:37clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate rock/_*__init.class or rock/_*.clj on classpath: >
20:37gfredericksweeerd
20:37gfredericks- must be special case
20:37brehautapparently * isnt name munged?
20:38gfredericks,(use 'rock.-*_$#)
20:38clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate rock/_*_$#__init.class or rock/_*_$#.clj on classpath: >
20:40xeqiI can't imagine it being legal
20:40xeqiwouldn't it mess with java's import statements
20:51wingyclojure might have the best doc of all langs
20:55technomancythat's probably the first time anyone has ever said that
20:56wingyhow can it not have .. everything is just there
20:56wingyi remember 2 years ago on Ruby .. it was so bad documented
20:56wingykinda like a toy
20:56hiredmantechnomancy: hey man, I think clojure.org is pretty good
20:57technomancywhoa; when did the special forms get their :doc metadata added?
20:57hiredmandoc special cases special forms
20:57wingywho is rich hickey in here?
20:58hiredmanhas forever, which is why it doesn't work in clojurebot (I am too lazy to special case them)
20:58gfredericks$seen rhickey
20:58lazybotrhickey was last seen quitting 3 weeks and 5 days ago.
20:58wingythx
20:58gfredericks,'(ns %!:>-+#:<$&=*:.core)
20:58clojurebot(ns %!:>-+#:<$&=*:.core)
20:58hiredmanwingy: he is rarely in #clojure these days
20:58technomancyhiredman: yeah, but didn't it used to just say "see http://clojure.org/special_forms&quot; or something?
20:58wingyhiredman: we know why?
20:59hiredmanyou'd have to ask him
20:59hiredmanI think he has refered to irc as an "opinionfest"
20:59gfredericksit is not an opinionfest imho
21:00technomancyhe's probably still here under a pseudonym
21:00gfredericks$seen notrhickey
21:00lazybotI have never seen notrhickey.
21:00wingyperhaps he is watching how you are behaving in this channel against newcomers
21:00technomancy$seen such-an-opinionfest-as-this-channel
21:00lazybotI have never seen such-an-opinionfest-as-this-channel.
21:01gfredericks(inc tecnhohamncy)
21:01lazybot⇒ 1
21:01hiredmanwingy: that would be hard to observe because after enough stupid questions I just put people on /ignore
21:02septominwhere are they holding opinionfest this year? probably somewhere i hate
21:02technomancygfredericks: I took Stupid Bot Tricks 101 from jlf.
21:02wingyhiredman: oh .. now I know
21:02wingyim rich hickey!
21:02gfredericksthe power of rhickey was inside you all along
21:03wingyyou never stop to learn
21:08wingywhy is google clojure a part of clojurescript
21:08wingythat forces everyone to load something they don't into the browser?
21:09dnolenwingy: advanced compilation eliminates unused code.
21:10wingybut is google clojure sent to my browser .. isnt compilation done in server side only
21:10dnolenwingy: which part are you confused about?
21:13wingyif google clojure library will be loaded into my web site or is the compiler only used server side to compile it
21:13wingysince people are comparing it to jQuery I kept thinking I have to load closure into my website
21:15dnolenwingy: CLJS has a dependency mechanism. but even if you include some Closure Library dep (or CLJS dep), unused functions will get eliminated by GClosure Compiler.
21:19wingydnolen: i see that you are one of the commiters .. would you sincerely recommend using cljs if i start a project from 2 weeks for production usage? are most of the bugs cleared out etc?
21:20dnolenwingy: it's alpha software. but people are using it in production. try it out and make your own judgement call.
21:30frozenlockIs there a function to dissoc a key from a map inside a map (with any depth)?
21:31gfredericksfrozenlock: I think update-in can do it
21:31gfredericks,(update-in {:foo {:bar {:baz {:bang 12 :booze 13}}}} [:foo :bar :baz] dissoc :booze)
21:31clojurebot{:foo {:bar {:baz {:bang 12}}}}
21:32frozenlockPerfect! Thank you very much! :)
21:33gfrederickspersistent immutable data structures are the knees of bees.
21:34wingycan't get why the index nr is after a vector (nth [13 87 56 75] 2) .. compare to (filter even? [1 2 3 45 6 32 3])
21:34wingywhy isnt it: (nth 2 [13 87 56 75])
21:34wingyseems more natural and consistent
21:35dnolenwingy: collection fns take collection as second param - helps with threading.
21:35dnolenwingy: sequence fns take sequence as last params - helps with threading.
21:36dnolen,(-> ["foo" "bar"] (nth 1) first)
21:36clojurebot\b
21:37wingyright
21:37wingyyou have it all figured out havent you
21:44dnolenwingy: heh well using a PL for a few years helps.
21:45gfrederickspommon lisp?
21:45gfredericksoh "a PL"
21:45gfredericksI missed the "a"
21:47wingywhats that?
21:48gfredericksprogramming language
21:48wingy:)
21:48wingydnolen: what languages have you used?
21:49dnolenwingy: dabbled list is long. I've written non-trival programs in Java, C, C++, Obj-C, Python, Ruby, & JS.
21:50dnolenwingy: strongest language is JS.
21:50dnolenwingy: and Clojure, but I've only done OSS work w/ it.
21:50wingyseems like you are a perfect candidate for coding cljs :)
21:54wingy(pretty simple to get clojure when you have worked with ruby, coffeescript, livescript)
21:55wingyClojure programming was indeed a very very good book for beginners
21:56dnolenwingy: Clojure (Lisp really) is a pretty deep well. 50 years of Lisp and still changing ...
21:59wingyi totally love it
21:59wingyno more JS
21:59wingyi really thought that node.js was going to be my last stop
21:59wingyyou never know when life suprises you
22:00dnolenplan on more stops ;)
22:00wingyi can't figure out whats next
22:01wingyi mean how can i ever choose another lang than clojure
22:01wingyimpossible!
22:02cemerickheh, that's what I thought when I found python :-P
22:02wingybut that's python
22:02wingythis is clojure!
22:02gfredericksoh now that you put it that way
22:02brehauteverything is blub to something
22:03cemerick(inc brehaut)
22:03lazybot⇒ 7
22:03xeqibrehaut: omega, coq ?
22:04brehautxeqi: entirely possible :) agda too
22:04gfredericksbrehaut: there are a finite number of programming languages. Given any partial ordering there must be some undominated language.
22:04brehautgfredericks: take your scary math reasoning somewhere else
22:04gfredericksour job is to find it and convince management to adopt it.
22:04gfredericksusing charts.
22:04friolol wingy
22:04frioerlang's next for me
22:05wingygfredericks: haha
22:05cemerickbrehaut: APL!
22:05brehautcemerick: ahaha :) i fear that, but for different reasons :P
22:05frioif clojure ran well on osgi id get to use it for my next pet project
22:07wingy"As you can see here .. with this new technology productivity is increased ... and thus sales!"
22:07cemerickfrio: It does. Counterclockwise is largely written in Clojure.
22:07wingy.. they are convinced
22:08frio... interesting cemerick
22:08frioi need to run away for a meeting
22:08friobut ill look into that :)
22:08wingyfrio: erlang .. they don't have erlangjs!
22:10technomancygfredericks: the problem is that suck is a unit vector
22:10technomancythere's always some suck, it just often happens to be in a direction a given hacker finds more or less disagreeable
22:12gfrederickstechnomancy: so blub is not a partial order you claim?
22:13technomancymaybe a 3D chart where the dimensions are quickness of development, practicality, and compile-time correctness?
22:14gfredericksso a developer's preference is some linear combination of those three, producing a subjective total order
22:14gfredericksalso combined with "what do I already know"
22:16wingysometimes the book refer () to a list and sometimes a sequence .. what is the diff?
22:16taliosfrio - theres work on clojure-osgi underway, and it looks pretty good so far
22:16gfrederickslist is a data structure, seq is a sequential abstraction
22:17wingygfredericks: that doesnt make me much smarter
22:17wingywhats the latter
22:17gfredericksan interface
22:17wingyso list is a sequence
22:17taliosfrio - checkout https://github.com/pmoriarty/clojure-osgi-maven-plugin
22:17wingyare there other sequences?
22:17gfredericksyes it is
22:18gfredericksvectors, maps, sets...
22:18gfredericksstrings?
22:18gfredericks,(seq "foo")
22:18clojurebot(\f \o \o)
22:18gfrederickslazy-seqs are certainly seqs
22:18xeqi,(seq? "foo")
22:18clojurebotfalse
22:19gfredericksxeqi: yeah I was trying not to get too much into that :/
22:20wingygfredericks: seems that the book have it wrong then: Notice that the value of
22:20wingyrest here is a sequence, and not a vector, even though we provided a vector to the
22:20wingydestructuring form
22:20gfrederickswingy: what's wrong about that?
22:20gfredericks,(seq? (rest [1 2 3]))
22:20clojurebottrue
22:22wingyah i get it :)
22:24wingygfredericks: but (seq? [1 2]) is false .. why is that if vector is a sequence
22:25brehaut,(instance? clojure.lang.Sequential [])
22:25clojurebottrue
22:26brehautsome things are sequential without being 'sequences'
22:26brehautsequential things can trivially be converted to a sequence though
22:26gfrederickswingy: ##(sequential? [1 2]) might be a more useful test
22:26lazybot⇒ true
22:26gfrederickswell
22:26gfredericksnevermind
22:26gfredericksI find all this very complicated.
22:26gfredericksalso it is the hallmark of clojure's simplicity, I think
22:28cemerickwhat's the question?
22:28gfrederickswhy is the question "is X a seq?" so complicated to answer?
22:29friotalios: thanks for those links :)
22:30wingywhere can i find clojure.lang in http://clojuredocs.org
22:30wingyi just see clojure.core
22:30wingywanna find clojure.lang.PersistentVector
22:31cemerickgfredericks: (instance? clojure.lang.ISeq x) will evaluate to true only for seqs
22:31wingythats the class for an [] .. so i can see it inherit Sequential to get the pic
22:31gfrederickswingy: that's in the java code, which might not be documented anywhere
22:31gfrederickscemerick: why shouldn't a vector implement it?
22:32gfrederickswingy: but you can certainly find it in the clojure repository
22:33wingyhm
22:33wingywhy dont they generate doc for it
22:34gfrederickshasn't seemed to be too much of a pain point
22:34jeremyheilergfredericks: because a vector is not a sequence, but something that can become a sequence. It implements clojure.lang.Seqable
22:34gfredericksjeremyheiler: what makes a vector not a sequence? it's just a first/rest interface, right?
22:34wingyhttps://github.com/clojure/clojure/tree/master/src/jvm/clojure/lang
22:35cemerickgfredericks: Well, I didn't write PersistentVector et al.; but, I wouldn't doubt it if it is as it is because you can (and want to) have all sorts of different seqs over vectors efficiently.
22:36gfredericksyou could return a different kind of thing for [1,2].next()
22:36jeremyheilergfredericks: calling (seq []) will call the seq() method on the vector, which returns an object that is a sequence over the given vector.
22:37xeqioh, ISeq requires cons
22:37gfredericksjeremyheiler: I understand that; it still doesn't tell me why you can't implement seq directly and return this from (seq [])
22:37gfredericks(seq? []) => false just seems confusing
22:38gfredericksnot to mention why should (first [1 2 3]) require an extra object allocation?
22:43wingygfredericks: seems that maps are not sequences
22:43wingy(sequential? {:a 2 :b 1})
22:43wingyfalse
22:43gfredericksright
22:43gfredericksbut they're sequable
22:43gfredericksseqable
22:43wingyjezz
22:44gfredericksI can repeat my vector question for maps, though with somewhat less of a WAT value
22:44tmciverwingy: for the most part you don't have to worry about that; hof's like map, reduce, etc "just work"
22:45tmciverwingy: i.e. you can map over a vector or a map without first having to call seq
22:48jeremyheilergfredericks: I suppose it's the same reason ArrayList doesn't implement Iterator. But I understand what you're getting at.
22:49gfredericksiterators are stateful aren't they?
22:49technomancyyou can't cheaply get the rest of a vector without constructing a seq to walk it
22:49gfrederickstechnomancy: sure, but you don't have to create a seq for the whole vector
22:49technomancyyou certainly don't; it's lazy
22:49gfredericksso Vector#seq could return `this` while Vector#next returns a specialized seq impl
22:50technomancy... or seq could just return a seq =)
22:51gfredericks^that's what I meant; wasn't referring to eagerness
22:51gfrederickstechnomancy: if vector implemented seq then that's what it would do
22:51gfrederickswhy do we need to create a new object?
22:51technomancyyou're going to need one anyway
22:51technomancywhy wait for next?
22:51gfredericksfor what?
22:52technomancyif you're calling seq the implication is you're going to want a head and a tail
22:52gfredericksor maybe just the head
22:52gfredericksand even if you want the tail, that's still one extra object
22:52technomancybut it's uniform
22:52gfrederickswhy is that important?
22:52gfredericksI'm trying to figure out if this was an intentional decision or just a "meh doesn't matter all that much whatever"
22:53gfredericksso the next time somebody asks why isn't (seq? []) I can say something less made up
22:54technomancy"prefer has-a to is-a" maybe?
22:54brehauti think that its to do with the access mechanism; you can access any index in O(1*) time?
22:54brehaut(in a vector)
22:55brehautso its not inherently a sequence, even though it can be treated sequentially?
22:55gfredericksso if the caller is expecting a crippled data structure we need to go out of our way to cripple it for them?
22:55technomancyI mean the uniformity makes sense to me; walking a vector should start a lazy walk-the-vector operation
22:56gfredericksreturning this is pretty lazy
22:56technomancyteaching vector how to rest itself rather than delegating that to seq feels like shoehorning
22:56technomancybecause what the vector is going to do is just construct a seq with the pointer offset by 1
22:56wingyclj is it! i found her!!!!!!
22:57gfredericksit either has to seq itself or rest itself; seems about the same amount of work
22:57wingytime to sleep though .. c u tomorrow and thx for all the lessons
22:57technomancywhich is basically the exact same thing as calling seq first and then calling rest on that
22:57brehautwingy: i think you should get your keyboard checked, i just got a big pile of exclaimation marks
22:57technomancygfredericks: it sounds like you're arguing for a break in uniformity to avoid a single cons call
22:57gfrederickstechnomancy: I'm more bothered by the seq? function than the extra cons call
22:57gfredericksmaybe we just shouldn't pay as much attention to (seq?)?
22:58gfredericksdoes it have external utility?
22:58technomancyyeah, I don't think that's a useful predicate at all
22:58wingybrehaut: each one for my love to clj
22:58gfrederickstechnomancy: okay, if we admit that then I think I'm fine with everything
22:58technomancyother than to answer "does this object print with parens?"
22:58technomancybecause c.c/list? is a nest of vipers
22:59gfredericksalright newbs, you heard him. Stop asking about c.c/seq?
22:59amalloytechnomancy: well, macroexpansion needs seq?
22:59amalloybecause seqs are function calls, and vectors aren't
23:00technomancyamalloy: right; because list? is useless
23:00amalloyfor sure
23:00gfredericksI was just thinking it's useful for code-data
23:00brehauttechnomancy: whoa, its true! i did (source list?) and its (defn list? [x] (instance? 🐍 x))!
23:00technomancybrehaut: ಠ_ಠ
23:00gfrederickstechnomancy: let's rename it parens?
23:01technomancygfredericks: (def parens? (comp (partial = \() first str)))
23:01technomancygfredericks: open a jira
23:01gfrederickslol
23:01gfredericksman \() is hard to mentally parse
23:01technomancybrehaut: it's dumb. clojure.contrib.condition got bit by that
23:01technomancybitten
23:02brehauttechnomancy: it does look more than a bit vague
23:07amalloytechnomancy: pr-str, not str, right? because of ##(str (range))
23:07lazybotExecution Timed Out!
23:07technomancyyow
23:07amalloywait, i thought that was "clojure.lang.LazySeq@xdfsdf"
23:07amalloy&(str (range 1))
23:07lazybot⇒ "clojure.lang.LazySeq@1f"
23:07gfrederickswat
23:07amalloyoh, it's computing the hash
23:07technomancydoes pr-str honor *print-limit* or whatever it's called?
23:08amalloytechnomancy: it should
23:08gfredericksamalloy: it hashes the whole seq to print the useless lazyseq string?
23:08amalloygfredericks: yes, sorry
23:09gfredericks....that's not very lazy
23:10gfredericks,(time (str (range 100000000)))
23:10xeqihaha
23:13TimMc*cough*
23:13gfrederickslazybot: is clojurebot okay??
23:13lazybotgfredericks: Definitely not.
23:13TimMcOops, right. clojurebot's trigger is ,
23:14gfredericksTimMc: I wonder how many neurons I waste keeping track of that fact.
23:14TimMc,(+ 2 5)
23:14clojurebot7
23:14gfredericks,(time (str (range 100000)))
23:14clojurebot"Elapsed time: 146.032819 msecs"
23:14clojurebot"clojure.lang.LazySeq@49160f51"
23:14gfredericks,(time (str (range 100)))
23:14clojurebot"Elapsed time: 0.237375 msecs"
23:14clojurebot"clojure.lang.LazySeq@5c8e6fb3"
23:15gfrederickswell I would have bet probably $100 on that not being the case
23:15gfredericksI figured the hex was just the object address
23:15amalloygfredericks: it's the hash code
23:16gfredericks,(= (str (range 100)) (str (range 100)))
23:16clojurebottrue
23:16amalloywhich is the object address if you don't override hashCode
23:16cmajor7reading more about datomic.. if a peer A reads from its cache, and a transactor is writing into a storage service, would that be true to say that the second peer B, that has its own cache, can read a different datom than A at the same point in time? Or a transactor does not commit until all peers' caches are invalidated?
23:16TimMcOops.
23:16calvados1i am using lein to make standalone jar , i got a jdbcappender.jar and i want to include it to uberjar, is there a way to do it ?
23:17TimMcI may have killed clojurebot.
23:17taliosresurrection!
23:17gfredericks,'[has he?]
23:17gfredericksTimMc: you did it with your mind?
23:17clojurebot[has he?]
23:17TimMcslobot
23:18TimMcYup, that time-str-range thing does it.
23:23technomancywait... are the messages you pass to clojure.test/is supposed to be failure messages or success messages?
23:24xeqiwould you want it printing out success messages?
23:25gfredericksxeqi: you could imagine (it "should be good" (= 1 1 ))
23:25gfredericksif string-as-first-arg were allowed :/
23:25technomancyxeqi: the pom tests in lein have stuff like "version is correct"
23:25technomancyI would have put "version mismatch" or something
23:25technomancybut I realized the docstring doesn't really say which way is right
23:26xeqibah, use something I wrote against me
23:26gfrederickstechnomancy: I would think it's easier in principle to describe how something works correctly than how it breaks
23:26gfredericks(is (= 5 (+ 2 3)) "one prime can't be the sum of two others")
23:27technomancygfredericks: I think I do it that way because the only time you see the message is when it fails
23:27gfrederickstechnomancy: let's just agree to have both said different things
23:28technomancygfredericks: deal
23:29technomancywhoa: http://nikebetterworld.com/404
23:30brehauttechnomancy: wahoa indeed
23:30gfrederickswhat? that the site uses clojure?
23:30technomancynot just that, also the favicon is the triforce!
23:31technomancyand it's misconfigured, I guess
23:33brehautgfredericks: yeah you get to work at a cool palce that uses clojure. dont rub it in :P
23:33xeqitechnomancy: hmm, looking at my other projects I seem to write success messages
23:33xeqiit must be my rspec background
23:33xeqiand that I need to use (testing ...) more
23:34gfredericksbrehaut: just a little bit
23:35technomancyxeqi: it's just funny because it made me realize I don't have a good reason for thinking the way I've been doing it is right
23:35technomancyI don't use those messages very often though
23:36technomancyman... I wish thrown? were a macro though; the special-case in c.t/is sucks a lot
23:36technomancypostmodern testing; you have to deconstruct the intention of the author of your testing lib to find the truth
23:38amalloytechnomancy: it's not so much a special case as a well-hidden compile-time multimethod, right?
23:39technomancyamalloy: I wouldn't say that means it's not a special case
23:40technomancyman, why would you ever want to extend c.t/is? just write a macro that throws failure. ಠ_ಠ
23:40xeqitechnomancy: or write one that hits clojure.test/do-report directly
23:40brehauttechnomancy: do you have a keybinding or substitution for the face?
23:41technomancyxeqi: yeah, actually that makes more sense
23:41technomancyit's a good thing clojure.test is so small, or I'm sure I would find more things to be grumpy about
23:41technomancybrehaut: https://github.com/technomancy/dotfiles/blob/master/.emacs.d/phil/cosmetics.el#L47
23:41xeqiI ended up doing that in kerodon
23:41technomancyoh no, you found my secrets! (╯°□°)╯︵ ┻━┻
23:41brehauttechnomancy: haha amazing :)
23:42brehauti dont understand that one at all
23:42xeqithe guy flipping the table?
23:42brehautoooh is that what it is
23:42brehautbut no interrobang‽
23:43technomancybrehaut: for a single character might as well use C-x 8 INTERROBANG
23:43brehautfair enough
23:49technomancyif you're running lein from git it would be great if you could update to the latest and put it through the paces
23:49technomancyhoping to cut another preview release in a day or two
23:58technomancynuclearsandwich: ping
23:59amalloytechnomancy: C-x 8 I and C-x 8 i both claim to be unbound, for me. what do i have to do to make this magic happen?
23:59technomancyamalloy: my bad; C-x 8 RET
23:59technomancyaka M-x ucs-insert