#clojure logs

2011-09-17

00:24alandipertkonr: see also http://clj-me.blogspot.com/2009/04/mapping-every-second-item.html
00:53zippy314_I'm having a clojurecript/closure problem that I can't figure out. Here's a gist: https://gist.github.com/1223636 The code is supposed to create a dialog with a field in it, and then after the button is clicked get the value from the field an insert it into the dom. The problem is that I can't get the value out! (.getValue l) seems to return the javascript function for getting the value, but ((.getValue l)) causes a wei
00:54tomojwhat's a wei?
01:00mdeboardI dunno, but apparently it's worse than no wei
01:04tomoj:D
01:13Chousukezippy314_: isn't the syntax for function calls (. l (getValue)) in ClojureScript
01:14ChousukeI'm not a fan of it but it seems to be necessary because otherwise the compiler can't tell whether getValue is a normal property or a function that must be called.
01:32jlizippy314_: Chousuke is right.
01:33jlithough isn't that code redundant? it looks like you're taking a dom element, getting the html, and converting it to a dom element?
01:33jlican you just use "l" directly?
04:33mullrAn amateur question, encountered while going through problems at 4clojure: When writing functions that return a list or vector, I find myself often wrapping things in 'vec' so that 'conj' will add things to the end rather than the beginning. Is there a more idiomatic way to do this?
04:33mullrAn example (a solution to http://www.4clojure.com/problem/31) : https://gist.github.com/1223758
04:48tufflaxmullr (partial partition-by identity) is most idiomatic
04:48tufflax:)
04:49mullrah, I was staring at group-by and wondering if there was something similar
04:49mullrwell, the awesome library function notwithstanding, I've seen this problem in many places
04:49mmarczykmullr: you should generally try to pick an approach which will allow you to choose one data structure and stick with it
04:49mmarczykusually that's possible
04:51tufflaxmullr maybe you could just conj to a list and reverse it the last thing you do :P
04:51mullrI'm looking at the source to partion-by, since it's effectively what I've implmented....
04:52mullrbut it seems to go through a lot of trouble to be lazy
04:52mmarczykif you need to add things to one end and remove them from the other, you could use a queue (see clojure.lang.PersistentQueue; take clojure.lang.PersistentQueue/EMPTY and conj, peek, pop away)
04:53mullroh, that's a good tip
04:54tufflaxlazy-seq is what you want to use most of the time i suppose. I don't think it's a lot of trouble.
04:55mmarczykwell, to be fair, I think partition-by is quite non-trivial if you want to make it as lazy as possible
04:55tufflaxBut honestly I haven't had this problem much. Often one can use higher-level functions such as map, partition, etc.
04:57mullrindeed, that seems to be the case.. ok, thanks for the help.
04:58tufflaxany time
05:20robermannhello! a quick emacs question: can I use two REPLs in two separate buffers?
05:21mrBlissrobermann: yes
05:21robermannso that , when trying to write a function in a buffer, in the second buffer I can test my ideas
05:22mrBlissrobermann: you don't need 2 REPLs for that though
05:24robermannah; how can I do it? when writing a function the prompt is waiting my input, so how can I evaluate another expression?
05:25mrBlissrobermann: you can write in another Clojure buffer
05:25mrBlissI bind C-j to slime-eval-print-last-expression, so you can eval expressions inside a Clojure buffer (like C-j for Emacs Lisp buffers)
05:28robermannthanks mrBliss, I'm going to try it
05:32mrBlissthe only problem with using C-j instead of a REPL is that you can't kill the program when it hangs or goes into an infinite loop (C-c C-c in a REPL).
05:34robermannok
05:34robermannI'm trying also M-x slime-scratch
05:34robermannopen another buffer and with C-j evaluates it
05:35robermann(I check out this. http://common-lisp.net/project/slime/doc/html/Scratch-Buffer.html)
05:38robermannBTW, a thing I find annoying and I think should be possibile to do: how can I have every buffer in a separated "pop-up" window?
05:40mrBlissrobermann: (setq pop-up-frames t)
05:42Nocabanyone care to explain the semantics around this simple example to me? ;)
05:42robermannthanks mrBliss. Where should I put it
05:42robermann?
05:42mrBlissrobermann: your .emacs file
05:42Nocab(#{ :a :b } :a) ;=:a
05:42Nocabis a set also a function which works as a discriminator on other values?
05:43Nocabhow does that work? :P
05:43robermannNocab: a set is a function of itself (I'm not an expert anyway :) )
05:43mrBlissNocab: (set key) -> (contains? set key)
05:44Nocabah ok
05:44Nocabgotcha
05:44mrBlissNocab: same for maps and vectors (the indices are the keys)
05:44robermann,([1 2 3] 0)
05:44clojurebot1
05:45robermann,([1 2 3] 1)
05:45clojurebot2
05:53Nocabthanks
05:54NocabIt was just an example where #{ :3 :4 } was used as a predicate, as opposed to like (= 3)
05:54Nocabwhich struck me as odd
05:54Nocabah well. Ill be off then ;)
05:59rqcursqGood morning European Clojurians
06:16Netpilgrimrqcursq: Goog morning!
06:17Netpilgrimrqcursq: Eh, Good morning. :)
06:42robermannmrBliss: you said that "I bind C-j to slime-eval-print-last-expression" - how do you bind keys? I was supposing it is a trivial thing, but after a look to the manual (http://www.gnu.org/s/libtool/manual/emacs/Key-Bindings.html) I'm desperating :)
06:45mrBlissrobermann: https://gist.github.com/1223837
06:46mrBlissI hope you have installed Slime and Clojure-mode
06:50robermannI'm using clojurebox. I tryied a raw Emacs + clojure-mode (as http://technomancy.us/149) but when running clojure-jack-in "sh" does not find lein - it turns out being an issue of cmdproxy.exe, which does not see lein.bat in the PATH!
06:50robermann(note: I'm on a Windows machine)
06:51mrBlissrobermann: ok, then you should have all you need, just add one of the snippets to %APPDATA%\.emacs.d\init.el
06:53robermannnot in .emacs?
06:53robermannok
06:53mrBlisseither one
06:54mrBlissI just thought Clojurebox would be using a .emacs.d folder instead of a .emacs file (or sometimes _emacs on Windows)
07:02robermannmmm it has both, but emacs.d contains only auto-save-list. Of your snippet, works only the lazy version: the not-lazy makes SLIME crash. Now, I'm in the buffer, and set the cursor in the end of a valid expression. Doing C-j should evaluate it?
07:04robermanndoes not works. C-j still adds a line
07:23zippy314_jli: (from last night) My intention was to take the value of the input dom element in the Dialog, and insert it as a new dom element in the main body of. So I don't think it redundant, but I could be misunderstanding. I'm a clojurescript newbie.
07:25zippy314_Chousuke: [from last night] Thanks! That was exactly it. I haven't wrapped my head around the "." function. As I've always been using the ".funname" syntax to call methods on objects in clojure, so I thought the same thing would be the case in clojurescript. Is this difference documented anywhere?
07:26robermannmrBliss: C-c C-e (or C-x C-e) evaluate as slime-eval-print-last-expression, They are configured byclojure-mode.el, as far I can understand
08:10rqcursqmy first https://clojars.org/klojoule
08:10rqcursq:)
08:52gfredericksow my macro is hurting
08:53gfredericksI'm trying to make use of this library (fnparse) that is full of macros and I'm not sure how to do it.
08:53gfrederickse.g., if there's a vararg macro (foo ...), and my instinct is to call (apply foo coll), which I obviously cannot do, how do I get around that?
08:54gfredericksgiven, of course, that I don't know what coll looks like at compile time.
09:47lnostdalseancorfield, about 1.3 .. can't *vars-like-these* not declared dynamic still generate a warning, but actually still be dynamic? .. that'll maintain backward comp., but still warn users
09:47lnostdal..or does that not make sense.. hm
10:02DeusExPikachuhow do you get rid of reflection warnings with regard to protected methods in gen-class?
10:03neroothTrying to do (fetch-by-id mycoll "a-id-string-that-shows-up-in-fetch-all") with karras (mongodb wrapper): java.lang.IllegalArgumentException: invalid ObjectId [9b319b9f-72c1-4e71-9b05-e9dc0c14c07e] (NO_SOURCE_FILE:0). What am I doing wrong?
10:04DeusExPikachui typed hinted the this argument as a super class but I still get the reflection warning when calling the protected method
10:08NarviusHello, I have a problem. I'm using a MouseAdapter proxy for mouse input, and I want to store the clicked location when mousePressed is called, and then use it in mouseReleased. What is the best way to store that information?
11:07TimMcgfredericks: You'll have to use another macro...
11:08TimMcgfredericks: Is coll a piece of syntax?
11:22konrI'm getting a "No implementation of method :make-reader" ( http://3d843a8c52457f13.paste.se/ ) reader. Any idea of what's the cause of this?
11:23konrs/reader\./error.
11:23lazybot<konr> I'm getting a "No implementation of method :make-reader" ( http://3d843a8c52457f13.paste.se/ ) error. Any idea of what's the cause of this?
14:39arohneranyone know of a library for RPC/agents between clojure JVMs?
14:47michaelr525\>
14:47gfredericks<
14:49michaelr525gfredericks: what's up?\
14:50gfredericksoh just trying to have a conversation with no alphanumeric characters is all
14:57michaelr525what's new and exciting?
14:57gfredericksstrange loop?
14:57PPPaul*
14:58michaelr525\(.*\)
14:58PPPaul:@
14:59michaelr525whyy?
14:59PPPauli want recursive regex
14:59PPPaulso i can parse xml
14:59gfredericksfor fun https://github.com/fredericksgary/ranguages/blob/master/src/ranguages/regex_parser.clj
14:59gfredericksPPPaul: doesn't clojure parse xml for you?
15:00PPPauli need more options
15:00PPPauli'm going to make an AI that will learn to parse xml
15:01gfredericksPPPaul: I learned the fnparse library for the code in that link above. It wasn't too hard.
15:01PPPaulok i'll give it a look... i haven't done much regex in a while
15:02PPPauli've been having fun with clojure walks
15:02PPPauli wish i knew about walking when i started learning clojure
15:03PPPauli'm not really sure what the regex parser is supposed to do
15:03PPPaulwhat's the use-case?
15:05PPPaulthe readme is a "fixme:"
15:05michaelr525gfredericks: yeah
15:05michaelr525whats the usecase?
15:12gfredericksthe regex parser is just a component in the program
15:12gfredericksthe whole program is for manipulating regular languages abstractly
15:13gfredericksplease don't get the impression that this can be used for anything in real life :)
15:13gfredericksit's just messing around with theoretical things
15:15gfredericksThe end product I'm imagining is you input a regular expression and it will be able to enumerate all strings that match the regex. Particularly you could give it an index such as 2^50 and it would be able to quickly compute the (2^50)th string that matches the regex, without having to compute the first (2^50 - 1)
15:16gfredericksalso the inverse (matching string to index)
15:53PPPaulcool
16:32sridwhy would this code use nth? https://github.com/dbyrne/4clojure/issues/107
16:33sridspecifically, (fn foo [[x & xs] n] (if (zero? n) x (foo xs (dec n))))
16:37gfrederickssrid: probably the destructuring did it?
16:37sridyup
16:37gfredericksI suppose that ought to be allowed
16:44gfredericksI bet it would be a lot harder to allow that though
18:26devnhm, this is fun... I just used the haml gem for via jruby in clojure
18:27gfredericksdevn: now make an uberjar out of that and see how big it is.
18:27gfredericksdevn: maybe add rhino and haml-js for convenience
18:28gfredericksbest practice says you should wait till runtime to decide what language to use with your haml
18:29tomojmuch like template spaghetti imo
18:30gfredericksmust be a meatball sub then?
18:38devngfredericks: heh, any guesses on the size?
18:38gfredericksdevn: ignoring my rhino comment?
18:39devngfredericks: I'm having trouble picking up on what you're driving at
18:40devngfredericks: Are you suggesting that this is just going to be a big bloated jar and that I should exacerbate the issue by adding rhino and haml-js
18:40gfredericksdevn: oh I just thought that a jarfile that includes the entire clojure runtime _and_ ruby runtime might be rather large
18:40gfredericksyeah that's a good summary
18:40devngfredericks: what's the harm in a big jar file?
18:41gfredericksdevn: no harm, just humor
18:41devnheh, noted.
18:41gfredericksassuming you have such a jar and have measured its size, I'd guess ~50mb, with very low confidence
18:42devngfredericks: I'm just trying to do my damndest to get friends of mine who are rubyists to do some clojure
18:42gfredericksdevn: oh golly how I know that feeling.
18:42gfredericksevery time they mutate an array I wince
18:42devngfredericks: wow. i am not alone, apparently.
18:43devneverything I see a foo = foo.gsub! or something I think "no!", but then I realize that this is reality
18:44gfredericksdevn: the worst part is that _they're_ on the cutting edge, generally
18:44gfredericksgiven the big picture
18:44gfredericksnot compared to clojure, but compared to java and such
18:45gfredericksruby makes functional programming so weird -- it has methods, procs, lambdas, and blocks. wtf?
18:46devngfredericks: heh -- i just wish the std lib included let
18:46devngfredericks: luckily you can get let without a lot of ceremony by doing: def let; yield; end
18:46devnin 1.9.2 anyhow
18:47gfredericksah I see
18:47devnThe first thing I do on most projects is go in and add a second and let method to the lib/
18:48gfrederickssecond?
18:48clojurebotMotion seconded and carried. Next agenda item.
18:48devnheh
18:48Raynesgfredericks: Japanese people like competition?
18:48devn,(second [1 2 3])
18:48clojurebot2
18:48gfredericksdevn: I've never wanted such a thing in ruby. You must be doing things quite functionally :)
18:49devngfredericks: when I can get away with it I will do it
18:49gfredericksRaynes: heck if I can figure out what that was in response to
18:49devnit's mostly in custom rake tasks and so on
18:49Raynesgfredericks: Your commend about it having methods, procs, lambdas, and blocks. wtf?
18:49Raynescomment*
18:49gfredericksRaynes: clearly your explanation is the only possible one
18:49devnlol
18:50gfredericksdevn: do you know of any FP lib for ruby? I forget what sorts of things I was imagining it to have...
18:50gfredericksooh
18:50gfredericksimmutable data structures particularly
18:50RaynesMy co-workers are currently kind of writing Clojure in Ruby.
18:50Rayneshttps://github.com/flatland/rupture
18:50gfredericksRaynes: that's more comical if I imagine you meant "writing a Clojure runtime ..."
18:51RaynesNaw. Just the sequence library and higher order functions.
18:51Raynesninjudd likes to say that they're writing Clojure in Ruby though, because it sounds cooler.
18:51devngfredericks: only 18 megs for what its worth, which includes jetty, ring, jruby-complete, and some other miscellany
18:51RaynesBut the library is very cool.
18:51gfredericksRaynes: I think the persistent immutable data is what I'd want first
18:52Raynesdevn might be especially interested in the library.
18:52gfredericksdevn: nice.
18:52gfredericksimplementing such data structures in ruby would be hella thrilling for me. I love that kinda thing.
18:53RaynesMan I hate that word. 'Hella'.
18:53gfredericksRaynes: oh I see the persistent data structures note under "Coming soon".
18:53gfredericksRaynes: suggest a different word
18:53Raynes'very'
18:53gfrederickss/hella/very
18:53RaynesIts origin in California makes me not want to move there anymore.
18:53devnWas it Twain who had the comment about using "very"
18:53gfredericksnow imagine that lazybot can intelligently choose among the last few statements
18:53devnSubstitute "damn" every time you're inclined to write "very";
18:53devnyour editor will delete it and the writing will be just as it should be.
18:54gfredericksRaynes: does 'hamster' refer to something I don't know about or is it just a funny noun?
18:54devngfredericks: it's hash-mapped tries for ruby
18:54Rayneshttps://github.com/harukizaemon/hamster
18:55gfredericksoh so this is exactly what I always wanted?
18:55devn"Hash array mapped trie" => HAMT => Hamster
18:55Raynesgfredericks: Everything you've ever wanted is one google away.
18:56gfredericksRaynes: so what does hamster not have that your lib would want to add?
18:56RaynesNot my lib.
18:56gfredericksRaynes: your cow-orkers' lib?
18:56RaynesCo-workers. I have no part in it.
18:57RaynesNo clue. I try to avoid the Ruby parts of my job as much as possible.
18:57RaynesI usually only touch Ruby when I'm replacing a piece of Ruby code with Clojure/ClojureScript.
18:57Raynes;)
18:57gfredericksyeah, replace that legacy language
19:00devnRaynes: The right tool for the right job.
19:00gfredericksis there a job that ruby is right for?
19:00devnRails is a nice framework.
19:01devnDoes Clojure have a framework as mature as Rails?
19:01gfredericksbut is that a property of the language?
19:01gfredericks(answer: sorta)
19:02Raynesdevn: Right, I didn't mean to imply I've been replacing Ruby code just to be replacing it.
19:02devngfredericks: I love me some clojure, but I can't honestly tell people right now that the web story with Clojure is fully fleshed out
19:02gfredericksdevn: no argument from me
19:02devnnoir, ring, compojure, moustache, and many more -- but there isn't a clear winner there yet
19:03devngfredericks: *nod*
19:03devnRaynes: yeah, that's like saying "I like ClojureScript so I'm going to rewrite all of my bash scripts in ClojureScript on nodejs!"
19:04Raynesdevn: Specifically, we're considering replacing Ruby in cake using http://github.com/flatland/portal. I'm writing a ClojureScript+nodejs client that could be a candidate for that.
19:05RaynesAnd I do write ClojureScript+nodejs scripts rather than bash scripts.
19:05RaynesBut that's because I don't know bash.
19:05Rayneshttp://github.com/Raynes/mkvrename :>
19:06RaynesThe README is a bit screwed because I forgot you can embed HTML in markdown.
19:09devnRaynes: depends on the project and the environment... On my personal machine I've been writing ClojureScript and nodejs over bash for fun, but at the end of the day, bash sort of wins
19:10devnfor instance, I can't just hand anyone on UNIX a compiled clojurescript => nodejs script and say "go for it"
19:10devnif you need a bootstrap for your bootstrap script, there's something wrong
19:11devnwell, that might be laying it on a bit thick, but overall, I've seen people do things that manipulate and rely on ENV in languages other than bash, and frequently there is a cost associated with that
19:12RaynesI'm not sure if you constantly analyse what I say to find things to argue about or if this is just your manner of speech. Seems to happen a lot between us as of late. :p
19:13sridhttp://dpaste.com/616614/ <- what does the compiler error "Unexpected parameter" mean at the (letfn ...) form?
19:16RaynesWow.
19:16sridit is supposed to be a solution to http://4clojure.com/problem/29#prob-title (i know it has a bug in dealing with non-alpha chars)
19:17gfredericksyou're using letfn with an empty body?
19:17sridi fixed it, but still same error
19:17gfrederickshmm
19:18sridcan't (letfn ...) form be used as an argument to functions?
19:19gfrederickssure
19:19gfrederickssrid: btw, you don't need to let anything in order to define a recursive function
19:19gfredericksyou could just as easily have done (fn cpp-seq [...] ...)
19:20sridright
19:20gfredericksoh I guess you sorta used that with your cpp function
19:20gfredericksoh hey
19:20gfredericks,(fn [x & xs :as l] x)
19:20clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: :as>
19:20gfredericksat my repl that gets me your unexpected parameter error
19:21gfredericks,(fn [& [x & xs :as l]] x)
19:21clojurebot#<sandbox$eval11777$fn__11779 sandbox$eval11777$fn__11779@db4002>
19:21gfrederickstry switching it for something like that
19:21devnRaynes: It's my opinion, and little more. Also, by a lot I think the number is at 2.
19:22gfredericks,((fn [x & xs] xs) (range 10) (range 100 110) (range 1000 1010))
19:22clojurebot((100 101 102 103 104 ...) (1000 1001 1002 1003 1004 ...))
19:22Raynesdevn: Well, we've only talked like twice.
19:22gfrederickshmm
19:22sridgfredericks: http://dpaste.com/616616/ same error
19:22gfredericksp00n
19:23sridlooks apply is not happy with accepting fn and related forms
19:23devnRaynes: heh, this is my point though -- it's hard for me to agree with "a lot" as being a fair measure of the number of times we've disagreed in recent memory
19:23gfrederickssrid: that paste looks the same to me at the relevant point (line 6)
19:23Raynes&(apply str (filter #(Character/isUpperCase %) "$#A(*&987Zf")))
19:23lazybot⇒ "AZ"
19:23Raynesdevn: That makes three, since you disagree with 'a lot'.
19:23sridgfredericks: what is the & for?
19:24devn,0xA
19:24clojurebot10
19:24sridoh, I see
19:24sridmy destructuring was missing wrapping []
19:24gfrederickssrid: that's interesting you ask because I have no idea how to explain it :)
19:24gfredericksit just seemed like another thing to try
19:24devnRaynes: Err on the side of not taking me too seriously. I think that will smooth things out.
19:24Raynesdevn: When you say a bootstrap script shouldn't require a bootstrap, were you referring to cake?
19:24gfredericksdevn: you can't be serious!
19:25RaynesIt's all good. I was just pointing out that we seem disagree more than usual these days.
19:25gfrederickssorry, I couldn't restrain myself...
19:25RaynesEverybody has to disagree every now and again.
19:26Iceland_jackRaynes: Why do you say that?
19:26Iceland_jack~Utterly false~
19:26clojurebotExcuse me?
19:26Iceland_jackHaha don't worry clojurebot, I'm attempting humour
19:27Raynes~botsnack
19:27clojurebotThanks! Can I have chocolate next time
19:27devnRaynes: no I wasn't thinking of cake, but I think objectively we could all agree that adding external dependencies doesn't make things as portable as they might be without said dependencies
19:27paul__i want a botsnake
19:27paul__snack
19:27paul__both
19:27devnhahaha
19:27devn(and a botsnack)
19:27paul__good
19:28RaynesRight. In cake, it was decided that the benefit of using a higher level and portable programming language would be better in the long run.
19:28RaynesHence ending up with Ruby.
19:29devnThat was the decision they made.
19:31gfredericks"I'm ruler", said Yertle, "of all that I see. But I don't see enough! That's the trouble with me."
19:31srid(<= (int \A) (int x) (int \Z)) -- is the only way to check if a char is uppercase or not?
19:31devngfredericks: I'm guessing I could google "Yertle" and find the source, but what's that from?
19:32gfredericks$google yertle the turtle
19:32lazybot[Yertle the Turtle and Other Stories - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Yertle_the_Turtle_and_Other_Stories
19:32gfredericksdevn: Dr. Seuss
19:32devnhmph, don't remember that one...
19:32gfrederickscompletely unrelated to clojure, but I was so compelled to share it that the unrelation couldn't stop me
19:33devngfredericks: I for one appreciate that kind of behavior
19:33devn3% battery remaining and I'm on a bus -- see you all on the other side
19:33devnciao
19:34gfredericksdevn: chau
19:35gfrederickssrid: so mucking with the arg-list fixed that problem?
19:35sridyes.
19:35gfrederickscool.
19:36gfrederickss/cool/hella
19:36lazybot<gfredericks> hella.
20:05srid4clojure timed out on my solution http://dpaste.com/616623/ to problem 31, but it runs fine on my computer
20:06RaynesHow long does it take on your computer?
20:06sridoops, it timed due to the (println ..) form, removing which it doesn't timeout
20:08RaynesKeep in mind that 4clojure has a timeout to prevent infinite loops. If your solutions take too long to run, 4clojure will time out even if they run fine on your computer.
20:08gfredericks4clojure has solved the halting problem.
20:09gfredericks...by halting things.
20:09sridcan't I (recur ...) to the parent (loop ...)?
20:10sridctx - in that paste, I intend to make `cseq` tail-recursive
20:10gfrederickssrid: it looks good to me
20:24zodiakstupid question but, how do I get lein deps to pull a dep from a github repo ?
20:29gfrederickszodiak: I don't know whether or not that's possible, but you could probably achieve something similar using checkouts
20:30gfrederickszodiak: such a thing might make the underlying mavenness of lein really messy
20:32zodiakah. hrm. I have managed to stay away from ant/maven for most of my life, so, .. hrm .. maybe I should lein jar and then install locally, but how would I deploy to 3/4 servers ?
20:33gfrederickszodiak: clojars is not an option?
20:33zodiakgfredericks, can I have private repos ?
20:33gfredericksdon't think so
20:33zodiakthen biz will probably have a hissy fit :(
20:33gfredericks:)
20:33gfrederickswelp.
20:34zodiakany other thoughts gratefully received :)
20:34gfredericksI guess it depends on what you mean by "deploy to 3/4 servers"
20:34zodiakideally, I would like to automate the deployment to 3 or 4 servers as much as possible
20:34zodiaksince I don't want to have to do every release ;)
20:34gfrederickszodiak: why do your deployment servers need to know about lein/maven?
20:35zodiakgfredericks, I was hoping for something as simple as 'lein deps' after the git pull from the private repo
20:35gfrederickszodiak: how are you running the program? lein run?
20:35zodiakyes indeedly
20:36gfrederickszodiak: any reason you can't make an uberjar, copy that to your servers, and then execute it?
20:36zodiakcould do. that could work.
20:36zodiakwas jst wondering if I was missing something 'duh'
20:36gfrederickszodiak: another option would be a script in the root of your project that does the necessary legwork, like installing jars locally
20:37gfrederickszodiak: you very well might be, but only if I'm missing it too :)
20:37zodiakgfredericks, yeah.. I always fall back on good old Makefiles ;)
20:37gfredericksand nobody else is speaking up
20:37zodiakgfredericks, your input is welcomed and appreciated. I assure you :)
20:38gfrederickszodiak: anytime
20:38gfrederickssorta
20:38zodiak*chuckles* danke
20:40zodiakoh. lein-war plugin. that could work as well.
20:42gfrederickshuh? what does it do?
20:42zodiakgfredericks, makes the java/glassfish standard .war file
20:43zodiakeasier deployment
20:43zodiakactually lein-localrepo could rock as well, with a small script
20:45gfredericks,(macroexpand-1 '(defrecord FOO []))
20:45clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
20:46gfredericksew
20:58DeusExPikachuI'm having trouble casting a long into an int
20:59DeusExPikachu(type 0) ;= java.lang.Long
20:59DeusExPikachu(type (int 0)) ;= java.lang.Long
21:00zodiakDeusExPikachu, huh.. on clojure 1.2.1 the first gives me int jst fine
21:00DeusExPikachuI'm on 1.3-RC0
21:00zodiakwell, shut my mouth then :D
21:01wiseenis there a catch-all statement in clojurescript ? I don't even see how to catch string literals and numbers considering how instance? function is implemented.
21:02DeusExPikachuzodiak, also do you get int, or java.lang.Integer?
21:02zodiakDeusExPikachu, java.lang.Integer
21:02DeusExPikachuhmm, I need the primitive type int, not java.lang.Integer
21:02DeusExPikachuso reverting to a previous version isn't going to help either
21:03wiseenshouldn't (instance? js/String "foo") return true, and (instance? js/Object .) always return true ?
21:19jliwiseen: I believe js/String is a function: ClojureScript:cljs.user> js/String
21:19jli#<function String() { [native code for String.String, arity=1] }
21:19jli>
21:22jlior maybe I'm wrong
21:24wiseenjli, isn't it js String type ?
21:24jlithe "string?" function works
21:24jliwiseen: I don't think so. ClojureScript:cljs.user> (js/String 1)
21:24jli"1"
21:25jliwhat do you need "instance?" for?
21:25wiseenI don't, but the catch clause uses it
21:25wiseenand I want to catch any exception
21:25wiseenbut it expects a type
21:25wiseenand there is no "root object type" in javascript
21:26wiseenafaik
21:26jlioh, I ran into this a while ago
21:26jlilet me see what I did
21:26wiseeneg. this is valid but it won't catch the exception (try (throw "foo") (catch js/Object (println "caught?")))
21:28jlihttps://github.com/clojure/clojurescript/wiki/Exception-Handling
21:28jliI think I used "Exception" or "Error" for the type
21:30jlihm. or maybe this has been changing recently?
21:34wiseenjli, well that doesn't work since the code generated uses instance? to check if exception is Error
21:34wiseenjs/Error that is
21:35jliyeah, I see. it's weird, because I see examples like that in clojurescript. maybe this all changed recently.
21:35wiseenwell reading the link you provided, it ends with RH - Just use instance? in a cond(p). There is no useful 'any' type in JS, and we'll need to deal with strings and numbers that are not Strings and Numbers. That is true elsewhere as well.
21:36wiseenso instance? does need to be patched
21:36wiseento match String/Number
21:36wiseenand Object
21:53jliwow, I can get firefox to segfault with my clojurescript program
21:54gfredericksman.
21:54gfredericksthat's like an error 4 levels down
21:56jlioh, hmm.
21:57jli(defn ^:export main []
21:57jli (try (throw (js/Error "?!"))
21:57jli (catch js/Error e (js/print "segfault?!"))))
21:57jlithat seems to do it
21:58jliman, wtf
21:59jliuh, maybe something's wrong with my firefox. just "<script>print();</script>" makes things go south
22:00tomojsouth = segfault?
22:00gfrederickstomoj: that's my residential experience
22:01tomojover my head?
22:02gfredericksoh just making fun of geographical regions of the US
22:02jlioh, right. something is broken with firefox printing on this system. doh.
22:02iceyjli: hopefully you haven't spent too much time chasing down the problem… i hate it when i do that
22:03gfredericksis (defrecord Foo [bar] ...) equivalent to (defrecord Foo [bar]) (extend-type Foo ...)?
22:04gfredericksah. no it isn't.
22:04tomojoh, I'm in texas, so over my head indeed I suppose
22:04tomojI think there is a performance difference, for one thing?
22:05gfrederickstomoj: the compiler error showed me at least one syntactic difference -- in the second form the functions do not have access to the symbols of the member names
22:06gfrederickse.g., (defrecord Foo [bar]) (extend-type Foo IFoo (fooz [_] bar)) fails to compile
22:06tomojmakes sense I guess
22:06gfredericksyeah
22:07gfredericksoh good I don't think I have to write my code that way anyhow
22:31iceyman, something like nowjs for clojurescript / clojure would be amazing
22:32iceyactually, i guess pinot is kind of close, at least for client -> server calls. so that just leaves server -> client
22:48brehautnose
22:49brehautsorry bout that, wrong window
23:32srid4clojure's "code golf" is interesting, but too bad I can't *see* those concise solutions (even after solving the problem myself)
23:46brehaut"Tremors (Ron Underwood, 1990). A seamless, brilliant updating of the 1950s B-movie to the modern era pits a small desert town against giant, malevolent sandworms. The first movie is so much better than it deserves to be that the viewer makes it halfway through the sequel without realizing how inferior it is." — http://www.sjgames.com/gurps/books/horror/bibliography.html