#clojure logs

2012-12-10

00:03tomojis one called "one" to taunt people who only want _one_ piece of it?
00:11tomojI guess the plan is for those pieces to graduate to libraries eventually
00:14seangroveI thought of it as a PoC right now
00:14seangroveIt's a bit large, was definitely difficult for me to wrap my head around when I was getting started with cljs
00:15seangroveBut maybe that's my fault for thinking it'd be a good way of starting
00:15tomojisn't that exactly what it's supposed to be?
00:16tomojI wonder why one.test hasn't been broken out
00:16tomojwould feel weird copying it and releasing it, but neither do I really want to copy it into every one of my projects
00:19muhooprivate repo then?
00:20tomojgood idea for now, but I want to release my library too :)
00:21muhoooh, well, hmm. there's nothing wrong with ripping guts out of an open source project and forking it as a separate thing, it is open source. maybe ask the one people if they'd accept a patch to split it up tho?
00:21muhoowho knows, they may have been waiting for someone to volunteer to do it.
00:35michaelr`good morning
01:48tomojwonder how the ring spec would look for ajax
01:49tomojseems to make sense for :server-port, :server-name, and :scheme to be optional
01:49tomojand maybe for :uri to be possibly relative?
01:53tomojbut if you supply :server-name and a relative :uri..
01:54tomojon the other hand, if you require :uri to be absolute, and, like clj-http, have a middleware that accepts a :url, it would be rather odd for :url to be a uri
01:59nightfly_Are the protected/private java access modifiers respected while doing Java interop?
01:59tomojyes
02:05LajjlaTHEY'RE MAD
02:05LajjlaMAD I TELL YOU
02:05LajjlaI was at #wordpress-dev
02:05LajjlaTHEY'RE MAD
02:06LajjlaThey consider echo '<h3>' . $title . '</h3>'; good coding practce
02:06LajjlaMADNESS
02:06LajjlaThey thought the established way of something like $page->addElement('h' . $page->currentLevel, $page->title); was bad
02:07LajjlaMADNESS I SAY
02:21p_lLajjla: welcome to PHP world
02:22p_lthough your established practice looks bad as well. Again, welcome to PHP :P
02:26bbloomhttps://github.com/brandonbloom/dispatch-map :-)
02:38seangroveWell, hard to argue with their success
02:39nightfly_tomoj: Thanks. Of course I was hoping they wouldn't be in this instance, but for the greater good...
02:39seangrovebbloom: No idea what this is for, but curious
02:39bbloomseangrove: i'll probably write a blog post to motivate it
02:40bbloomso basically, i'm working on some GUI experiments and i have a scene graph -like tree structure
02:41Lajjlap_l, they were like
02:41LajjlaTHEY DIDN'T BELIEVE ME
02:41LajjlaWHEN SAID
02:41bbloomand i wanted to be able to have a sort of list-view thing that renders a template for each element in the list, but the template dispatch was a simple map of class -> template
02:41LajjlaTHAT PHP IS A HIGHLY CONTROVERSIAL LANGUAGE WHICH DIVIATES FROM A LOT OF STANDARDS
02:41bbloomtemplates aren't functions, they are data structures
02:41LajjlaAnd that it's known to be very bad at identifying bugs for you.
02:41LajjlaHOW CAN THESE PEOPLE ACTUALLY CODE A WORKING CMS
02:42LajjlaI must go to the source and inspect
02:42seangroveAh, I see
02:42bbloomseangrove: i wanted a map that would let me render the "best" template for a datatype
02:42LajjlaI raised the issue that if you mistyped a variabvle name in PHP, it didn't bleep and said the variable was not in scope but it created a new one for you with the value set to null.
02:42LajjlaThey never even considered the fact that it would be better to catch bugs if you made a type error that it then bleeped.
02:42bbloomseangrove: it also means you could redefine multi methods in terms of a dispatch-map and an atom
02:43seangroveYeah, that's the inverse of what I was thinking
02:43seangroveWhere you would dispatch based off of deep keys in a map
02:44seangroveVery cool stuff
02:44bbloomseangrove: what would that be for?
02:44seangroveI also wasn't sure of that, but was just curious ;)
02:45bbloomwell that's the short version: i wanted to treat a multimethod like data
02:45bbloomer, i mean, like a "value"
02:55SegFaultAXMan, datomic is pretty pricey for a virtually unproven database.
02:56bbloomSegFaultAX: it's pretty cheap (and simple) when compared to a virtually DISproven database: http://www.oracle.com/us/corporate/pricing/price-lists/index.html :-P
02:56bbloomi kid, i kid
03:08michaelr`i wonder how excel's grid is stored in memory
03:08tomojSegFaultAX: free to try at least :/
03:09nightfly_Slightly related, how useful is datomic's free version in a "production" environment?
03:10typeclassyis cljs.core.IFn a protocol in clojurescript? the compiler claims it isn't, but google is only showing me https://gist.github.com/2346866
03:12typeclassyplain "IFn" gives a massive gibberish java stack trace
03:16seangrovenightfly_: Been using datomic free along with wei_ for Jida (a dideproject), seems reasonably good, haven't run too many problems yet so far
03:16seangroveMain problem is that we don't have enough money for a vps to run a transactor
03:17typeclassydoes datomic free store all of its data on the filesystem?
03:19wei_typeclassy: I believe so, yes
03:20typeclassyi suppose it doesn't really matter if you're not a gigantic app. hacker news runs off the filesystem as well iirc
03:20wei_another problem was that we ran into the max peer limit pretty quickly with one worker and one web server
03:31bbloomseangrove: i packed up my motivation in a blog post http://blog.brandonbloom.name/2012/12/clojures-multimethod-dispatch-as-library.html
03:31bbloomseangrove: let me know if that makes sense :-)
03:50andrewmcveigh|wobbloom: I was thinking about something somewhat related to that the other day. I wanted a multimethod where the dispatch value could be a core.match pattern. Didn't have time to try it though.
04:01tomojseangrove: hmm, for what?
04:02tomojoh, I see someone else already asked
04:05tomojI've considered writing multimethods for deep keys for dealing with document-ish maps
04:06Lajjlap_l, MADNESS
04:06LajjlaMADNESS I SAY
04:42no7hinggood morning everybody
04:43no7hingseems like i have some problems wrapping my head around protocols
04:44ucbno7hing: morning! what's up?
04:44no7hingi thought i had a nice case for using protocols to abstract the used datastore behind a registry
04:44no7hinghttps://gist.github.com/4249604
04:45ucbno7hing: what's wrong with that?
04:45no7hingbut what was a self-contained service before that could be called like (registry/register 123) now needs the actual instance passed in too
04:46no7hingmy problem is that i don't know where to put my actual instance
04:46ucbhow was registry/register defined before?
04:46no7hingand if it's really true that i have to implement another layer in front of it to store the actual instance in
04:47no7hingjust a function in the namespace and f.e. the zookeeper connection as a ref
04:47ucba global ref then?
04:47no7hingyes
04:47no7hingglobal in the ns
04:49ucbright, so that's where protocols might be an interesting alternative
04:49ucbyou'd have no global shared anything
04:49amalloyno7hing: how could ZKR work without an instance, though? you need to store a connection *somewhere*, and making it global to your namespace is really unpleasant
04:49ucbthanks for putting it succinctly amalloy
04:51no7hingthen i'am actually not getting a vital part of idiomatic clojure
04:52no7hingbecause i have no idea where i should put my connection other than the namespace that serves as my zookeeper facade
04:53amalloyno7hing: if you did that, one of the problems you'd have is that you could never have two different registries in the same program
04:53no7hingthat's what i actually want
04:54amalloymake the person who's calling register and deregister responsible for tracking their registry. they probably have some other larger object that it's convenient to put it into
04:54no7hingbut isn't that a global var again?
04:54amalloyonly if you imagine, for whatever reason, that their larger object is global
04:55no7hingas this is in the context of a stateful server i need to store state *somewhere*
04:55amalloy(there's nothing disastrously bad about having a global var for this sort of thing, for convenience, but definitely don't tie it in at the lowest level, which would force everyone to use the same model)
04:56no7hingthe way i built it so far is that the ns store the state they're responsible for
04:57amalloythen your whole app is just singletons. you can't ever use a namespace twice
04:58no7hinga registry holds a map of registered (=currently online) users either in memory or in ZK, the session store holds the actual user sessions, etc
04:58no7hingi think there's a lot of erlang thinking in the way i built my app
04:58no7hingmy clojure exercise: https://github.com/mhaemmerle/grimoire
04:59Sgeo|web_I need to learn how to stop using global variables
04:59Sgeo|web_Ironic, since I love Haskell and it practically prevents usage of global variables
04:59amalloyno7hing: all of that is fine, but the example.registry namespace isn't a registry: it is code for building and using a registry. it shouldn't also be responsible for maintaining a reference to one particular "blessed" instance of a registry
04:59Sgeo|web_(There are tricks around it, but they're noticable and annoying)
05:00no7hingok, so i need another ns to actually implement it - even if it's more or less just doubling the protocol and passing the actual registry instance in
05:00no7hingback to the drawing board :)
05:01no7hingand thanks a lot for the help!
05:02amalloyyou're welcome! apologies if i'm overly zealous this late at night: it's bedtime
05:02no7hingno apologies needed!
05:02clojurebotGabh mo leithscéal?
05:03no7hingi want to learn it the proper way
06:23AWizzArdIs there a list that tells me what Interfaces/Protocols I have to add to my defrecord/deftype, when I want it to do X. For example, I want to be able to deref instances ==> this list would point me to clojure.lang.IDeref. I want to (count it) ==> list would point me to?
06:24Sgeo|web_Reading the source?
06:24Sgeo|web_(source count)
06:24Sgeo|web_,(source count)
06:24clojurebotSource not found
06:24Sgeo|web_Although actually, actual documentation would be better
06:24AWizzArdCurrently I read the sources at https://github.com/clojure/clojure/tree/master/src/jvm/clojure/lang
06:25AWizzArdI just thought having such a list might save some time.
06:25Sgeo|web_Would also make it less implementation-detail-y
06:26AWizzArdNow I really would like to know: what does my deftype have to implement/extend when I want to use count?
06:27Sgeo|web_What time complexity is your count?
06:27AWizzArdISeq?
06:27AWizzArdlinear
06:27Sgeo|web_Looking at the source, it looks like Counted would work for ... oh, Counted implies O(1) I think
06:27Sgeo|web_Um, I think ISeq would work, but not sure
06:28Sgeo|web_countFrom mentions Collection and IPersistentCollection
06:29AWizzArdSgeo|web_: thanks, Counted is fine.
06:29AWizzArdWorks.
06:29Sgeo|web_:/ pretty sure Counted is intended to imply O(1) time complexity
06:29bbloomAWizzArd: you shouldn't implement Counted unless you have O(1) counts
06:29AWizzArdYes, I now have o1
06:30bbloom,(source counted?)
06:30clojurebotSource not found
06:30bbloomblah.
06:30bbloom(doc counted?)
06:30clojurebot"([coll]); Returns true if coll implements count in constant time"
06:30bbloomthe source is: [coll] (instance? clojure.lang.Counted coll)
06:30bbloomanyway, bed time
06:32AWizzArdThat other bot maybe supports “source”?
06:33Sgeo|web_&(source counted?)
06:33lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
06:33Sgeo|web_lazybot is Clojailed :( (not relevent, but it's a source of a flaw)
06:34Sgeo|web_,(let [-> inc] (-> 5)) ; ##(let [-> inc] (-> 5)
06:34clojurebot6
06:34Sgeo|web_,(let [-> inc] (-> 5)) ; ##(let [-> inc] (-> 5))
06:34lazybot⇒ 5
06:34clojurebot6
07:23hcumberdaleHi ;)
07:24ucbhello hubert :)
07:27ivaraasenconsidering buying a ThinkPad T430. does anyone here own one?
07:32hcumberdaleivaraasen: Thought about it. But at the moment I consider the Samsung S9 and Apple Mac Book.
07:34ivaraasenhcumberdale: definitely considering the S9.
07:35hcumberdaleIt's only 4GB ram on board. FEB 2013 are the new release dates.
07:35hcumberdaleSo I think there will be 8GB+ and the new WQHD display.
07:36ivaraasenthing is, a T430 over here (with IPS and a 180 GB SSD) is the same price as a low-end MacBook Air, given that I buy an extra two years of guarantee for the latter. (the T430 comes with a three year guarantee)
07:37hcumberdaleivaraasen: yes. Gurantee @Apple is bad
07:37hcumberdaleremebering the defect displays...
07:37ivaraasenand defective logic boards in my case
07:37ivaraasenlike, three times
07:37hcumberdaleNealy everyone was affected. Display inverter must be replaced in all old mac books
07:37ivaraasenand two dead power supplies, because they break so easily
07:37hcumberdalehere too ;)
07:38ivaraasenalmost blew my speakers due to the logic board problems
07:38hcumberdaleHave a TP X300
07:38hcumberdaleThat notebook is years old but super awesome.
07:38ivaraasenhow are ThinkPad power supplies? way sturdier?
07:38hcumberdalenearly indistructible
07:39hcumberdaleBut,... the real "ThinkPad" is gone ;(
07:39ivaraasennice. small detail, but it's really important for me as a journalist.
07:39hcumberdaleThe new keyboards are horrible, thx to background leds
07:39ivaraasenwhich is why I'm going with a matt screen as well
07:40hcumberdaleme2 I really dislike the "mirrored" screens ;)
07:40hcumberdaleMy experience: The X series are robust and good
07:41hcumberdaleA lot T series (@ my company) broke after ~2 years.
07:41hcumberdaleDefect screen, only power-on with power supply
07:41hcumberdaleThey tried to fix it two times. Errors occured again
07:41hcumberdaleThe new keyboards are horrible
07:42hcumberdaleThe X1 has a different power adapter. I thought everybody is buying thinkpads because there is everywhere power for it ;)
07:42ivaraasenhcumberdale: regular or IPS screen?
07:43hcumberdaleregardless of technology it should be non-reflecting and ~400nit
07:44ivaraasenI'm guess I'm not going to worry that much with a three year guarantee, at least.
07:44hcumberdaletraveling with notebooks <350nit and reflecting screen is the worst ;(
07:44hcumberdaleYes, one year is pretty bad @Apple
07:45hcumberdale2 Years for the S9 is okay
07:45hcumberdaleThe S9 power jack is really bad designed ;( And the 4GB ram... Will wait to FEB
07:45hcumberdaleuntil FEB 2013
07:46mpenet2x8g ram = $80 for T4**
07:46ivaraasenI'm probably upgrading to 8 GB myself. I only have 2 GB on this poor old Unibody
07:46mpenetyou can upgrade it yourself, something not possible with apple laptops I think
07:46hcumberdaleivaraasen: the S9 mem is onboard. If you are familiar with reflow soldering it's possible I think ;)
07:47hcumberdalempenet: not possible for apple & samsung
07:50ivaraasenhcumberdale: when I solder things myself, angels cry
07:54hcumberdaleivaraasen: the odds are 1:100 that it'll work
07:55hcumberdalemultilayer board
07:55PGGBanyone here using set with clojure?
07:56PGGB*swt
07:56mpenet~anyone
07:56clojurebotanyone is anybody
07:56mpenet:(
07:57hcumberdalebetter move over to javascript ;)
07:57Sgeo|webWhy do I keep typing analyze as analyse
07:58mpenetI make that mistake very often
07:58clgvSgeo: your british side fights your american side? :P
07:58mpenetthat is how it's written in my first language tho
07:58Bergle_1you have been eposed to proper english.. it is 's'
07:59PGGBswt is actually quite nice
07:59PGGBbut it requires functions to run in the main thread
07:59PGGBso I can't seem to call them from the repl
08:00clgvPGGB: there probably is some "invoke in main thread" function
08:00Sgeo|webI shouldn't have a British side. I have only left the US once in my life, when I was a little kid
08:01Sgeo|webBut I'm in an IRC channel with a bunch of Brits, so maybe I should blame them
08:01Sgeo|web"Brits" isn't offensive, is it?
08:01PGGBclgv: yeah that'd be nice, haven't found anything thus far
08:01clgvSgeo|web: seems your subconsciousness has a british side then... ;)
08:02Sgeo|webI do have an intense hatred for doing the American thing with quotes, the whole punctuation on the inside even if you're not quoting the punctuation thing
08:04clgvhcumberdale: :O and you are not in #clojure.de ? tsktsktsk
08:04Sgeo|webHmm
08:05Sgeo|webIt doesn't look like it should be too difficult to write a correct macroexpander, if I just look for which part of each special form Compiler.java uses analyze on, and copy that
08:05Sgeo|webHow often would that stuff change though
08:06Sgeo|webI'd need to change it with each version of Clojure, potentially, and also have a convenient way to write code that works in several versions
08:06clgvPGGB: display.syncExec(new Runnable() ... ); (http://www.eclipse.org/swt/faq.php#uithread)
08:06Sgeo|webAlso, what if there's some complication that I'm overlooking?
08:07hcumberdaleclgv: never heard from it
08:07clgvhcumberdale: now you have ;)
08:07Sgeo|webI know that I need to handle &env and special forms which don't macroexpand their arguments
08:07Sgeo|webBut I might be forgetting stuff
08:08hcumberdaleclgv from .de too ?!
08:08clgvhcumberdale: yes
08:10PGGBclgv: I need to create a display first though
08:11PGGBand it still needs the main thread for that
08:11clgvPGGB: maybe there is something similar as static method... I have almost zero experience with SWT ;)
08:12PGGBhm
08:12PGGBit'd be nice if you could lein run with a repl attached
08:12clgvPGGB: Display.getDefault().syncExec( ... )
08:13Sgeo|webLooking at the FnExpr parsing code, I don't see any calls to analyze
08:13Sgeo|webwtf
08:17kmicuac 0 set status "Fajka, jajka i Jamajka!"
08:21kmicuand muscle memory
09:04fureddoAnyone could explain why in case 1 (let [r (range 1e9)] [(first r) (last r)]), it runs ok but in case 2 (let [r (range 1e9)] [(last r) (first r)]), I got a OutOfMemoryException?
09:05Chousukefureddo: in the latter case, the program can't free the elements in the sequence before you run (first r)
09:06Chousukewhereas in the first case it'll just throw out each element while realising (last r) since there's no longer anything that needs a reference to r.
09:09fureddoChousuke, I don't get it. :-(
09:11andrewmcveigh|wofureddo: http://stackoverflow.com/questions/5698122/explanation-of-lose-your-head-in-lazy-sequences
09:11kmicufureddo: range is lazy
09:11andrewmcveigh|wofureddo: Maybe that will help?
09:11kmicu, (class (range 1e9))
09:11clojurebotclojure.lang.LazySeq
09:12kmicuIf you'll keep reference to first element, then whole seq must fit into memory.
09:12kmicu@google clojure lazy seq
09:15fureddoandrewmcveigh|wo, Interesting link. Thanks.
09:25cemericktpope: I'm around, if you want to nail down this :out and :err issue.
09:25tpopecemerick: I've got about 10 minutes, sure
09:26cemerickso, you've got a session id from clone, ands still no :out?
09:26tpopecemerick: correct
09:26cemerickcan you replicate in Clojure, or is this solely in vimscript?
09:27tpopecemerick: I can replicate in clojure
09:27cemericktpope: please, do paste somewhere
09:28Sgeo|webI seem to actually be singing "a special symbol at the head of a list always means a special form"
09:28Sgeo|web...that's wrong, just realized
09:28Sgeo|webOnly when that form is treated as code
09:28tpopecemerick: https://www.refheap.com/paste/7470
09:37cemericktpope: OK; what are you seeing as the result of the (client ...) call?
09:39tpopecemerick: ({:ns "user", :session "20bd7b37-aa50-4c23-b61b-326976436fc8", :value "nil"} {:session "20bd7b37-aa50-4c23-b61b-326976436fc8", :status ["done"]})
09:40tpopeso it gets the result but does not capture the output
09:46cemericktpope: Yeah, something's screwy, despite a dozen-plus testcases verifying :err and :out. What if you send {"op" "eval" "code" "(println :foo)"}? (i.e. no sid)
09:46tpopecemerick: works fine
09:47cemerickyesh
09:47cemerickyeah*
09:47cemerickthat's what I'm seeing too
09:47cemericktpope: on it :-P
10:11cemericktpope: OK, so: I can verify what you're seeing in a REPL, but not when running the same code as part of an automated test.
10:11cemerickI need to take off for a while, but will return with a solution this afternoon. :-P
10:18Sgeo|schoolShould I keep my whining in the comments, or is whining ok in examples?
10:19Sgeo|schoolhttp://clojuredocs.org/clojure_core/clojure.walk/macroexpand-all#example_1001
10:21clgvSgeo|school: write a better macroexpand-all ;) just kidding
10:21Sgeo|schoolI think frenchy64 is doing that
10:22Sgeo|schoolI should play with it
10:22clgvambrosebs does?
10:23Sgeo|schoolThe analyzer should be usable for that purpose, I think
10:23clgvah ok
10:27Sgeo|schoolHah!
10:28Sgeo|schoolhttps://www.refheap.com/paste/7471
10:28Sgeo|schoolI do object to ast being a macro though :(
10:29Sgeo|schoolOh, it's just a wrapper around an analyze-form function
10:29Sgeo|schoolhrm, crud
10:34Sgeo|schoolLooks like it handles &env properly
10:34Sgeo|schoolAlthough I wish it could actually take an &env as input
10:34Sgeo|schoolambrosebs thank you thank you!
10:35Sgeo|school@tell ambrosebs THANK YOU
10:35Sgeo|school@mail ambrosebs THANK YOU
10:35Sgeo|school?
10:35Sgeo|school%mail ambrosebs THANK YOU
10:35nDuffSgeo|school: /msg memoserv send ambrosebs THANK YOU
10:35Sgeo|school$mail ambrosebs THANK YOU
10:35lazybotMessage saved.
10:35nDuffSgeo|school: ...or that. :)
10:37Sgeo|schoolToo lazy to sign in to Freenode, and recipient might not sign into freenode
10:37scriptorand $mail is much shorter to type, anyway
10:39nDuffSgeo|school: I was too lazy to sign into freenode, and then someone stole my preferred nick
10:39nDuffSgeo|school: ...which is why I'm now nDuff, zDuff or znDuff as opposed to Duff.
10:39nDuff...anyhow -- lessons learned.
10:40Sgeo|schoolI'm registered on Freenode at least
10:40nDuff...err, that.
10:40Sgeo|schoolAnd usually have XChat sign me in automatically
10:40Sgeo|schoolBut computer being weird
10:42Sgeo|schoolDoes Clojail use a macroexpander?
10:43AWizzArdIs there a way how I can implement my own count on a defrecord? Currently when trying to do so I get a ClassFormatError: Duplicate method name&signature in class file
10:44mdeboardis there a recommended AWS S3 lib for Clojure? I'm looking at weavejester's repo but it doesn't appear to use connection pooling, so if I need to GET multiple objects, it's going to open a new connection for each (get-item) invocation.
10:48Sgeo|schoolHah. Clojail's macroexpand-most is strictly better than macroexpand-all, but it's still wrong
10:51Sgeo|schoolWould Raynes likely to be willing to depend on analyze?
10:52mdeboardweavejester: Any input on connection pooling for multiple GET requests to S3 using your lib?
10:53Sgeo|school,(seq? [1 2 3])
10:53clojurebotfalse
10:53Sgeo|school,(coll? [1 2 3])
10:53clojurebottrue
10:53Sgeo|school,[-> 1 2]
10:53clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/->, compiling:(NO_SOURCE_PATH:0)>
10:53Sgeo|school&[-> 1 2]
10:53lazybotjava.lang.RuntimeException: Can't take value of a macro: #'clojure.core/->
10:54Sgeo|schoolDarn
10:56Sgeo|school,(let [(-> a) 5] a)
10:56clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: (-> a)>
10:56Sgeo|school&(let [(-> a) 5] a)
10:56lazybotjava.lang.Exception: Unsupported binding form: (-> a)
10:56Sgeo|school&[(-> 5)]
10:56lazybot⇒ [5]
11:08technomancygfredericks: it will change your life
11:09technomancyI don't know how people get by with git on the command line; it's so awful
11:10hyPiRiontechnomancy: In what way is it better than the git CLI?
11:10scriptorit's a bit painful to learn, but after that it starts making sense
11:10nDuff...expects the user to put in time and effort to learn abstractions unique to it, rather than following conventions set by other SCMs.
11:10hyPiRionI've not looked at magit, so feel free to pitch it.
11:10ohpauleezcognitively taxing, mostly. Otherwise pretty solid
11:12daimrodhyPiRion: it's easy to browse the log and to do partial commit
11:12gfredericksokay. it is loaded. now I need to figure out how to use it.
11:13daimrodgfredericks: C-h i m magit RET
11:13hyPiRiondaimrod: partial commit as in part of a file, or part of files?
11:13daimrodpart of file
11:14daimrodlike git add --interactive
11:14scriptorequivalent of add -p I'm guessing?
11:14daimrodor -p
11:14daimrodI don't know
11:14daimrod-p
11:15hyPiRionWell, I'm not in dire need of that as of right now, but I guess I'll have a look at it later.
11:15scriptorthat's the only feature I'd like to have editor support for, staging specific lines
11:17daimrodhyPiRion: not having to open a terminal (even within emacs) is a big plus for me.
11:20gfredericksdaimrod: my C-h don't work
11:20gfredericksgotta have da backspaces
11:23chronnogfredericks: then try f1 i m magit RET
11:24gfredericksomg I just made a commit
11:24TimMcM-x info I think
11:24gfrederickschronno: f1 opens the gnome terminal help; I am forever cut off from emacs help
11:25chronnogfredericks: lol, I'm on KDE so never tought of that...
11:31chronnogfredericks: Do as TimMc says, M-x info m magit RET
11:31technomancyscriptor: magit lets you just select a region and stage it with a single keystroke
11:32scriptorhmm, how does it define regions in non-sexpr languages?
11:32technomancyscriptor: I mean "the region"
11:32technomancythe area between mark and point
11:33scriptorah
11:33technomancya screencast on it: http://vimeo.com/2871241
11:33daimrodyou can add/revert a file/thunk/region
11:33technomancybit dated but it gets the idea apart
11:35TimMcI've been pretty happy with git-gui and gitk.
11:43TimMcWhat benefits does magit provide, other than being part of an editor?
11:44S11001001TimMc: does there need to be more of a reason than that?
11:48TimMcYes.
11:49TimMcAnd no. But I'm mostly curious about feature/workflow differences.
11:50weavejestermdeboard: Still around?
11:51gfrederickstechnomancy: I decided to switch when I realized that my workflow was A) open a terminal for emacs, use emacs for everything except B) open a terminal for git because eshell sucks for that
11:51gfredericksI'm not a git-cli hater. I'm just tired of that second window.
11:53gfredericks(I do realize the git-cli is crazy, I'm just already acclimated so it doesn't bother me)
11:53TimMcscreen
11:53TimMc(now you have two problems)
11:54nDuff(screen? bah!)
11:56weavejestermdeboard: clj-aws-s3 is just a wrapper around the Java SDK library, so whether or not it uses connection pooling depends on the library provided by AWS
11:58eggheadare there any good writeups on wrapping a clj library in java?
11:59thorwilTimMc: magit will notify you, if you bring it up and have unsaved files belonging to the repo open in any buffer
11:59gfredericksegghead: you want to take a clj library and write a java wrapper for it?
11:59nDuffegghead: How do you want to do it? There are two basic approaches -- interacting with clojure.lang.RT from your Java code, or exporting a Java-friendly interface from your Clojure via gen-class or such.
12:00gfredericksegghead: nDuff: lib-2367 gives you a one-liner for exporting a namespace into a class with static methods
12:04gfrederickshokay so if I'm using compojure and planning on returning all-json all-the-time what is the easiest way to let the routes return data that gets encoded transparently?
12:04gfrederickswrite a handler-wrapper myself?
12:08eggheadnDuff: I saw some snippets of datomic which uses RT.invoke in it's private methods, it looked very nice but I think I'd like to understand it better
12:09thorwilgfredericks: i did that recently, for now for a single case of doing a async PUT via javascript: https://github.com/thorwil/tlog/blob/master/src/tlog/dispatch/route.clj#L19
12:12technomancygfredericks: what's wrong with git in eshell?
12:12technomancylack of a pager?
12:12gfrederickswell it uses LESS I think
12:12gfredericksI suppose you can configure it not to?
12:12technomancyexport GIT_PAGER=cat
12:12gfredericksthen git will suck outside of emacs
12:13technomancy(export "GIT_PAGER" "cat")
12:13gfredericksthis good tip.
12:19Sgeo|schoolmap->form emits fn.
12:19Sgeo|schoolWait, hold on
12:19Sgeo|schoolYeah, it does
12:19Sgeo|schoolBut fn is not a special form, fn* is
12:20Sgeo|schoolfn is a macro
12:20Sgeo|schoolSo why is map->form emitting fn?
12:29duck1123I have a ns that is AOT compiled into a gen-class. The methods of this class need to call into my application, but if I require those namespaces then it ends up AOT-ing almost my entire application. Can anyone point to any resources to see how best to keep the compile time requires to a minimum? Would it be a huge hit to require the namespace, intern the var and call it in each of these methods? Or is there a better way?
12:30Sgeo|school$mail ambrosebs Considering that fn is not a special form, while fn* is, why does map->form emit fn and not fn* ?
12:30lazybotMessage saved.
12:30Sgeo|schoolIs ambrosebs the correct nick?
12:31Sgeo|schoolLooks oit
12:31Sgeo|schoolit
12:33meliponehi! it's me again
12:35meliponeHow can I have a for loop with a counter? I wanted to do (for [x [:a :b :c] n (iterate inc 0)] (println x n)) but the counter "n" does not stop when "x" stops
12:37Sgeo|schoolzip?
12:37clojurebotzip is not necessary in clojure, because map can walk over multiple sequences, acting as a zipWith. For example, (map list '(1 2 3) '(a b c)) yields ((1 a) (2 b) (3 c))
12:38duck1123,(doall (map str [:a :b :c] (range)))
12:38clojurebot(":a0" ":b1" ":c2")
12:38Sgeo|school,(for [[x n] (map vector [:a :b :c] (iterate inc 0))] (println x n))
12:38clojurebot(:a 0
12:38clojurebot:b 1
12:38clojurebotnil :c 2
12:38clojurebotnil nil)
12:38meliponeduck1123: thanks!
12:38Sgeo|schoolI don'
12:38Sgeo|schoolI doubt that that's the best way to do that though
12:39uvtcmelipone: `for` is for creating seqs. For printing out stuff, I think you want `doseq`.
12:40duck1123(doc map-indexed)
12:40clojurebot"([f coll]); Returns a lazy sequence consisting of the result of applying f to 0 and the first item of coll, followed by applying f to 1 and the second item in coll, etc, until coll is exhausted. Thus function f should accept 2 arguments, index and item."
12:40meliponeuvtc: thanks!
12:41Sgeo|school,(map-indexed identity [:a :b :c])
12:41clojurebot#<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (2) passed to: core$identity>
12:42Sgeo|school,(map-indexed vector [:a :b :c])
12:42clojurebot([0 :a] [1 :b] [2 :c])
12:42Sgeo|schoolIn that context, what function makes more sense to use, list or vector?
12:44meliponeSgeo: thanks!
12:45Sgeo|schoolmelipone: erm, you're welcome, but I think the others in this channel were more helpful
12:46uvtcAw, I like all the thank-yous. :)
12:47duck1123he thanked everyone in turn. No one got left out
12:47technomancyhttp://nedroid.com/2010/11/thanks-for-reading-my-comics/
12:47uvtcYes. One of my fears: thanking profusely but leaving someone out.
12:48uvtctechnomancy: thanks for that link!
12:48technomancythanks for following it
12:53meliponequit
12:58TimMcduck1123: Does your ns need to expose anything besides -main?
12:58duck1123TimMc: My ns has a load of methods that it needs to implement. https://github.com/duck1123/jiksnu/blob/master/src/jiksnu/xmpp/user_repository.clj
13:00duck1123I've tried to use channels and promises to work around it, but I don't like that solution
13:00TimMc*and* you have a shitload of requires
13:00TimMcOh hey, tigase -- I use their free host.
13:02TimMcduck1123: Maybe there's a solution where you first pull all the implementations into a different ns.
13:02duck1123The requires in this file used to be a whole lot worse. I want to keep it as small as possible
13:02clj_newb_234is http://skillsmatter.com/podcast/scala/the-refined-clojurist available in non-video format?
13:02clj_newb_234like maybe words + diagrams on a page?
13:52alexnixonwhere I can read up about the implementation of local variable and argument nulling in clojure (i.e. the compiler making it harder for you to unwittingly hold on to your head)?
13:56hiredman,(doc dorun)
13:56clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. dorun can be used to force any effects. Walks through the successive nexts of the seq, does not retain the head and returns nil."
14:04borkdudewhat's the current status of counterclockwise + leiningen 2, do I still need a beta or can I use a stable version?
14:06Sgeo|schoolApparently I'm in a writing mood, yet instead of writing my ethics paper I'm writing on Clojure vs Common Lisp
14:06Sgeo|schoolAnd I think I sort of went off the rails a bit
14:08AimHereMaybe you could write a paper on the ethical implications of your choice of Lisp
14:09AimHereIf you're going to go off the rails, might as well do it properly
14:09borkdudewhat's Common Lisp?
14:10Sgeo|schoolhttp://sgeo.tumblr.com/post/37650151853/common-lisp-symbols-vs-clojure-symbols
14:11Sgeo|schoolI don't think this post is entirely clear to be honest
14:11Sgeo|schooloops, wrote Common Lisp when I meant Clojure
14:18TimMcalexnixon: A useful search term would be "locals clearing".
14:30gfrederickswhy was rhickey's go talk not taped? :(
14:30ivaraasengfredericks: schadenfreude
14:31gfredericksthat's the worst kind of freude
14:31ivaraasenit's the only kind
14:31gfredericksah so the term is redundant then
14:33Sgeo|schoolGo talk?
14:34gfredericksfrom SL2011 I think
14:34gfredericksit's been long enough now that I can assume it won't ever exist :)
14:35Sgeo|schoolIs it rhickey talking about the Go language? Or something else
14:35gfredericksno the board game
14:35gfredericks^ no sarcasm there in case that occurred to you
14:36gfredericks"Rich hickey discusses the english language's shortest verb."
14:36Sgeo|schoolI'm just not sure why he'd give a talk on a non-Clojure language
14:37gfredericksright. he didn't. it was the board game.
14:37ivaraasenSgeo|school: masochism
14:37gfredericksno wait I can use the link
14:37gfredericks$google rich hickey learn to play go
14:37lazybot[Learn to Play Go - Strange Loop] https://thestrangeloop.com/sessions/learn-to-play-go
14:37gfredericksthere now you know I'm not kidding
14:38Sgeo|school...I thought your "no sarcasm there in case that occured to you" was sarcastic
14:38Sgeo|schoolJust Googled...
14:38ivaraasengod damn it gfredericks. there goes my reading hour
14:38gfredericksI thought you might but it seemed futile to make meta-assertions
14:38gfredericksivaraasen: why? there's no video. You're just going to start learning go independently?
14:39g_s_g_snewb question, the expression:
14:39g_s_g_s(set (map #( [ (:name %) (:type %) ] ) nodes)
14:39ivaraaseng_s_g_s: yes
14:39g_s_g_sbarfs, what am I missing?
14:39gfredericksfails with wrong number of args passed to a vector
14:40g_s_g_sam trying to return a 2-elt containing those extracted fields
14:40gfrederickstry (fn [%] [(:name %) (:type %)])
14:40gfredericksthe #() form is a bit awkward for returning vectors
14:40g_s_g_saha thx
14:40gfredericksthe way you have it you're calling the vector as a function and trying to return that
14:41TimMcErgh, don't use % as a normal symbol.
14:41gfredericksg_s_g_s: also good options are (fn [{:keys [name type]}] [name type]) and (juxt :name :type)
14:41g_s_g_sif I wanted to return a 2-elt list would it be easier?
14:41g_s_g_sdon't care particulalry
14:41gfredericksg_s_g_s: you could say #(list (:name %) (:type %)), yeah
14:41gfredericksjuxt is the bestest option though if it doesn't weird you out
14:42amalloyclojurebot: juxt is the bestest option though if it doesn't weird you out
14:42clojurebotRoger.
14:45amalloygfredericks: my goal is to someday cause clojurebot to have more juxt quotes from you than from me
14:46TimMc&(nth (iterate (juxt first second) '[first second]) 1000)
14:46lazybot⇒ [first second]
14:46gfredericksamalloy: that's juxt nonsense!
14:47g_s_g_sjuxt it is, thx :)
14:49TimMc,(nth (iterate (juxt first rest) '[first rest]) 10)
14:49clojurebot[first (((((((((#)))))))))]
14:50amalloywhaaaaat
14:51Sgeo|schoolUgh, webchat seems to be rather unstable
14:51amalloyfyi in any reasonable repl that results in [first ((((((((((rest))))))))))], which makes total sense. i don't get this # nonsense clojurebot is saying
14:52Sgeo|schoolI missed it, what did clojurebot say?
14:52gfredericks[first (((((((((#)))))))))]
14:52Sgeo|schoolWhat was the thing?
14:52gfrederickseh just some code
14:52gfredericks,(nth (iterate (juxt first rest) '[first rest]) 10)
14:52clojurebot[first (((((((((#)))))))))]
14:52TimMcamalloy: print-depth indicator
14:52TimMcI once spent like an hour trying to debug my repl because of that.
14:52Sgeo|schoolSo, there are no perfect Clojure REPL bots in here
14:52Sgeo|school:(
14:53TimMc&(nth (iterate (juxt first rest) '[first rest]) 10)
14:53lazybot⇒ [first ((((((((((rest))))))))))]
14:53TimMcSgeo|school: lazybot is better at printing (and not flooding, too)
14:53Sgeo|schoolclojurebot is better at not using a broken recursive macroexpander
14:54gfrederickslazybot is better at having feature X
14:54TimMcSgeo|school: Ah, do tell?
14:54Sgeo|schoolI'm way too fond of this example
14:54mattmoss&::xyz
14:54lazybot⇒ :clojure.core/xyz
14:54amalloyTimMc: he's pointed it out like a hundred times but isn't interested in trying to fix it
14:55Sgeo|school,(let [-> inc] (-> 5)) ; (##(let [-> inc] (-> 5))
14:55lazybot⇒ 5
14:55clojurebot6
14:55amalloylazybot's macroexpander is definitely awful; i know, because i wrote it :P
14:55Sgeo|school../me wats at the extra parens he put for the lazybot one
14:55mattmoss&(do (in-ns 'foo) ::bar)
14:55lazybotjava.lang.SecurityException: You tripped the alarm! in-ns is bad!
14:56Sgeo|schoolamalloy: I think a good fix would be to replace it with ambrosebs's analyze
14:56mattmossDoh.
14:56amalloySgeo|school: no, a good fix would be to replace it with clojure.tools.macro. analyze is probably hugely overkill
14:56TimMcAh, it applies macros even where locals should shadow them?
14:56Sgeo|schoolamalloy: in terms of speed issues?
14:56TimMcGood to know, I guess.
14:57amalloyno, in terms of being too hard to figure out
14:57Sgeo|schoolIf the output is different from expected but equivalent, would that cause any issues?
14:57Sgeo|schoolBecause a macroexpander from analyze is just a composition of two functions that it has
14:58Sgeo|schoolWas playing with it earlier
15:00ARTWORKSwww.artworks.lt is waiting for a new artists, and people who like art.
15:03Sgeo|schoolDoes lazybot expose any libraries that have macros that use &env?
15:03Sgeo|schoolBecause mexpand-all doesn't process &env correctly, iirc
15:06hcumberdaleHow to get a key=>value pair from a map?
15:06Sgeo|school,(find :a {:a 1})
15:06clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.util.Map>
15:06Sgeo|school,(find {:a 1} :a)
15:06clojurebot[:a 1]
15:06Sgeo|school,(find {:a 1} :b)
15:06clojurebotnil
15:06hcumberdalethx Sgeo|school
15:06Sgeo|schoolyw
15:07hcumberdaleis it possible to return it as map again?
15:07Sgeo|school,(into {} (find {:a 1} :b))
15:07clojurebot{}
15:08Sgeo|school,(into {} (find {:a 1} :a))
15:08clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
15:08gfredericks,(conj {} (find {:a 1} :a))
15:08clojurebot{:a 1}
15:08gfredericks,(conj {} (find {:a 1 :b "BEEES"} :a))
15:08clojurebot{:a 1}
15:08TimMc&(into {} [(find {:a 1 :b 2} :a)])
15:08lazybot⇒ {:a 1}
15:09Sgeo|school_qwebirc sucks :(
15:09scriptorschool lab computer?
15:10Sgeo|school_Yes
15:11hcumberdalewhat is the difference between binding and let in macros?
15:12nDuffhcumberdale: binding creates thread-local values for dynamic vars.
15:12mr_rm,()
15:12clojurebot()
15:12mr_rm,((fn [] "a"))
15:12clojurebot"a"
15:12nDuffhcumberdale: ...those local values are visible from anything that can see that dynamic var, not just within the textual scope.
15:13mr_rm,(#("a"))
15:13clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to clojure.lang.IFn>
15:13TimMchcumberdale: If the (binding ...) and (let ...) in question are inside a syntax-quoted form, then nothing.
15:13TimMc(As in, it won't matter that it's in a macro.)
15:13mr_rmcan someone tell me what the difference is between calling anon functions is here: ((fn [] "a")) and (#("a"))
15:14TimMcmr_rm: Instead, ask hy this does what you expect: #(+ 1 2)
15:14TimMc,(#(+))
15:14clojurebot0
15:14mr_rmTimMc: in this case i want a simple function that just returns a string
15:15mr_rmwhy doesn't the second case work? i thought those two syntax examples should be identical but they aren't
15:15TimMcThat's why I posed that question to you.
15:15nightfly_mr_rm: (#("a")) is the same as ((fn [] ("a")))
15:16TimMc,'#("a")
15:16clojurebot(fn* [] ("a"))
15:16nightfly_#(do "a") should work
15:16TimMc(constantly "a")
15:16mr_rmahh
15:16mr_rm<slaps forehead>
15:16mr_rmyeah ok
15:22ipostelnikin lein, can you make a task automatically select a profile?
15:23technomancyipostelnik: you can alias the task to ["with-profile" "my-profile" "mytask"]
15:24nDuffHeh.
15:24nDuffipostelnik: Howdy!
15:24ipostelniktechnomancy, that's what I did, but it appears I can't use the same task as alias name
15:24ipostelnike.g. :alias ["uberjar" ["with-profile" "foo" "uberjar"]]
15:24ipostelniknDuff, hey
15:24technomancyipostelnik: it's definitely possible; that's been explicitly supported for a while
15:25ipostelniktechnomancy, I get stack overflow using 2.0.0-preview10
15:25hcumberdaleI have a lot routes looking like: (GET "/url" request (render-in-admin-template (page-content-as-string) request)). Is it possible to write it cleaner? maybe using macros? render-in-admin-template extracts :context from request and provides it as additional argument to the rendering map (mustache template)
15:26technomancyipostelnik: hrm; maybe there's a regression
15:26technomancyif you can repro on a fresh project feel free to open an issue
15:33brehauthcumberdale: im no expert, but i think you are bumping up against the division between macros (GET) and functions (ring handlers). the presence of a macro makes me thing you may need macros to create anything that will simplify it
15:35weavejesterhcumberdale: In general it's not always a great idea to pass the entire request object to your functions.
15:36weavejesterhcumberdale: But you don't need a macro to simplify it. Just a function will do.
15:36BrackiWhere did clojure/contrib/socket-server go?
15:36BrackiTrying to refurbish a 4 yr old fun project...
15:36amalloyclojurebot: where did clojure contrib go?
15:36clojurebotcontribute is http://clojure.org/contributing
15:36amalloy~contrib
15:36clojurebotcontrib is contribs
15:36amalloysigh
15:36Brackiexactly
15:37bbloom~contribs
15:37clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
15:37TimMcclojurebot: forget contribs |is| contrib
15:37clojurebotI forgot that contribs is contrib
15:37amalloyclojurebot: forget contrib |is| contribs
15:37clojurebotI forgot that contrib is contribs
15:37Brackiserver-socket did not seem to go anywhere or vanished in thin air...
15:37amalloyBracki: that wouldn't be too surprising to me; it doesn't do very much iirc
15:37TimMcamalloy: contribs -> contrib was taught; the reverse direction was inferred.
15:37weavejesterBracki: I had that problem a couple of years ago, and wrote: https://github.com/weavejester/tcp-server
15:39TimMchiredman: The symmetric relation in clojurebot's inference engine is making the factoid module pretty hard to use.
15:39technomancyweavejester: "Copyright (C) 2011 FIXME" <- oops =)
15:40amalloyTimMc: is that really a thing he does implicitly? that's pretty surprising
15:40weavejestertechnomancy: I didn't say it was very polished :)
15:40technomancyweavejester: not even a © symbol
15:40brehauttechnomancy, weavejester: at least it has Usage
15:41bbloomI think I taught him contrib is contribs b/c it game some nonsensical error
15:41TimMcbbloom: Other way around.
15:41amalloytechnomancy: Foundation for Imagining Xanth, by Malloy Enterprises. he attributes copyright to meeeeeeee
15:42TimMcI've always wondered what that stood for!
15:43bbloom"Usage: see test/*"
15:44borkdudeif I want to try Scala (to find out if it's worth educating to students), what book and IDE do you recommend? I know it's cursing in here, but Clojure people seem to have good taste :P
15:45amalloyi bet eclipse has a pretty good scala plugin
15:45hcumberdaleweavejester: a function will do? how?
15:45weavejesterhcumberdale: Well, the GET etc. macros are just fancy ways of creating anonymous functions
15:45weavejesterhcumberdale: So you can treat them like a closure
15:46hcumberdaleWhen I like to call them in the following syntax:
15:46weavejesterhcumberdale: e.g. (defn template-get [route template] (GET route request (render-template template request)))
15:46hcumberdale(GET "/abc" [] (admin-template (other logic)))
15:47hcumberdaleHow do i pass the :context parameter to admin-template ?
15:47weavejesterhcumberdale: Do you just want to wrap a set of routes in a template?
15:48weavejesterIf so, you could use middleware
15:48hcumberdaleyes weavejester. But only a few, not all
15:48hcumberdalesome are POST JSON/REST stuff
15:48weavejesterhcumberdale: Middleware can be applied selectively to some routes, and not to others
15:48hcumberdaleothers are GET adminui-view stuff
15:49weavejesterUnless you're using Noir
15:49hcumberdalecurrently I'm doing: (defmacro S_GET [path args & body] `(GET ~path ~args (atmpl ~@body {:context (:context ~args)})))
15:50hcumberdalebut it isn't nice because I need the full request to be there!
15:50weavejesterhcumberdale: That could be a function, depending on what ~@body is.
15:50weavejesterIt's generally a bad idea to pass a function directly through the routes
15:50hcumberdalebody differs for each adminui route
15:50weavejesterOne of the purposes of the routes is to filter relevant information out of the request
15:51callenweavejester: how does ragtime store applied migrations?
15:51weavejestercallen: It depends on the adapter
15:51callenweavejester: is "in the database defined by the adapter" a fair summary?
15:51weavejestercallen: The default SQL adapter stores them in a table called ragtime_migrations
15:51callenweavejester: precisely what I wanted to know. tyvm.
15:52weavejestercallen: You're welcome
15:52callenweavejester: I'm evaluating lobos, ragtime, migratus, etc.
15:52weavejesterhcumberdale: Could you give me an example of what ~@body might be?
15:53hcumberdale(render-file "templates/dashboard" {}) << 'inner template' rendering
15:53hcumberdaleresults in a string
15:53hcumberdale=> evaluates to a string
15:53callenhcumberdale: what are you doing for templates?
15:53hcumberdalestencil
15:54weavejesterhcumberdale: So ~@body always evaluates to a string?
15:54hcumberdaleLogicless Mustache templates for Clojure
15:54hcumberdaleyes weavejester
15:54callenhcumberdale: da. just wondering, thank you.
15:54weavejesterSo you could have some middleware that does something like…
15:55hcumberdaleIn the case that a adminui page is rendered,... not for all GET/POST requests
15:56ohpauleezis there anyway to visual the tree/trie of a data structure?
15:56ohpauleezI thought the inspector would do it (never used it before), but it doesn't seem to be the case
15:57weavejesterhcumberdale: https://gist.github.com/4253294
15:57weavejesterSo you return the body that isn't wrapped in the outer template
15:57weavejesterAnd then use middleware to add it.
15:59hcumberdaleweavejester: it feels some kind of wrong to use middleware. It should take effect only on specific routes and how they differ is configured in the defroutes part
15:59brehauthcumberdale: middleware is used more aggressively in clojure/ring/compojure than other languages / frameworks
16:00weavejesterhcumberdale: Why is it wrong? Middleware is about applying a common set of behaviour to a subset of routes.
16:00brehauthcumberdale: its the secret sauce that makes it so great
16:01hcumberdaleHow can I mask to routes where the middleware should be applied?
16:01ohpauleeznvm, found: https://groups.google.com/forum/?fromgroups=#!topic/clojure/HmsyuhLzico
16:02weavejesterhcumberdale: You just apply the middleware directly to a subset of routes
16:02Brackihttps://github.com/technomancy/server-socket/ I found this
16:02weavejesterhcumberdale: So (wrap-foo (GET "/bar" [] …)) will work
16:02BrackiBut now I get a Could not locate server_socket__init.class or server_socket.clj on classpath
16:02weavejesterhcumberdale: As will (wrap-foo (routes (GET "/foo" [] …) (GET "/bar" [] …)))
16:03BrackiGiven project.clj how do I figure out what the actual namespace is?
16:03amalloyBracki: not possible
16:04hcumberdalelike (defroutes admin-routes (wrap-template (GET "/" [] nil) (GET "/x" [] nil)) (GET "/other" [] nil))
16:04hcumberdale?!
16:04Brackiamalloy: What is not possible?
16:04amalloyBracki: Given project.clj how do I figure out what the actual namespace is?
16:04weavejesterhcumberdale: More like...
16:04weavejester(def admin-routes (wrap-template (routes (GET "/" [] nil) (GET "/x" [] nil)) (GET "/other" [] nil)))
16:05BrackiSo leiningen just downloads useless stuff?
16:05amalloycannot be done. the project.clj has no bearing on the namespace, except that frequently the namespace is related somehow to the project name
16:05weavejesterI kinda regret putting "defroutes" in Compojure
16:05S11001001Bracki: no
16:05weavejesterBecause it's just short for (def … (routes …))
16:05weavejesterBut people treat it as more magical than it is.
16:05hcumberdale;)
16:05amalloyweavejester: kinda inclined to agree. my mind was blown when i found out routes was its own entity
16:06brehautweavejester: i imagine people would have treated routes as just as magical
16:06weavejesterI think "routes" was a poor name, too. It should have been something like "combine" or "cascade"
16:06TimMcBracki: A project called "org.timmc/sparkles" might have a main namespace called "unicorn.rainbows.core".
16:06S11001001weavejester: then the RoR refugees wouldn't have been able to find it
16:06hcumberdaleweavejester: no second routes for "other" ?
16:06weavejesterSince all it does is combine multiple routing functions into one
16:06amalloyi also imagined, for quite some time, that routes was a macro that looked at all the GET/POST clauses and compiled something special
16:06weavejesterhcumberdale: Oh, right, yeah, there should be a separate one for other
16:06S11001001weavejester: since the only way to learn a new framework is to assume it's like the one you already know, after all
16:07brehautweavejester: i think that often peoples preconceptions from other frameworks and libs blind them to what is actuall going on
16:07BrackiOk, so given the above project https://github.com/technomancy/server-socket/blob/master/src/server/socket.clj what do I :use?
16:07amalloyBracki: https://github.com/technomancy/server-socket/blob/master/src/server/socket.clj#L9
16:07weavejesterBracki: server.socket it looks like
16:08TimMcsrc/NAMESPACE/IS/IN/HERE.clj
16:08TimMcexcept munged for use as a path
16:08BrackiHa, thanks
16:08TimMcso you look at the top of that clj file to be sure
16:08BrackiNow I only need str-join
16:08BrackiWhere did that go?
16:08duck1123clojure.string/join
16:10BrackiCan I do aliased usage?
16:11BrackiReplacing str-join with join gives me ould not locate join__init.class or join.clj on classpath
16:12borkdudeBracki: try (use '[clojure.string :only [join]) and then try again
16:15hcumberdaleweavejester: with your solution "other" is also templated
16:16weavejesterhcumberdale: Yeah, that was a mistake. Just apply the middleware to all the routes *except* the "other"
16:17BrackiException in thread "main" java.lang.IllegalStateException: join already refers to: #'clojure.string/join in namespace
16:17weavejestere.g. (def r (routes (wrap-foo (routes a b c)) d e f))
16:17weavejesterOr: (defroutes r (wrap-foo (routes a b c)) d e f)
16:18weavejesterOr: (defroutes admin a b c) (defroutes other d e f) (defroutes all-routes (wrap-foo admin) other)
16:18BrackiIt's always the same, being a parent I spent 90% of my evening on class loading/bootstrapping stuff and then I go to bed.
16:19dr1Hi, I'm new to functional programming and am stuck on something simple. I'm trying to run a function from a project I'm working on in a repl. I'm seeing this: IllegalArgumentException No implementation of method: :priority of protocol: #'gui2.list/IInterface found for class: clojure.lang.Symbol clojure.core/-cache-protocol-fn (core_deftype.clj:527)
16:19hcumberdalejava.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword
16:19hiredmanhttp://dev.clojure.org/jira/browse/CLJ-1085
16:19dr1does that mean I am passing the wrong data type?
16:20amalloydr1: probably
16:20Brackilib names inside prefix lists must not contain periods, aha
16:21mthvedtdr1: you're passing a symbol, and it doesn't implement that protocol… this error is commonly caused by accidentally using a symbol instead of what the symbol refers to
16:21dr1amalloy: how do I figure out what I'm supposed to pass… priority should be some non-negative number and I tried passing it in as 0 or "0" and get the same error complaining that it's a java.lang.symbol
16:22dr1agh, so then it's likely that priority is not just a simple number?
16:22TimMcIt sounds like you're not passing in the args that you think you're passing.
16:22hcumberdaleweavejester: it returns some crazy things now: [:status 200][:headers {"Content-Type" "text/html;charset=UTF-8", "Character-Encoding" "UTF-8"}][:body ...
16:22mthvedtdr1: in that error message, priority is a fn being called
16:22hcumberdalenot the html ;(
16:23mthvedtnumbers and strings are not symbols, so that's probably not the cause
16:23weavejesterhcumberdale: Well, a handler returns a response map
16:23weavejesterhcumberdale: You need to apply your template to the body of the response
16:24hcumberdalemhh,...
16:24TimMcdr1: Seeing a small code snippet would be helpful: http://refheap.com/
16:25BrackiDoes anybody spot whats wrong here: http://pastebin.ca/2291229
16:26llasramBracki: You're excessively quoting the first :use "argument" vector
16:26hcumberdaleI've used a fn to ensure utf-8 is send back (defn utf8r "Ring skeleton with headers." [body] {:status 200 :headers { "Content-Type" "text/html;charset=UTF-8" "Character-Encoding" "UTF-8"} :body body})
16:26llasramBracki: (i.e., you need to delete the ' character)
16:27hcumberdaleHow to I use it in the middleware? Or is it the wrong place?
16:27Brackillasram: That gives me join already refers to: #'clojure.string/join in namespace: urkle.core
16:28llasramThat's a just warning, and means you already pulled it into the namespace / are pulling it in via a raw use/require call elsewhere in that namespace
16:28weavejesterhcumberdale: Everything in Ring is just functions and maps, so you could just alter the response with middleware to add the content type.
16:29Brackillasram: Exception in thread "main" java.lang.IllegalStateException, doesn't look like a warning to me...
16:29weavejesterhcumberdale: Though Compojure defaults to returning text/html;charset=UTF-8 anyway with strings
16:29hcumberdalewhy do I need if-let [response (handler request)] ?
16:29hcumberdaleis it possible that there is no (handler request) ?
16:29weavejesterhcumberdale: Just in case the response is nil
16:29weavejesterhcumberdale: That's what happens when a route doesn't match
16:30llasramBracki: Hmm. Usually it's just a warning. Do (ns-unmap *ns* 'join) in your REPL, then reload
16:30dr1agh! While trying to write a code snippet, I think I found the problem.. priority ISN'T just a number. Now, I guess I have to figure out how to create a priority properly. Thanks, I'll be back if/when I get lost again
16:30weavejesterhcumberdale: I wrote a blog post on how Compojure routes were made up
16:30weavejesterhcumberdale: http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html
16:32hcumberdaleSo it will be some kind of: (defn wrap-utf8 [handler]
16:32hcumberdale (fn [request] (if-let [response (handler request)]
16:32hcumberdale (assoc-in response [:headers] { "Content-Type" "text/html;charset=UTF-8" "Character-Encoding" "UTF-8"}))))
16:32Brackillasram: ain't got no repl, lein test says that
16:33llasramBracki: Then you've got a call to (use ...) somewhere else in there, or something
16:35weavejesterhcumberdale: Yep, though there are some functions in ring.util.response that could make things easier
16:35hcumberdaleweavejester: is there a chance of overwriting other headers using assoc-in?
16:36hcumberdaleweavejester: remembering to have problems with jetty and UTF-8
16:36weavejesterhcumberdale: e.g. (content-type response "text/html;charset=UTF-8")
16:36llasramBracki: Or potentially, multiple files which are actually declaring they implement the same namespace
16:36weavejesterhcumberdale: Well, the way you wrote it it would overwrite
16:36hcumberdalehow to merge?
16:36hcumberdaleis there a merge-in ?
16:36weavejesterhcumberdale: Because you wrote (assoc-in response [:headers] …) instead of (assoc-in response [:headers "Content-Type"] …)
16:37weavejesterhcumberdale: There is an update-in
16:37hcumberdaleBut this will replace them too
16:38weavejesterhcumberdale: I'm not completely sure what you want to do...
16:38hcumberdaleIs it a good idea to overwrite the headers?
16:38hcumberdaleOr is it better to merge them?
16:39weavejesterhcumberdale: That depends on what you want to do...
16:39weavejesterassoc-in won't overwrite *all* the headers, if used correctly
16:39hcumberdaleSettingthe Content-Type and Caracter-Encoding headers, leaving other headers untouched
16:39weavejesterAnd you can use update-in for more nuanced changing of the header
16:40weavejesterhcumberdale: If you just want that, then use assoc-in
16:40hcumberdaleweavejester: two calls?
16:40weavejesterweavejester: Or use the ring.util.response/header and ring.util.response/content-type
16:40hcumberdaleone with [:headers "Content-Type"] and another with [:headers "Character-Engoding"] ?
16:41weavejesterhcumberdale: Well, there isn't a Character-Encoding header in HTTP
16:42TimMcOne of many annoyances!
16:44Brackillasram: Whatever I do, I keep getting that error
16:48llasramBracki: If you posted a git repo of the entire project state, I'd be willing to take a look, but there's not much more I can say ATM
16:52hcumberdaleThx weavejester it works
16:55eggheadwork just set me up for clojure west :D :D :D
16:57weavejesterhcumberdale: You're welcome :)
17:02Brackillasram: https://github.com/bracki/urkle
17:05llasramBracki: Oh! Both clojure.string and clojure.set have a 'join' function
17:05llasramSo you can't blindly pull in all symbols from both namespaces
17:05RaynesYou wouldn't want to do that anyway
17:05llasramBracki: Best practices is to use :require with :as anyway
17:05amalloylet this be a lesson to never :use a whole namespace, for the perils are beyond mere mortal comprehension
17:06RaynesIf you don't qualify your requires, you end up with code that makes no sense because there is no way to tell where anything came from.
17:06Bracki4 years ago that was recommended practice...
17:06RaynesYou end up with Ruby.
17:06RaynesOops, did I say that out loud?
17:06amalloyBracki: maybe it was common practice, but i doubt it was recommended
17:06hiredmanit never was
17:06hcumberdaleHaha Raynes
17:07BrackiI'm fine with common...
17:08bbloomdnolen: just watched your core logic talk via skills matter. good stuff!
17:08RaynesBracki: Please, don't be.
17:10BrackiI was refering to what was common 4 years ago.
17:10amalloyRaynes: the poor guy is trying to bring a 4-year-old project up to date. give him a break
17:10Raynesamalloy: Go play with your Emacs and let the adults talk.
17:10amalloyyou'll never be as swank as i am
17:10llasram"You'll never be as nrepl as I am" really doesn't have the same ring to it, does it?
17:11llasramWell, unless you use drawbridge
17:12BrackiThanks, it runs again.
17:12technomancyllasram: well there's always http://www.youtube.com/watch?v=-VJcfXdR1X0
17:12BrackiNow I'll commit it and ask again in 2 yrs time ;)
17:12llasramnice
17:12Sgeo|webRaynes: is it ok if the macroexpander that Clojail uses does weird things like putting the whole thing in an fn and immediately calling it?
17:13Sgeo|webOr using ... I forget what it does when it sees +
17:13BrackiWhat did the *foo* syntax mean?
17:13BrackiAnything special or just some convention?
17:13Sgeo|webConvention for dynamically-scoped vars
17:13amalloytechnomancy: what an interesting cover
17:14RaynesSgeo|web: Not sure what you're asking.
17:14technomancyamalloy: it's the first version I heard
17:15ipostelnikhow can I convince lein to never look in central and clojars?
17:15llasramipostelnik: :omit-default-repositories true
17:15technomancyipostelnik: or add ^:replace metadata to your :repositories map
17:15Sgeo|webRaynes: I want to scrap macroexpand-most and replace it with (comp map->form analyze-form)
17:15technomancyvector
17:15technomancywhatever
17:15weavejesterDoes anyone know if there's an in-memory queue for Java that will put items back on the queue if a worker times out?
17:15llasramtechnomancy: Oh, does that work with preview10 ?
17:16ipostelnikI have :repositories ^:replace [["my-repo" "url"]]
17:16technomancyllasram: it should; haven't tried it myself
17:16RaynesSgeo|web: Everything in clojar does weird things. If it works, go for it.
17:16Raynesclojail*
17:16Sgeo|webhttps://www.refheap.com/paste/7471
17:16ipostelnikyet I get lots of "Could not find artifact ... in central" and same for clojars
17:17technomancyipostelnik: maybe you need :omit-default-repositories then
17:17Sgeo|webThat fn should really be fn*
17:17Sgeo|webI think
17:17hcumberdale,(type :x)
17:18clojurebotclojure.lang.Keyword
17:18Sgeo|webI don't really know the difference though, and don't know if that could be an exploitable hole
17:18llasramtechnomancy, ipostelnik: Yeah, I def need :o-d-r
17:18hcumberdale,(type #^Keyword :x)
17:18clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Metadata can only be applied to IMetas>
17:18technomancythey should be the same thing; hrm
17:20hcumberdale,(let [#^Keyword x :y] (type x))
17:20clojurebotclojure.lang.Keyword
17:21hcumberdaleIs clojure.lang default included for type hinds? It seems
17:21hcumberdale,(type [:y nil :x nil])
17:21clojurebotclojure.lang.PersistentVector
17:22hcumberdale,(type {:y nil :x nil})
17:22clojurebotclojure.lang.PersistentArrayMap
17:22llasramhcumberdale: It is not. And also, the #^Class syntax is obsolete -- you can just use ^Class
17:23hcumberdaleWhat's the best type hind for map and vector?
17:24hcumberdalellasram: why does ^Keyword work then ?
17:24llasramhcumberdale: Probably none. Unless you're directly invoking methods on the passed in values, the hints won't do anything
17:24hcumberdale,(let [^Map x {:x 1}] (type x))
17:24clojurebotclojure.lang.PersistentArrayMap
17:25nDuffhcumberdale: Do you mean "why doesn't"? (And that would be a surprise, if it didn't, unless clojure.lang.Keyword weren't in your namespace)
17:25llasramhcumberdale: Because ^Symbol is just shorthand for ^{:tag Symbol}, where the "Symbol" value is quoted, and resolved when needed. This can be kind of confusing at times, but allows ^int etc for primitives
17:26hcumberdale,^Keyword x
17:26clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0)>
17:26hcumberdale,^Keyword :x
17:26clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Metadata can only be applied to IMetas>
17:26hcumberdalehmpf
17:26llasram&(meta (first '(^Example x)))
17:26lazybot⇒ {:tag Example}
17:27hcumberdale&(meta (first '(^Keyword :x)))
17:27lazybotjava.lang.IllegalArgumentException: Metadata can only be applied to IMetas
17:28llasramYeah, keywords are singletons, so can't have metadata
17:28amalloyhcumberdale: there is also no reason to ever typehint a keyword literal (and very rarely a reason to typehint a literal of any sort)
17:28TimMcBesides, you can't reliably attach metadata to runtime values using ^ anwyay.
17:29amalloyTimMc: i thought that for a long time, but apparently i'm basically crazy
17:29TimMcOh, has it changed?
17:29amalloyi don't think so
17:29amalloyit's always worked
17:29TimMcI could swear I've seen it fail in the recent past.
17:29amalloyit's just that (my fault, again) it doesn't work in lazybot
17:29clojurebotHuh?
17:29TimMcOh, ha.
17:30amalloyclojurebot: go away
17:30clojurebotGabh mo leithscéal?
17:30hcumberdaleShould I use type hints with defrecord?
17:30TimMcamalloy: EVERYTHING I KNOW ABOUT CLOJURE IS A LIE
17:30amalloy,(meta ((fn [x] ^:even x) 'sixteen))
17:30hcumberdaleI thought they are used to avoid reflection
17:30clojurebotnil
17:30hcumberdale,(type :x)
17:30clojurebotclojure.lang.Keyword
17:30amalloygod damn it. really? how can i never be right about this?
17:31TimMcI would certainly not expect that to work.
17:31amalloy,(meta ((fn [x] ^:even [x]) 'sixteen))
17:31clojurebot{:even true}
17:31hcumberdale(= (type :x) 'Keyword)
17:31hcumberdale,(= (type :x) 'Keyword)
17:31clojurebotfalse
17:32hcumberdale,(= (type :x) 'clojure.lang.Keyword)
17:32clojurebotfalse
17:32hcumberdale??
17:32lazybothcumberdale: What are you, crazy? Of course not!
17:32llasramhcumberdale: It avoids reflection, but that only matters when you actually invoke JVM methods. If you just pass them to clojure functions there's no reflection to avoid
17:32amalloyTimMc: i think it works on collections but not symbols? i just never try to do it, but it works more often than you'd expect
17:33TimMchcumberdale: First off, you want class, not type (to make things simpler).
17:33TimMchcumberdale: Second, the return type is a class, not a symbol.
17:33hcumberdaleDirect access is faster by 10 times I think
17:33TimMcamalloy: a.k.a. not reliably
17:33llasramamalloy: That boggled my mind for a second, but now I see what's happening
17:34TimMchcumberdale: ##(= (class :foo) clojure.lang.Keyword) Note the lack of ' in front of the classname.
17:34lazybot⇒ true
17:34pyris there a way to control aot compile order ?
17:34Bronsa,(meta ((fn [x] (with-meta x {:f true})) 'sixteen))
17:34clojurebot{:f true}
17:34hcumberdaleTimMc: ahh
17:34Bronsaamalloy: ^
17:34llasramTimMc: I think the confusion is around type-hinting, which *does* use symbols. Just symbols which are resolved to class names at certain times
17:35TimMc&(meta ((fn [x] ^:even [x]) 'sixteen))
17:35lazybot⇒ nil
17:35amalloyBronsa: we're well aware
17:35hcumberdale,(defrecord Foo [a b c d e f g h i j k l m n o p q r s t])
17:35clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
17:35hcumberdale;9
17:36hcumberdale,(class 1)
17:36clojurebotjava.lang.Long
17:36hcumberdale,(class :1)
17:36clojurebotclojure.lang.Keyword
17:37hcumberdale,(class clojure.lang.Keyword)
17:37clojurebotjava.lang.Class
17:37hcumberdaleahh!
17:38hcumberdaleIs the correct type hint ^Keyword or ^clojure.lang.Keyword ?
17:39hcumberdaleOr do they work only with primitives ?
17:41hcumberdalethought about using (defn +typeX [& [init]] (merge {:x nil :y false} init)) or defrecord.
17:42hcumberdaleBut performance will be an issue with ~15 parameters and thousands of instances
17:49hcumberdaleHow to change values in records?
17:50AimHereI think you can't; you have to use types for mutable values
17:50AimHereYou could consider making a new record with the updated value in proper functional style.
17:51nDuffhcumberdale: What's your situation/use case?
17:52hcumberdalenDuff: I have ~2500 xml files stored on the file system
17:52hcumberdaleI want to write an UI to attach meta information to these files
17:53hcumberdalelike assign a file to a category
17:53hcumberdale~15 attributes for each file
17:53clojurebot_seanc_: Your files don't get reloaded when a request is made.
17:53nDuffhcumberdale: I typically use atoms in that kind of case -- you can have the UI subscribe via listeners to know when there's an update coming from other code so it can respond.
17:54hcumberdalenDuff: it is a web ui, currently without websockets
17:54nDuffhcumberdale: ClojureScript supports atoms.
17:55hcumberdalein general I would use a map
17:55nDuffhcumberdale: ...yes, but Clojure's native maps are immutible.
17:55nDuffhcumberdale: ...so, you have the same question with them you have about records, ie. "how do I change these?"
17:55nDuffhcumberdale: ...and the answer to that question is "put the object behind an atom".
17:56hcumberdalebut I have multiple values there
17:56hcumberdaleIs a ref better then a atom then?
17:56nDuffhcumberdale: If you're only using _one_ map to hold your multiple values, an atom is the right thing.
17:57nDuffhcumberdale: refs are useful when you want to have coordinated transactions across several entry points into your mutable state
17:57nDuffhcumberdale: ...in general, it's better to avoid doing that.
17:57nDuff(also, refs aren't available in ClojureScript, so if you're doing this browser-side, you can't use 'em anyhow)
17:57nDuffhcumberdale: I'd suggest reading Joy of Clojure, btw.
17:58nDuffhcumberdale: ...it has a lot of focus on the kind of conceptual grounding that your questions seem to be centered around.
17:58nkkarthikhow can I start nrepl server in tomcat webapp?
17:59hcumberdalenDuff: maps = bad performance, they are 25 times slower then direct access to a record
17:59nDuffhcumberdale: ...so, this is another thing that reading Joy of Clojure would be answering for you. :)
17:59hcumberdalenDuff: I'm writing server-side
18:00nDuffhcumberdale: Clojure's native record types provide a compatible interface with its native map types.
18:00nDuffhcumberdale: ...so, you can prototype with native maps and move to defrecord without changing the rest of your code.
18:00hcumberdalechanging means a second instance then?
18:00nDuff...huh?
18:01nDuffhcumberdale: ...oh, you don't understand structural sharing.
18:01nDuffhcumberdale: Seriously, go read JoC.
18:01hcumberdaleI know what it is. But not how it affects records
18:01nDuffhcumberdale: ...basically -- Clojure's native datatypes share their content as much as possible on updates.
18:01nDuffhcumberdale: That's true for records too.
18:02hcumberdalebut they are java objects, how is that possible?
18:02nDuff...by implementing structurally-shared datatypes in Java?
18:02sshackSo what's the current user friendly Clojure repl to use?
18:03hcumberdaleHow does a Type hint work then?
18:03nDuff...
18:03brehautsshack: lein repl / reply (its the same thing)
18:03nDuffhcumberdale: ...I'm having trouble following the train of thought that would lead to that follow-up question.
18:03nDuff(and I don't have time for 20 questions)
18:03hcumberdaleok
18:03brehautnDuff: i was under the impresion that records didnt do structural sharing for their intrinsic fields, only conj'd on map fields?
18:04sshackbrehaut: Any with syntax highlighing/paren matching?
18:04nDuffbrehaut: ...well, yes -- there's not really so much structure there.
18:04brehautsshack: the ccw / eclipse repl might? or an emacs nrepl?
18:05nDuffsshack: emacs+paredit+nrepl.el certainly does all that, and a whole lot more.
18:05sshackMight play with emacs, thanks.
18:05sshackWish we could get beyond emacs though. It's so 1970's.
18:05nDuffsshack: I'd suggest Emacs Live if you're a newcomer -- has a whole lot of shiny plugins all in one place, and some videos showing off features/usage
18:05sshack(Yeah, I know about light table, it looks wonderful)
18:06hcumberdaleawww!
18:06sshacknDuff: 15 year emacs user. But I gave it up a few years ago out contempt for its user apathy.
18:06sshacknDuff: I agree. But the intent and potential is there.
18:11hcumberdaleIs there a JSON FlatFile Store for Clojure data structures?
18:12Apage43a who
18:12Apage43I just do line-separated
18:12oskarthhow are people setting up emacs with clojurescript repl?
18:13Apage43you can JSON encode it, but you lose stuff like sets
18:15hcumberdaleApage43: How do you sync changes with the file?
18:16Apage43depends. If it's just one big structure, it's just (->> "file" slurp read-string make-changes pr-str (spit "file"))
18:16dnolenhmm what's w/ the "Namespace not found." nrepl.el errors again after a nrepl-quit and restart?
18:17dnolenoskarth: I just use inferior lisp
18:17oskarthdnolen: how do you set it up?
18:17oskarthit tells me CLOJURESCRIPT_HOME isn't configured, but it's in my env
18:18dnolenoskarth: you may need to setup .bashrc w/ that info too.
18:18oskarthdnolen: it's in there
18:18dnolenoskarth: perhaps you need to set in .profile too? or .bash_profile?
18:19dnolenoskarth: I always get confused so I just do it in all 3.
18:19oskarthpossibly, I'll do some more trial and erorr and googling
18:19oskarthhaha
18:19oskarthdnolen: but you tie it to $CLJS_HOME/script/repljs, right?
18:19dnolenoskarth: not unless I'm doing something w/ the compiler - I use lein-cljsbuild's repl support
18:20oskarthah
18:20oskarthdnolen: could you paste the line you use to config that? maybe I'm doing something wrong there
18:20dnolenoskarth: what I use to config Emacs?
18:20Apage43hcumberdale: what exactly do you need?
18:20oskarthdnolen: yeah, the inferior-lisp hook
18:21dnolenoskarth: http://gist.github.com/4254233
18:22Apage43i like hadoop. Depending on the version you either -have- to set HADOOP_HOME, or you get yelled at because you set HADOOP_HOME
18:23technomancyApage43: ah, glad to see it hasn't lost any of its charm in the 3 years since I briefly glanced at it and fled in horror
18:24gfredericksdoes korma's select ever return a lazy thing? or is the data always loaded by the time it returns?
18:24brehautgfredericks: from memory it always realizes the data so that it doesnt have cursors hiding in unrealized seqs?
18:24oskarthdnolen works, thanks!
18:24gfredericksbrehaut: that's what I would hope
18:25brehautgfredericks: (incase the connection is closed)
18:25brehautgfredericks: caveat: i dont know what im talking about
18:25gfredericksI'm a little concerned about the behavior of (select foos (with bars))
18:25technomancywouldn't you want cursors to translate into clojure lazy seqs?
18:26brehauttechnomancy: i dont make the decisions, i just parrot them in a lossy form
18:26hiredmantechnomancy: korma doesn't using a with-connection macro
18:26hiredmanso there is nothing else to control the scope of the connection
18:27hiredmanso the connection and associated resources (cursors, results, etc) must be closed before the select returns
18:27technomancyoh right, bleah
18:27hiredmanyep
18:27gfredericksoh so korma is inherently terrible for reducing over large result sets?
18:28hcumberdaleApage43: Holding 15 metadata attributes for ~2000 xml files
18:28hcumberdaleModify them using a web ui
18:29hiredmanI am not a fan
18:29hcumberdaleIt should be possible to cluster the application. Then they share a disk for the shared data
18:29gfredericksI'm not particularly enamored with korma. But I do think there is value in assembling a query programmatically rather than using SQL strings
18:30hcumberdaleWhen I write logic to store data structures and load them + Sync logic so every client is up-to-date maybe the best solution is mongodb or a rdbms...
18:30technomancygfredericks: it's clear that c.j.jdbc is not the right abstraction, but I'm pretty sure korma isn't it either
18:31hiredmana problem with korma is it combines sql generation with database connections and management there of
18:31hcumberdale+ korma does not handle ddl
18:31TimMcYou can separate those somewhat...
18:31technomancyhcumberdale: that's a feature
18:31jeremyheilergfredericks: jkkramer is working on a library to do just that, but im not sure if he's released it yet
18:31Apage43hcumberdale: yeah, once you have more than one machine, I don't know that file based is the way to go. But https://github.com/flatland/masai w/ tokyo cabinet would probably be what you want otherwise.
18:31TimMcKorma can emit the SQL strings instead of sending them.
18:32hiredmanuse sql-form or whatever and pass it to clojure.java.jdbc
18:32hiredmanI guess
18:32technomancyhcumberdale: there's no way to handle DDL in a way that works across databases. it's just impossible to do consistently.
18:32gfredericksjeremyheiler: I particularly like having the compiler notice if I have a typo. But that requires declaring your tables at a minimum.
18:32gfrederickswhich feels verbose if typo-checking is the only thing you're getting from it.
18:32hcumberdaletechnomancy: but a subset like hibernate does
18:32hiredmananyway, some needs to spec out a sql ast in clojure datastructures, and write a compiler that generates sql strings from that
18:33technomancyhcumberdale: even then it's impossible to do on the scale of clojure
18:33gfrederickshiccup-for-sql
18:33hiredmanmaybe
18:33gfrederickssqicclup
18:33technomancyit takes an immense amount of work to catch all the edge cases needed for that
18:33technomancyno single clojure project has that kind of manpower
18:33hiredmanI was thinking something more ast like, like the output of the cljs analyzer
18:34gfrederickstechnomancy: are you talking about query generation or ddl?
18:34technomancygfredericks: ddl
18:34gfrederickshiredman: for the end user, or for other tools to build on?
18:35hiredmangfredericks: the latter
18:35gfredericksthat doesn't sound remotely terrible
18:35hiredmanthe ast would be the "interchange" format so the layer of macros can just spit out an ast, then another tool knows how to check the ast against your table definitions to see if they make sense
18:36gfredericksvery nice
18:36hiredmanplease do it
18:36jeremyheilerhere's one of jkkramer's projects, but its not the one i saw at conj https://github.com/jkk/honeysql
18:36gfredericks:)
18:37hiredmanjeremyheiler: interesting
18:37hiredmanit looks like it tries to hard to be human consumable though
18:38hiredmanbut maybe in practice it could be fine, and I am just biased towards my own vision
18:38jeremyheilerhaha yeah. definitely get in touch with him about his other project.
19:07bbloomi've got an algorithm that produces an extremely large tree of maps. many of the elements are only one assoc away from each other, so it's pretty memory efficient, but if i prn it to a file and read it back in, then it's huge. i kinda wish i had a way to "compress" a recursive persistent datastructure...
19:08hiredmanbbloom: interesting
19:09hiredmanyou'd want to print out a collection of deltas and bases and apply the deltas on read
19:10bbloomi think it's actually simpler than that… if you could treat every internal tree node as a "value" then you could simply walk the tree and memoize look up an instance for every node
19:10hiredmanbbloom: there is always java serialization
19:10bbloomhow is that relevant?
19:11hiredmanhmmmm, I guess it isn't
19:11hiredmanI was thinking you could use it to just dump everything exactly as is, but of course there are no bck pointers
19:12bbloomi wish there was some InternalRepresentation protocol
19:12bbloomif i called it on a PersistentTreeMap, i'd get back an immutible array, or on a PersistentTreeMap i'd get back the trie or red black tree or whatever it is
19:13bbloomthen i could just stick every node into a map and each time i build one up, check the map to see if i already have it, if so, throw out the new value and reuse the existing instance
19:13bbloomthen throw out the memo table after reading the large data structure
19:17bbloombut none of the internals provide hashCode or equality implementations
19:20bbloomoh well maybe some of them do....
19:20tpopebbloom: I'm not sure how to follow up to Meikel
19:22bbloomtpope: *shrug*
19:22bbloomhe said feel free…. i guess go for it? :-P
19:22bbloomi guess the issue then becomes the maintenance burden
19:23tpopeI feel like stealing his static files, bikeshedding them, and submitting them upstream would be a bit douchey
19:24bbloomby bikeshedding, you mean modifying them to meet your/bram's arbitrary requirements for inclusion in vim?
19:25tpopeI actually meant the more traditional definition of petty changes
19:25tpopee.g. I think making the options look like vimclojure#foo is dumb
19:25tpopewhy am I defining stuff in your namespace?
19:26tpopeI guess Meikel wasn't the original author of the syntax file anyways
19:27bbloomwhich pieces do you want specifically? syntax, indent, ftdetect, what else?
19:27tpopea subset of the ftplugin
19:27tpopeand that's pretty much it
19:28bbloomwhat functionality is in that subset?
19:28tpopestuff like 'comments' and 'formatoptions'
19:28tpopeI could write the ftplugin from scratch easy
19:28bbloomyeah, hm
19:28bbloomwell, considering:
19:29tpopesyntax is harder, and indenting a nightmare
19:29bbloom1) he's not the original author of many bits
19:29tpopeI still don't understand clojure indenting
19:29bbloom2) it's MIT and he said go for it
19:29bbloomand 3) my strict adherence to the "better to beg for forgiveness than ask for permission" philosophy
19:29bbloomi say go for it
19:30bbloomindenting is a whole nother topic
19:30tpopehis indenting stuff looks kind of complected with the dynamic stuff
19:30bbloomso, generally, people line up arguments
19:31bbloombut only indent 2 spaces for the body of blocks
19:31bbloombut thanks to macros, there is no easy syntactical clue as to what is a block and what is an argument
19:31tpopewhat *is* a block
19:31bbloomso it looks like he has some heuristics for guessing if something is a block
19:31bbloomin this case starts with def, with, let, etc
19:32technomancyjust steal the list from clojure-mode.el =)
19:32tpopean excellent idea
19:33technomancyhttps://github.com/technomancy/clojure-mode/blob/master/clojure-mode.el#L781
19:33bbloombut for a real fuzzy definition of what a block is, i'd say it's anywhere you'd imagine a macro expands out to some implicit 'do form :-)
19:33cemericktpope: just 2 spaces everywhere is the only sane thing, if you were looking for easy opionions
19:33technomancydocs for that macro are here: https://github.com/technomancy/clojure-mode/blob/master/clojure-mode.el#L630
19:33bbloomor something that is the spiritial equivilent of a 'do, like the top level logical conjunction in core.logic
19:33tpopecemerick: I like that but clearly it's not the norm :)
19:33cemerickmacro-or-not is not a solvable problem statically
19:33technomancycemerick: it is if you name your macros right =)
19:34technomancyif you want indentation support, name it with-*
19:34cemerickoy :-P
19:34bbloompersonally, i find vimclojure's intenting somewhat annoying
19:34cemerickccw has done away with any kind of special macro indenting support AFAIK. Even ever-present REPLs aren't enough to make it workable.
19:35tpopeI know enough clojure that maybe, just maybe I'm finally up for the task of muddling through elisp
19:35bbloomi'd prefer what cemerick says, just indent 2 spaces if i'm inside an unclosed block and i'll line it up myself beyond that
19:35brehauti just watched dnolen's clojure exchange presentation. i really want an excuse to use core.logic
19:35technomancytpope: I think the docstring should give you all you need to know
19:35technomancyhopefully you don't have to read the implementation
19:35cemerickbbloom: anything that isn't automatic is too irritating to bother with
19:36tpopetechnomancy: "addition to those that are built-in" <-- do I need a list of built-in ones?
19:36bbloomi abuse the hell out of block selection to insert and remove whitespace in a very percise way before/after/within lines
19:36technomancytpope: there are two types of exceptions to the regular indent rules: 0) always indent the second line with 2 spaces, or 1) treat the first N args as special and line up everything beyond those according to traditional rules
19:37technomancy0) in this case is for those forms marked with 'defun and 1) is for those marked with an integer
19:37amalloytechnomancy: i can't think of any instances of (1)
19:37bbloomamalloy: deftype and defrecord?
19:37bbloomproxy?
19:37clojurebotproxy is not reify
19:38bbloomany conditional or binding form
19:38technomancyamalloy: in practice they're usually indented like 0) unless you put newlines in funny places
19:38technomancymaybe 0) is all you need
19:38technomancyI'm not really sure why it's implemented that way in clojure-mode
19:38bbloomthere is a difference between reformat and indent while editing
19:38technomancyamalloy: wait didn't you submit some indentation patches to this? you probably know more about the implementation than I do
19:38bbloomif you're going to reflow a form, you need to know how many args to preserve on a line
19:39bbloomif you're just looking for "how many spaces should i insert when you press <cr>"
19:39bbloomthen the answer is "generally: 2"
19:39amalloytechnomancy: well, i submitted a way to ask for a given symbol to be indented like (0)
19:39amalloyi still don't understand the indent specification for deftype and friends
19:39amalloybbloom: deftype, reify, and proxy are neither (0) nor (1)
19:40technomancyamalloy: me neither woooooo
19:40bbloommaybe i misunderstood technomancy's definitions
19:40technomancymaybe I misdefined them
19:41bbloomi'm thinking (do x y z) would put x y and z on new lines indented 2 spaces, but (let [x 1] y z) would leave [x 1] on the first line
19:41tpopehow much of this is absolute and how much is opinion?
19:41tpopebbloom I get the impression you're trying to challenge the existing conventions
19:42amalloybbloom: https://www.refheap.com/paste/7479
19:42bbloomtpope: that's not my intention
19:42technomancytpope: bonus points if you don't include a way to change indentation from two spaces
19:42amalloyoh, except i labeled them wrong like an idiot
19:42seangroveIs there a concise way of sorting a map on a key, and then if that key is equal in both args, sorting on a secondary key?
19:43seangroveWell, sorting a vector or maps, sorry
19:43bbloomseangrove: vectors are comparable, so you can sort on a function of each element, where that function returns a vector in order of keys to sort by
19:43bbloomuse juxt :-)
19:43technomancyoh man beat me to it
19:44tpopetechnomancy: a tricky one. overwhelming dogma of indent files that ship with vim is "that's up to the user"
19:44callendoes anyone know what the current state of sourcemaps in ClojureScript are? http://dev.clojure.org/display/design/Source+Maps this seems old and not very encouraging.
19:44amalloywell, juxt doesn't let you be lazy about not calling (g a) if (= (f a) (f b))
19:44seangroveWill try juxt I support
19:44technomancytpope: actually as long as they can't turn on tab indentation I'm good
19:44amalloyjuxt would be the right answer in haskell, i guess. in clojure it's pretty good and fine most of the time
19:44tpopedo people actually do this?
19:45bbloomamalloy: is there a short circuiting solution?
19:45technomancytpope: I guess I mostly only see it in old code
19:45cemericktpope: I think I found the fix to #11
19:45tpopecemerick: :D
19:45cemericktricky little bastard
19:45amalloybbloom: sure. nothing built in, but it's easy to write
19:45bbloomamalloy: yeah, i was asking about built in
19:45seangroveamalloy: There will only be a few items in the vector ~100 at most
19:45cemericktpope: I need to put together some good tests to verify and such, but an 0.2.0-RC2 should be ready for you tomorrow morning.
19:45tpopebbloom: ^
19:46bbloomexcellent.
19:46tpopeI guess I'll need to add some sort of detection to foreplay to only use sessions if this bug doesn't exist
19:46cemericktpope: Thank you very much for the report. In the end, it *was* provoked by the different connections. Hopefully _now_ we can say that sessions and connections/transports are properly separated.
19:47tpopebbloom et al: can you keep an eye out for concrete examples of indent failures with the VimClojure stuff?
19:47cemerickAll the existing (popular) nREPL clients maintain mostly-persistent connections, which explains why this bugger hid for so long.
19:47tpopeI won't be solving that tonight
19:48tpopecemerick: guess you didn't plan on an editor with one foot still in the seventies :D
19:48bbloomtpope: i might be beyond help there. my brain adjusts to indent annoyances until it's transparent to me
19:48cemericktpope: always using sessions is highly recommended. Later futures (like subscribing to System/out and System/err) will end up streaming on a per-session basis.
19:48tpopebbloom: I see stuff that feels wrong, but it's hard for me to say *why* it's wrong
19:48bbloomdon't knock the 70s. there's some damn good 70s tech :-)
19:48cemericktpope: quite the opposite; I've been trying to design around probable issues around vim et al. from the beginning
19:49cemerickThus the (almost fulfilled) disconnect between transports/connections and sessions.
19:49tpopecemerick: well I can't really turn them on if it's connected to an nrepl with this bug
19:49cemerickright
19:49cemerickwell, you could just say "requires nREPL 0.2.0" :-P
19:50tpopemaybe a year from now I cna
19:50cemerickoh?
19:50tpopeI mean I don't want to require an RC that was released 3 hours ago
19:50cemerickno one's using anything before 0.2.0-beta something
19:51tpopeyeah but beta something has the bug
19:51bbloomdoes lein auto self update? and does it bring new releases of nrepl with it?
19:51cemerickthey'll all roll forward once lein 2 is finalized, I promise you
19:51cemerickbbloom: no, and yes
19:51tpopeokay
19:51tpopewell after lein 2 is finalized I can do that
19:51cemerickbbl
19:51cemericksounds very reasonable
19:52tpopeas it stands I still support lein 1.7
19:52seangroveWow, juxt worked wonderfully
19:53seangrove(sort-by (juxt #(or (:order %) 999) :source :name) (flatten field-descriptions))
19:53bbloom(inc juxt)
19:53lazybot⇒ 3
19:53technomancyseangrove: you don't need or there; just do #(:order % 999)
19:53bbloomi just keep finding new uses for juxt, love that little function
19:54seangrovetechnomancy: That's why I pasted it, thought there might be something nifty like that :)
19:54amalloyalso jesus, flatten? that's like 100% to be wrong
19:55brehautis there a kibit rule for flatten?
19:55amalloybrehaut: it just reformats your hard drive
19:55technomancySystem/exit
19:55brehautahaha
19:55brehautliterally lolling
19:56seangroveamalloy: Mind explaining a bit?
19:56brehaut~flatten
19:56clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
19:56hcumberd`is there any lib in clojure to help with file locking?
19:57seangroveI'll re-examine it and see if I can get rid of flatten
19:57bbloomhcumberd`: it would be nice if there was an https://github.com/liebke/avout type thing for that….
19:58bbloomin fact, avout probably could be extended to work on a normal posix file system
20:51cemerick_awaytpope: wow, 1.7?
20:51cemerick_awaytechnomancy: do you have usage stats at all between versions?
20:53tpopecemerick: the second thing I did when trying out clojure was brew install leiningen. I can't be the only person to make that mistake
20:54cemerickheh
20:54cemerickProbably not _only_, but...
20:54cemerick;-)
20:54tpopecemerick: and really, I didn't have to go out of my way to support it
20:55cemerickfair enough
20:55tpopeI just have to make sure I say "Lein 2" when talking about target/repl-port
20:55bbloomwhat's blocking the lein 2 release? i seem to recall it being something small
20:55cemericktpope: are you planning on supporting remote connections and such?
20:56tpopecemerick: it should already work
20:56tpopeI don't have any remote servers running clojure yet
20:56bbloomcemerick: i'll probably figure out how to get clojurescript working with it soon
20:56hiredmanbbloom: the final release of lein 2 will only pull from the signed clojars releases by default, but they are not many signed clojars releases
20:57bbloomhiredman: ouch. that's gonna take forever to evolve, is it not?
20:57hiredmandunno
20:58tpopebbloom: I made the repl interface small and well defined, so hopefully it will be pretty easy
20:58bbloomtpope: cool. i'll trade you more Clojure help for VimL help :_)
20:58tpopecemerick: how do people usually do that. ssh tunneling? I don't see any authentication
20:59hiredmantpope: I dunno that people usually do that, nrepl has an http transport and you can drop cemerick's http auth stuff (friend) in front of that
21:00cemericktpope: what hiredman said. nREPL is channel-agnostic. HTTPS + Basic auth is easy mode.
21:01tpopeHTTP was the first thing I tried and I couldn't get it to work
21:01cemerickI've been meaning to get a JMX transport wired up, eventually.
21:01hiredmancemerick: that would be neat
21:01tpopeor rather, I couldn't find enough documentation to convince me that was a viable path
21:02cemericktpope: see https://github.com/cemerick/drawbridge
21:02cemericktechnomancy did a writeup on using it on heroku, which might be of some interest https://devcenter.heroku.com/articles/debugging-clojure
21:02hiredmanthe thing to watch out for are the middleware requirements
21:02cemerickThough, heroku's lack of session-affinity is a bit of a bummer.
21:03tpopecemerick: "Other nREPL transports are provided by the community" in the README links to https://github.com/clojure/tools.nrepl/wiki/Extensions
21:04tpopeI took that very literally
21:04cemerickjeez
21:04cemerickI didn't realize that changing the title changed the URL :-/
21:04bbloomcemerick: what is the state of piggyback?
21:05bbloompiggieback*
21:05tpopecemerick: is drawbridge simple enough that I could talk to it with curl?
21:05brehautoh now i want to be insane and implement an xmlrpc nrepl transport
21:05cemericktpope: fixed
21:05tpopegreat
21:06hiredmanyou can talk to it via curl, data is json encoded though
21:07hiredman(I've used curl to verify that drawbridge was working)
21:07bbloomi guess i need to wait for the sessions fix to use piggieback
21:07cemericktpope: yes
21:07cemerickbbloom: and, yes
21:07tpopeI can actually parse json in VimL with eval()
21:07cemerickpiggieback is solid AFAICT
21:08hiredmantpope: sounds gross
21:08bbloomcemerick: glad to hear it. is there anything that could move upstream to the cljs repl protocols and stuff?
21:08cemerickbbloom: much of it really should be in cljs already, w.r.t. eliminating the REPL's assumption about being on stdin/out
21:08tpopea drawbridge adapter should be pretty easy to implement
21:08bbloomcemerick: yeah, that's what i was asking about. i'd be happy to contribute patches to cljs to get it there
21:09bbloomi want to get foreplay working as smoothly with cljs as it does with clj
21:09tpopeis there a good oss project with drawbridge set up I can play with?
21:10cemerickbbloom: There's not a lot of code, and I commented as I went along and hit pain points. ;-) https://github.com/cemerick/piggieback/blob/master/src/cemerick/piggieback.clj
21:10tpopeI mean I could roll my own, but exposure to another code base is a win for me learning
21:10bbloomcemerick: yeah, skimming it now
21:10cemerickMuch of it would be super-simple to fix, if one has cljs commit.
21:10bbloomi want to press cpp and have an expression evaluated like magic and not have to care about if it's a clj or a cljs form :-)
21:11cemerickI just didn't have the energy to produce tickets and patches.
21:11bbloomi don't have cljs commit, but dnolen tends to at least look at my patches :-)
21:11cemerickbbloom: exactly what piggieback does; same with load-file, interrupt, etc
21:12amalloybeing in #clojure is practically like having cljs commit rights, given dnolen exists
21:12tpopebbloom: me too
21:12cemerickYeah, I've never had any problem getting patches in. I just couldn't bring myself to spend more time on it, once I got the thing working.
21:12bbloomfair enough
21:12cemerickmental budget blown, and all that
21:13cemerickI doubt I'll ever know cljs internals the way I grok Clojure.
21:13bbloomcljs' internals are a mix of messy/hacky/dammit-it-works and "oh, that's nice"
21:14bbloomanalyzer and compiler, despite not being sliced up into smaller passes, are actually quite understandable
21:14bbloomit's all the rhino and closure and module system gunk that leaves me scratching my head
21:14cemerickYeah, it's always the interop bits that I gloss over on.
21:15cemerickright
21:15cemerickAnd the weird node bits that poke through here and there
21:15bbloomheh
21:16bbloombut now that there are a bunch of parties interested in self hosting the cljs compiler (such as light table and other dev tools), there may be more pressure to decouple from the JVM
21:16bbloomwhich will surely yield cleaner protocols for those messy bits
21:16bbloomthe biggest wrinkle in this is our dependence on the google compiler for performance of the resulting targeted code
21:17bbloombut that's not strictly necessary for non-optimized code generation
21:17bbloomand ultimately we want clojure-specific optimizations, such that we can apply them to any backend
21:21sshackThere aren't any kernel density estimators (statistics) done in clojure are there?
21:21cemerickI'm a blissful user of cljs.
21:22cemerickNeed that easy dial turned up to 11. :-P
21:23bbloomcemerick: luckily, most clojure code ports to cljs pretty seamlessly
21:23bbloomright now i'm working primarily in clojure with a very small runtime component in cljs
21:24cemerickhrmph
21:24bbloomsince all the data structures are printable/readable, i just forward them across the wire to render in the browser :-)
21:24bbloomperf is obviously shit this way, since i need to serialize and deserialize application state on every change
21:24bbloombut testing is sooo much easier
21:24cemerickThat's been my biggest problem: keeping libs portable
21:25cemerickEven using crossovers, cljx, everything I can get my hands on.
21:25bbloomyeaaaaah....
21:25cemerickSo many little twiddly silly differences.
21:25bbloomthere's been some talk of feature expressions
21:25cemerickSounds like dnolen wants them bad, so that's something.
21:25cemerickThey're going to lead to a lot of *really* messy codebases.
21:25bbloomyeah, he's been trying to maintain core.logic on clj and cljs at the same time
21:25bbloomit's tricky
21:26bbloomwell that's the big problem: people are gonna use feature expressions like C preprocessor macros
21:26bbloom:-/
21:26cemerickwell, it's sorta inevitable
21:26cemerickever see some super-portable CL?
21:26cemerick:-O
21:26bbloomheh, well yeah, i mean that's what people did with C preprocessor: they ported software
21:27cemerickI've started to wonder if portability really is a lost cause.
21:27bbloomand then people were like "this is ugly" so people have crazy tools that take the preprocessor and REMOVE IT and generate a patch file
21:27bbloomhaha
21:28cemerickThe semantics around hosty bits may always conspire against us.
21:28bbloomthere are a bunch of java-isms that people use a lot that we need to wrap in the standard lib
21:28cemerickesp. numerics.
21:28bbloom… like "throw"
21:28cemerickhah
21:28bbloomi don't even want to think about numerics :-P
21:28cemerickThat was my first custom cljx/kibit rule I wrote
21:29bbloom(throw (Exception. ?e)) -> (throw (Error. ?e))
21:29bbloomyeah?
21:30cemerick(try ... (catch AnyJVMExceptionType e ...)) => (try ... (catch js/Error e ...))
21:30cemerickand yeah, the throw, too
21:30bbloombetter yet, do: (try ... (catch* e ...))
21:31cemerickoh really!
21:31cemerickWhen did that become kosher?
21:31bbloomit's not kosher.
21:31bbloom:-P
21:31cemerickheh
21:31cemerickYou're not going to troll me into looking at whatever `try` emits :-P
21:32cemerickOr are you proposing a variant of try on the fly?
21:32bbloomoh, i might be wrong, it's not catch* it's try*
21:32bbloomcatch isn't really a form, it's processed by try
21:33bbloomhttps://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L874
21:33bbloom (try* … (catch e …))
21:33technomancycemerick: download stats are at https://github.com/technomancy/leiningen/downloads but don't really include timestamps unfortunately
21:33technomancyI'd pay a fair bit to get raw logs out of github =\
21:34technomancyI should start timestamping snapshots of those numbers though
21:34cemericktechnomancy: huh, strong numbers for 1.7.1
21:34bbloomtechnomancy: yeah, and they got rid of the traffic graph when the redesigned the graphs
21:35bbloom:-/
21:35cemerickClojureScript sources are the new rickroll
21:36bbloomcemerick: i have a tendency to force people to look at the source any chance i get :-)
21:36tpopecemerick: as someone who was confused by the state of affairs with the preview releases, I am unsurprised by this
21:36bbloomquite a few junior devs have thanked me for it years later ;-)
21:37tpopeit took me a long while to figure out that using the preview was the preferred course of action
21:38cemericktpope: I never had any use for 1.x, so I've never known anything else.
21:39cemericktechnomancy & co. are relentless though, so it was probably only a matter of time
21:39tpopewait how long has 2.x been a thing?
21:40cemerickDevelopment started on it more than a year ago
21:40tpopeI expected worse actually
21:40cemerickworse?
21:40clojurebotworse is slurp
21:41cemerickclojurebot: that's dumb
21:41clojurebotI don't understand.
21:41gfredericksclojurebot: that is dumb
21:41clojurebotc'est bon!
21:41tpopewell you've been doing clojure for well over a year, no?
21:41bbloom~that
21:41clojurebotthat is a completely unrelated, but entirely useful link
21:41bbloom~dumb
21:41clojurebotdumb is that
21:41bbloomheh.
21:42tpopefor a brief moment I failed to consider that you may have been using some tool other than lein
21:42tpope*shrug*
21:43bbloomtpope: there's a bunch of shell scripts in the clojurescript tree… that's what i was using :-P
21:43cemericktpope: Started in 2008
21:43cemerickbbloom: don't get me started :-P
21:55tomojbbloom: any guesses what that more fundamental abstraction (than INotify) might look like as a protocol?
21:55tomoj(or protocols..)
21:55bbloomtomoj: not sure… i suspect i'd have to study erlang's OTP
22:00bbloomtomoj: you're interested in push sequences too, right?
22:00tomojare you suggesting it replace INotify? or just that there's this other thing we need to think about too?
22:00bbloomwell i'm not sure INotify is sufficient
22:01bbloombut there are definitely other things to consider too
22:01bbloomconsidering that there is no unregister… i worry about resource leaks with INotify
22:01tomojoh yeah, me too
22:01bbloombut there are other concepts to consider
22:02tomojbut for the one example I had in mind, I realized there is no resource leak
22:02bbloomprocess links/trees, etc
22:02bbloomexecutors
22:02bbloompools
22:02bbloomschedulers
22:02tomoj(specifically (any a b) where one of a and b is never realized, or is realized much later than the other)
22:02bbloomqueues
22:02tomojdoes IScheduler satisfy your process tree concerns?
22:02bbloomcomposite futures, processes, sequences, etc introduce all sorts of interesting riples
22:03bbloomwhere is IScheduler?
22:03tomojRx
22:04bbloomlooking at it now
22:04bbloomthis is a scheduler in the cron sense
22:04bbloomi'm talking about a scheduler in the kernel sense
22:04tomojwell, ignore the complection with time stuff
22:05tomojwithout that IScheduler looks something like executors I think
22:05tomoj(in one video the Rx team conveniently tells us that IScheduler is three different things stuck together :D)
22:05bbloomso convenient :-P
22:06bbloomi'm looking at http://msdn.microsoft.com/en-us/library/dd460693(v=vs.100).aspx now
22:06bbloomtask schedulers are different than reactive schedulers
22:06bbloomthere are also "partitioners"
22:07bbloomyou see rich's talk about reducers? somebody asks when reducers stops breaking it down into smaller parts to be executed sequentially per part?
22:07bbloomrich says that he picks an arbitrary configurable threshold and that somebody else can figure that problem out :-P
22:08bbloomwell that whole partitioning/load balancing/whatever thing is a tough problem too
22:08bbloomthere's lots of stuff
22:09bbloomi guess my main thought was that we're putting the cart before the horse by focusing on listenable futures without the underlying bits and pieces for multiprocessing
22:10bbloomi recall Erik Meijer (architect of Rx) saying that the first version of Rx was stand alone and they rewrote it on top of Px and everything got much simpler and faster
22:10tomojI think I agree - there shouldn't be an ExecutorService param in INotify
22:10tomojbut getting rid of it requires answering some of your questions (if I understand them)
22:10tomoj...luckily I mostly care about cljs
22:12bbloomdopey single threaded javascript :-/
22:12bbloomanyway, concurrency and parallelism have many design concerns in common
22:13bbloomi think if you design a solution for a concurrent AND parallel environment, it's reasonably straight forward to make it run in a concurrent but NOT parallel environment
22:13bbloomyou just pretend that there is 1 CPU
22:13bbloomand no threading :-P
22:13bbloomprobably can optimize a bunch of things, but i would design in java land and port to javascript for Px and Rx type things
22:14bbloomas long as you never call (Thread. X) in client code and only ever enqueue work, then it should abstract cleanly
22:15bbloomthe really hairy bit comes in when you consider blocking…. suddenly you need a CPS transform :-P
22:21tomojI have the cps transform bucketed into the "easy" side — but haven't started working on it yet :(
22:21bbloomtomoj: feel free to fork and contribute to mine: https://github.com/brandonbloom/cljs-cps/
22:22bbloomi lost all my momentum on it while i waited to get some fixes into cljs that i needed
22:22bbloomall the fixes are in now, but i haven't gone back to it yet
22:28holoi have: "No method in multimethod 'to-source' for dispatch value: class clojure.core.match.WildcardPattern" when compiling on heroku. i don't have this problem in my local machine. i can't understand why this behaviour is different
22:40tomojany reason not to implement the cps as a normal macro instead of on analyzer output?
22:41tomojeventually want it on the jvm too, and likely before there is an analyzer there like cljs's
22:41bbloomtomoj: so the analyzer currently whole bunch of things all in one pass
22:41bbloomi really just need the "parse" piece of it
22:41bbloomconsider for example try* https://github.com/brandonbloom/cljs-cps/blob/master/src/cps.clj#L157
22:42bbloomit's actually a non trivial piece of logic to parse a try/catch/finally block
22:42bbloomsimilar story with fn: https://github.com/brandonbloom/cljs-cps/blob/master/src/cps.clj#L200
22:42tomojyeah, I see. and I think macroexpansion may be a problem on the jvm, if some macros use &env
22:42bbloombut yeah, was gonna say: macro expansion is the big part
22:43bbloomif you have macros that themselves use the environment, you can't do macro expansion
22:43bbloomin theory, you could just macroexpand up front, but the analyzer does that for you
22:43bbloomi don't need any tag inference or any of the other fancier bits in the analyzer
22:44bbloombut also the :children model makes it easy to walk the AST and search for serious/non-trivial expression
22:46bbloomthat ANF transform is reasonably robust, so you can see how nice an AST transform can be
22:46bbloomthe CPS part isn't finished, but primarily because i was still designing IContinuation, etc
22:50bbloomthe ANF transform makes the :default case for the CPS transform pretty nice: https://github.com/brandonbloom/cljs-cps/blob/master/src/cps.clj#L226
22:50bbloomsince you can trust all of the serious expressions have already been hoisted out into a :let form
22:59bbloomi'm interested in breaking up the clojure analyzer dramatically
22:59bbloomshould be able to opt into or out of macro expansion
23:00bbloomfor example
23:00bbloomwhat if codeq just wants to see how often a macro is used?
23:00bbloomright now there isn't a way since the macros are expanded upon analysis
23:01akhudekdoes anyone know why clojure would be trying to compile an installed jar instead of it's checkout version?
23:02akhudekthe classpath looks right: the checkout source comes before the maven copy
23:11cemericktpope: are you set up to be able to test against a SNAPSHOT rev of nREPL? I'd love to get confirmation from you on the fix before cutting -RC2
23:11tomojthat by itself seems like a potentially easy change, since macroexpand-1 is only called in analyze-seq ? maybe I underestimate
23:12tpopecemerick: I think so. I've never done it before
23:12pendlepantsif I've got a list like (1 2 3 4 5 6), is there a function that returns ((1 2) (3 4) (5 6))?
23:12cemericktpope: add this to your project.clj:
23:12cemerick:repositories {"sonatype-oss-public" "https://oss.sonatype.org/content/groups/public/&quot;}
23:13cemericktpope: then change the nREPL version to 0.2.0-SNAPSHOT
23:15tpopecemerick: first thing I notice is "nREPL server started on port 57778" (from lein?) is now printed after the prompt
23:16tpopecemerick: it works!
23:16cemericktpope: the printing of stuff like that (prompt, server started on X, etc) is all up to the clients (in this case, reply/lein)
23:17cemericktpope: awesome
23:17tpopeyeah that's what I figured
23:17cemerickThanks again for the report! Hope I didn't hang you up too much
23:17tpopeno it's all good
23:17cemerickI hope I can get to giving foreplay a try soon.
23:18tpopewho would I ping about the prompt thing? technomancy?
23:18tpope:D
23:18cemericktpope: trptcolin, mostly
23:19cemerickHe's only occasionally on irc; probably best to open an issue on the reply project
23:19cemericktpope: this is just from running `lein repl`?
23:19tpopecemerick: yep. That string appears in the source to leiningen
23:20cemerickwell, in that case, there's lots of people you can bother :-P
23:20tpopeif I blame the line of code it goes back to trptcolin :P
23:21cemerickit was printed *before* the prompt? Seems nigh-impossible, since that println happens before reply is connected to the REPL.
23:21cemericktpope: he's mostly to blame for the lein repl task these days ;-)
23:22cemericktpope: do you mind a general vim Q?
23:22tpopecemerick: it looks like user=> nREPL server started on port 54346
23:22tpopecemerick: not at all
23:22cemerickyuck
23:22cemerickraciness around System/out?
23:23cemericktpope: have you ever used eclim successfully, or do you know of anyone who has/does?
23:23tpopeit feels like there's a split second between the prompt and the port announcement
23:23tpopecemerick: I haven't, but I get bug reports against other plugins from people who apparently have
23:24cemerickinteresting
23:24cemerickI'd love to use it, but it doesn't support macvim :-((((
23:24cemerickgood to know that it's apparently viable
23:24tpopecurious that macvim isn't supported
23:25tpopeI have no idea if these people run on a mac at all
23:28cemericktpope: Not surprising, given the ways swt and any-other-ui-toolkit interact.
23:28tpopemy vague understanding was that eclim worked by talking to an external eclipse instance, not by embedding in it
23:28cemerickKiller vim Clojure support + the promise of eclim working well may be just another little push to get away from OS X for work.
23:28tpopebut it's been years since I looked
23:29cemerickit can do both, apparently
23:29rbxbxcemerick what do those have to do with OS X?
23:30cemerickrbxbx: You just missed it. eclim apparently can't embed macvim into eclipse, but gvim on linux or windows is fine.
23:31rbxbxhmm
23:32tpopecemerick: do you get much out of eclipse for clojure? or do you want it mostly for java?
23:33cemericktpope: The Clojure support is roughly on par with e.g. SLIME IMO. Different tradeoffs. I've been contributing to ccw for years now, so...
23:33cemerickLaurent would be so disappointed if I started using vim for clojure :-P
23:34cemerickActually, I'd still use ccw's REPL support; it's just the editor that I'd like to swap out
23:34cemerickBut, yes, having that JVM stuff underneath you is the motivating factor. Java-the-language capabilities, debugger, profiler, etc etc etc
23:34tpopehmm, ok
23:35rbxbxtpope: it looks like eclim works in two ways, either a headless instance that vim can talk to, or (on unix & windoze) embedding a vim editor inside of eclipse itself
23:35rbxbxtpope: (though admittedly until this talk of embedding I was only familiar with the former)
23:35cemerickrbxbx: funny, I can't get to their page at all now
23:35tpopecemerick: yeah that's what I just tried
23:35tpopeI'm a little curious to try it
23:35rbxbxcemerick: had to use cached & text only
23:35cemerickah
23:35tpopeI *am* sitting in front of a linux box currently
23:36rbxbxI tried to use ccw without prior eclipse experience and just found myself overwhelmed and dumbfounded.
23:36RaynesEclipse has that effect on people.
23:37RaynesOMG, WHICH BUTTAN
23:37frozenlockHow does one close an NREPL buffer and kill the process at the same time? (Like slime did with swank...)
23:37tpopemy gut has been screaming DON'T DO IT and you just explained why
23:37rbxbxRaynes: yeah. All the wizards in the world couldn't save me
23:38cemerickAll these geeks managing to browse the web with all its funny buttons, links, and geegaws, but then get flummoxed by a systematic, consistent UI
23:38rbxbxtpope: yeah. You'll have to lose your sense of smugness toward IDE users after their primitive tooling destroying you in minutes.
23:38tpopeit's more robust than that :)
23:39rbxbxha
23:39RaynesSystematic like cancer, consistent like Hitler.
23:40rbxbxdamn.
23:40bbloomtomoj: simply conditionally executing macroexpand-1 in analyze-seq would yield yet another dynamic configuration variable
23:40rbxbxcemerick: I'm sure had I grown up on IDEs or sat with a proficient user of one it'd be a non-issue
23:40bbloombut macroexpansion is just a basic case
23:41bbloomtomoj: i want to add other passes, stuff like what's going on inside of GClosure: all your typical compiler stuff. constant folding, closure lifting, etc
23:41rbxbxcemerick: xcode and squeak do the same thing to me, so it's not just eclipse
23:41bbloomtomoj: so a pluggable pass pipeline is desirable
23:41cemerickrbxbx: *shrug* I'm convinced it's a social-signaling thing amongst certain classes of programmers.
23:42cemericktextmode good/hip/cool/efficient, GUI bad/gauche/dilbert
23:42tpoperbxbx I seem to recall you basically became a web developer because you couldn't figure out how to pirate visual studio
23:43rbxbxtpope this is true. And I knew how to, but my AOL connection wouldn't stay alive long enough to download 6 megs :(
23:43cemerickOh, pleeeze let that be true!
23:43tpopeit's pretty much my backstory too
23:43rbxbxIt was just preordained that I not be an IDE user
23:43cemerickyou just needed to find the right AOL group that had the bits split across 6 .pk files.
23:43bbloomheh. that is awesome
23:44cemerickgawd, now I feel old
23:45rbxbxcemerick: to address your previous point though, there are swaths of languages that don't benefit much from the tooling provided by IDEs... and a lot of those languages are more "hackery" than "enterprisey"... so... the issues maybe get conflated?
23:45bbloomif you plot knowledge against productivity, you get two very different plots with or with access to the internet
23:45bbloomwith the internet, your knowledge grows faster, but has this sine-wave format to it where you learn backwards wrong shit from the internet
23:45bbloomand then that sine wave is amplified times a million along the productivity axis
23:46bbloomin part because you spend too much time reading, but mostly b/c you fall down a whole into reddit
23:46bbloom… or irc....
23:46bblooms/whole/hole
23:46rbxbxsome people fall into a whole with reddit as well ;)
23:46bbloomsometimes i intentionally disconnect my internet connection when i'm working :-)
23:47cemerickrbxbx: You might be right, though that's changing significantly.
23:47rbxbxbbloom I've heard of many doing that... I've tried but found it difficult. Especially when working with a team.
23:47cemerickText editor + terminal sorta sucks for Clojure, for example. Racket and factor have been producing killer environments for years. None enterprisey at all, at least in the pejorative sense.
23:47bbloomrbxbx: the trick with a team is to negotiate quiet hours
23:48rbxbxcemerick: s/enterprisey/academicy
23:48rbxbx;)
23:48bbloom"monday through wednesday, i am not going to check my email or respond to low priority interrupts between 1 and 6pm"
23:48cemerickrbxbx: bah
23:49rbxbxcemerick: I don't know what I'm talking about. You should likely ignore me.
23:49bbloomcemerick: tpope just halved the suck-factor of my text editor + terminal workflow
23:49tpoperbxbx, bbloom: counterpoint: http://weblog.therealadam.com/2012/12/08/focus-mode-considered-harmful/
23:50technomancycemerick: it's changing because it's only recently that you've been able to perform interactive development on an IDE using itself maybe?
23:50cemerickrbxbx: nah, don't discount like that
23:50bbloomtpope: yeah, that too. i'm trying something like that now
23:50rbxbxbbloom tpope +1 to that. My workflow was janky at best.
23:50technomancys/IDE/Java IDE/; obviously most things said about IDEs don't apply to smalltalk
23:51bbloomtrying to "release" something every week
23:51cemerickbbloom: well, it's getting into semantics at some point. At which point is your text editor + terminal + JDI wire debugger + etc become an IDE...
23:51bbloomcomponent, project, bug fixes, blog post
23:51Raynestechnomancy: But smalltalk doesn't have an IDE.
23:51bbloomsomething like that
23:51technomancyRaynes: smalltalk *is* an IDE
23:51Raynestechnomancy: It has its own dimension and planet and such.
23:51cemericktechnomancy: Right; good tools are good, regardless of labels
23:51Raynestechnomancy: You've got to give me time to finish being funny before you take me seriously brow.
23:52technomancyRaynes: brb switching to qwerty
23:52cemericki.e. if we could all use something like Dr. Racket for Clojure, I'd be surprised if many among us stuck with vim/emacs/ccw/whatever
23:53rbxbxcemerick: old tools/habits/muscle-memory die hard, not to mention portability.
23:53technomancycemerick: well, to a degree good tooling requires interactive development. back when you had to use Java to extend Eclipse, it was a lot less fun and productive; you would experiment less
23:53bbloomcemerick: i dunno, i don't think i'll ever leave vim unless i leave unix behind with it…
23:53cemericktechnomancy: believe me, extending eclipse with anything other than Java is still full of suck
23:53technomancyoh =(
23:53Raynescemerick: I'd be extremely surprised if a large portion switched.
23:54technomancyI thought ccw was leveled up beyond that by now
23:54cemericktechnomancy: We do it with Clojure, but the API vocabulary overhead is *huge*
23:54cemerickIt's probably a 50/50 split now
23:54technomancyah, gotcha; because you're supposed to be writing it in a tool that does all kinds of autocomplete stuff, so reducing the surface area isn't a priority?
23:54bbloomIDEs, runtimes, and OSes just have too much in common....
23:54cemerickLaurent's working on putting userland hooks into it these days, so you can have the equivalent of a .emacs directory for ccw.
23:55cemericktechnomancy: Yeah. Your head would fly off if you looked at it.
23:55bbloomi worked on visual studio…. let me tell you…people joke that emacs is an operating system…. it's not a joke
23:55bbloomvisual studio is a poorly implemented operating system built on top of windows….
23:55cemerickRaynes: That'd be shocking to me. Dr. Racket blows the doors off of any Clojure environment around.
23:55technomancythe whole "it's not intended to fit in your head" paradigm of development
23:56Raynescemerick: You underestimate how much I like having one environment for everything I use.
23:56bbloomI second what Raynes says. i don't only do Clojure. i do like 10 other languages in any given week :-P
23:56bbloomconsistency counts.
23:56rbxbxRaynes you're not the only one, or things like smalltalk-80 wouldn't have existed
23:56technomancycemerick: does Dr. Racket have two IRC clients, three MUAs, a couple jabber clients, version control integration for every VCS imaginable and a few in-editor shells?
23:57cemerickRaynes: given the differential between nrepl.el/SLIME and Dr. Racket, that's like saying you like carrying one saw for all of your carpentry needs.
23:57RaynesI think you just agreed with me.
23:57tpopereally need that second irc client huh?
23:57cemerickGood luck knocking in that screw, I think was my point. :-P
23:58Raynescemerick: I can use the butt of the saw for that.
23:58RaynesI can also write a screwdriver in elisp if I want.
23:58cemerickDamn, I just knew you were going to say that.
23:58Raynes*shrug*
23:58cemerickYou're not going to write Dr. Racket in elisp. Sorry.
23:58bbloomsee what happens tpope? you show up in here, making everyones lives better, and none of us can resist an editor war. it's terrible.
23:58bbloom:-P
23:58RaynesI said I'd write a screwdriver, sir.
23:58cemerickAnyway, my broader point was, best tool for the job, etc.
23:58vsyncgnu emacs lisp or xemacs lisp? ;)
23:58tpopeeditor warmongerer
23:59rbxbxbbloom but who knew that war would be between Dr. Racket and Eclipse!
23:59cemerickM-x replicator "screwdriver, philips, 6" long, 1/4" wide head"
23:59rbxbx... er, I guess it's emacs now.
23:59bbloomrbxbx: us clojurians are ahead of the curve, even on irc flame wars
23:59vsynchttp://anglicancontinuum.blogspot.com/2008/04/die-heretic-scum.html