#clojure logs

2012-03-29

00:00autodidakto(TL;DR, get Clojure Programming and Programming Clojure 2nd when they come out within a month, then do Joy of Clojure)
00:00mbriggsyeah
00:00mbriggsi would agree with that
00:01autodidaktomethodmissin: Oh! I know something you can have fun with -> https://github.com/ibdknox/live-cljs
00:02autodidaktocljs implementation of the game editor in "inventing on principle talk". git clone, and lein run it and open chrome
00:03autodidaktogotta run. was fun doodling the wednesday away in IRC :)
00:03methodmissinautodidakto, I love that talk! I'll check it out, thanks. For now, though, goodnight :)
00:03muhooi made this thing, but it feels stupid to me: https://refheap.com/paste/1474
00:04muhoosure, it works, but seems... ugly
00:04muhooi have a feeling amalloy will show me how it could be done in one line :-)
00:08brehautmuhoo: how is num ever going to not be a seq?
00:09muhoowhen it's nil
00:09brehauthuh. so it is
00:09brehautmuhoo: however, (first nil) is nil
00:09brehauti think
00:09brehaut,(first nil)
00:10clojurebotnil
00:10muhoooh, when it's a num
00:10muhoo,(first 1)
00:10clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
00:10muhoosee
00:10muhooso in the recur, it's sent a num
00:10muhoohmm, i guess i could send it [num] instead
00:11brehautoh huh. i dont think ive ever recured on a vararg function
00:11brehautstupid java varargs
00:11technomancybrehaut: recur with varargs is weird even without java's weirdness
00:12brehauttechnomancy: maybe thats why ive never tried it ;)
00:13muhoowell weird is my middle name
00:13muhooi tried it with the multiple arity form of defn, but it involved repeating code, which was even uglier
00:14brehautmuhoo: can you explain what this function does? (eg, inputs and outputs)
00:14muhoooh, it just generates unique names
00:14brehaut(comp name gensym) ?
00:15muhooso if i give it (gen-unique #{"fubar"} "fubar"), it gives me "fubar1"
00:15muhoono, unique as in, the user gives it a username, that username is taken, it gives them "username1" instead
00:16brehautoh right
00:16muhoovery pedestrian stuff :-)
00:16brehautand your using varargs for a single optional argument?
00:17muhooright
00:17muhoois there a better way to have a single optional argument?
00:18brehauti tend to do (fn f ([a b] (f a b ni)) ([a b c] …))
00:18brehaut(or some other sensible default in the n-1 args form)
00:19muhooi like that approach. but when i tried it, i ended up with duplicated code in the [a b] and [a b c] bodies
00:19brehaut,(or nil 0)
00:19clojurebot0
00:19muhooooh, nice
00:19brehaut,(or 1 0)
00:19clojurebot1
00:19brehauttheres only two falsy values in clojure: nil and false
00:19brehautmuhoo: right, so just dont duplicate the code ;)
00:26brehaut,(re-pattern (str #"^" "foo" #"(\d*)$"))
00:26clojurebot#"^foo(\d*)$"
00:27brehaut,(map second (keep (partial re-find (re-pattern (str #"^" "foo" #"(\d*)$"))) ["a" "foo" "b" "foo23"]))
00:27clojurebot("" "23")
00:35technomancyaperiodic: do you remember who was in the rogue vim group for the swarm coding session?
00:35technomancythey said they were adapting the bootstrap script for vim
00:36aperiodictechnomancy: no idea, unfortunately. i came in too late.
00:36aperiodicwhat does the bootstrap script do?
00:36technomancyjust gets all the necessary dotfiles and keys set up on a fresh account
00:37brehautmuhoo: https://refheap.com/paste/1477
00:37Lajlatechnomancy,
00:38brehautmuhoo: its still a bit larger than it needs to be, but at least its a bit more declarative
00:38LajlaWhat's with the (symbol "string whose characters do not make up a valid symbol") stuff
00:38muhoobrehaut: now i have two problems :-)
00:38brehautmuhoo: (and i dont think it covers the case of the name not being in the set)
00:39muhooit's very cool though, thanks
00:39brehautim sure someone could come up with a cleaner way to do the keep and then map
00:42brehautmuhoo: infact https://refheap.com/paste/1478
00:43muhoonow it's shorter than mine :-)
00:43brehautless crashy too ;)
00:44brehaut(than my previous attempt0
00:44brehauti need to sign up to this refheap thing so that i can edit these pastes
00:44muhooand uses regexp instead of recur. interesting.
00:44brehautive got to cook dinner now
00:44muhoothanks!
00:44muhoobrehaut: that's a whole new way of looking at it. i learned a lot, thanks
03:07kralmorning
03:46Raynes$(Character/toUpper \é)
03:46Raynes&(Character/toUpper \é)
03:46lazybotjava.lang.IllegalArgumentException: No matching method: toUpper
03:46Raynes&(Character/toUpperCase \é)
03:46lazybot⇒ \É
04:31_andrew_k$(Character/toUpperCase \й)
04:31_andrew_k$(Character/toUpperCase \ъ)
04:32_andrew_k&(Character/toUpperCase \й)
04:32lazybot⇒ \Й
04:32_andrew_k&(Character/toUpperCase \ъ)
04:32lazybot⇒ \Ъ
04:33_andrew_k&(Character/toUpperCase \어)
04:33lazybot⇒ \어
04:35progooh man
05:01stirfoo(nth (subvec [:??? 1 2] 1) -1) ; bug?
05:03clgv(nth (subvec [:??? 1 2] 1) -1)&
05:03clgv&(nth (subvec [:??? 1 2] 1) -1)
05:03lazybot⇒ :???
05:04clgv&(nth (subvec [:??? 1 2] 1) -10)
05:04lazybotjava.lang.IndexOutOfBoundsException
05:04clgv&(nth (subvec [:??? 1 2] 1) -2)
05:04lazybotjava.lang.IndexOutOfBoundsException
05:05clgvstirfoo: I'd vote for bug
05:05stirfooI would say it's ok, but it's not consistent, you can access beyond the upper bound of the subvec. assoc gives funky behavior on subvec's too.
05:05stirfoo*can't access beyond the upper bound
05:06alexyakushev&(doc subvec)
05:06lazybot⇒ "([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done."
05:06clgv&(nth (subvec [:? 1 2 :??] 1 2) 2)
05:06lazybotjava.lang.IndexOutOfBoundsException
05:06clgv&(nth (subvec [:? 1 2 :??] 1 2) 1)
05:06lazybotjava.lang.IndexOutOfBoundsException
05:06clgv&(nth (subvec [:? 1 2 :??] 1 3) 1)
05:06lazybot⇒ 2
05:06clgv&(nth (subvec [:? 1 2 :??] 1 3) 2)
05:06lazybotjava.lang.IndexOutOfBoundsException
05:06alexyakushevclgv: "This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done."
05:06stirfooThat's a hell of fast way to nice way to to a sub vector though.
05:06stirfoowhat alexyakushev said ;)
05:07clgvalexyakushev: yeah but that -1 behaviour should also be avoidable in O(1) ;)
05:07stirfooI'm not sure if it is a bug but I thought I'd mention it here where a few devs hang out.
05:07clgvstirfoo: if you can report it as a bug. It's definitely no feature ;)
05:07alexyakushevclgv: you mean to put additional warts on the input argument to nth?
05:08clgvalexyakushev: no on the class implementing the subvec
05:09stirfooit's in the bounds test: if (start + i > end) throw...
05:09stirfooit's only checking the upper bound
05:10clgvhere: https://github.com/clojure/clojure/blob/612fba9159c6986cf875f97e086337f24a5ea3d8/src/jvm/clojure/lang/APersistentVector.java#L524
05:10clgvstirfoo: report it if you can. btw: can everyone create a clojure jira account for reporting?
05:11stirfooclgv: I have no idea, I looked into before on another bug but gave up.
05:11clgvstirfoo: well there is still the google group
05:12stirfoothe dev group? that's invite only, no?
05:12clgvstirfoo: I think the normal will be sufficient
05:12stirfooah
05:18stirfooposted
05:25GeoffSKhas anyone used clojure to talk to riak?
05:26clgvstirfoo: is it already visible on the group? I dont see it yet ;)
05:26stirfoohas to be approved
05:27clgvah ok. that list is moderated?
05:27stirfooI don't use groups much at all any more, might be because it's my first post there.
05:28stirfooI'm sure someone will handle it if it's actaully a bug.
05:41zamateriangeoffeg, I have
05:41zamaterianGeoffSK, I have used riak
05:42zamaterianGeoffSK, https://github.com/reiddraper/sumo
05:42GeoffSKdoes it work with the latest riak client jar?
05:46zamaterianGeoffSK, it uses 1.0.3,
05:47GeoffSKyep, it looks (so far) easier then clj-riak
05:48zamaterianGeoffSK, reiddraper is a basho employee - so its maintained :-)
05:49GeoffSKoh, nice.
05:51rdsrhow do I fetch "test-jars" with lein. By test-jars I mean the ones we specify as "<type>test-jar<type>" under the <dependency> tag in maven...
05:53GeoffSKthanks zamaterian - worked well.
05:56lyttonCheck your private channnels zamaterian :)
06:09clgvstirfoo: :)
06:13_andrew_k&(Long/toBinaryString 1)
06:13lazybot⇒ "1"
06:13_andrew_k&(Long/toBinaryString -1)
06:13lazybot⇒ "1111111111111111111111111111111111111111111111111111111111111111"
06:16lyttonser=> (Long/toBinaryString -5)
06:16lytton"1111111111111111111111111111111111111111111111111111111111111011"
06:16lyttonuser=> (Long/toBinaryString -5)
06:36clgv_andrew_k: lytton: what is the issue?
06:38lyttonmy guess is that it was a ex in two's complement in binary form
06:51zamaterianlytton, how goes
06:55_andrew_ki wanted to check bits and it was closest repl i had )
07:03zamaterianfrankvilhelmsen, enjoy my day off :-)
07:08zamaterianfrankvilhelmsen, :-) i'm one my out in the sun
08:08makkalotHi everyone, i'm reading some stuff about refs, what is not clear to me is the reader part of the model. I understand if you have shared data to modify you put it in a transaction,but what does reader part see ?
08:10makkalotFor example suppose i have a mutual list and some threads modify it. My reader part prints the list to screen, what happens when i start printing it and in the middle of the print action some other thread changes it in some transaction ?
08:13samaaronmakkalot: so the first thing to grok is that your vector is immutable
08:13samaaronso it can't be changed by any threads
08:15makkalotsamaaron, so when i do (println myvect) there is no way someone to change it implicitly ? when i get its reference i got its snapshot ?
08:15samaaronexactly
08:15samaaronthe only thing that changes is the ref - not the vector
08:16samaarononce you dereference a ref, you have an immutable value that will never change
08:16samaaron(unless of course you stored a mutable thing in there like a standard Java object)
08:17makkalotsamaaron, ah it is clear now, thanks
08:20samaaronmakkalot: have you seen this talk: http://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickeyhttp://www.infoq.com/presentations/Are-We-There-Yet-Rich-Hickey
08:21samaaronif not, it's definitely worth watching
08:21makkalotsamaaron, thanks will watch it
08:24alexyakushevCould anyone tell me how to call String.format function from Clojure?
08:24alexyakushev,(String/format "%s is bar" "foo")
08:24clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;>
08:24alexyakushevI know that I can use format, but I'm interested in getting around the particurlar set of issues
08:26samaaronalexyakushev: use #'format
08:26samaaron,(format "%d green bottles" 10)
08:26clojurebot"10 green bottles"
08:27alexyakushevsamaaron: yes, I am aware of format
08:28samaaronso what's the issue?
08:28alexyakushevI'm interested whether there is any mechanism in Clojure to force the certain overloaded method to be called
08:28samaaronarity
08:28alexyakushevAnd if the arity is the same for both?
08:29alexyakushevtake a look at the two definitions so you see what I'm talking about:
08:29alexyakushevstatic String format(Locale l, String format, Object... args)
08:29samaaroncan you have two methods in Java with the same arity and different signatures?
08:29alexyakushevstatic String format(String format, Object... args)
08:29samaaronso, they have different arities
08:30samaaronthe first takes a Local, a String and an Array
08:30samaaronthe second takes a String and an Array
08:30alexyakushevWell, not actually. They both have variadic arities
08:32samaaronalexyakushev: that's probably only in the Java syntax, not the JVM semantics
08:33samaaronjust take a look at the implementation of #'format and you'll see what I mean
08:33samaaron:-)
08:34samaaronRick Ceme!
08:37samaaronSid Eriss!
08:37samaaronDue Yjim!
08:38alexyakushevsamaaron: Thank you. Type hints are the answer, I supposed something like that
08:38alexyakushevBut...
08:38alexyakushev,(let [^String formstr "%s is bar"] (String/format formstr "foo"))
08:38clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;>
08:39samaaron,(String/format "%d green bottles" (to-array [10]))
08:39clojurebot"10 green bottles"
08:40samaaronit's not a type hint thing
08:40alexyakushevah, the to-array thing
08:40samaaronthe method signature is String, Array
08:40samaaronat least from the Clojure side
08:41alexyakushevThanks again for help
08:41alexyakushevSorry, my bad
08:41fdaoudAron Sama!
08:43samaaronfdaoud: your vowels and consonants aren't evenly distributed
08:43samaaronDa Oudf!
08:44fdaoud:-)
08:44samaaronalexyakushev: you're very welcome :-)
08:44fdaoud,(sort "fdaoud")
08:44clojurebot(\a \d \d \f \o ...)
08:45fdaoud,(apply str (sort "fdaoud"))
08:45clojurebot"addfou"
08:45samaaron:-)
08:45fdaoud,(apply str (sort "samaaron"))
08:45clojurebot"aaamnors"
08:45ssideris_almost "add foo"
08:45samaaronDa Food!
08:45fdaoudssideris_: yeh :D
08:45jimdueysamaaron: How goes The Reasoned Schemer?
08:46samaaronjimduey: I'm only on page 20
08:46samaaronbut it's been amazing so far
08:46fdaoudah I still have to read the Seasoned
08:46samaaronjimduey: dnolen pointed me to your recent blog post - looks like crazy cool work
08:46jimdueyThanks.
08:47fdaoudthis one? http://www.clojure.net/2012/03/24/Continuation-monad/
08:47jimdueyTRS is pretty mind bending. I couldn't understand it until I actually implemented it.
08:47jimdueyfdaoud: The next one.
08:47samaaronI must say, I still haven't managed to get my head around monads
08:48samaaronThat "aha" moment is waiting for me in the future
08:48jimdueysamaaron: Feel free to ping me if you're stuck on anything in particular.
08:48fdaoudjimduey: I see, thanks.
08:48ssideris_my main question about monads is: what's the benefit?
08:48samaaronjimduey: that might be helpful - I'll try working through your posts again
08:49jimdueyOnce you get the "aha" you'll be like "Is that all there is?" :)
08:49samaaronssideris_: from what I can perceive, making code more readable for DSLs is a big benefit in Clojure
08:49fdaoudjimduey: so far almost everything I've read that you have written has made my brain hurt.
08:50jimdueyssideris_: Because they're cool! Actually, my last post tells how thinking in DSL's helped me make core.logic multi-threaded.
08:50samaaronAlso, jimduey's latest post implied that monads helped him reason about something super complex
08:50sthuebnera friend told me, Clojure is not the right language to learn Monads. Haskells types would help the beginner to understand easier, what Monads are.
08:50jimdueyfdaoud: :) That was how I felt when I was trying to get a handle on monads the first time.
08:51jimdueysthuebner: Probably true. But I didn't want to have to learn the Haskell syntax, so I learned just enough to read papers.
08:51fdaoudjimduey: right. I'm still trying to "get" monads. I know there is something very cool in there, but I haven't "aha"'d yet.
08:51ssideris_ok, thanks. I started reading about monads, but I couldn't see the motivation (the motivation for making my brain hurt, as fdaoud mentioned)
08:51ferdsorry to interrupt the monad philosophy talk... Anybody managed to make Cobertura (code-coverage tool) work with Clojure?
08:52sthuebneryeah, learning Haskell would too much, I think, just to get my head around Monads
08:52ssideris_jimduey: in fact, I was reading *your* blog posts last night
08:53ferdjimduey: I'm feel I'm getting closer to the "aha" moment thanks to your posts
08:53bulters`w
08:53jimdueyferd: Good to hear.
08:53bulterswhu, there goes my lurking
08:53ssideris_thanks, they're great, but it's a very tricky subject anyway
08:54fdaoudjimduey: Ideally I need to see a piece of code in its "before" state, probably something with an ugly bunch of if's and so on, and then in its "after" state, all cleaned up and much nicer looking thanks to monads.
08:54jimdueyssideris_: Let me know if you need a hand getting over a particular hump.
08:55jimdueyfdaoud: That's kind of what I was trying to do in showing how DSL's can often be written easily using monads.
08:55ssideris_jimduey: thanks, much appreciated
08:55samaaronjimduey: sorry to be an apostrophe-fiend but it's DSLs not DSL's :-)
08:56jimdueyTo me, the core.logic fork/join work was pretty compelling.
08:56samaaronalthough i understand it's me that should stop whincing with misplaced apostrophes rather than people misplacing them
08:56jimdueysamaaron: :) I'll correct my usage immediately.
08:57samaaronunless you're talking about the properties of a specific DSL, then it's this DSL's properties
08:57jimdueySo you can save your whincing for other things.
08:57samaaron:-)
08:57fdaoudsamaaron: I understand how you feel. Its something that let's me get upset sometimes as well ;)
08:57samaaronhaha - you just did it too!
08:58samaaronit's lets not let's
08:58samaaron:-)
08:58fdaoudum, both were on purpose :)
08:58samaaronargh!
08:58samaaronDa Food!
08:59samaaronDa Foud!
08:59fdaoudthe Its was wrong too
08:59samaaronyeah, i noticed on a re-look
08:59samaaronit always got me when people were talking about Rails
08:59ssideris_samaaron: there is something way more annoying
09:00fdaouddon't "loose" your mind over it-- there's another mistake that keeps coming up.
09:00[[ssideris]<- this
09:01fdaoudsamaaron: don't "loose" your mind over it-- there's another mistake that keeps coming up.
09:01samaaronhaha, i just this moment got some recruitment spam:
09:01samaaron"I have a position in Central London that I think may interest you. It would be heading up a team of RoR Developer’s with the view..."
09:01fdaoudhaha
09:02fdaoudlet's the good time rolls!
09:02samaaron:-)
09:24tacomanI installed leiningen via the bootstrap script on Ubuntu 11.10, but I'm getting a "could not find the main class: clojure.main" error on attempts to run lein swank (full trace at http://pastebin.com/DSiUxdS9); is it not finding Clojure itself? I have 1.1, 1.2, and 1.3 all installed
09:25tacoman1.1 and 1.2 through the package manager, 1.3 by downloading it and placing it where it would go if it had been installed via package manager (not the best approach I now realize, but this install only has another month to live anyway)
09:36alexyakushevDo you have swank plugin installed?
09:36alexyakushevz
11:10lynaghk`ping: jonasen
11:21jonasenlynaghk`: yes?
11:22lynaghk`jonasen: what's the story with the new rules format?
11:23jonasenwhat do you mean? If we're going to use it in kibit?
11:23lynaghk`jonasen: do you think that will be integrated into kibit? What needs to be done before that can happen, and what (if anything) would you like my help on?
11:23jonasendoes it do what you want?
11:23lynaghk`Yes, I think it's the most general solution that's appropriate for Kibit
11:24lynaghk`since you can throw around anything that'll work with core.logic; not just forms that can be unified-with.
11:24jonasenI think so too. I've been working on some macros to get the rules to look nicer...
11:25lynaghk`jonasen: ok, great. I was thinking about doing the same thing.
11:26jonasenlynaghk`: I'd be very interested in what you could come up with.
11:26lynaghk`jonasen: for basic matching what is the most appropriate core.logic goal that I should be using? E.g., to match (symbol ?x . ?rest) you'd expand into...matche?
11:27lynaghk`jonasen: I'll give it a shot this weekend; I'm actually sitting down to start porting big pieces of C2 to "cljx" this morning.
11:28jonasenlynaghk`: I saw you struggled with metadata and core.logic
11:28lynaghk`jonasen: but won = )
11:28jonasenI think the struggle continues with clojure.walk :(
11:28lynaghk`that it was silently eating metadata didn't help build my learning-logic-programming confidence though.
11:29lynaghk`jonasen: ohhhh. I'm only dealing with toplevel forms right now, but I wouldn't be surprised if core.walk was using some fn that didn't preserve metadata.
11:30jonasenlynaghk`: But if it turns out to be a problem we can always write our own prewalk. It's just a few lines anyway
11:32lynaghk`jonasen: yep. Okay, well I'm going to dig into translating C2, which is a decently sized codebase. That should inform any more modifications to kibit (which I don't anticipate) and the kind of rules that could use tidying up via macros.
11:34jonasenI think you can count on the new rule system. I'll include it in master when I've got some macros I'm happy with, but it should alway be possible to fall back on "raw" rules.
11:36lynaghk`jonasen: okay, rad. Have a great day.
12:35dnolenCLJS PersistentVectors are looking good
12:36bobzhang1988hi all, just read the source, what does fn* mean? I googled, but found nothing
12:37jimdueydnolen: Realized last night how I could aggregate fork/join tasks to reduce the overhead in core.logic.
12:38dnolenjimduey: excellent! I was pondering that myself today :)
12:38dnolenbobzhang1988: it's a special form - the primitive function constructor
12:39bobzhang1988dnolen: can you give me a link? Yes, I guess it's a special form
12:39jimdueyPretty simple really, just don't fork at every level of the search tree. Only fork every other, every third or somethig.
12:39jimdueyAlso, don't fork on every clause in a conde. Group them in pairs or triples.
12:39dnolenjimduey: have you given this a go yet?
12:40jimdueyNah, I've kind of moved on to something else. Looking at arrows and also writing a java bytecode->x86 compiler in Clojure.
12:40dnolenjimduey: nice :)
12:41jimdueyAnd maybe a state machine DSL for writing distributed apps sparked by this: http://blog.incubaid.com/2012/03/28/the-game-of-distributed-systems-programming-which-level-are-you/
12:41jimdueyOverwhelmed by too many interesting things to work on. :)
12:43dnolenjimduey: definitely. Thanks for doing the the fork-join core.logic - definitely a good starting point for taking it further.
12:46jimdueyAnother interesting thing to look at would be distributing core.logic programs over a cluster. Should be pretty easy to do.
12:47jimdueyThen you could have a database sharded and do some cool queries, I think. For example.
12:47dnolenjimduey: definitely! I also like the generality of your solution. There's talk of task parallelism in the browser - would be easy to make your mods work in CLJS if/when that happens.
12:48jimdueyYeah, that would be cool. In the back of my mind I'm curious if I didn't miss something that makes the whole approach unusable. I'm too close to the code now to see it if there was.
12:48dnolenjimduey: how do you mean?
12:49jimdueyDon't know. It's those dang unknowns that bite you. :)
12:49dnolenjimduey: you said most of the tests pass right? :)
12:49jimdueyYeah. :) So I'm not too worried about it.
12:59dsabaninhi guys
12:59dsabaninI have a possibly stupid java+clojure question
12:59dsabaninI never used java for anything real
13:00dsabaninmy problem is: I call a factory and get back an instance of the Blah class. That class is a subclass of an abstract class Meh (Blah extends Meh). However, instance of class Blah is missing the methods from class Meh
13:01dsabaninI'm using highly popular java library so I think there's something wrong with my code or I'm doing clojure/java interop incorrectly
13:02fdaouddsabanin: which library, if you may tell?
13:02dsabaninsvnkit.com
13:03fdaouddsabanin: so how are you trying to invoke a method on a Blah object?
13:05dsabaninhere's some code: http://pastie.org/3692894
13:05dsabaninactually, that's my whole code :)
13:05dnolennice, CLJS PersistentVectors are nearly 100X faster to use then Vector
13:06TimMcthan which Vector? Java's Vector?
13:06TimMcthe old CLJS impl?
13:07dnolenTimMc: old CLJS impl
13:07TimMc(I guess that's the only one it makes sense to compare against...)
13:08fdaouddsabanin: it looks like it's the other way around. You're getting a Meh class back and are trying to call a method only defined in Blah.
13:09dsabaninfdaoud, but if "FSRepository extends SVNRepository", that means that FSRepository should have SVNRepository's methods, right?
13:10sattvikdsabanin: Actually, I think it's just a matter of the arguments being wrong…
13:10dsabaninI checked the list of methods on the FSRepository instance I get, and it's missing "log" method at all
13:10dsabaninit has logImpl (which is used in log method implementation in SVNRepository)
13:11dsabaninsattvik, or are you talking about some other arguments?
13:11fdaouddsabanin: that's right. but SVNRepository does not have a log method. And, from what I can tell from the Javadocs, it doesn't look like FSRepository has a log method, either. Where do you see this log method?
13:11dsabaninI'm looking here http://svn.svnkit.com/repos/svnkit/tags/1.3.7/svnkit/src/main/java/org/tmatesoft/svn/core/io/SVNRepository.java
13:11dsabaninsearch by "public long log"
13:12dsabaninalso here: http://svnkit.com/javadoc/org/tmatesoft/svn/core/io/SVNRepository.html#log(java.lang.String[],%20java.util.Collection,%20long,%20long,%20boolean,%20boolean)
13:13dsabaninand I checked the source java code for the version of svnkit I'm using, and it has that method too
13:14fdaouddsabanin: if you don't see the log method by inspection at runtime, maybe it's a classpath issue? you have a different version on the classpath?
13:15dsabaninI use leiningen, and I see jar with proper version in the lib/
13:16dsabaninI don't use any custom classpaths (don't know how yet :)
13:16technomancybest to keep it that way
13:16sattvikdsabanin: Have you tried into-arry instead of to-array. The latter gets an Object[], not a String[].
13:16gtrakcemerick, what is this I hear about emacs-ifying eclipse?
13:17cemerickgtrak: just noodling on some things
13:17dsabaninsattvik, you did it!!
13:17dsabaninthank you :)
13:17fdaouddsabanin: just trying to think of what it could possibly be,the problem.. probably sattvik is right, it has to do with types of args
13:18dsabaninso is it possible to not see the method in the list and yet the method will still be there?
13:18dsabanindoes it not show you the methods of ancestors?
13:18sattvikdsabanin: No problem.
13:18gtrakcemerick, it sure sounds really exciting :-)
13:18gtrak I use the emacs+ plugin myself for java work
13:22dsabaninfdaoud, thanks for your help too!
13:23fdaouddsabanin: you're very welcome
13:25dnolenCLJS PersistentVectors have landed, https://github.com/clojure/clojurescript/commit/e615f4cd326e7c608050272c64c4dfaff9a34689
13:26RickInGAvery cool
13:27ibdknoxdnolen: what were the numbers on that?
13:27dnolenibdknox: insanely faster all around, http://jsperf.com/persistentvector-norecur-js/11
13:27dnolenibdknox: those tiny bars are Vector
13:28ibdknoxnice! :D
13:29dnolenibdknox: notice how fast the handwritten PersistentVector.js is on Chrome, something to look forward to when we get more compiler optimizations in :D
13:30ibdknoxdnolen: yeah, what a big difference :) definitely room for awesomeness there.
13:30dnolenibdknox: I think in 6-7 months we can look forward to all around good performance from CLJS.
13:31dnolenibdknox: PersistentHashMap is another big one to do.
13:31ibdknoxI like that outlook.
13:31ibdknoxhehe
13:32gfrederickswhere's the hippest library with a -?>> macro?
13:32ibdknoxcore.incubator might have that one
13:33gfredericksibdknox: looks like it does; thx
13:38cemerickgtrak: that's probably just keybindings though?
13:39gtrakcemerick, keybindings, and it does M-x stuff as well, but not the full experience of course
13:39cemerickright; I'm not concerned with UI
13:39cemerickIMO, that's solidly part of "the rest" of emacs :-)
13:40gtrakso, like an emacs backend for eclipse? could you hook up emacs to it?
13:40cemerickIt's far more important to be able to interactively extend and modify the environment from userland, and do it in Clojure
13:40cemerickno, no unholy unions ;-)
13:41gtrakneat though, I suppose if you're writing clojure you may be in emacs anyway, so there's that :-)
13:41gtrakrepl-driven java refactoring?
13:43cemerickI'm never in emacs; I was talking more about adding the easy runtime-modifiability of emacs to eclipse / counterclockwise.
13:43gtrakvery cool
13:43jimdueyI would love an editor I could program in Clojure that had VIM keybindings and a repl that understood more than just text.
13:44Iceland_jackjimduey: viper?
13:44jimdueyBonus points if it ran in a browser and multiple people could connect to the same session.
13:44Iceland_jackEditor in a browser?
13:44cemerickjimduey: vimclipse + ccw + future magic sauce, perhaps.
13:44Iceland_jackYou can use one of many terminal multiplexers that support shared sessions
13:44jimdueyIceland_jack: I might have to look at viper in the future.
13:45jimdueycemerick: yet another thing on my todo list. :)
13:45Iceland_jackI believe Emacs offers some multi-user support but I just use GNU Screen
13:45cemerickbah, it's eclim, not vimclipse :-P
13:45jimdueyIceland_jack: Yeah, I've used tmux and emacs to great effect when pairing.
13:46technomancymulti-user emacs doesn't work unless you have nearly zero latency
13:46technomancyconcurrency =(
13:46gtrakideally, you would want to share buffers but not keyboard control, right?
13:46Iceland_jackgtrak: yes
13:46cemerickjimduey: BTW, I really appreciate the work you've been doing with monads, as well as the f/j core.logic stuff.
13:46Iceland_jackcreate an Emacs server, connect to it using two Emacs clients from different screen sessions
13:47jimdueycemerick: thanks. It's been fun to have something to talk about.
13:47ibdknoxjimduey: GSOC might start to get you exactly that this summer
13:47RickInGAtechnomancy: you talked about emacs and vim for swarm coding. do you think it is feasable to do swarm coding with eclipse?
13:47jimdueyibdknox: Cool!
13:47technomancyRickInGA: if you have a very fast local network and/or a high tolerance for latency, maybe
13:48RickInGAtechnomancy: translation, don't count on it :)
13:48TimMcI've seen multi-user Eclipse.
13:48TimMcIt communicates over XMPP.
13:48technomancywell, I don't think swarm-coding would work nearly as well if you had to install a bunch of stuff on every machine
13:49technomancyit works because all you need is a terminal emulator and an SSH client; otherwise you've got That Guy holding up the whole group because he's got the wrong version of something or other
13:50technomancyat least for a user group. maybe in other contexts (inside a company or during a workshop session where folks are prepped) it wouldn't be as big of a deal.
13:51simardI read in JoC that you shouldn't use clojure.lang.PersistentQueue accross threads, why ?
13:55raeksimard: it works perfectly fine with multiple threads (since it's persistent), but there are more effecient ways of implementing work queues
13:55simardpersistent == immutable ?
13:55Bronsano
13:55mksimard: sort of, and a few other things
13:56simardso, no, and sort of :)
13:56mklike same-performance guarantees
13:56Bronsawell, it was a "not only" :)
13:56gtrakI thought persistent is just about performance
13:56raeksimard: normally you'd use something like this for work queues: http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/BlockingQueue.html
13:56Bronsait means also that they do structural sharing
13:57gtrakah, I suppose I was wrong, then it's redundant to say persistent immutable data structures as folks do
13:57raekmy assumption was that persistent implies immutable
13:57TimMcit does
13:57Bronsai guess so
13:58mkI guess it's just extra-immutable, in that the performance isn't supposed to change either
13:59mkwasn't there a structure in clojure that works as a blockingqueue?
13:59eggsbyHola #clojure, I had a quick question about load-file vs. (eval (read-string ..)). If I were to use the read-string method, Assuming what I'm reading is a clojure data structure, how would I read in more than one def from a file?
14:00Bronsaclojure.lang.PersistentQueue maybe?
14:00ibdknoxeggsby: wrap it in (do .. )
14:00simardas for the BlockingQueue, why is it more efficient than PersistentQueue ?
14:01eggsbyibdknox: I'm new to clojure, I understand the do construct, but how would I loop over each def in the file?
14:02ibdknoxyou wouldn't have to if you did (eval (read-string (str "(do " some-str ")")))
14:02ibdknoxyou're turning it into one form that way
14:02mksimard: it's not immutable, but it's not broken when it comes to threading
14:03mk(is my guess)
14:03raeksimard: you can't really compare their performance because they do different things
14:04mkI was thinking of something more like what seque uses?
14:04eggsbyoh interesting ibdknox
14:04raeka BlockingQueue does thread synchronization (so that threads can wat for each other) and maintains state
14:05eggsbythank you, I will try that
14:05raeka persistent queue is stateless, so to have something that changes over time you need a reference primitive too
14:06simardOk, I have two threads, I want to send immutable objects (say strings) between them (bidirectionaly), and asynchronously. What's the best data structure in that case ?
14:06raekmaybe you could say that a persistent queue wrapped in an atom is comparable to a blocking queue
14:06simardraek: that's what I use at the moment
14:06raekbut the atom lacks blocking features
14:06mkraek: well, it abstracts much of that away, since you can treat it as a simple function (since it blocks), and to add things to the queue is a lot like using an agent
14:07simardand I don't need to block.
14:07mksimard: could you explain the bidirectionality?
14:07simardso I guess a persistent queue wrapped in an atom is what I needed after all.
14:07raeksimard: what do you want to do when you try to pop when the queue is empty?
14:07simardmk: well, I'll just use two queues.
14:08simardbasically, one thread reads, the other writes, and I'll have two such queues, one each way.
14:08mksimard: are you talking about return values? do you want two server-like things?
14:08simardraek: go on doing something else, and peek later.
14:08raekI guess you could use both approaches
14:08clojurebotExcuse me?
14:09raekif any of the threads need to way for a value, then blocking queue is a better fit
14:09simardmk: hum no there would not be request/reply, but I guess it COULD happen sometimes (that would be an exception)
14:10mksimard: it might help if you give a bit of a broader picture
14:10raekor if you are thinking of implementing an infinite loop that polls for values
14:10autodidaktoibdknox: thanks for noir, btw. I'm messing with it now, trying to get my head around it (coming from a sinatra/padrino/rails perspective)
14:11raekthe biggest difference between the approaches is how the reading end behaves, I think
14:11simardok I have an opengl rendering loop (thread 1), and some clojure sandbox (thread 2). thread 1 sends commands to thread 2, thread 2 sends results back. Note that thread 1 could send events to thread 2 (that do not require a reply from thread 2).
14:12simardthe opengl thread must not be blocked by a long operation of thread 2.
14:12mkdo you mean that the sandboxT2 sends commands to the renderT1?
14:12raekwhat does thread 2 do while the queue is empty?
14:13raekyou can also use thread pools through executors
14:13mkI'd guess that it renders more frames
14:13simardraek: sleep ?
14:13raekso it's blockgin, then?
14:14ibdknoxautodidakto: you're quite welcome :)
14:14raekor do you alternate between pop and Thread/sleep?
14:14simardraek: hum actually no it doesn't sleep, it could do some other jobs.
14:14eggsbythank you ibdknox I was able to solve my problem :)
14:14simardbut I guess the thread could be awoken by some message from that queue.
14:14raekre. executors: http://blog.raek.se/2011/01/24/executors-in-clojure/
14:15fdaoudibdknox: so much for hiding from the fans ;)
14:15ibdknoxsrsly
14:15ibdknoxhaha
14:16mksimard: what does the sandbox do?
14:17gtrakanyone, any thoughts on what's useful to say about clojure(script) to normal js/ruby who haven't heard or considered clojure?
14:18simardbasically the idea is to allow the player to script his own actions, and perform some tasks based on timers etc.
14:18gtraknormal js/ruby web dev guys*
14:19simardmk: you could, say (defn jump-twice [] (jump) (jump)) in the sandbox, then bind that function to a keypress. thread1 (UI/GL) would send keypress events to the sandbox, sandbox would reply asynchronously by sending two strings "jump" "jump".
14:19gtrak"it's a lisp on the jvm" is not persuasive :-)
14:19mkgtrak: you can recite the usual 4 things, which are immutability, lispyness, functions?, and... something else
14:20lynaghkgtrak: tell them Clojure is expressive and fun like Ruby, but without all of the magic. That should appeal to anyone who has had to go into a Rails project he/she didn't write.
14:20gtrakah, yea
14:20ibdknoxon the JS side, reasonable semantics
14:20ibdknoxlol
14:20mkgtrak: one big pull might be that it's really set up for multi-processor computing
14:20autodidaktogtrak: as a way to convince them to check out clojure in general? or try to replace their ruby/js frameworks?
14:20technomancy"metaprogramming you can still understand next week"
14:20lynaghktechnomancy: hells yes.
14:20autodidaktotechnomancy: lol. nice
14:20fdaoudno more "what the hell 'this' is this?"
14:20Bronsalol
14:20Wild_Catlynaghk: I wouldn't so much say "without the magic". I mean, macros *are* pretty magical.
14:21gtrakthose guys don't really get shared memory, php/ruby/python is all about launching a process per your request
14:21gtrakso concurrency means 'add another box'
14:21lynaghkWild_Cat: yes, but people in the community are wary of them much more than Ruby folks are wary, of, well, everything they do.
14:21ibdknoxWild_Cat: not really, they're just functions that take in a form and spit out a new one
14:22Wild_Catgtrak: IMO the awesome thing about Clojure is that it's a Lisp with more syntax, which makes it saner, and it has kickass STM support.
14:22ibdknoxI think the real argument is the level of abstraction you can achieve in Clojure
14:22fdaoudas RH put it, if you want syntactic sugar, clojure macros give you your own personal chocolate fudge machine!
14:22mksimard: I see. And both sides have other things to do when not waiting for the other side to do something?
14:23Wild_Catibdknox: you can also halt/resume form evaluation in macros, and rebind surrounding vars, which as a Python dev I find weird.
14:23lynaghkwild_cat: this is the best critique of ruby programming style I have ever seen: https://www.destroyallsoftware.com/blog/2011/one-base-class-to-rule-them-all
14:23simardmk: the GL side, definitely, the sandbox side, yes, maybe.
14:23Wild_Catlynaghk: note that I'm not defending Ruby programming style. I hate it because it appears to rely so much on monkeypatching.
14:24simardunless timers are dealt with from thread1 and sent as events to the sandbox
14:24gtrakwell, the main issue I found is immutability, concurrency, lisp metaprogramming are both core motivations of clojure and totally unrelatable to those guys, the 'fun like ruby but less magic' is a great one though
14:24simardin which case the sandbox could be blocking
14:24lynaghkWild_Cat: yeah, I hear you. I think I've still written more Ruby code than I have Clojure code at this point. You can probably bend Clojure to do terrible things too, but I love that the community is very much against that kind of thing.
14:24fdaoudaot straight JS, definitely that in ClojureScript I don't worry about JS weirdness lurking and just waiting to ruin my day.
14:24mksimard: on the gl side, you don't need to block. If you want to block on the sandbox side, you can have it block on a blockingqueue
14:24Wild_Catlynaghk: and I agree with that paper, although Ruby isn't my thing much. I'm a hardcore Python guy currently learning Clojure (and liking it)
14:25gtrakWild_Cat, python was my schtick before clojure, too, I haven't looked back really
14:25ibdknoxgtrak: the old you write the language you write your program in is also interesting to those folks
14:25lynaghkWild_Cat: glad to hear you're liking Clojure thus far.
14:25fdaoudWild_Cat, gtrak: Django too?
14:25Wild_Catgtrak: Python is kinda like my job, so... :p
14:25Wild_Catfdaoud: no, Pyramid.
14:25gtraki tried django to learn web dev, and got really bogged down :-)
14:25mkI've been wondering about opengl actually, because it's hard to map on to clojure's persistent collections...
14:26autodidaktoMatz: "Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people." :)
14:26Wild_Catfdaoud: although that's a recent development. I used to do embedded work with Python
14:26gtrakibdknox, i think you typo'd there?
14:26simardmk: so basicaly, two queues, both blocking, t1->t2 and t2->t1. t2 blocks on t1->t2 and sends results on t2->t1, t1 peeks t2->t1 and never blocks on it.
14:26ibdknoxleft off the quotes
14:27ibdknoxgtrak: the old "you write the language you write your program in" is also interesting to those folks
14:27gtrakah, got it
14:27eggsbydjango is fun, pyramid is better
14:27eggsby:p
14:27eggsbyI'm playing with a coworker using noir right now
14:27Wild_CatDjango is kind of a PITA if you're not using its ORM, which I strongly dislike.
14:27mksimard: one of them would be non-blocking (the one that gl reads). Presumably you'd use an atom for that
14:27autodidaktoone last quote: "Ruby is the love child of Lisp and Smalltalk, raised by Perl the eccentric nanny"
14:27fdaoudjust asking out of curiosity, because my publisher has a django book in the works now.
14:27Wild_Cat(plus, since I'm working with DynamoDB these days, I couldn't use Django's ORM even if I wanted to)
14:27eggsbyWild_Cat: it's not so different than sqlalchemy declarative, but.. ~wrong channel~
14:28Wild_Categgsby: fair enough, let's drop that :p
14:28eggsbySo, what are peoples thoughts on enlive vs hiccup?
14:28gtrakfdaoud, I went to pycon to try to get better at all that stuff, including django, but my style is to understand things thoroughly, which is harder than it looks there
14:28autodidaktoeggsby: coming from haml, both scare me.
14:29eggsbylol
14:29ibdknoxhiccup is not far from haml
14:29ibdknoxwhy does it scare you?
14:29eggsbyDo you have a reason why you prefer hiccup over enlive ibdknox ?
14:29mksimard: does the sandbox simulate the environment?
14:29technomancyenlive is more elegant, hiccup is more straightforward.
14:29ibdknoxenlive is probably the single most complicated library I've seen, which is somewhat ridiculous given what it does :)
14:30autodidaktoibdknox: going through the noir examples now... just feels really weird to see the html defined inline, i guess
14:30ibdknoxI don't necessarily prefer hiccup to anything really.
14:30eggsbyautodidakto: it makes sense if you just think of it in terms of the dom structure
14:30eggsbyah ibdknox sorry for the assumption :p
14:30ibdknoxIn talking to people these days, I usually list 3 solid solutions to templating:
14:30eggsbydom structure is just a tree, easy to represent in clojure
14:30ibdknoxhiccup, comb (erb-like), and stencil (mustache)
14:31iceyautodidakto: I felt the same way initially, but give it a go in a project or two… it ends up being really nice once you start thinking about your UI in terms of pieces that are disconnected from styling
14:31iceyautodidakto: then use CSS to push stuff around on the page / style
14:31mksimard: it sounds like you're dealing with proper-object or actor (?) communication / message passing
14:31autodidaktoicey: Thanks, I'll keep that in mind
14:31technomancyhiccup has a cooler namesake: http://tinyurl.com/y7ncrur
14:31iceyautodidakto: being able to treat your markup like everything else in clojure (data) ends up being really powerful feeling
14:32ibdknoxyeah, true composability is really nice. That coupled with the simplicity of hiccup are its main values
14:32autodidaktoibdknox: second-ing your enlive comment, i like how enlive is a templating language... and a web scraper!.... and a cold-press coffee brewer!
14:32iceyibdknox: btw, I'm checking out Korma for the first time today. It's nice, I like it :)
14:32technomancyfrom a tooling perspective, erb-like tools are a mess
14:32fdaoudicey: +1
14:33technomancyI tried to write Emacs support for ERB and had to abandon it; it is simply not worth the trouble.
14:33ibdknoxtechnomancy: sure, but some people want them *shrug*
14:33mk"also makes chili and fries"
14:33fdaoudI hate writing an app and need to switch mindsets just because I'm working on the template part
14:33technomancyibdknox: people want for loops too.
14:33ibdknoxthere are times when you need that level of complexity
14:33technomancyibdknox: times when you don't have time to do it the right way, I guess
14:33ferdfdaoud: +1 ?! come on!... it's (inc %) here ;-)
14:33autodidaktoicey: haha yeah, I was checking out noir, then korma, then live-cljs and i was like "hey wait this is that one guy in irc"
14:34ibdknoxtechnomancy: haha :p
14:34fdaoudferd: :)
14:34ibdknoxicey: glad you like it :)
14:34iceyautodidakto: afaik ibdknox is actually quadruplets who all happen to hack
14:34ibdknoxtechnomancy: in any case, I think those three cover all the bases
14:34fdaoudgit clone https://github.com/ibdknox/*everything*
14:35autodidaktofdaoud: about switching mindsets: that's how i got use to things in sinatra/rails... You program controller, you structure in html, you design in css...
14:35ibdknoxlol
14:35mkshouldn't it be (inc! username)?
14:35technomancyibdknox: I think stencil gets you the familiarity of looking erb-like without opening the door to doing stupid things you'll regret later.
14:35fdaoud{ibdnox,technomancy,weavejester,mmcgrana}
14:36ibdknoxI think the place hiccup *really* shines is on the client
14:36ibdknoxusing hiccup (via crate) in CLJS is awesome
14:36ibdknoxtechnomancy: I agree, it's my first suggestion for those looking to write html in html
14:36technomancyit's like having pure functions; it's not really about adding restrictions, it's about being able to offer guarantees about a function/template.
14:36autodidaktoibdknox: ahh, makes sense. one reason i've stayed around from client side javascript mvc stuff is the hideous templating/views..
14:37ibdknoxyeah
14:37ibdknoxthey're terrible
14:37autodidaktonot that i know what i'm talking about, but it all kind of looks like a hack the browser/javascript was never ment to do
14:37autodidakto*meant
14:38autodidaktocljs is a tempting promise of better days
14:38fdaoudautodidakto: yeah it gets a bit crazy. I'm mainly a Java guy and JSP just drives me nuts.
14:39lynaghkautodidakto: I feel the same way. I just do all of my dynamic templating with hiccup / C2.
14:40lynaghkSeeing all of the {{ }} in JS just makes me long for a better Clojure set literal synatax, anyway.
14:41autodidaktofdaoud: I don't know much about jsp. What is it that drives you nuts?
14:42autodidaktolynaghk: what's C2?
14:42ibdknoxlynaghk: lol
14:42lynaghkautodidakto: http://keminglabs.com/c2/
14:43lynaghkibdknox: (lil' kevin's first troll!)
14:43ibdknoxhaha, like I said, I think we should switch the syntax for maps ;)
14:43fdaoudautodidakto: essentially what I hinted at earlier, that you work with a solid full-featured language (Java,Clojure,whatever), then you get to the template side (which in Javaland usually means JSP) and then it's a whole different syntax, watered down features, and a ton of "oh but in JSP you can't do that.."
14:44lynaghkibdknox: actually, I do all of my clojure programming with inline JSON literals = P
14:44autodidaktolynaghk: cool thanks
14:45scriptorhey guys, so I'm tinkering with a clojure->php thing right now
14:45ibdknoxoh god
14:45ibdknoxlol
14:45ibdknoxthat's scary :p
14:45autodidaktofdaoud: well said. It's like you leave the power and world of the language, and enter into a not-quite-right dsl-disconnect
14:45scriptorgot a question on how you guys suggest how to tag whether an expression should be used as an expression or a statement
14:46autodidaktofdaoud: or at least that's how I feel when I do rails stuff
14:46chouserscriptor: are you trying to generate idiomatic php? or something that has clojure symantics?
14:46scriptor(for example, an if expression that's just by itself is compiled as a statement, one embedded in a function call needs to be an expression)
14:46scriptorchouser: clojure semantics, preferably
14:47scriptorat best the php should be readable, but doesn't have to be idiomatic
14:47chouserscriptor: ah. Well, the Clojure analyzer (but not the cljs one) figures this out
14:47ibdknoxscriptor: are you starting from the ClojureScript ocmpiler?
14:47scriptoribdknox: nope
14:47scriptorI looked through the cljs compiler a bit
14:47simardmk: sorry someone passed by my office, yes, I use actors
14:47simardmk: elsewhere in the app anyway
14:47scriptorit seems to package sexprs into...hashes? lemme check again
14:47simardnot from clojure code right now, I was considering using queues instead
14:48technomancyI don't think it's possible to have a clojure implementation on a runtime that has mutable strings
14:48hiredmanscriptor: it is easy, everything is an expression unless it is not the last expression in a do
14:48simardmk: the sandbox doesn't simulate anything, there is another (a third) thread for that running jbullet
14:48technomancyyou would have to call seq on every string before you compare it for equality, which is just horrible
14:48chouserscriptor: The Clojure analyzer keeps track of "context", whether an expression is in return, expression, or statement position
14:48scriptorright, context
14:49dnolenchouser: I thought CLJS analyzer did that as well
14:49technomancyyou would have to choose between broken equality semantics (in which case it's not really Clojure anymore) and losing host interop for strings.
14:49scriptortechnomancy: as long as strings are never actually mutated, would there still be a problem?
14:49chouserdnolen: It may. I meant to say that I didn't *think* the cljs one did. I wasn't trying to claim knowledge there.
14:49chouserdnolen: and now that you mention it, I think I do recall that.
14:50dnolenchouser: k, it does :) I was deferring to you're generally deeper knowledge about these things :)
14:50scriptorah, if other php code mutates the strong
14:50scriptor*string
14:50chouserdnolen: ha!
14:50technomancyscriptor: you simply cannot make the kind of guarantees you need
14:50technomancyI recommend reading http://home.pipeline.com/~hbaker1/ObjectIdentity.html before you sink too much time into the project =)
14:50mksimard: hmm. Since you're sending keystrokes to the sandbox, if the sandbox is a single thread, and it might be busy, you might end up with something very unresponsive
14:50technomancyI've thought about this for elisp as a compilation target, and I can't see any way around the problem.
14:51chouserclojure deals with mutable platform things all the time that it just pretends are immutable.
14:51chouserit would be a shame if strings were in that category, but I think not a deal breaker.
14:51scriptortechnomancy: so the issue is if, say, you call a function in some external code, pass it a string, and that function mutates the string?
14:51dnolenscriptor: just use the CLJS analyzer, it should be easy to modify ClojureScript to emit PHP, save yourself a lot of time.
14:51scriptorchouser: that's what I was thinking
14:51fdaoudautodidakto: I agree, and that's why I like hiccup
14:51technomancy,(= (into-array [0]) (into-array [0]))
14:51clojurebotfalse
14:51technomancychouser: ^
14:52chouserhmm
14:52chouserthat's an excellent point
14:52dnolenscriptor: a CLJS->PHP would be kind of awesome - all the work has pretty much been done for you in ClojureScript, it wouldn't even be difficult I think.
14:52scriptordnolen: true, I'll have to look at it closer, but one issue is that js can do some things that you can't do in php
14:52dnolenscriptor: CLJS relies on lowest common denominator JS, what specifically are you thinking of?
14:53scriptorfor example, if you want to compile a do block as an expression, it wraps the resulting code of that into: (function(){...})()
14:53scriptorwith the result of the do block inside the function
14:53fdaoudchouser: because in person you are always right, so coming here keeps you honest? :D
14:53simardmk: yeah, there's a timeout in the sandbox, but of course the user could make it rather unresponsive if he wished to. Did you have something on your mind about that ?
14:54chouserfdaoud: I didn't say that. Not out loud.
14:54fdaoudchouser: ok. I didn't hear you say that, either.
14:54technomancyit bothers me because this is the argument I use against CLers who loudly proclaim how CL is so great because it can be made to do anything with macros
14:54dnolenscriptor: seems like that wouldn't be hard to work around.
14:54technomancyand it's a really good argument against CL
14:54ibdknoxphp has lambdas now
14:54technomancybut unfortunately it's also a really good argument against a bunch of otherwise-interesting runtimes
14:54hiredmanyou don't need lambdas
14:55chouseryou could use non-host strings. :-P
14:55pjstadigtechnomancy: i don't get why mutable strings matters
14:55hiredmanhttps://github.com/hiredman/php.lisp/blob/master/compiler.php
14:55pjstadigeven immutable strings are compared char for char for equality
14:55technomancypjstadig: because you can't define meaningful equality predicates against mutable objects
14:55technomancy,(= (into-array [0]) (into-array [0]))
14:55clojurebotfalse
14:56technomancy,(= (seq (into-array [0])) (seq (into-array [0]))) ; you have to seq it first
14:56clojurebottrue
14:56pjstadigso
14:56chouserpjstadig: the problem is if two strings are mutable, you should *always* say they are unequal, even if they happen to have the same contents at any given moment
14:56technomancypjstadig: you can implement it, but it's going to be very annoying to use in practice
14:57chouserbut having strings always be unequal ruins their usefulness (I was going to say "value" haha) as map keys
14:57scriptorso in clojure equality for arrays is based on identity, not contents?
14:57chouserscriptor: exactly
14:57pjstadigi don't follow the argument
14:57pjstadigthere are all kinds of mutable objects that are compared for equality all the time
14:57chouserfor pretty much anything mutable, equality is based on identity
14:57pjstadigsure it isn't as nice as immutable objects
14:57mksimard: I think mostly I'm just trying to think through how I would end up doing this in clojure... the way gl handles state is ugly (if you want it to be efficient)
14:58pjstadigand you can argue that they should rightly be considered unequal (or at the least only equal at that moment)
14:58pjstadigbut practically people compare mutable objects
14:58scriptortechnomancy: so we only treat strings as if they were immutable, is the problem then that the strings *can* be mutated by outside code?
14:59mksimard: I guess there should just be the simulation code, which needs a dropbox for incoming keystrokes/input (though these could be converted into specific :right :left :jump keywords)
14:59technomancypjstadig: right; the point is that clojure.core/= makes a certain set of guarantees, and if you want to compare the current value of two strings, you will have to use something else.
14:59chousertechnomancy: what about a combination of a str= function, an immutable non-host string type, and not using host strings as map keys?
14:59chousera bit of a mess, but maybe not too bad in practice?
14:59scriptorinterop could be a pain
15:00chouseryeah. as would two different string types.
15:00technomancychouser: yeah, the map keys issue is moot in elisp since you would be using symbols for that anyway. it might not be too horrid in practice; I don't know.
15:00scriptoryep, and PHP doesn't let you extend the string class in any meaningful way
15:00chousermaybe just str= and then use keywords not strings as map keys
15:01technomancychouser: funnily enough, elisp case actually refuses to consider strings as equal, which I hated until I read the Baker paper.
15:02dnolenscriptor: nor does Java, Clojure implementation will need to work around those kinds of host details in various ways.
15:02technomancyanyway, everyone should read http://home.pipeline.com/~hbaker1/ObjectIdentity.html and keep a copy on hand in case you are accosted by a CLer.
15:02mksimard: if you're not using the advanced gl stuff which caches collections on the gpu, then maybe the gl thread can just run on its own, and occasionally read the "worldstate" atom or whatever, and then render it
15:03autodidaktotechnomancy: Here's that link in Reability: http://www.readability.com/articles/nme17i9w :)
15:03scriptortechnomancy: can you explain what the problem is with just treating strings as if they were immutable, interop?
15:03mksimard: (I'm just thinking out loud here - the way you seem to have it set up with a pair of atoms, or an atom+blockingqueue, will probably work out just fine)
15:03dnolenscriptor: CLJS is immutable by convention as well
15:03technomancyhmm; it could be possible to make strings in clojure-in-elisp read as symbols
15:03chouseroh I forgot js strings are mutable
15:04scriptorwait, they are?
15:04dnolenscriptor: anybody could take a CLJS PersistentVector and mess things up if they want to.
15:04technomancywhat
15:04dnolenchouser: they are not
15:04technomancyok, whew
15:04technomancyscriptor: the problem is that clojure.core/= makes a very specific set of guarantees; you either have to break those guarantees or always return false.
15:04simardmk: actually, the rendering (scala) and the simulation (java) both work at the moment and communicate with each other using actors (sending force application to objects) and locks (setting objects position by physics engine)
15:04scriptorany place where those guarantees are documented? :)
15:04chouserseriously, I need to keep my mouth shut. I wonder if there's something about today I can blame it on.
15:05technomancyscriptor: yeah, the paper I just linked to =)
15:05technomancyclojure.core/= is an implementation of egal
15:05simardmk: the sandbox (clojure) is something else, that must communicate with the GL thread (same thread as UI)
15:05scriptorah, got it
15:05mksimard: I see - though I thought that the sandbox was a sort of secondary simulation
15:06simardmk: no, however if the user wants to do some calculation there (say AI), he could.
15:06dnolenchouser: haha, no way :) easy to forget what can be changed in a language as loose as JS
15:08technomancythe baker paper on equality will help you appreciate the huge mountain of crap that Clojure neatly lets you totally avoid.
15:08technomancyit's up there with Out of the Tarpit IMO
15:08scriptorso, even if strings are never actually mutated, it'll break the set of guarantees core/= has?
15:09autodidaktotechnomancy: "crap clojure neatly lets you totally avoid" makes me think of design patterns
15:09chouserscriptor: yes
15:09Wild_Cattechnomancy: what paper is that, I'm afraid to ask?
15:09technomancyclojurebot: equal rights for functional objects
15:09clojurebotEqual Rights for Functional Objects is Baker's paper on equality and why it's impossible to define sensible equality in the presence of mutable data structures: http://www.pipeline.com/~hbaker1/ObjectIdentity.html
15:09technomancyWild_Cat: there ya go
15:10autodidaktoclojurebot: Out of the Tarpit
15:10clojurebotOut of the Tarpit is a short, accessible paper on FP and reducing complexity by identifying and minimising state: http://ben.moseley.name/frp/paper-v1_01.pdf
15:10technomancyclojurebot: botsnack
15:10clojurebotThanks! Can I have chocolate next time
15:10Wild_Cattechnomancy: it's appropriate to break out the "mother of god" memeface.
15:10chouserscriptor: imagine (let [a {"foo" "bar"}] (baz a) (get a "foo")). I clojure, I promise that returns "bar". I don't have to look at baz
15:10autodidaktotechnomancy: the link for out of the tarpit is way behind wrong
15:11technomancyclojurebot: forget Out of the Tarpit |is| a short, accessible paper on FP and reducing complexity by identifying and minimising state: http://ben.moseley.name/frp/paper-v1_01.pdf
15:11clojurebotI forgot that Out of the Tarpit is a short, accessible paper on FP and reducing complexity by identifying and minimising state: http://ben.moseley.name/frp/paper-v1_01.pdf
15:12gtrakaikido is pretty awesome though
15:12chouserscriptor: but if strings are mutable and = compares their contents, then the definition of baz could reach into a and change the contents of the the string "foo" or "baz"
15:12technomancyclojurebot: Out of the Tarpit is a short, accessible paper on FP and reducing complexity by identifying and minimising state: http://web.mac.com/ben_moseley/frp/paper-v1_01.pdf
15:12clojurebotOk.
15:12technomancyautodidakto: thanks
15:12autodidaktogtrak: hehe
15:12autodidaktotechnomancy: no prob
15:13chouserscriptor: if "foo" changes, the map is then completely broken with hashs leading to the wrong branches of the tree.
15:13gtrakimmutability, use your mutable-state's energy against itself in a circle-like motion
15:13chouserjust an example of what happens when you break the guarantees provided by =
15:14technomancy"even if strings are never actually mutated, it'll break the set of guarantees core/= has?" is a bit like "if a tree falls in the forest and no one is around, does it make a sound?"
15:14technomancyif you can guarantee that strings are never mutated, then you don't have mutable strings anymore =)
15:16mksimard: I see - I don't think I'll be able to come up with something better than suggesting blockingqueue for cases when the thread has nothing else to do (ie, it sleeps then polls), and agent/persistentqueue communication otherwise
15:17pjstadiglook i'm not saying that mutable strings are better than immutable strings
15:17pjstadigi'm just saying it's not impossible to use mutable strings
15:17pjstadigit's just very, very precarious and fragile
15:17simardmk: well thanks for your time, the discussion itself was worth it :)
15:18pjstadigthe java.util.Map javadoc gives you a stern warning about using mutable objects as keys, because it most definitely can be disastrous if a key changes after being put into a map
15:18gtrakthat's what you have to do in C, but they're already ok with precarious/fragile
15:18mksimard: :)
15:18technomancypjstadig: yeah, it's just a question of whether the hassle would be enough to render the runtime impractical
15:19HaakonKLWhy would you want to use mutable keys in the first place?
15:19technomancycertainly it's possible
15:21amalloyHaakonKL: presumably because you're in a language where everything is mutable by default, and it's just easiest
15:21sritchietechnomancy: trying out leiningen 2, finally!
15:21sritchieFor some reason I'm getting no output from lein2 deps
15:22sritchieException in thread "main" java.lang.IllegalArgumentException: array element type mismatch
15:22sritchielein2 compile is silent as well, strange
15:22technomancyno output is what you should expect from lein deps, right. where are you getting the exception?
15:25scriptortechnomancy: right, so even though php's strings may be implemted to be mutable, clojure semantics would still hold if you could guarantee that it is never actually mutated
15:25scriptor*they are never
15:25cemerickinteresting bits on the ML today…dum de dum…trademark law?! o.0
15:25dnolenscriptor: hmm can't you copy PHP strings?
15:25autodidaktoibdknox: It's huge shock to the system to be reading the html tutorial on the beautiful noir site, then clicking on the "StringTemplate" link.
15:25technomancyscriptor: if you could guarantee that it's never mutated then it's immutable.
15:25scriptordnolen: I think it uses copy-on-write, so probably
15:25ibdknoxautodidakto: lol
15:26scriptortechnomancy: yes! that's what I was thinking
15:26scriptornow to guarantee that in a language so friendly to things like this
15:26technomancybut you can't guarantee that without rewriting the interpreter
15:27sritchietechnomancy: exception's on lein swank --
15:27sritchietechnomancy: lein2 deps doesn't populate a lib folder either, though
15:27technomancysritchie: yes, that's by design
15:27scriptoroff the top of my head I can't think of too many functions that change a string as a side-effect
15:27technomancythe lib/ dir was an accident of history
15:27emezesketechnomancy: Would it not be sufficient (although perhaps inefficient) to implement an immutable string class in the host language, and use that?
15:27sritchieah, interesting
15:27technomancyscriptor: that's a far cry from a guarantee though
15:27sritchielein2 repl is throwing the exception
15:27scriptortechnomancy: true, but a start
15:28technomancyemezeske: depends on the runtime I guess
15:28technomancyyou can never entirely avoid hosty strings
15:29sritchietechnomancy: here's what I've got: https://gist.github.com/2242587
15:29sritchiethat's my initial stab at conversion
15:29technomancyemezeske: "no wrapper classes" is very central to the design of Clojure
15:29technomancybasically you'd end up doing (into "" (hosty-function)) all over the place
15:30technomancysritchie: there's currently a bug in :javac-options handling; lemme find the issue
15:30technomancyI think the workaround is easy
15:30scriptoryea, it wouldn't be worth it
15:30sritchietechnomancy: fixed, it was my javac-options
15:30sritchiecool
15:30technomancysritchie: https://github.com/technomancy/leiningen/issues/450 for the record
15:31emezesketechnomancy: Ahh, I see, that does make sense. You'd have to also make sure all the hosty-functions were wrapped so as to return immutable strings, which might not be tenable
15:32scriptoremezeske: yep, or have all string handlling functions call my-stringify in some way
15:32emezeskeYeah, that does get pretty ugly
15:33scriptoron the other hand, that's pretty much what I do with pharen's sequences
15:33technomancynot saying you shouldn't try it; just be mindful of the pitfalls
15:33technomancyeven if it's a bit of a mess, it'll be much more pleasant than using PHP =)
15:33cemerickweavejester: Q: what was the rationale for lower-casing HTTP header names?
15:34cemerickeh, I withdraw the question. :-)
15:34scriptorit's easy with strings, since a lot of it boils down to first/rest
15:34scriptor*with seqs
15:34ferdtechnomancy: I'd like for slime's macroexpand to show me metadata (like when setting *print-meta* on the REPL). Is it possible?
15:36ferdtechnomancy: If it needs changes on swank-clojure, I can look into it (some pointers welcomed ;-))
15:38FrozenlockHmm... lein asks me for javac.exe. Do I need to install another java package? (Development Kit?)
15:40TimMcJDK, not JRE
15:41weavejestercemerick: You'd have to ask Mark, but I suspect it was because HTTP headers are case insensitive, and keys in a map are case sensitive.
15:41weavejestercemerick: So you need some normalization, and lower-casing it probably the easiest.
15:43cemerickweavejester: Sure; I was mostly asking in frustration after not grokking why my (headers "Some-Header-Name") refused to work for a bit. :-)
15:44FrozenlockTimMc: Thanks, downloading now :)
15:46samaarondoes lein handle plugin and support dirs in a special way?
15:47weavejestersamaaron: What do you mean by plugin and support dirs?
15:48samaaronweavejester: i'm trying to figure out how the lein-cljsbuild plugin works
15:48samaaronit seems to have two internal 'projects' - one in a dir called plugin, and another in a dir called support
15:48samaaronwhen you do a `lein deps` lein seems to know to pull the deps for both
15:48emezeskesamaaron: That's not handled by lein specially, they are literally two separate projects
15:49ibdknoxsamaaron: emezeske separated the primary library from the leiningen plugin
15:49samaaronso lein knows to look for subprojects?
15:49emezeskesamaaron: 'lein deps' doesn't pull deps for both; it pulls only the plugin. Then, when the plugin executes, it uses eval-in-project, at which point the dependencies for that subproject are pulled.
15:49samaaronoh, interesting
15:50emezeskeSo technically the plugin/ doesn't depend on the support/, in it's project.clj file
15:51emezeskeIt's the subproject that the plugin creates that depends on it.
15:51emezeskeBTW, I wouldn't use lein-cljsbuild as an example of how to do things -- I have no idea what I'm doing! ^_^
15:52samaaronemezeske: :-)
15:52samaaronemezeske: it just seems like magic to me
15:53samaaronin fact, most of lein seems like magic
15:53samaaronperhaps that's the point?
15:53weavejestersamaaron: Lein's not that magical, honestly :)
15:53weavejestersamaaron: The command "lein foo" just runs leiningen.foo/foo
15:53samaaronweavejester: oh, i'm sure - when you understand it thoroughly enough
15:54RaynesI can attest that there is very little magic in Leiningen.
15:54samaaronweavejester: yeah, i grok that simple usecase
15:54weavejestersamaaron: And then the eval-in-project macro evaluates a Clojure form with all the project's dependencies
15:54RaynesIt only looks like magic because Clojure is like magic.
15:54weavejestersamaaron: That's really all you need to know
15:55weavejestersamaaron: The way people make dependencies is they assoc them into the project map before calling eval-in-project
15:55samaaronoh ok
15:55samaaronso `lein deps` calls eval-in-project with an empty form?
15:56weavejesterSo instead of: (eval-in-project project `(foo.core/foo "foo") `(require 'foo.core))
15:56Rayneseval-in-project isn't even magic. All it does is spin off a separate JVM with the classpath set up for the project. It then sends the code to that JVM for evaluation.
15:56RaynesNow classloaders (which we haven't quite gotten right yet) are a bit like magic.
15:56weavejesterYou'd first update the project like: (update-in project [:dependencies] conj ['foo "1.0.0"])
15:56HaakonKLClassloaders: Because otherwise you could get viruses from the internet...
15:57weavejesterWhat was that add-classpath project called...
15:58samaaronok, so let me try and get this straight...
15:58weavejesterAh, pomegranate
15:59samaaronwhen i call `lein deps` in a new project that i'm using cljsbuild in
15:59samaaronit creates me a .lein-plugins dir with a bunch of dependencies in
15:59samaaronis that lein doing that or cljsbuild?
15:59samaaronand how would I know?
16:00emezeskesamaaron: That's lein. You know that because you haven't typed 'lein cljsbuild' yet :)
16:00samaaronah ok
16:00weavejestersamaaron: Lein loads the plugin. When you run the plugin, it will update the project map with its own dependencies.
16:00emezeskesamaaron: (Technically lein cljsbuild could hook into deps and do it's own thing, but it doesn't)
16:00weavejestersamaaron: Leiningen automatically downloads any deps needed, so there's no need for "lein deps" strictly speaking
16:01weavejesterYou could just go "lein cljbuild" straight off
16:01weavejesterAnd Lein would make sure its deps were up to date before trying to resolve the command.
16:01samaaronthat makes sense
16:02weavejesterThere's an implicit "lein deps" before every command, and before any "eval-in-project"s
16:02samaaron:-)
16:03samaaronso when i do `lein cljsbuild` i don't see any new deps downloaded
16:04weavejestersamaaron: In new versions of Leiningen it doesn't bother creating a "lib" or "classes" directory
16:04RaynesYeah, it doesn't copy deps to your project anymore.
16:04weavejestersamaaron: I believe it just downloads the deps into your $HOME/.m2 folder and adds them to the classpath directly.
16:04RaynesIt uses them from where they sit in ~/.m2
16:05sparkleshywhy are some "special forms", like fn, implemented with just ordinary clojure code? Isn't that against the definition of "special form"?
16:05weavejestersparkleshy: Implementation detail :) - don't look behind the curtain
16:05weavejestersparkleshy: In future, they might be "real" special forms, so it makes sense to treat them that way.
16:08samaaronso how do i get access to the the google closure libs?
16:08RaynesCall google and ask for permission.
16:08samaaronhaha
16:08emezeskesamaaron: The base google closure library is a dependency of the clojurescript compiler
16:08samaaronbut if they're in a jar in my ~/.m2 directory...
16:09emezeskesamaaron: So you can just (:require ...) and you're good. They will always be on the classpath.
16:09samaaronoh, cool
16:09emezeskesamaaron: Note that the base library doesn't include any third party stuff (soy templates, etc)
16:17benDosWould this be the channel for clojurescript questions?
16:17lynaghkbenDos: it would.
16:17RaynesYep.
16:18benDosAh cool, was going to start with it this weekend and wanted to make sure i could find an irc :)
16:19Raynes$max
16:19lazybotThe most users ever in #clojure is 420
16:19RaynesHe lies.
16:19Raynesamalloy: Fix that plugin.
16:19scriptormake it say 69
16:19benDosOut of curiosity, do I still get access to browser native js libs like JSON?
16:20scriptorJSON isn't a lib, as far as I know
16:20TimMc~max
16:20clojurebotMost users ever in #clojure: 404
16:20RaynesAt least clojurebot is closer.
16:20RaynesEr, lazybot.
16:20TimMca broken clock...
16:20scriptorbenDos: you'll have access to anything the browser provides
16:20benDosI've tested in chrome firefox and opera, they all seem to recognize JSON.stringify etc
16:21scriptorah, didn't know they had that now
16:21benDosCause of the super loose typing the compiler is able to not care about that type of run time stuff?
16:21solussdis defstruct/create-struct actually going away sometime? I think I'd prefer using them in some cases- e.g. when I'm threading a datastructure through several functions that conj data onto a map
16:21benDosI mostly work in java and c, but need javascript for a new project
16:22benDosHaving not used clojure in a few years maybe less, seems like clojurescript will be a little nicer to work in
16:22scriptorI don't see why it wouldn't be able to use JSON.stringify
16:23hiredman ls
16:23dnolenbenDos: (.stringify js/JSON ...) is what you want
16:23dnolenbenDos: in generally if you want to access global JS functionality you need to prefix with js/...
16:24benDosForgive me, I don't remember clojure syntax v lisp'n'friends but the cadr looks like part of the function call there?
16:24dnolenbenDos: cadr?
16:25benDossecond element in the list :x
16:25scriptor(car (cdr ...)) ?
16:25scriptorah, yes
16:25scriptorit's (.method-name object ...)
16:25Bronsa,(macroexpand '(a/b))
16:25clojurebot(a/b)
16:26Bronsano wait.
16:26benDosMaybe I'll start with some clojure docs before getting into clojure script clearly i thought i remembered more than I do
16:26Bronsaoh.,
16:26Bronsa,(macroexpand '(Math/pow))
16:26clojurebot(. Math pow)
16:27dnolenbenDos: someone needs to write a good ClojureScript book - I heard perhaps one was in the works?
16:27benDosFrom the readme, clojurescript is clojure less the jre?
16:27benDosbut compiles to js etc
16:28dnolenbenDos: it's an implementation of Clojure that compiles to JS yes.
16:28technomancyless the JRE and less eval
16:28benDoscool
16:29hiredmanless vars
16:30amalloydnolen: won't a good clojurescript book be out of date by the time it's published?
16:30ibdknoxdnolen: isn't it a bit early for that?
16:30pjstadigless the stm
16:30ibdknoxit will certainly be out of date by the time it is published
16:30dnolenpjstadig: anything JVM concurrency related really
16:31cemericksomething is underway
16:31pjstadigisn't clojurescript still alpha?
16:31benDosclojure's stm uses the jre?
16:31dnolenamalloy: ibdknox: well I don't forsee the language changing dramatically. Many things going forward is optimization oriented.
16:31cemerickpjstadig: very, but the process of nailing down a book will be a decent forcing function for that
16:32dnolenare
16:32autodidaktoI heard cemerick has the ear of tim oreilly himself
16:32eggsbyWhat is the difference between binding and let?
16:32ibdknoxdnolen: but any book on the subject will need to talk about libs and ways to do things..
16:32eggsbyIt seems to me that they do the same thing...
16:32cemerickhah
16:32RaynesOh man.
16:32RaynesAm I obligated to have a chapter on clojurescript in my book now?
16:32amalloyi think you're more obligated to have a book that's finished
16:32cemerickautodidakto: keep spreading that; enough of a whisper campaign might end up making it so :-P
16:33cemerickRaynes: goodness no
16:33Rayneshis*
16:33dnolenibdknox: I think a good book could cover libs and tooling in an appendix with caveats about change
16:33scriptoreggsby: binding rebinds already existing vars, then when it's finished executing it reassigns those vars to their previous values
16:33dnolenI think there are many people who might use ClojureScript who are thoroughly unfamiliar w/ Clojure.
16:34eggsbyscriptor: but effectually, that is the same as let? Is it just the implementation that is different?
16:34benDosdnolen, google is throwing a shitton of money at dart maybe that'll end up working out
16:34technomancyeggsby: the two differences are that binding is "deep" and that let only applies to locals.
16:34scriptoreggsby: let doesn't assume that the vars exist, nor does it try to return them to their previous values
16:35technomancyvars and locals look sort of alike, but are very very different
16:35dnolenI also think ClojureScript might appeal to advanced JS devs who've been doing JS long enough to be interested in other approaches.
16:35dnolenwho don't really care about the JVM at all.
16:35scriptorhow much production use does cljs see, if any?
16:36dnolenscriptor: I think there's stuff happening tho perhaps under the radar, and I think in the next 6 months could pretty quick.
16:37eggsbyThank you scriptor and technomancy
16:37benDosI understand that concurrency with imperative languages is hard but do so many feel to claim it just doesn't work :/
16:37benDosWas reading http://clojure.org/state
16:37eggsbyI'm not sure I understand the use cases, but at least I understand the difference :)
16:37flazzis there a way to have stack traces be in terms of clojure?
16:38pjstadigbinding and vars are a concurrency mechanism and a way of managing mutable state
16:38technomancyflazz: look at clj-stacktrace
16:38pjstadiga binding is mutable and can be set within the same thread
16:38pjstadiglocals are immutable
16:38Chousukeeggsby: binding alters *dynamic* scope
16:38dnolenbenDos: note that's written by someone who's done C++/Java/C# concurrent programs for 20 odd years.
16:39Chousukeeggsby: ie. the binding is changed for all code that runs while the binding is in effect.
16:39Chousukeeggsby: even if it's not in the current visible lexical scope.
16:39autodidaktotechnomancy: btw, why do stacktraces have the error at the top and not the bottom? everybody is constantly scrolling up.
16:40technomancydunno
16:40Chousukeeggsby: let, on the other hand, just binds names (not vars) and creates a new lexical scope.
16:40dnolenflazz: 1.3 has very Clojure-y stacktraces, but I think few tools expose it.
16:41flazzdnolen: does emacs with swank/slime expose it?
16:42dnolenbenDos: even w/ Gilad Bracha's involvement, I find Dart insanely boring. But I believe it also pushing the multi-lang browser support we're seeing now.
16:42dnolenflazz: nope
16:42technomancyswank uses clj-stacktrace, which is a lot more readable
16:43eggsbythank you Chousuke and pjstadig
16:43eggsbythat clears it up, but wouldn't it be better to explicitly change state via a ref using the STM ?
16:44autodidaktoibdknox: it seems noir begins to embrace MVC with it's directory structure, but then mixes views and controlers routers?
16:44Chousukenot always
16:44technomancyeggsby: each of the four reference types is useful in different contexts
16:44Chousukeeggsby: dynamic vars are often used for a "context" sort of thing.
16:44sritchieautodidakto: that's kind of like saying you embrace bisexuality by dating girls, then losing steam
16:44Chousukeeggsby: ie, you have a bunch of functions using some global var, then you rebind that var to a value to provide a context for the functions, and proceed to use the functions while the binding is in effect.
16:45ibdknoxautodidakto: https://groups.google.com/d/msg/clj-noir/FxipsTEhVtM/nDH3JH48LFAJ
16:45autodidaktosritchie: hehe, ibdknox: ok i'll check that out
16:46eggsbyah Chousuke
16:46technomancyibdknox: does the default noir skeleton still spit out files that have non-def forms in the top-level?
16:46ibdknoxit has one
16:47ibdknoxwhich is sugar over require
16:47Chousukeeggsby: dynamic vars should be used sparingly though. After all, when you rebind a var you are affecting something that you can't see.
16:47technomancyI don't like it, but I'm stumped to come up with an alternative =\
16:48Chousukethat can get you in trouble.
16:48ibdknoxtechnomancy: yeah, I'm not sure what else I could do
16:48ibdknoxone line isn't so bad
16:49ibdknoxgiven what it does
16:49technomancysometimes I wonder what life would be like if ns were extensible
16:50ibdknoxlol
16:50ibdknoxif it had wildcards everything would be fine ;0
16:50ibdknox;)
16:50ibdknox(:require [my-views.*])
16:50technomancy(ns my.noir.app (:require [noir.server]) (:noir-views [my.noir.app]))
16:50ibdknoxooo
16:50ibdknoxthat would be neat
16:50ibdknoxdidn't think about that
16:50technomancybut there's no way to namespace them
16:51technomancyso you'd run into nasty collisions
16:51ibdknoxyeah
16:51technomancyns+ is pretty sweet; I would love to see something like :like in core
16:51technomancydoesn't help here though
16:53ibdknoxtechnomancy: what does :like do?
16:53technomancyit defines a template ns form
16:53technomancyhttp://code.google.com/p/clj-nstools/
16:53technomancyibdknox: have you considered using bultitude to load views?
16:54ibdknoxI don't know what that is :)
16:54RaynesHe does something similar and probably terribly.
16:54Raynesibdknox: https://github.com/Raynes/bultitude
16:54technomancy~bultitude is for finding namespaces on the classpath https://github.com/Raynes/bultitude
16:54clojurebotIk begrijp
16:55ibdknoxooo
16:55ibdknoxdo you know if that works in a war?
16:55technomancyanything on the classpath
16:55technomancyshould be fair game
16:55autodidaktoibdknox: I was looking at noir from a sinatra/padrino perspective, hence both familiarity and confusion. But I read the link and I like what you have to say. I'll give it a try (side note: i might be helpful to lots of people to have this rational on the website)
16:56ibdknoxautodidakto: yeah, I need to update the noir site sometime soon.
16:57ibdknoxtechnomancy: I use clojure.tools.namespace right now
16:57ibdknoxunfortunately it doesn't work in wars which has been the source of a fair amount of confusion
16:57technomancyditch it!
17:02sritchieibdknox: it fails w/ clojure 1.2 if you have any lein-newnew templates on the classpath
17:03ibdknoxsay what?
17:04technomancyibdknox: bug in clojure.tools.namespace
17:04ibdknoxwow
17:04ibdknoxweird
17:04ibdknoxok
17:04ibdknoxI'll switch it over
17:04Raynesibdknox: A bug that stuartsierra says he wont fix.
17:04ibdknoxunless Raynes gets to it before I do
17:04RaynesJust FYI.
17:05RaynesIs that a hint?
17:05Raynes:p
17:05ibdknoxfixing wars will eliminate what I think has been the largest source of questions on Noir lol
17:05scriptoralso world peace
17:05ibdknoxI looked into it at one point but didn't understand how classloaders worked in that context well enough to know how to fix it
17:06ibdknoxI'm woefully uninformed on the ridiculousness of loading things into the JVM :)
17:06technomancywell double-check for yourself; I have never used a war file before and could be gravely mistaken
17:06Bronsawhat's the bug?
17:07benDosdnolen, sorry had to run earlier i'll bbiab
17:08ibdknoxRaynes: no I don't mind either way
17:08Raynesibdknox: But yeah, it might actually not work in wars, but I don't really see why it wouldn't. It's pretty thorough.
17:08hiredmanthe thing is, all these "load namespaces" things are based on the classpath, when really the way you find resources and load code is via classloaders, there is really only one classloader that uses the classpath
17:09Raynesbultitude iterates through every classloader.
17:09ibdknoxah
17:09TimMccrazy talk
17:09ibdknoxthat should fix it then
17:09technomancyhiredman: isn't it more like there's one classpath per classloader?
17:10technomancyand thus there's only one classloader with the classpath provided at boot?
17:10cemerickibdknox: fixing wars?
17:10hiredmantechnomancy: but other classloaders don't have a classpath
17:10technomancythey can have an internal path by which they load classes though
17:11hiredmanthey can, but is not required at all
17:11hiredmanand in most cases they don't
17:11technomancyright; ok, that's a bit different I guess
17:11RaynesJava is a giant horror show.
17:11technomancystill, only one classpath seems like an oversimplification given clojure.lang.DynamicClassLoader
17:11hiredmanand classloaders don't give you a way to list the resources available
17:12hiredmantechnomancy: clojure.lang.DynamicClassLoader is an example of a classloader with no classpath
17:12hiredmanit loads classes right from memory
17:13hiredmanthe classpath is just a bootstrapping mechanism used by the system classloader
17:13technomancyhttp://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLClassLoader.html#getURLs() <- what does this return then?
17:14hiredmantechnomancy: that is only for a particular subclass of classloader
17:14technomancysure
17:14hiredmanhttp://docs.oracle.com/javase/1.5.0/docs/api/java/lang/ClassLoader.html
17:15hiredmanwhat you really want is, given a classloader, find on the namespaces available through it, which is hard
17:16hiredmanof course that also precludes dynamicly created namespaces
17:17technomancyit's not terribly difficult given an URLClassLoader, but it can be slow
17:17ibdknoxcemerick: dynamically loading view ns's doesn't work in wars
17:18cemerickibdknox: unless they're exploded, I wouldn't expect so, no
17:18cemerickor, do you mean via the REPL?
17:25aperiodichow do folks usually use swank when working with multiple projects in parallel?
17:26aperiodici'm starting a standalone swank server with lein-swank and connecting to it from multiple editor instances, but only one of my projects is on its classpath
17:26aperiodici suppose i could just make a fake project that has all of the projects i want to use as dependencies, and start the server there
17:28cemerickaperiodic: lein checkout deps + clojure-jack-in should handle that, I think
17:29lynaghkIs there a way to get clojure-jack-in working with Lein2 projects? My src-paths [... ...] doesn't get picked up when I try it.
17:34aperiodiccemerick: putting all the checkout deps into a catch-all project, then? the projects themselves actually don't have much to do with eachother, i'm just a bit ADD.
17:34cemerickYeah, that world work, though it seems like an odd thing to do if they're unrelated.
17:35aperiodicyeah, i felt that way, too. but it seems like the alternative is killing and starting swank servers whenever i switched between the two
17:35scriptorooh, non-copy-on-write persistent vectors
17:35lynaghkaperiodic: can't you just start swank servers on different ports?
17:37aperiodiclynaghk: as far is a can tell, the swank server port for slimv is configured globally, so that would mean juggling a few different vimrcs
17:37lynaghkaperiodic: sounds like you're using an inferior editor.
17:37aperiodic:P
17:37lynaghk=P
17:38pandeiroibdknox: iyo is there any advantage to using fetch if i'm just serving predefined clojure maps, not running remote functions?
17:39ibdknoxwhat's the disadvantage?
17:39pandeirodep i guess?
17:39ibdknoxthe lazy-store stuff would cache the result locally
17:39ibdknoxbut that's about it
17:40aperiodicooh, there's a "localvimrc" plugin for project-specific vimrcs. sweet.
17:47amalloyseancorfield: is there an easy way to get c.j.jdbc to show the query it's running? i'm trying to switch from clojureql, and it had this handy feature where you could ask for any query's sql (with ? replaced with actual values)
17:48amalloywe were only using it for logging, of course
17:49ibdknoxI couldn't find a way
17:49cemerickPerhaps of interest to some here: Drawbridge, an HTTP nREPL transport, implemented as a Ring handler. http://groups.google.com/group/clojure/browse_frm/thread/2c78990f8a49188c
17:50weavejestercemerick: I noticed you working on that. I've been meaning on writing something similar, but I'm glad you beat me to it!
17:50amalloyarohner: it should be pretty simple to implement yourself, right?
17:50arohneramalloy: how?
17:51dnolenarohner: huh, I'm not sure why CLJS doesn't have delay - would take a patch for that. That's an easy one.
17:51arohnerI must be missing something simple. Why is that easy to implement?
17:51dnolenarohner: delay is just thunking
17:51amalloyarohner: it's just a macro wrapped around an "is it done yet" atom
17:52ibdknoxcemerick_away: are you storing serializable things in the session?
17:52arohnerdnolen: oh right. I was thinking of promise
17:52ibdknoxcemerick_away: er, *only* printable things I guess
17:52arohnerI want promise as well :-)
17:52amalloypromise is just about as easy
17:53arohnerbut if you block waiting for a result, when does the other 'thread' run?
17:53dnolenamalloy: not really
17:53amalloyoh right, threading
17:53ibdknoxyeah, that one is hard
17:53dnolenarohner: promise is hard, and I'm personally not convinced it makes much sense, tho others might disagree
17:53arohnerI'm seeing a race in knockout.js that would be trivially solved w/ promise
17:54pandeiroarohner: are you doing interop with knockout.js?
17:54ibdknoxdnolen: why doesn't it make sense?
17:54arohnerpandeiro: I'm using knockout, but not interop yet
17:55dnolenibdknox: promise, at least in my mind, thread semantics - blocking on read
17:55pandeirojust curious because i know knockout uses custom attributes, and it's a little bit painful manipulating them from cljs imo
17:55amalloy(defmacro delay* [& body] `(let [value# (atom nil)] (reify clojure.lang.IDeref (deref [this#] (:value (swap! value# (fn [{done# :done :as curr#}] (if done# curr#, {:done true, :value (do ~@body)}))))))))
17:56ibdknoxdnolen: I guess the real solution is async from F#/C#
17:56amalloyexcept you'd want delay instead of delay*, and whatever cljs's protocol is called
17:56ibdknoxwhere while that is blocking the thread yields
17:56amalloydnolen: i can send that as a patch if you want?
17:57dnolenibdknox: yes inside an async construct it could make sense - and that could be done via a lib
17:57dnolenamalloy: sure! but it should just be delay, not delay* right?
17:58amalloyyes, i mentioned that. i copy/pasted my clj-jvm version, where i was avoiding overwriting
17:58arohnerbtw, knockout seems like a great lib for clojurescript. it's essentially clojure cells for web UI
17:59dnolenamalloy: actually there's a broken looking implementation of delay in core.cljs now
17:59dnolenamalloy: for some reason delay is a fn instead of a macro.
17:59amalloyhaha weird
17:59amalloyi do prefer their approach though, of deftyping for it, rather than my atom/reify
18:00amalloyso i'll just patch the existing impl
18:00dnolenamalloy: cool, thx
18:01amalloydnolen: how do i make a macro in cljs?
18:02dnolenamalloy: inside of core.clj, the same folder as complier.clj
18:02dnolenin the same folder as compiler.clj I mean
18:02amalloyyeah, just found that
18:02dnolenamalloy: I'm assuming you're going to remove broken fn too :)
18:02amalloyyeah
18:03amalloyit's a bit weird, because i want the macro in clj to depend on the deftype in cljs. is that not a problem?
18:03amalloyi guess it's not; lazy-seq does the same thing
18:04Raynesamalloy: What are you using cljs for?
18:05amalloyRaynes: i'm not
18:14amalloydnolen: how do the macros in core.clj get "imported" into core.cljs? i don't see any require-macros calls for me to add delay to
18:15dnolenamalloy: core.clj is required in compiler.clj
18:21cemerickweavejester: :-) hopefully it stands up to scrutiny
18:22cemerickibdknox: yeah, the session holds the nREPL transport (in this case, just a pair of queues) that the backend drops response messages into
18:22cemericknothing says the responses must be printable though; I've yet to address nontextual REPL interactions in drawbridge
18:23ibdknoxcemerick: I'm thinking about times when you can use the memory session store
18:23ibdknoxcan't*
18:23cemerickah
18:24cemerickthat would get very dicey very fast
18:24cemerickibdknox: the backend is necessarily single-host; when would memory sessions not work?
18:25ibdknoxbasically anytime you have more than one box and can't do sticky sessions :(
18:25ibdknoxi.e. heroku
18:26cemericktechnomancy may have a more useful response to that
18:26cemerickanyway, for textual REPL interactions, using a persistent session store would work fine
18:27ibdknoxcool
18:27hiredmanwhy use in memory queues? why not rabbit or similar?
18:27ibdknoxI just know a fair amount of people are using alternate session stores and that might cause some very weird errors if what's being added to the session can't be printed
18:28ibdknoxcemerick: that was my only concern ^
18:28Raynesibdknox: refheap uses a mongodb session store.
18:28hiredmanif you use a message bus, do you need sessions at all?
18:28cemerickhiredman: a rabbitmq transport would be quite trivial.
18:29hiredmanI am aware
18:29cemerickWell, I don't use it, and the extra dep would be a PITA for most people, so…
18:29hiredmaninfact, just hooking clojure.main/repl up to queues instead of io streams is trivial
18:30hiredmancemerick: I just mean it could actually make drawbridge work on heroku (if the session thing is a problem)
18:31hiredmanhttps://github.com/hiredman/vespa-crabro/blob/master/test/vespa_crabro/test/core.clj#L57
18:31cemerickibdknox: Sure; I don't think there'll be any problem given the publicly-available nREPL middlewares that are around so far.
18:32cemerickhrm, actually, it's more complicated than that. The REPL session's dynamic scope would need to be persisted as well.
18:32hiredman:|
18:33arohnerI'm starting to think everything should be serializable. Even fns and infinite seqs
18:33arohnermaybe *especially* fns
18:34TimMc$google serializable fn
18:34lazybot[technomancy/serializable-fn · GitHub] https://github.com/technomancy/serializable-fn
18:34arohnerTimMc: yes, I'm aware. I mean production-ready serializable
18:34TimMc:-P
18:34aperiodichow do you serialize the lexical scope?
18:35arohneraperiodic: the same way it's in the compiler, as a stack of maps of immutable values
18:35cemerickibdknox: I'll lay in wait for problem reports and science done by technomancy et al. before thinking too hard about it.
18:35hiredmanlexical scope is just fields in a class
18:35aperiodicah right, immutability rocks
18:35hiredmanTimMc: you mean vars?
18:36arohnerTimMc: obviously many Java things won't be serializable, but I'd be happy with a solution that worked on pure clojure
18:36ibdknoxcemerick: oh, I wasn't interested in a solution so much as a warning :)
18:36cemerickibdknox: Good thing! ;-)
18:36hiredmanto make fns serializable you would have to ship the fn's class around too
18:37cemerickI'm a Heroku noob myself, so I'm far from knowing where all the bodies are buried.
18:37ibdknoxalso no free variables
18:37hiredmanand clojure's gensym (used a lot for naming classes) isn't safe between vms
18:37ibdknoxin these functions to be serialized
18:38arohneribdknox: free variables?
18:38hiredmanibdknox: not a problem
18:38ibdknoxhiredman: hm, resolve them before?
18:38hiredmanwhen a fn object is created, the values it closes over are passed to the constructr and stored as fields
18:38ibdknoxah
18:39hiredmantop level values are resolved to vars at compile time
18:39hiredman(before the class is generated)
18:40arohnerhiredman: do you need the classname to be unique? why not just hash the input clojure source of the fn?
18:40arohneri.e. rather than (gensym foo), store (sha1 (str (quote (fn foo [x] (inc (bar x)))
18:41hiredmanarohner: it doesn't actually have to be uniqueue, but your stack traces become much harder to read
18:41amalloydnolen: http://dev.clojure.org/jira/browse/CLJS-173 opened, patch and test attached, marked as waiting on you
18:42arohnerhiredman: that seems like a minor problem compared to getting this to work at all :-)
18:43sritchietechnomancy, have you seen "error in opening zip file" at all?
18:43sritchiew/ leiningen 2
18:43sritchieor any idea how to debug it?
18:43sritchieerror's at at leiningen.core.classpath$extract_native_deps$fn__255.invoke(classpath.clj:42)
18:45amalloysritchie: probably a corrupt jar file on your classpath somewhere
18:45sritchieamalloy: this is that same issue as before, I think, where someone references a dependency that's just a pom, but doesn't mark it as such
18:45sritchiemaven doesn't choke on those, but leiningen does
18:45sritchieI'll see if I can track it down
18:47sritchieamalloy: lein 1 is fine
18:47sritchielein 2 chokes on this particular dep
18:55technomancysritchie: oh yeah, I think there was a bug reported with pom dependencies
18:55technomancyare you on master or preview2
18:55technomancy?
18:55sritchiepreview2
18:58technomancydo you have a :type :pom that I could test on?
18:58technomancyoh, and is your stack trace the same as https://github.com/technomancy/leiningen/issues/481 ?
19:02kurtharrigerIs it possible to turn this into a leiningen plugin https://gist.github.com/2244645, what step would I need to hook to get it to run for any command?
19:35TimMchiredman: No, it was a joke about serializing C-style pointers
19:47sritchietechnomancy: sorry, I need to turn my alerts back on
19:47sritchiethis one's private, but yeah, that's the exception
19:47sritchiefunny, that's the exact jar I was using
19:47sritchieperfect
19:47sritchiegotta start reading issues :)
19:49technomancyso ... with dependencies that aren't jars, does it make more sense to keep them off the classpath via a blacklist or a whitelist?
19:49technomancythinking maybe only allowing dependency jars/zips to be on the classpath would make sense, but I've never worked with non-jar dependencies
19:51technomancyif only cemerick were here
19:53aperiodicis it just jaring that chokes on non-jar deps?
19:54technomancyit's the search for native deps
19:54technomancyalso screws up eclipse though https://github.com/technomancy/leiningen/issues/330
19:55mebaran151I'm trying to play with Apache Pivot, but I'm having a tiny bit of a hard time getting it to see clojure's classes. It is using the wrong classloader
19:55mebaran151how can I get the awt thread (threads?) to reference the clojure classloader?
19:55kurtharrigertechnomancy: hadoop usually adds the configuration directory is added to the classpath so that configuration files can be accessed as resources
19:56kurtharrigerI currently do this with extra-classpath-dirs
19:56technomancykurtharriger: oh sure; I mean classpath entries that come in via dependencies
19:56technomancygotta have directories on the classpath
19:57kurtharrigerI guess I wasn't following the question well enough, getting dependencies that aren't jars or folders?
20:00mebaran151or change the classloader to default to clojure (right now Class/forName is failing to find classes created with defrecord / deftype)
20:00technomancykurtharriger: yeah, you can have dependencies that are just bare pom files
20:01sanderI think I have a (non-empty) solution to the 4clojure quine problem, but it says "Empty input is not allowed"
20:01xeqitechnomancy: I ran into this with 457 as well, and decided a .pom in the classpath didn't make sense
20:01amalloysander: care to share?
20:01xeqiI thought a whitelist to just zip/jar would work
20:01sanderif i am not ruining it for anyone here, sure
20:01sanderits probably not a very elegant one..
20:02amalloy*shrug* gist it then, and if someone doesn't want spoilers they won't click
20:02sanderright. didn't think about that one
20:02technomancyxeqi: yeah, I think I'll go with that
20:04amalloyoh whoa. something is wrong with 4clojure now, apparently, sander. it thinks every input is empty
20:04aperiodicmebaran151: i've never had to screw around with classloaders to get hadoop to find my classes, but they're all AOT'd so that might not be relevant
20:04amalloyit was working fine this morning, and i haven't touched anything since then
20:05sanderamalloy: uups
20:05aperiodicmebaran151: as long as .class files are being generated and placed on the classpath, i don't think you should have to resort to using the clojure classloader
20:06sanderamalloy: here it goes anyway: https://gist.github.com/2245072
20:07sanderamalloy: good luck for finding the problem, I'll go to sleep now
20:08amalloysander: fixed it
20:08amalloyif you want to submit your thing
20:08amalloyi didn't find the problem, but a restart fixed it :P
20:08sanderammalloy: thanks
20:08sanderamalloy: what was the problem?
20:08amalloydunno. didn't find it
20:09mebaran151aperiodic: not running havoc: trying to play with Apache Pivot (neat looking gui toolkit)
20:09mebaran151stepping through the source it's failing with a Class not found exception at Class/forName
20:09sanderamalloy: restart?
20:09sander:-)
20:09amalloyyep
20:09mebaran151I'm pretty sure aot would solve a lot of my problems, to be sure
20:10mebaran151but I'd like to play dynamically at the repl :)
20:10aperiodicthat shouldn't be an issue, as long as you're not changing the class interfaces
20:11mebaran151so I'd have to restart my repl first right?
20:13aperiodicyeah, but i think you'll be able to play around in the repl as long as the interfaces don't change
20:13mebaran151how do I AOT?
20:13aperiodiclein compile
20:13mebaran151cool I'll try that next
20:13mebaran151thanks
20:14mebaran151(I'm willing to bet I'm going to run into resource problems next actually
20:14aperiodicheh, don't thank me until it actually works ;)
20:17aperiodicmebaran151: oh, firstt you'll need to set the :aot key in your project.clj to a list of namespaces (or a regex) that you want to be AOT'd
20:32mebaran151aperiodic: that mostly worked!
20:33mebaran151now I just have to figure out a way to get it to find my resources
20:38aperiodicmebaran151: cool! for the resources, try the :extra-classpath-dirs key in project.clj (see https://github.com/technomancy/leiningen/blob/master/sample.project.clj)
20:38mebaran151I was just dropping it resources
20:42mebaran151actually it isn't lying to me, getResource is returning nil
20:42mebaran151where am I supposed to put things like xml gui descriptions, etc
20:42mebaran151(i.e. what do the best practices say; resources seems like a slightly poor fit)
20:44aperiodicwhy is resources a poor fit? they sound like resources to me.
20:45mebaran151maybe, they seem to have a code fit too. I put them in resources at first just because I didn't know if there was a better place
20:49mebaran151hey it's working now! Though I have to recompile my app every time I make a change
20:53aperiodicwhat happens if you remove all the .clj files from the classes directory?
20:53mebaran151there are none there
20:53mebaran151I think the main thing is that Pivot is looking to load a class file (and now it can find my ApplicationRecord)
20:59aperiodicoh, the application record is coming out of defrecord?
21:01aperiodicthat might have a different behavior than classes created using gen-class. such classes dynamically seek the implementation in .clj files, which is why you only need to AOT them when you add/remove functions, or change their signatures
21:01mebaran151ah yeah
21:01mebaran151I was using defrecord
21:02mebaran151seems like in this case gen-class might be a stronger fit
21:02aperiodici'd agree
21:08mebaran151I also have a minor quibble: when I ctrl-c lein on windows, it doesn't close and I have to use taskmgr to reset it
21:10ihodesso, i want to finally give clojurescript a try. i'm wondering what the best workflow/environment is? i'm using ring/moustache for my backend stuff, but i'm wondering what's the best way to update the javascript in the browser from my cljs repl and not refresh?
21:13aperiodicmebaran151: seems to be a known issue https://github.com/technomancy/leiningen/issues/319
21:36technomancymebaran151: according to someone on the mailing list it's an intrinsic problem with cygwin
21:53matt444Wow, Himera is a game-changer
21:53ihodeshmmm, anyone? (previous question asking about a setting up a good workflow for developing in clojurescript; i'm going to be doing graphics programming, so i don't want to be refreshing the page each time)
21:56mebaran151technomancy: I'm not running lein in cygwin: I'm running lein in Powershell
21:57technomancyhm; I don't know then.
21:58mebaran151I see the lein process die, but not its child swank
21:58technomancymatt444: still trying to figure out what game exactly it is that's been changed
21:58mebaran151btw, has there been a lein release that fixed clojure-jack-in for windows?
21:59technomancymebaran151: 1.7.1 is the latest release; I don't know if jack-in works on it
21:59mebaran151ah I'm there
22:00technomancyit's unlikely to get fixed unless some enterprising windows user dives in and tries to fix it
22:02oakwiseihodes: run a browser connected repl and have your editor send code to it
22:03oakwiseare you using emacs?
22:04ihodesoakwise: i am
22:05oakwiseihodes: great. I just M-x shell and start a repl with `lein trampoline cljsbuild repl-listen` and then do something like this to send forms to that repl: https://github.com/brentonashworth/one/wiki/Emacs
22:06ihodesoakwise: oh nice--thanks!
22:07oakwisenp
22:07Zokatechnomancy: This is far fetched, but are you by any chance running some incarnation
22:07Zokaof webrepl-client against ringMon demo site at http://noirmon.herokuapp.com/ringmon/monview.html ?