#clojure logs

2012-02-15

01:51emezeskeAnyone know of a tool that can turn a javascript library into a "nice" externs file for the google closure compiler? (by "nice" I mean "doesn't generate a ton of warnings")
03:00clj_newbfor classpath instead of saying foo/1.jar, foo/2.jar, foo/3.jar, ... is it possible to say foo/*.jar ?
03:00clj_newb[I tried foo/*.jar in zshrc, and it did not work; but I feel like there sholud be a way to do it]
03:01alexyk_i.e. convert nil to 0 and leave non-nils alone
03:09bbloomI'm only a few days into to "real" work with clojure… and I think I'm forever spoiled
03:09bbloomI never want to write a line of code again without a live running compilation environment….
03:10bbloomI've even got some crazy ideas of cool macros I can write with the clojurescript analyzer
03:17lnostdalhum, is *print-level* being bound to "no limit" (i.e. NIL) by default (root level) really a good idea? .. when debugging and looking at stacktraces and error messages, it sometimes causes the error message or stack trace to in-turn cause a stack-overflow x)
03:29muhoohmm. midje or clojure.test ?
04:06mrsep#e
04:31amalloy$mail alexyk it looks like you were having connectivity problems, so i didn't catch your whole question, but you probably want fnil
04:31lazybotMessage saved.
04:42jrobiewhat's the best emacs mode for clojure?
04:42vijaykiranclojure-mode ?
04:43jrobiethanks, vijaykiran - i'm just ramping up to play with the language
04:44vijaykiranif you are using any of the emacs-starter-kit or perlude etc, it should come with clojure-mode
04:46jrobievijaykiran, i don't know about emacs-starter-kit or perlude
04:47jrobieah, google says http://dev.clojure.org/display/doc/Getting+Started+with+Emacs
04:50vijaykiranwhich version of emacs are you using ?
04:57jrobievijaykiran, GNU Emacs 23.3.1
04:57jrobievijaykiran, it does not seem to know clojure-mode
05:00vijaykiranjrobie: you may want to use the package.el to load the starter kit, I'm not sure if you have any customizations already, otherwise, just download and start with starter-kit
05:01vijaykiranjrobie: the wiki page seems to have the info ( in the comments)
05:02jrobiethanks, vijaykiran
05:46alexykhmm
05:46alexyklazybot: ?
06:06Rayneslazybot: kill
06:06lazybotKILL IT WITH FIRE!
06:07clgvalexyk: use $mail to get your mail
06:07clgvlazybot: kill
06:07lazybotKILL IT WITH FIRE!
06:10alexykclgv: privately to /lazybot?
06:14clgv$mail
06:14lazybotYou have no messages.
07:08RaynesYay for income tax.
07:12ejacksonRaynes: amen.
08:31osa1what is "root value" of a var? I'm trying to understand `defonce`
08:31ordnungswidrigosa1: vars can be rebound locally, e.g. using "binding"
08:32ordnungswidrigosa1: ...if the var is declared as dynamic
08:32Raynes*Some* vars.
08:32TimMcRaynes: I believe that all vars, deep inside, have the capacity for change.
08:33raekosa1: the value you usually deal with. the exception is when the var is dynamically rebound using 'binding', as ordnungswidrig mentioned
08:33RaynesTimMc: That's very glass half full of you, man.
08:33RaynesTimMc: I want to be more like you. I want to see good in the world.
08:34TimMcRaynes: Well, you're in luck. I believe that all IRC users, deep inside, have the capacity for change.
08:35ordnungswidrigI was defonced and I to not want to be rebound.
08:36Raynesordnungswidrig: Put that on a tshirt.
08:36ordnungswidrigs/to/do/
08:48TimMc&(do (do (do (require '[clojure.string :as s5])) (do s5/join)))
08:48lazybot⇒ #<string$join clojure.string$join@548695>
08:48TimMc\o/
08:49TimMcSo nested top-level 'do forms are also unrolled.
08:49TimMcThat takes a load off.
08:54TimMcArgh, I can't run deftest in a separate namespace for some reason...
08:56TimMc...and I can't run the contents in a different namespace, since that's not the top level.
09:12clgvTimMc: why?
09:23TimMcclgv: I want to run tests that are sandboxed in their own namespaces such that they can play with custom variations of 'import and 'require
09:24TimMcdeftest is apparently not compatible with this.
09:25clgvah ok.
09:49aidyWhat does the <int>M print syntax mean?
09:51Raynes&(type 1M)
09:51lazybot⇒ java.math.BigDecimal
09:52aidythanks :)
10:00babilenHi all. I would be grateful if you could criticize my code at http://paste.debian.net/156333/ . I need a function that splits a sequence at a subsequence and came up with the pasted solution, but am not sure if that approach is idiomatic or if there are better ways to do it. Thanks a lot!
10:00babilenI'd also like to have another function that splits at variable numbers of subsequences (in order), but I'd like to get the single sequence case right first. :)
10:01tsdhbabilen: Instead of (empty? someseq), it's idiomatic to use (seq someseq) which returns nil for empty collections, so it's the other way round.
10:03RaynesHoly crap
10:03RaynesI'm starting to feel bad for contributing another pastebin to the world.
10:03RaynesThere are obviously more pastebins than websites of any other sort combined.
10:03babilenIndeed :)
10:03RaynesAt least mine isn't bright pink.
10:04bhenrycan someone point me in the direction of the clojurescript one example (i think by brenton) that shows the commands to send expressions to the two different repls?
10:05babilentsdh: Thanks - I'll use seq in that case. I am fairly new to clojure so I am not sure if loop+logic is the best way to handle this. I primarily want to have a function that removes a subsequence (if present) from a sequence and returns both prefix/suffix of that subsequence.
10:05bhenryRaynes: there's no need for another pastebin when you have gist.
10:05babilenI might use take-while/drop-while but process element-wise now.
10:06Raynesbhenry: Well, I obviously disagree.
10:06bhenryRaynes: well prove me wrong.
10:06TimMcRaynes: I WARNED YOU ABOUT PASTEBINS BRO!!!!
10:06RaynesIsn't really the goal I was aiming for, but I'll certainly try.
10:06TimMcI TOLD YOU DOG!
10:07TimMcI told you man. I TOLD you about pastebins!
10:07RaynesYou did. You really did.
10:08TimMchttp://www.mspaintadventures.com/sweetbroandhellajeff/ for anyone who didn't get the reference and probably still won't after they follow the link
10:08babilenOk, excuse me for initiating this discussion about pastebins and their merits, but is the approach I am using correct?
10:09RaynesI don't know. I'm still trying to get past your pink pastebin.
10:09RaynesI've used up my quota for today.
10:10babilenRaynes: Hehe, ok. I happily paste it somewhere else if that helps ;)
10:10RaynesI think you're okay.
10:12ivansomeone should write a program that backs up all of the pastebins incrementally
10:13ivanexcept for pastebin.com, that's all crap
10:14babilentsdh: How would I implement line 7 using seq? That is (or (seq []) (seq [1])) obviously evaluates to (1), which is not what I want. I am also reluctand to split this into multiple ifs.
10:16TimMcbabilen: You're building up an awful lot of nested concats there.
10:16RaynesI like cats.
10:16TimMcI see a StackOverflowError in your future.
10:16TimMcRaynes: How do you feel about turtles?
10:16Rayneswww.youtube.com/watch?v=CMNry4PE93Y
10:17tsdhbabilen: DeMorgans law, (and (seq sub-seq) (seq s')) and reverse the branches of the if.
10:17babilenTimMc: True, but that is what I have so far. What would be a better approach?
10:17babilentsdh: ta!
10:17TimMcbabilen: No need for s', you can just call it s.
10:18babilenyeah, had that on my list already
10:18tsdhbabilen: Maybe it's better to convert to a vector before and then use the fast subvec function. Then it should be linear.
10:21babilentsdh: Ok, I'll investigate that. Thanks for the input so far!
10:21tsdhbabilen: I mean, recur thru the vector v (= (vec s)) and check if the (subvec v 0 (count sub-seq)) equals subvec. if so, then that's the position and (subvec v (count sub-seq)) is the rest you need to concat to the beginning.
10:21tsdhbabilen: You're welcome.
10:22babilentsdh: That would essentially get rid of the backtracking, yes.
10:23TimMcbabilen: I take it you want the subsequences to be lazy as well?
10:23babilenTimMc: That would be nice
10:24babilenJust criticize and give me some pointers, I am merely looking for other ideas or things that I unwillingly screwed up :)
10:24TimMce.g. (first (first (split-at-subsequence (range) [10 10]))) => 0
10:25babilenexactly
10:25Raynesbabilen: You're loud and your voice is annoying.
10:25RaynesOh, you mean code?
10:26TimMcRaynes: You're over-quota. o\__/o
10:26RaynesDamn!
10:26RaynesTimMc: So, what's up with trycljs?
10:26TimMcNothing.
10:26RaynesGuys, you've got to WORK on it. :(
10:27TimMcHey, if *you* have any brilliant ideas on how to get it to compile correctly, let me know!
10:27TimMcs/compile/compile CLJS/
10:27babilenTimMc: So, how to be lazy?
10:27RaynesTimMc: You should get dnolen on board.
10:28TimMcRaynes: THat would certainly fix everything.
10:28TimMc"Pull requests welcome (especially from dnolen)"
10:31RaynesTimMc: Sounds legit.
10:36pandeirois there a way to disable the property access syntax warnings with the ClojureScript REPL?
10:38TimMcWhy?
10:38clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack>
10:38TimMcNuts to you, clojurebot.
10:39pandeiroTimMc: dunno minor annoyance
10:39pandeiroif it were warning that I was using antiquated syntax, that would be one thing... it's warning me that i'm using the new, correct syntax
10:45TimMcOh, weird.
10:47clj_newbis tehre a way to take my *.clj, compiel them into a *.jar, so I don't have to recompile on every load?
10:47clj_newb(I've done writing my editor; and am argely using it now)
10:48clj_newband don't want to go through the recompilation process on every use
10:48TimMcbabilen: Maybe you could have a first pass that converts split-points into (Object.) sentinals, and then a second pass that splits into subsequences?
10:48TimMcclj_newb: lein uberjar?
10:49babilenTimMc: I'll see what I can come up with. I tried a lazy-seq approach first, but my clojure-fu was too weak and .. well .. You saw what my best attempt was :)
10:49clj_newbI don't have lein
10:49clj_newbI have been coding i the repl athis whole time
10:56cemerickclj_newb: get lein :-)
10:58TimMcclj_newb: Dare I ask how you've been downloading dependencies, executing your code, running tests...
10:58TimMcI dursn't.
11:11TimMcbabilen: First write a fn that checks if a seq is a prefix of another seq.
11:13TimMcbabilen: Then write a fn that uses lazy-seq to iteratively either skip a prefix and cons on a sentinal or cons on the next element.
11:14babilenTimMc: Thanks -- I've incidentally started working on the first one just now. Great help and may you have a nice day :)
11:15TimMcbabilen: Finally, write a fn to split on sentinals.
11:15TimMc:-)
11:20babilenTimMc: Hmm, what is the best approach to achieve the "iteratively" part?
11:24TimMcbabilen: (source partition-by) Look at the call to lazy-seq, which contains some conditionals, which contains calls to cons, which then contains calls to partition-by again
11:25TimMc(It look recursive, but lazy-seq actually makes it iterative.)
11:26babilenTimMc: Oh, perfect example and exactly what I need. Wonderful :)
11:39TimMcclgv: Actually, the problem with sandboxing deftest seems to be that with deftest itself in a pocket namespace. lein test doesn't see it. >_<
11:40clgvTimMc: cant you just write a macro that doest the actual execution in another namespace and use that within a deftest?
11:41TimMcclgv: import, require, and other name-resolution or evaluation modifiers have to be in preceding top-level forms to the stuff they modify.
11:41TimMcI'm going to try using eval, actually.
11:42clgvTimMc: you do not need to use these
11:42TimMchmm?
11:42clgvTimMc: you can intern the symbols for the testnamespace yourself
11:42clgvTimMc: have a look at the namespace related function in core
11:43TimMcclgv: I'm testing a lib that manipulates namespaces.
11:46TimMcclgv: It manipulates the namespace via various methods -- I would like it if the test cases could capture and confine that manipulation.
11:48clgvTimMc: sounds like a bootstraping problem then ;)
11:49TimMcsort of?
12:19jkdufairbecause i think in smalltalk and/or lisp, I can't help conclude, with forehead against keyboard during my day job that oo design patterns are nothing more than language feature workarounds
12:19gtraknorvig has a good site about that
12:20gtrakjkdufair: http://norvig.com/design-patterns/
12:20clgvjkdufair: they are as well vocabulary ;)
12:21jkdufairyeah, a good vocabulary is essential
12:21gtraka pattern is something repetitive, what do we do when things are repetitive?
12:21jkdufairi get the impression in clojure there are fewer design patterns and more idioms
12:21`foguswrite a macro
12:21gtrakwait for fogus to write a macro :-)
12:21clgvgtrak: name them? ;)
12:23jkdufairyeah macros are sort of the anti-design pattern
12:23gtrakjust, abstraction in general
12:24jkdufairi think i'd seen that norvig bit before. at least the part about 16 of the 23 design patterns are simplified in dynamic languages
12:24jkdufairi think c# is like the cute girl/boy in choir in high school. hot & talented but you always end up in tears in the end
12:26jkdufairthx all for letting me rant
12:26xorola@jkdufair:How ? i am referring to c#
12:26jkdufairhow what?
12:27TimMcxorola is asking you to explain your analogy.
12:27jkdufairoh it's a weak one :-)
12:27xorola:)
12:28jkdufairall these libraries and fast JITs and such. but when i want a class instance var like smalltalk it says "sorry, i don't do that"
12:28jkdufairyou walk away a bit... blue
12:29jkdufairand i could probably start doing inner classes and whatever voodoo clojure probably has to do to kick things up a notch. but zawinski's law starts coming into play
12:29jkdufairguess it's not zawinski
12:30jkdufairgreenspun
12:30technomancythe tyranny of greenspun is inescapable
12:31jkdufairtyranny is right
12:32dnolenjkdufair: I'm of the opinion that OO is powerful stuff - but like mutability - too easy to get wrong. I think Clojure's strategy of putting the OO stuff at the bottom (instead of at the surface) of the language is a killer, killer idea.
12:32jkdufairyeah i suppose i don't disagree with OO's power. smalltalk is still a great love of mine. half-baked OO like Java and C# make me cry.
12:33jkdufairand i wholeheartedly agree with clojure's strategy
12:33jkdufairof course, then you put JavaScript at the bottom and you wonder if someone put something funny in your drink
12:33`fogus(inc dnolen)
12:33lazybot⇒ 4
12:34technomancyMenTaLguY: any luck with that lein deps hack you were trying?
12:34technomancyI have a feeling it might be nicer on lein2
12:34dnolenjkdufair: the story is more complicated then that I think. I don't think Smalltalk is all that ideal either - C# and Java bring good stuff to the table.
12:34xorolacan somebody tell me how smalltalk OO is different from C# or Java OO? a resource is helpful
12:35xorolai dunno smalltalk
12:35TimMc$google greenspun's law
12:35lazybot[Greenspun's tenth rule - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Greenspun's_tenth_rule
12:35TimMchaha, that one
12:35jkdufairin smalltalk, everything is an object. all the way down. so classes themselves are objects
12:35dnolenxorola: the purple Smalltalk-80 book is good, download Squeak
12:36jkdufairit's just more consistent
12:36jkdufairdnolen: i don't disagree. plenty of good stuff. and most of the time i like my day job. just not today
12:36xorolait sounds more like python OO, am i right?
12:36technomancyxorola: smalltalk is all about passing messages to objects
12:36technomancyrather than objects being a bucket full of methods where you reach in and find what you want to call
12:37jkdufairyeah python has many of the same design constraints as smalltalk
12:37technomancypython uses the bucket-o-methods approach, ruby uses smalltalk's approach
12:37technomancymore or less
12:37jkdufairah i had them backwards
12:39technomancyself and IO I guess, depending on how far you want to stretch the definition of mainstream-ish
12:39technomancyIo
12:39dnolen technomancy: Objective-C
12:39technomancyoh, of course
12:39chewbrancaerlang ;-)
12:40`fogusnot everything in Smalltalk is an object
12:41jkdufairprimitives may not be, but they can be treated as such
12:41kurtharrigerin leiningen I'm trying to specify 2 sperate hooks, :hooks [leiningen.hooks.groovyc leiningen.hooks.junit] but this results in a Caused by: java.lang.IllegalArgumentException: argument type mismatch if the list only contains one hook it works
12:41`fogusjkdufair: not talking about primitives
12:41jkdufairhmm. what have i forgotten?
12:42`fogusWhat is the Smalltalk object type of |x y z| ?
12:42technomancykurtharriger: :hooks is just a declarative shorthand for requiring a namespace, so as a workaround you can just slap (require 'leiningen.hooks.groovyc leiningen.hooks.junit) after your defproject form.
12:42jkdufairalas. all values are objects :-)
12:42technomancykurtharriger: but if you could paste your full project.clj I could attempt repro and see if we should open an isue
12:43kurtharrigerok, actually it might be something wrong with my junit plugin compile fails if that hook is included but test works
12:44kurtharrigerI thought maybe I had the syntax for hooks wrong but might be something else
12:44`fogusjkdufair: One could say that I'm just picking nits ;-)
12:44jkdufair:-) it's an important distinction. one i wouldn't have gotten without learning clojure. more specifically having read Joy of Clojure :-)
12:45jkdufairawesome book, btw
12:45jkdufairjust curious - do you get the same royalties whether i buy it from manning or amazon?
12:45`fogusjkdufair: Just buy from wherever is cheapest. I'm not getting rich in either case.
12:46jkdufair`fogus: bought it from amazon. just wanted to gauge how much guilt to feel
12:46jkdufairanyway, thx for writing it
12:47`fogusjkdufair: You should feel about $0.43 worth of guilt
12:47jkdufairhaha
12:47xorolafogus:heard jeff ritcher and joshua bloch royalties are high ,is it true?
12:47ibdknoxhow far the writing industry has fallen :(
12:47`fogusno idea
12:49kurtharrigertechnomancy: figured it out, the first groovyc is in a jar and on classpath, I had changed my project classpath to src/clj but still had my leiningen hook in src/leiningen so it wasn't on the classpath
12:49technomancytricky
12:50kurtharrigerthe exception changed when I tried the require form to the much more obvious class not found
12:50babilenHi all -- I am a bit baffled by the behaviour you can see on http://paste.debian.net/156370/. What am I missing or doing wrong?
12:50technomancyhm; that is a pretty strange exceptino
12:52cemerickBarring a miracle, I'm sure I'd self-publish if I were to ever write another book (or any other for-pay content).
12:52technomancyI'm afraid I must have been less than totally clear; he says he wants to try out "my lisp implementation" o_O
12:52kurtharrigerthe werid thing is the plugin itself worked just not the hook
12:52technomancycemerick: peepcode does all the video recording, payment handling, and promotion but still gives you half.
12:53kurtharrigerAt clojure conj I saw a guy riding a bike with a t-shirt reading "one less car"
12:53cemericktechnomancy: I've never considered doing screencasts. Maybe that should change. *shrug*
12:53technomancyit's ridiculous
12:53ibdknoxcemerick: as someone who might do that... I'd love to hear why :)
12:54TimMcbabilen: partition 2 interleave is just map vector
12:54`fogustechnomancy: ridiculous == lucrative?
12:54cemerickibdknox: I'm reserving full judgement for a year, but you can ask me for details so far next month if you like.
12:54babilenTimMc: Right, but still -- Why the difference?
12:54ibdknoxwill do
12:54TimMcbabilen: and this approach of counting, welll... better off doing a loop recur, I think
12:54technomancy`fogus: yes, but I was thinking more in terms of comparing it to the rest of the industry
12:55ibdknoxcemerick: I would've thought that with oreilley's reach it'd be worth it
12:55TimMcAlso, the subseq should be the first arg, I think...
12:55ibdknox-e
12:55cemerickibdknox: well, that's why I'm reserving judgement :-)
12:55mi6_x3mhello, am I right that a clojure form is just executable data?
12:55cemericktechnomancy: I think the prags do 50/50 too
12:55babilenTimMc: I am just playing around, but do not understand the difference in the behaviour. (which might highlight a more general misunderstanding I have)
12:55technomancycemerick: oh, really? that's fantastic.
12:56semperosreading through the congomongo code, looking at how the set-connection! function "resets" a var; can someone explain why both alter-var-root and set! are used like this?
12:56semperoshttps://github.com/aboekhoff/congomongo/blob/master/src/somnium/congomongo.clj#L133
12:56`fogusPrags are notoriously generous
12:57cemericktechnomancy: http://pragdave.blogs.pragprog.com/pragdave/2009/10/pragmatic-bookshelf-royalty-rates.html
12:57ibdknoxbut truthfully writing a book, especially a technical one, will never amass a fortune
12:57technomancycool
12:57ibdknoxit's the cred that's the reward ;)
12:57`fogusibdknox: Maybe not, but certain authors can live comfortably
12:57cemerickibdknox: Nevermind fortune, it's probably rare to make minimum wage.
12:58technomancyibdknox: considering it only took me a month and I still get checks every quarter, both my peepcode screencasts were an excellent investment of my time economically
12:58ibdknox`fogus: I suspect they're the exception?
12:58ibdknoxtechnomancy: I'll have to check out this peepcode thing :)
12:58`fogusibdknox: Flanagan was living off of his JS: TDG for many years as I understand it
12:59`fogusibdknox: Yes, he's an exception
12:59cemericktechnomancy: is yours the only Clojure vid they have?
12:59technomancymy situation was maybe somewhat unique given that I was between jobs at the time
12:59technomancycemerick: yeah, but I also did the Emacs one
12:59technomancythey've been focusing on JS a lot recently
13:00cemerickThat's probably a big factor: if you're not busy otherwise, a book/video/etc is a great investment.
13:00babilenTimMc: Sorry, have to run now. If you have any idea why it works in the repl, but not as functions let me know. I'll be back later and grateful for all your tips and help so far :)
13:00ibdknoxyeah
13:00xorolaexception in the sense,js everywhere :)
13:00xorolaso many buy flanagan's books
13:00ibdknoxcemerick: anything that generates passive income
13:00`foguscemerick: cross-sells?
13:01technomancymine came out a couple weeks before the prags', so it was technically the first commercial Clojure documentation released =)
13:01cemerick`fogus: going to bring the atlas up to date and a general polishing; buy the book, get the atlas for $X
13:01`fogusAhhh
13:02`fogusI only have Marginalia and Trammel to offer :-(
13:02cemerickBetween that and amazon affiliate chits…
13:02ibdknoxcemerick's building a little empire ;)
13:02technomancyevery time I see Trammel my mind autocorrects it to Pummel
13:02ibdknoxlol
13:02cemerickemphasis on *little*
13:02`foguscemerick: Yes! I get one free book per year thanks to affiliate links. :p
13:03cemerickreally?
13:03`fogustechnomancy: That about sums it up
13:03cemerick`fogus: Is your only affiliate link on http://joyofclojure.com/buy-joc/ ?
13:03arohnersemperos: alter-var-root doesn't change a thread local binding, I believe
13:04`foguscemerick: that among 2 or 3 others
13:04cemerickoh, didn't see the amazon icon at the bottom of the home page
13:04cemerick`fogus: should put an amazon link right below the book cover on blog.fogus.me
13:05technomancythe word "pummel" has such a great background
13:05technomancycomes from "pommel", which is the non-pointy end of a sword
13:05semperosarohner: I understand that alter-var-root atomically changes the root binding
13:05semperosbut I guess I don't understand why both of those operations are stringed together
13:06`fogustechnomancy: We created a function named pummel in JoC :-)
13:06semperosas the root binding is used by default
13:06technomancy`fogus: refresh my memory?
13:06arohnersemperos: a var can have two values: the 'root' value, which is what you see if the current thread is not using (binding), and the thread local value
13:06arohneralter-var-root sets the root value, but not the thread-local value
13:07arohnermongo uses both, set-connection! sets the root value, with-mongo sets the thread-local value
13:07`fogustechnomancy: It just throws a bunch of mutations against a reference across a bunch of threads.
13:08technomancynice
13:09semperosarohner: so it's just setting the root value, which will be shared by all threads not having a local binding, as well as the thread local value, just to have the local one set explicitly?
13:09arohnersemperos: right
13:10semperosis it just to be explicit? am I wrong in understanding that the root value would be defaulted to anyway?
13:10semperos(sorry for beating this, just want to make sure I understand the nuances)
13:11arohnernotice the check for a thread binding. If the the user did (with-mongo …. (set-connection!)), they wouldn't see a change in the local thread, because the previous thread-local would still be in effect
13:13semperosright, so after changing the root binding, it checks to make sure it's bound locally as well, and only if that's the case, changes the thread-local binding as well?
13:13arohnersemperos: right
13:14semperosarohner: thanks for the hand-holding, I think I've got a better grip now
13:14`fogusOMG That video is awesome
13:15hugod`fogus: any plans for a marginalia release?
13:16`fogushugod: I want to have 0.7.0 out before CljWest
13:17hugod`fogus: ok, thanks (I would love to have a 1.3 compatible goal for marginalia in zi)
13:17jaimefso you point lein directly at the clojure.jar via the env var CLOJURE_JAR and it bombs with ClassNotFoundException: clojure.main
13:17technomancyjaimef: yeah, don't do that
13:17`fogushugod: Any feedback for v0.7.0-SNAPSHOT?
13:17technomancyCLOJURE_JAR is an implementation detail
13:18jaimefyeah well I unset it, it downloads it, then gets the same error :P
13:18technomancyjaimef: oh, crap. =(
13:18jaimefoddly was fine on bsd just bombing on linux
13:18technomancyI have checksumming in there to protect against corrupted downloads
13:19hugod`fogus: haven't tried it, since I can't run it from zi ;) - I should give it a go...
13:19technomancyjaimef: can you rm the jar, retry, and see if it gives a checksum warning?
13:19jaimefit download to ~/.m2?
13:19technomancyjaimef: yeah
13:19jaimefenoent
13:20jaimefok nuked ~/.lein
13:20jaimefreran, it downloads the standalone jar for lein, then bombs with Exception in thread "main" java.io.FileNotFoundException: Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath:
13:20jaimef
13:21technomancyjaimef: oh, you're using lein2?
13:21jaimefleiningen-2.0.0-SNAPSHOT-standalone.jar guessing so
13:21technomancyon purpose? =)
13:21jaimefyeah LEIN_VERSION is 2.0.0-SNAPSHOT
13:21jaimefobviously I don't know better :P
13:21technomancyhehe; ok.
13:21technomancyif you just want to get stuff done, you should use the stable branch
13:22jaimefyeah pulled it from github
13:22jaimefthanks
13:26technomancyyeah, I have a warning in the readme about the master branch, but it's easy to miss
13:28technomancywould be happy to have help testing out lein2, but if you just want to get stuff done it's not the most convenient right now
13:29jaimefsure
13:31jaimefodd M-x slime asks to download items.
13:31technomancythat would be from swank-clojure.el; you want either M-x slime-connect or M-x clojure-jack-in
13:31technomancyM-x slime has been deprecated for Clojure for ... I want to say 2 years?
13:33sorenmacbethtechnomancy: Is there an equivalent to clojure-jack-in when you want to kill your repl session, something like clojure-jack-off (sorry, couldn't resist)?
13:33sorenmacbethI usually just kill the swank and repl buffers
13:34technomancyI just re-run M-x clojure-jack-in
13:34technomancyit knows to kill the existing connection
13:34sorenmacbethok, that is what I tend to do as well
13:34sorenmacbethcheers
13:39tmciversorenmacbeth: you can also comma "," followed by quit, in the repl, but as I may have mentioned here in the past (technomancy), the follow up clojure-jack-in occasionally fails in which case I must restart emacs.
13:39technomancyhm; haven't seen that myself
13:41tmcivertechnomancy: doesn't bother me much but I would be interested to know what's going on there. Could be my setup though I don't believe I'm doing anything very strange. Running emacs 23, if that could matter.
13:41technomancycould be why I'm not seeing it
13:41sorenmacbethtmciver: I see, that closes the repl, but leave the swank server running in the *swank* buffer
13:42Null-AHas anyone gotten autodoc working with emacs24?
13:42sorenmacbethThe typical reason I want to close my repl session is because it can hog a ton of ram (because I have it configure to do so in my project.clj)
13:43jaimefslime -> "Clojure is not installed do you want to download?" Y-> fails, N-> Exception noclassdef for clojure/main
13:43sorenmacbethtmciver: Hi, btw =)
13:43tmciverHello!
13:43tmciverDid you get my email?
13:43sorenmacbethtmciver: I did, that time should be fine
13:43jaimefodd thing is the same emacs config works on one system.
13:43sorenmacbethI'll reply to the email now though
13:44technomancyjaimef: see above; that's been deprecated for about two years
13:44jaimeftechnomancy: yeah tried jack-in same error
13:44tmciversorenmacbeth: concerning the swank buffer, I see that it is still there for me as well, but I don't get a complaint from emacs when I quit as I will if I don't kill slime.
13:44jaimefrather exits with error code 1
13:44technomancyjaimef: need to get rid of the swank-clojure emacs lisp package
13:45jaimefyeah already installed
13:45jaimefahhh so it runs "cd /home/jaimef && lein jack-in 2621" but the error is "That's not a task Use "lein help" to list all tasks"
13:46technomancyit only works from a project
13:46technomancyplus you need swank-clojure as a lein plugin, not an emacs plugin
13:47jaimefyes I already ran lein plugin install swank-clojure
13:48jaimefwill double check my ~/.m2 dirs between the two
13:48jaimefso "M-x slime" was replaced with "M-x clojure-jack-in" which only works on projects?
13:48tmcivertechnomancy: does the existence of the swank buffer in emacs imply that the swank server is still running?
13:48technomancytmciver: no, the swank buffer stays open after the project exits
13:49tmciverOK
13:49technomancyjaimef: more or less; you can use slime-connect to work outside a project
13:49jaimefhmm ~/.m2 is the same on both. same contents. clj-stacktrace, org, swank-clojure. same emacs config, and emacs version. including same clojure.jar location.
13:50jaimefjre is different
13:50technomancyif it says "that's not a task" then you don't have the swank-clojure plugin
13:50jaimefok I can rerun plugin install
13:55mrevil`for Leiningen projects is there a best practice for a directory location to store test data? Sorta like a resources dir, but for test. I need to store an XML file that is normally fetched by an HTTP GET in order to mock some functionality.
13:56technomancymrevil`: dev-resources should do the trick
13:56jaimefrinse repeat
13:57mrevil`sweet, ty
13:58technomancymaybe it has to be test-resources in lein1; can't remember
14:32dnolenjaimef ?
14:34jaimefdnolen: ?
14:34dnolenjaimef: what are you asking?
14:34jaimefahh more context.
14:35jaimefin ruby you can take any object and run .class to see what type of object it is, e.g. int, float, array, hash
14:35cemerick,(class 5)
14:35clojurebotjava.lang.Long
14:36cemerickjamiei: ^
14:37dnolen,(class :foo)
14:37clojurebotclojure.lang.Keyword
14:37dnolen,(bases (class :foo))
14:37clojurebot(java.lang.Object clojure.lang.IFn java.lang.Comparable clojure.lang.Named java.io.Serializable)
14:48jaimefthanks
15:08duck1123Keep in mind, with clojure, you want to think more in interfaces and basic abstractions than in concrete class names
15:18TimMc&(class (list* 3 nil))
15:18lazybot⇒ clojure.lang.PersistentList
15:18TimMc&(class (list* 3 (range 5)))
15:18lazybot⇒ clojure.lang.Cons
15:18TimMc:>
15:22Null-Awhen I call str on a lazyseq, it returns "clojure.lang.LazySeq@c0dddfb" even with a doall
15:23tmciverNull-A: (apply str mylazyseq)
15:24Null-Ahm, what if I have a seq of lazyseq?
15:24Null-Ai'll try that first
15:25Null-AHere's the code (defn fail [format-str & args]
15:25Null-A (throw (Exception. (apply format format-str args))))
15:25Null-Aargs is a seq of lazyseqs
15:27Null-Athis works:
15:27tmciverwhat do you want returned? A string? seq of strings?
15:27Null-A(defn fail [format-str & args]
15:27Null-A (throw (Exception. (apply format format-str (doall (map #(apply str %) args))))))
15:27Null-AI want the exception to not print lazyseq@xxxx
15:27jondot_i'm seeing this for clojure koans, https://github.com/functional-koans/clojure-koans --> from amount of watchers i deduce its good, right?
15:27Null-Athat works though
15:31Raynes$max
15:31Raynes~max
15:31clojurebotTitim gan éirí ort.
15:31RaynesDamn it.
15:33cemerickseems like a new-ish high, huh?
15:35amalloypr-str, Null-A
15:35amalloy&(pr-str (range 3))
15:35lazybot⇒ "(0 1 2)"
15:35Null-Aamalloy: ah thanks
15:42foodoodnolen: I just watched your Conj video on match. Where can I find documentation for your module?
15:43dnolenfoodoo: https://github.com/clojure/core.match, still pretty alpha, but the final puzzle pieces are falling into place
15:44foodoodnolen: thanks. I wish clojars.org had a link to the homepages of the projects (I even searched github, but couldn't find it)
15:46emezeskefoodoo: clojars *will* link to project homepages, if those projects include a :url
15:46Null-AIs it possible to change the toString implementation of an existing object?
15:46emezeskefoodoo: so it's not clojars' fault, it's projects that omit the :url entry
15:47dnolenfoodoo: core.match isn't provided via clojars, i should probably remove core.match from clojars.
15:48dnolenNull-A: in Clojure? no
15:48Null-Adnolen: I thought so, thanks
15:48foodoodnolen: I think the good thing about clojars is that Leiningen can easily pull dependencies from it. I don't know if it supports git urls.
15:50Null-Adnolen: Is there any way to reset relation and index state in core logic? like retract-all-facts?
15:50dnolenfoodoo: [org.clojure/core.match ...] will work fine
15:50dnolenNull-A: just redef the relation
15:50Null-Adnolen: hm, i tried that, but it didn''t work, i'll try again
15:50dnolenNull-A: there's no way besides that at the moment
15:53zakwilson_ibdknox: does korma know anything about postgres hstore?
15:55Null-Adnolen: Yah I get null pointer exception with var-get, then fact in stack trace
15:55Null-Adnolen: I put the defrel inside a function
15:55dnolenNull-A: probably not a good idea, defrel is meant to be top level
15:56Null-Ahm, makes it hard to retract facts then dynamically
15:56Null-Ai wrote a hack to do it anyways
15:56Null-Abut it's not patch worthy
15:57tscheiblfrom a functional programming standpoint, is it wise to adhere to the "with" paradigm as e.g. applied in clojure/java.jdbc? ... or is it generally better to pass explicit arguments to functions and use dynamic var binding for commonly required data in a local context where you often just split functionality over separate functions not to facilitate code reuse but to increase readability?
15:57dnolenNull-A: patch welcome, the defrel/fact stuff could use some attention from someone - don' t have the bandwidth for it at the moment
15:58Null-Adnolen: actually I just got it working by binding *ns*
15:58Null-AI guess *ns* is not available during runtime
16:05tscheibldnolen: btw, would you consider it better to fix the ClojureScript Compiler to not convert the \u unicode notation to utf-8 when compiling without optimizations or rather consider it as an undocumented Microsoft(tm) extension to Javascript that IE takes the utf-8 equvalents of \uFDD0 up to \uFDEF as equal and stick to the proposed fix (workaround, hack?) by replacing \uFDD0 and \uFDD1 with \uFDF0 and \FDF1 respectively?
16:13dnolentscheibl: http://stackoverflow.com/questions/5188679/whats-the-purpose-of-the-noncharacters-ufdd0-to-ufdef
16:14dnolentscheibl: I'd rather not apply the patch given ^
16:15tscheibldnolen: so it would be more adequate to fix the compiler?
16:15ivanGoogle will tell you that putting non-ASCII in your .js is wrong
16:15ivanIE does Noncharacter->replacement char in other places as well, like XDomainRequest responses. seems to hate them.
16:16Null-Adnolen: just submitted two patches on jira
16:16dnolentscheibl: I'm not clear on what has to be done - do you have a proposal?
16:16dnolenNull-A: thx
16:20dakronetb
16:21tscheibldnolen: as you can see by running the tests I've attached it only happens when the code does not get optimized by the google closure compiler. So ClojureScript somehow converts the \u unicode representations to their utf-8 equivalents which makes (only) IE behave the described way (considering the "characters" of the mentioned unicode range as equal). What I would do is to fix the ClojureScript to Java compiler not to do the converion as it happens when
16:21tscheiblswitched to a google closure optimization mode.
16:21Null-Ai've noticed C-xC-k is much faster in emacs24
16:21Null-AC-cC-k*
16:22tscheibldnolen: otherwise it's not possible to test non trivial ClojureScript apps in "development mode" on IE
16:24tscheibldnolen "non trivial" was probably not the correct phrase... it starts to fail when it has to distinguish between symbols and keywords
16:25tscheible.g. when doing read-string containing keywords
16:25dnolentscheibl: I agree it's a big problem. Just not clear to me where the problem is occurring in Compiler. Perhaps an artifact of Java strings?
16:29tscheibldnolen: I could have a look at the ClojureScript compiler (in the meantime I should be fit enough with Clojure to understand what's going on) when I find some time, the next 2 days I will be quite busy in trying to satisfy a "nasty" customer.. but afterwards
16:30dnolentscheibl: please do, what precisely does GClosure do to those chars under optimization?
16:30tscheiblnothing.. that'S the point
16:30tscheibldnolen: it leaves the /u notation untouched
16:30ivanI think GClosure turns all UTF-8 into \u escapes
16:31tscheibl.. or maybe reencodes it from the utf-8 strings the ClojureScript compiler produces
16:31ivancan't you stick more backslashes in ClojureScript somewhere? ;)
16:31mi6_x3mcan someone explain to me exactly what keywords are
16:31mi6_x3mI know they resolve to themselves
16:31tscheiblivan: nah.. it's not Windows :D
16:32mi6_x3mwhat is their type
16:32dnolentscheibl: oh ok, then probably a result of not escaping Java strings seems like an easy fix. Will look into, thanks for the clarification
16:33dnolen,(class :foo)
16:33clojurebotclojure.lang.Keyword
16:33dnolenmi6_x3m: ^
16:33mi6_x3mdnolen: do you happen to know what the type consists of?
16:33mi6_x3msome string description of the keyword?
16:33mi6_x3msome identifier?
16:34dnolenmi6_x3m: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java
16:34mi6_x3mdnolen: ah, okay, sorry, I am all new to this stuff
16:39ibdknoxzakwilson: it knows no vendor specific things
16:40zakwilsonibdknox: I thought not. It seemed very confused by my attempt to give an hstore field a map.
17:12mrevil`what should I be googling to find examples of mocking in midje?
17:12TimMcmrevil`: Alex Baranosky's email address.
17:20Null-Ai'm having font-lock issues with emacs24 while editing clojure, has anyone else run into this?
17:24wthiddenNull-A: what plateform is emacs running on?
17:24Null-Awthidden: osx
17:25Null-Ait's odd, it wasn't happening until I recompiled clojure-mode
17:25Null-Aslime*
17:25Null-Ai might have upgraded slime in the process
17:25dnolenNull-A: I've had no problems
17:25Null-Ahm
17:25Null-Ai'll keep playing
17:26wthiddenNull-A: hmmm, i've had little experience with OSX. I've had some issues in the past with linux
17:26wthiddenNull-A: what is the error/symptom?
17:26Null-Awthidden: The coloring gets messed up as I type stuff
17:26Null-Awthidden: e.g. it doesn't really fix coloring when I use paredit to unquote strings
17:26wthiddenNull-A: are you using color-themes?
17:27Null-Awthidden: yes but I tried without , and no difference
17:28wthiddenNull-A: do you have some font-lock setting set in the customize section of your .emacs?
17:28Null-Aoh I might
17:28Null-Ai'll try removing it
17:29wthiddenNull-A: I sometimes get over zealous with customize setting ... and thus conflicts
17:33Null-Awthidden: it's working now, but I need to wait longer to make sure
17:35mi6_x3mcan someone explain to me whz
17:35mi6_x3mwhy* (def myfunc (fn [w] (count w))) is different than
17:35wthiddenNull-A:good luck.
17:35mi6_x3m(defn myfunc (count w))
17:35Null-Awthidden: thanks
17:39wthiddenmi6_x3m: well the first thing that jumps out to me is that your defn is form is ill-formed.
17:39mi6_x3mwthidden: yes, I know I missed [w]
17:39mi6_x3mit's a general question
17:40brehaut,(macroexpand '(defn mf [x] (count c))) ; mi6_x3m
17:41technomancymi6_x3m: defn will give you better stack traces
17:41clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
17:41brehaut,(macroexpand '(defn mf [x] (count x)))
17:41clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
17:41technomancythe only practical difference is the metadata attached to the function
17:41brehautbah, ##(macroexpand '(defn mf [x] (count c)))
17:41lazybot⇒ (def mf (clojure.core/fn ([x] (count c))))
17:41mi6_x3mtechnomancy: OK, thank you very much
17:45dhmdhm/_dhm
17:49amalloytechnomancy: better stacktraces, really?
17:49technomancyamalloy: well, you could put a name inside your fn as well
17:50ibdknoxyou get the name of the function
17:50technomancybut a nameless fn sucks to see in a stack trace
17:50pandeirois it possible to test cljs macros at the browser repl?
17:50ibdknoxnot that I'm aware of
17:51pandeiroibdknox: can't get defpartial to work and dunno how to debug it
17:51amalloymmmm, i don't think that's true, technomancy
17:51dnolenpandeiro: something that could be solved by some kind of reflection facility
17:51ibdknoxpandeiro: get the latest crate
17:51amalloy(def f (fn ...)) compiles the function into a class named user$f
17:52ibdknoxpandeiro: there was a bug in defpartial
17:52amalloythere's special magic in the compiler's handling of (def ...), that checks if the value is a (fn) literal and calls compileForDefn instead of just compile
17:52pandeiroibdknox: thanks
17:54technomancyamalloy: huh; I guess that makes sense
17:54technomancyI wish it went the other way where the fn would get the metadata from the var =(
17:54ibdknox+1
17:55technomancyno arglists make for sad pandas
17:56pandeiroibdknox: what are the special crate group attrs useful for?
17:56ibdknoxpandeiro: if you use jayq you can then do things like ($ my-partial)
17:57ibdknoxand bind events, or animate, or whatever
17:57ibdknoxand it will take effect on anything that is created by that partial function
18:06pandeiroibdknox: still no luck w/ defpartial
18:06ibdknoxmaybe I didn't push
18:06pandeirolooks like it's expanding into a call to crate.html()
18:06pandeirobut it returns undefined
18:07emezeskepandeiro: do you have a (:require crate.core :as whatever) ?
18:07pandeiroemezeske: yep
18:07emezeskepandeiro: nm then! that's bitten me before. :/
18:07pandeirobut not sure i would need it right?
18:07ibdknoxyou do
18:07pandeirok
18:08emezeskeyeah, anything that the macro's output references must be available :(
18:08ibdknoxpandeiro: you restarted cljsbuild and and saved that file to get it to recompile, right?
18:08emezeskepandeiro: could also do a "lein cljsbuild clean" first
18:08pandeiroibdknox: still hacking on top of one but yeah it has a handler that rebuilds cljs every time
18:08pandeirolet me empty the browser cache too (for some reason chromium is caching js randomly)
18:09ibdknoxpandeiro: I have this crate and it works: crate-0.1.0-20120214.022223-8.jar
18:10pandeiroibdknox: i have the master from github as of now, should be good?
18:10ibdknoxhm
18:10ibdknoxyes
18:11ibdknoxactually
18:11ibdknoxno
18:11pandeiroibdknox: k
18:11ibdknoxpandeiro: pull
18:12ibdknoxI should automate that so that I can't lein push without commiting and pushing
18:12ibdknoxcommitting*
18:13ibdknoxpeople haven't been working against my source much, so it's never been an issue before
18:13pandeiroibdknox: something's weird, the js looks fine but it still returns undefined... probabl something on my end
18:14pandeiroibdknox: i am still working on something with one, soon i'll mix up my workflow for cljsbuild and jars and stuff
18:14ibdknoxpandeiro: it's pretty darn easy these days
18:15ibdknoxespecially with the classpath stuff it's even easy to do the externs and whatnot
18:15pandeiroibdknox: i admit the externs convo scared me
18:15babilenHi all -- I am a bit baffled by the behaviour you can see on http://paste.debian.net/156370/. What am I missing or doing wrong?
18:15ibdknoxpandeiro: it's easy :)
18:16ibdknoxpandeiro: just have to add :externs ["externs/jquery.js"] to your cljsbuild params
18:16pandeiroibdknox: you are pushing the jayq pretty hard :)
18:16ibdknoxand done
18:16ibdknoxeh, not really
18:16ibdknoxjust trying to convince people that things have gotten better/much easier
18:17pandeiroibdknox: i will definitely try it, tell me though can it automate compiling a dev and production version like one does?
18:18ibdknoxthe only difference is :advanced vs. :simple, right?
18:18pandeiroyeah
18:18ibdknoxsure
18:18pandeiroi run into some weird stuff with :advanced so i'm testing it every commit to avoid having to track down stuff after
18:19ibdknoxyou just need to switch a keyword in your project file
18:19ibdknoxit's easy enough to have that happen based on env vars or something
18:19technomancybabilen: (range) is infinite
18:19pandeiroibdknox: yeah could be in the repl module maybe
18:19technomancyif you interleave a finite seq with an infinite seq, you get an infinite seq =)
18:20pandeirobut i think one had an interesting idea putting that scaffolding around the app in the browser
18:20technomancywhich is weird because map operates on two seqs but stops when one runs out
18:20ibdknoxpandeiro: what do you mean?
18:21pandeiroibdknox: well they have a handler doing advanced compilation wired up to a link on the top bar
18:21technomancyhm; I guess it should still work with laziness though
18:21ibdknoxoh
18:21pandeiroso when you test dev, you just right click a link to test advanced in another tab, done
18:21ibdknoxI see
18:21pandeiroit's clever since you have to be at the browser anyway to test
18:22pandeirorather than having to go into the repl or project.clj specifically just to do that
18:22emezeskeibdknox: I just had an idea. What if I made lein-cljsbuild hook into the "lein deps" task, and clean/rebuild when that happened
18:22emezeskeibdknox: Would that make life easier when dealing with rapidly changing upstream jars?
18:22babilentechnomancy: Yes, sure. But why does it work when I run it in the repl? And shouldn't all these functions return lazy-seqs anyway? (so the indefiniteness doesn't matter) -- I mean "(take-while #(= (first %) (second %)) (partition 2 (interleave (range) [0 1 2 2])))" works fine.
18:23ibdknoxemezeske: you should talk to technomancy, not sure if things are supposed to hook deps
18:23ibdknoxemezeske: it seems like a good idea to me though
18:23ibdknoxpandeiro: something like that would have to operate closer to the server level
18:23emezeskeibdknox: thanks
18:23pandeiroibdknox: yeah exactly, one is doing all compilation at the server
18:24ibdknoxpandeiro: I've been considering bringing noir-cljs back, which could easily mimic that behavior
18:24emezesketechnomancy: see my note above about cljsbuild hooking into "lein deps" ? does that make sense?
18:24pandeiroibdknox: just tie it altogether into the ultimate framework, man :)
18:24ibdknoxlol
18:24babilentechnomancy: I just don't understand the difference in behaviour (emacs, clojure-jack-in, clojure 1.3 if that matters)
18:24ibdknoxpandeiro: if I had more time I would ;)
18:24technomancybabilen: aha
18:24technomancyyou got slimed
18:24TimMc:-D
18:24technomancybabilen: starts-with-seq? vs starts-with-subseq?
18:25technomancymust have had a stale definition left in the repl
18:25babilen*sigh*
18:25technomancyhappens to everyone =)
18:25babilendamn
18:25technomancyemezeske: seems reasonable
18:26babilentechnomancy: Thanks -- At least I am not crazy, just tired.
18:26technomancyemezeske: in lein2 there's a way to register your task as something that runs before every eval-in-project form. would that be sufficient for your use case?
18:27emezesketechnomancy: yeah, I think that could work, although it might be overkill
18:27emezesketechnomancy: thanks.
18:27technomancyemezeske: you could keep a checksum and only rebuild if you detect a change
18:29emezesketechnomancy: you are some kind of genuius
18:29emezesketechnomancy: and a genuius is better than a genius
18:29emezesketechnomancy: why didn't I think of that? *sigh*
18:30emezesketechnomancy: thanks! that will make things way better.
18:30technomancyemezeske: heh, well it's a bit more work, but if the delay is noticeable then it's worth the bother
18:30technomancyemezeske: we do a checksumming of :dependencies in lein deps in 1.x; feel free to steal the codes =)
18:31emezesketechnomancy: the problem people have with cljsbuild now is that if an upstream jar containing cljs is updated, it doesn't trigger a rebuild
18:31emezesketechnomancy: using a checksum will make that work like it should
18:31emezesketechnomancy: cool, I'll peek at that code!
18:31muhoogeeeeeenius
19:38TimMcOK, am I wrong to believe that proxy can handle multiple overrides of the same method name? https://refheap.com/paste/761
19:40TimMcCan't push?
19:40emezeskeHaven't tried that, but I'm getting 500s on the web ui :/
19:40brehautTimMc: i recall hiredman saying that you have to do the dispatch yourself somehow for proxies in that situation
19:40TimMcbrehaut: Huh?
19:40dgrnbrgIs there a protocol I can implement so that I can work w/ keywords as map accessors?
19:41brehautTimMc: unfortunately it was a few weeks ago so i have forgotten the details
19:41TimMcWas this in this channel?
19:41brehautyeah
19:42gtrak`anyone managed to get the midi example working with overtone? I can't tell if it's taking in notes, and I can't get the defsynth to play on its own
19:43TimMcbrehaut: Found it, but that's about overriding, not overloading.
19:43brehautTimMc: oh, sorry my bad
19:44brehautTimMc: im pretty sure proxies are a map under the hood; (as you can monkey patch the methods later) its possible you need to provide a single function that implements both overloads
19:45TimMcugh
19:45brehaut(invokePrim ([^long p_312] …) ([^double …] …)) ?
19:45TimMcLet me try that.
19:45TimMcWait... that doesn't make sense, does it?
19:45TimMcTHat only allows one return type.
19:46brehautthat does appear to be a downside of that approach
19:46TimMcbrehaut: "CompilerException java.lang.RuntimeException: Can't have 2 overloads with same arity"
19:47brehauttimm: oh of course. sorry :/
19:49amalloydgrnbrg: ILookup or Associative or something. just check the source of clojure.lang.*
19:49brehautTimMc: it defintely looks like it collects up all the methods as functions and sticks them into a map
19:50amalloyyes, ILookup
19:50dgrnbrgamalloy: thanks
19:50dgrnbrgbut eit! github is down
19:51dgrnbrgwhere else is the sourceR?
19:52amalloycloned on your machine, i strongly suggest (in future). way easier to navigate your local filesystem than a bunch of point-and-click on github's web ui
19:53TimMcyup
19:53TimMcGot tired of clicking around, finally cloned EVERYTHING.
20:05dgrnbrgI like clicking :)
20:05dgrnbrgi have rsi; it's a nice break
20:07TimMcOK. WELL THEN.
20:08TimMcbrehaut: Any idea how to get around this?
20:09brehautTimMc: no sorry. i got lost spelunking into the innards. you'll need to find someone more knowledgable i think
20:09TimMcI think deftype will allow hinting...
20:09brehautthat does sound right
20:09amalloydeftype allows the same things reify does, right?
20:09TimMcI'll need to redo the same stuff AFn does for IFn, but whatever... :-(
20:10amalloyi wouldn't deftype here unless you have to; they both have the same relevant features
20:11TimMcAh, reify gives an object back, I see.
20:13mdeboardamalloy: Is that you introducing cemerick here http://blip.tv/clojure/chas-emerick-modeling-the-world-probabilistically-using-bayesian-networks-in-clojure-5953843
20:13amalloyno
20:14brehautstuart sierra isn't it?
20:14amalloyright
20:14brehautalso is the full vid of that up yet?
20:14mdeboardbrehaut: of?
20:15brehautcemerick's presentation; it was abbreviated by accident i think
20:15mdeboardno idea where these talks were held
20:15mdeboardoh yeah looks like it's 13min long
20:15brehautclojure conj 2011, in reaiaealeigh NC i think
20:15mdeboardoic
20:17amalloygood hedging there
20:19amalloyor maybe you were just making fun of pronunciation? i thought you were unsure which mess of vowels to use
20:20brehautamalloy: i have _no idea_ how its pronounced at all
20:20brehautand i can never remember how its spelt
20:21amalloyraleigh, pronounced rah-lay or rah-lee, by geography
20:21amalloynot that there's any reason you should care, i suppose
20:21brehautoh right. thanks
20:21brehauti hear it has a cool lemur zoo
20:22TimMcR'lyah
20:22brehautF'tagn TimMc
20:50citizenparkeremezeske: You around? Had some questions on lein-cljsbuild
20:50citizenparker(which is great, btw)
20:55emezeskecitizenparker: Yeah, what's up?
20:57citizenparkerI noticed you have an open issue around the possibility of incorporating a repl command into that plugin
20:57citizenparkerHave you actually going a ClojureScript repl to work with files built from cljsbuild today?
20:57emezeskecitizenparker: Funny you should bring that up; I was just thinking about working on it tonight
20:57citizenparkerHa!
20:57emezeskecitizenparker: No, I haven't messed with CLJS repls yet
20:57emezeskecitizenparker: But I am forming a plan
20:58citizenparkerSome solution would be great. I love the plugin, but I haven't managed to get a repl connected via the generated files
20:58citizenparkerI'm guessing it's because cljsbuild compiles them all down into one file, which the clojurescript wiki advises against
20:59emezeskecitizenparker: Do you have a link to the "advises against" part?
20:59citizenparkerYeah, one sec
20:59ibdknoxcitizenparker: that shouldn't matter
20:59ibdknoxI've definitely run the REPL after it's compiled everything into one file :)
21:00citizenparkerhttps://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments - in the example, it shows the files broken out
21:00citizenparkeribdknox: Oh? Maybe I'm missing something obvious then, hmm
21:00citizenparkeribdknox: with cljsbuild? or with clojurescript proper?
21:01ibdknoxwith cljs-watch, but that's equivalent to cljsbuild at this point
21:01ibdknoxeither way though, the files shouldn't really matter so long as that call to start the repl exists :)
21:02citizenparkerGood to know! I'll recheck my work again. When I was trying with the cljsbuild output, I was getting some truly obscure JS errors upon loading the page
21:03citizenparkerI thought that went away when I went to a pure clojurescript approach, but I could have changed something else along the way
21:03emezeskecitizenparker: If you check back later, I plan to have something basic working in cljsbuild soon to make repls easy
21:03citizenparkerOh man, that would be dreamy
21:04citizenparkerAnd I think would really help ease the barrier to cljs adoption
21:05emezeskeYeah, should be handy
21:10cjfriszSo it seems that function definitions with "defn" created inside the scope of another function are visible outside the enclosing function's scope in Clojure.
21:11cjfriszThis doesn't jive with my notions from Scheme that a procedure defined in the scope of another is only visible within the enclosing scope.
21:11cjfriszIs this a feature or a bug in Clojure?
21:11technomancyin Clojure anything that starts with "def" shouldn't be called anywhere but the top level
21:11amalloya bug in scheme </troll>
21:11technomancyif you want locals, use let.
21:12technomancythe difference between locals and "globals" in Clojure is much bigger than it is in most languages
21:12amalloycjfrisz: that's a special-case rule in scheme that only applies to defines at the *very beginning* of a procedure, to avoid having to write a let or something
21:12amalloywhich is pretty gross imo
21:13cjfriszamalloy: Er...that's not true
21:13cjfriszIt doesn't have to be the very beginning of a procedure.
21:14zakwilsonI've seen defun used non-toplevel in Common Lisp a few times. Those are global and were intended to be by the programmer in question.
21:14cjfriszAnd it's just a stylistic difference as to whether that looks nice ;-)
21:14shaunxcodeI think he means not nested lower?
21:14amalloyit's only guaranteed to behave the way you want at the beginning. scheme implementations may choose to make it work elsewhere, but it's not standard-compatible. that's my understanding from reading SICP, but i'm not a scheme expert
21:15cjfriszI don't think that's true, but I'm not 100% sure, either.
21:15amalloysome quick googling confirms, with text like: Some implementations of Scheme permit definitions to occur at the beginning of a <body> (that is, the body of a lambda, let, let*, letrec, ordefine expression)
21:15arohnercjfrisz: in clojure, def and let have different semantics in clojure, so they're named differently. def always creates a global, regardless of where you call it
21:16amalloyThere's a restriction on internal defines--they must be at the beginning of the procedure body (or the beginning of another body, like a letbody, before the normal executable expressions in the body.
21:16cjfriszamalloy: They still don't break lexical scoping, which is the issue I'm concerned with
21:17amalloy"break"
21:17amalloythere is no breaking going on. you're using def, which is for globals. in scheme, some define forms happen to not define globals; i don't see how either of these involves breaking anything
21:18cjfriszAhh, ok
21:18cjfriszarohner's answer is the one I was looking for.
21:19cjfriszThat was not intended as a troll, btw
21:19cjfriszI'm sorry if it came off that way.
21:20cjfriszI wasn't aware of the distinction of def for globals and was seriously concerned about the sanctity of lexical scope.
21:20amalloyno, i was </troll>ing myself for saying it's a bug in scheme
21:21amalloyit's obviously not, it's just a feature i don't like the flavor of
21:21cjfriszI'm a recent Clojure convert and I'm noticing that there's a marked difference between Scheme and Clojure style.
21:22cjfriszSchemers find internal defines to be perfectly nice.
21:22cjfriszNot that either is wrong!
21:40gtraksuccess with the midi!
21:45jkdufairtechnomancy: I believe i have a fix for lein and cygwin. what's the best way to test? lein jar of swank-clojure then just copy to plugins dir? or is it more complicated than that?
21:45jkdufairi should say for swank-clojure and cygwin
21:59dgrnbrgIs it possible to get all the semantics of defrecord but override the ILookup interface provision?
22:01cjfriszStylistic question: is it standard to do all function-level documentation as docstrings?
22:02cjfriszI've got some namespace-local functions, and I can't tell if it's silly to document them with docstrings instead of comments.'
22:03duck1123if you use docstrings, then those docs can be accessed from c.repl/doc and others
22:04TimMccjfrisz: docstrings are standard
22:04duck1123so even if it's a private function, it's still worth it to put it in the docstring when you document
22:04cjfriszAlright
22:04cjfriszThanks
22:04TimMcComments can't be retrieved programmatically.
22:11dgrnbrgHow do you override a function with multiple arities with deftype?
22:12dgrnbrg(deftype … IProtocol (fnname ([arglist1] body1) (arglist2 body))) doesn't seem to work
22:19dgrnbrgthis is very sticky…I want all the features of defrecord except for the ILookup
22:19dgrnbrgbut if I use deftype, I have to write a tremendous amount of code that should be autogenerated
22:22alexbaranoskyone option might be to make your on macro for it if you have to do it more than once
22:22dgrnbrgI could copy the code out of clojure.core
22:22dgrnbrgbut that seems unfortunate
22:22dgrnbrgis there a good way to delegate with reify?
22:22dgrnbrgor some other macro/lib, similar to Groovy's @Delegate?
22:23alexbaranoskynothing like @Delegate as far as I know
22:23dgrnbrghack it is, then
22:27TimMcOMG, what the hell is clojure.lang.Util/ret1 doing
22:27TimMcand why does clojure.lang.AFn/applyTo use it?
22:27TimMcIs that some sort of bizarre GC trick?
22:29alexbaranoskyTimMc, you're in the belly of the beast, man
22:31TimMcAnyone know if fn args undergo locals clearing like let bindings do?
22:32cemerickTimMc: I believe so, yes.
22:34TimMcPhew, I think that I can ignore Util/reet1 then.
22:34TimMc*ret1
22:35TimMcContext: There's a "tail call" in a Clojure core Java file which includes Util.ret1(arglist,arglist = null) -- arglist is one of the function's arguments.
22:35TimMcUtil.ret1 simply returns the first argument.
22:42amalloyTimMc: that's how locals clearing is accomplished
22:43amalloyon the java side, that is (i believe. not sure about any of this)
22:43amalloyyou call ret1, passing it a pointer to your thing, and then clearing your own pointer to it
22:44amalloyString x = "data"; someMethod(x); // x can't be GCed until someMethod finishes, because it's in your scope
22:45amalloyString x = "data"; someMethod(ret1(x, x = null)); // now x isn't referred to locally anymore when someMethod is running
22:45cemerickwhat amalloy said
22:46amalloycemerick: you saved me the trouble of "just in case cemerick says anything, he'll be right"
22:47cemerickha!
22:47clojurebotPardon?
22:47cemerickI fall down faster than anyone else I know.
22:51TcepsaI'm a little confused, if you're up for explaining this a little further. While I realize that x no longer points to whatever it was x pointed to (e.g. the string "data"), won't that thing still be ineligible for GC while someMethod is on the stack? If so, then what's the point? (If not, how come?)
22:52amalloysomeMethod might decide it no longer needs its reference to data, clear it, and then keep doing other work
22:52TcepsaOh! At which point it can be GC'ed because the calling function no longer has a reference to it. Got it, thanks! ^_^
22:56amalloyright. that's an important part of how lazy sequences work - otherwise the closures they create would keep references to the closed-over variables indefinitely
22:58TimMcI was partly having trouble with order-of-operations in the call to ret1.
22:58TimMcBut that's Java for you. -.-
22:58amalloyfunction calls go left-to-right
22:58amalloyjust like in clojure
22:58TimMcI eventually decided that there was only one interpretation that would be useful, so I went with that...
22:59amalloyi was actually surprised in both cases that the left-to-right order is guaranteed
23:01TimMcI guess the JVM is putting evaluated args on the stack left to right, then invoking the method.
23:22TimMcjava.lang.ClassNotFoundException: Object
23:23TimMcI should really be going to bed.
23:24TimMc(Yes, it should be java.lang.Object)