#clojure log - Sep 17 2011

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:24 alandipert: konr: see also http://clj-me.blogspot.com/2009/04/mapping-every-second-item.html

0:53 zippy314_: 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

0:54 tomoj: what's a wei?

1:00 mdeboard: I dunno, but apparently it's worse than no wei

1:04 tomoj: :D

1:13 Chousuke: zippy314_: isn't the syntax for function calls (. l (getValue)) in ClojureScript

1:14 I'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.

1:32 jli: zippy314_: Chousuke is right.

1:33 though isn't that code redundant? it looks like you're taking a dom element, getting the html, and converting it to a dom element?

1:33 can you just use "l" directly?

4:33 mullr: An 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?

4:33 An example (a solution to http://www.4clojure.com/problem/31) : https://gist.github.com/1223758

4:48 tufflax: mullr (partial partition-by identity) is most idiomatic

4:48 :)

4:49 mullr: ah, I was staring at group-by and wondering if there was something similar

4:49 well, the awesome library function notwithstanding, I've seen this problem in many places

4:49 mmarczyk: mullr: you should generally try to pick an approach which will allow you to choose one data structure and stick with it

4:49 usually that's possible

4:51 tufflax: mullr maybe you could just conj to a list and reverse it the last thing you do :P

4:51 mullr: I'm looking at the source to partion-by, since it's effectively what I've implmented....

4:52 but it seems to go through a lot of trouble to be lazy

4:52 mmarczyk: if 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)

4:53 mullr: oh, that's a good tip

4:54 tufflax: lazy-seq is what you want to use most of the time i suppose. I don't think it's a lot of trouble.

4:55 mmarczyk: well, to be fair, I think partition-by is quite non-trivial if you want to make it as lazy as possible

4:55 tufflax: But honestly I haven't had this problem much. Often one can use higher-level functions such as map, partition, etc.

4:57 mullr: indeed, that seems to be the case.. ok, thanks for the help.

4:58 tufflax: any time

5:20 robermann: hello! a quick emacs question: can I use two REPLs in two separate buffers?

5:21 mrBliss: robermann: yes

5:21 robermann: so that , when trying to write a function in a buffer, in the second buffer I can test my ideas

5:22 mrBliss: robermann: you don't need 2 REPLs for that though

5:24 robermann: ah; how can I do it? when writing a function the prompt is waiting my input, so how can I evaluate another expression?

5:25 mrBliss: robermann: you can write in another Clojure buffer

5:25 I 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)

5:28 robermann: thanks mrBliss, I'm going to try it

5:32 mrBliss: the 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).

5:34 robermann: ok

5:34 I'm trying also M-x slime-scratch

5:34 open another buffer and with C-j evaluates it

5:35 (I check out this. http://common-lisp.net/project/slime/doc/html/Scratch-Buffer.html)

5:38 BTW, 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?

5:40 mrBliss: robermann: (setq pop-up-frames t)

5:42 * Nocab looks around

5:42 Nocab: anyone care to explain the semantics around this simple example to me? ;)

5:42 robermann: thanks mrBliss. Where should I put it

5:42 ?

5:42 mrBliss: robermann: your .emacs file

5:42 Nocab: (#{ :a :b } :a) ;=:a

5:42 is a set also a function which works as a discriminator on other values?

5:43 how does that work? :P

5:43 robermann: Nocab: a set is a function of itself (I'm not an expert anyway :) )

5:43 mrBliss: Nocab: (set key) -> (contains? set key)

5:44 Nocab: ah ok

5:44 gotcha

5:44 mrBliss: Nocab: same for maps and vectors (the indices are the keys)

5:44 robermann: ,([1 2 3] 0)

5:44 clojurebot: 1

5:45 robermann: ,([1 2 3] 1)

5:45 clojurebot: 2

5:53 Nocab: thanks

5:54 It was just an example where #{ :3 :4 } was used as a predicate, as opposed to like (= 3)

5:54 which struck me as odd

5:54 ah well. Ill be off then ;)

5:59 rqcursq: Good morning European Clojurians

6:16 Netpilgrim: rqcursq: Goog morning!

6:17 rqcursq: Eh, Good morning. :)

6:42 robermann: mrBliss: 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 :)

6:45 mrBliss: robermann: https://gist.github.com/1223837

6:46 I hope you have installed Slime and Clojure-mode

6:50 robermann: I'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!

6:50 (note: I'm on a Windows machine)

6:51 mrBliss: robermann: ok, then you should have all you need, just add one of the snippets to %APPDATA%\.emacs.d\init.el

6:53 robermann: not in .emacs?

6:53 ok

6:53 mrBliss: either one

6:54 I just thought Clojurebox would be using a .emacs.d folder instead of a .emacs file (or sometimes _emacs on Windows)

7:02 robermann: mmm 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?

7:04 does not works. C-j still adds a line

7:23 zippy314_: 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.

7:25 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?

7:26 robermann: mrBliss: 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

8:10 rqcursq: my first https://clojars.org/klojoule

8:10 :)

8:52 gfredericks: ow my macro is hurting

8:53 I'm trying to make use of this library (fnparse) that is full of macros and I'm not sure how to do it.

8:53 e.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?

8:54 given, of course, that I don't know what coll looks like at compile time.

9:47 lnostdal: seancorfield, 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

9:47 ..or does that not make sense.. hm

10:02 DeusExPikachu: how do you get rid of reflection warnings with regard to protected methods in gen-class?

10:03 nerooth: Trying 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:04 DeusExPikachu: i typed hinted the this argument as a super class but I still get the reflection warning when calling the protected method

10:08 Narvius: Hello, 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:07 TimMc: gfredericks: You'll have to use another macro...

11:08 gfredericks: Is coll a piece of syntax?

11:22 konr: I'm getting a "No implementation of method :make-reader" ( http://3d843a8c52457f13.paste.se/ ) reader. Any idea of what's the cause of this?

11:23 s/reader\./error.

11:23 lazybot: <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:39 arohner: anyone know of a library for RPC/agents between clojure JVMs?

14:47 michaelr525: \>

14:47 gfredericks: <

14:49 michaelr525: gfredericks: what's up?\

14:50 gfredericks: oh just trying to have a conversation with no alphanumeric characters is all

14:57 michaelr525: what's new and exciting?

14:57 gfredericks: strange loop?

14:57 PPPaul: *

14:58 michaelr525: \(.*\)

14:58 PPPaul: :@

14:58 * gfredericks has been playing with regular expressions all morning actually

14:59 michaelr525: whyy?

14:59 PPPaul: i want recursive regex

14:59 so i can parse xml

14:59 gfredericks: for fun https://github.com/fredericksgary/ranguages/blob/master/src/ranguages/regex_parser.clj

14:59 PPPaul: doesn't clojure parse xml for you?

15:00 PPPaul: i need more options

15:00 i'm going to make an AI that will learn to parse xml

15:01 gfredericks: PPPaul: I learned the fnparse library for the code in that link above. It wasn't too hard.

15:01 PPPaul: ok i'll give it a look... i haven't done much regex in a while

15:02 i've been having fun with clojure walks

15:02 i wish i knew about walking when i started learning clojure

15:03 i'm not really sure what the regex parser is supposed to do

15:03 what's the use-case?

15:05 the readme is a "fixme:"

15:05 michaelr525: gfredericks: yeah

15:05 whats the usecase?

15:12 gfredericks: the regex parser is just a component in the program

15:12 the whole program is for manipulating regular languages abstractly

15:13 please don't get the impression that this can be used for anything in real life :)

15:13 it's just messing around with theoretical things

15:15 The 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:16 also the inverse (matching string to index)

15:53 PPPaul: cool

16:32 srid: why would this code use nth? https://github.com/dbyrne/4clojure/issues/107

16:33 specifically, (fn foo [[x & xs] n] (if (zero? n) x (foo xs (dec n))))

16:37 gfredericks: srid: probably the destructuring did it?

16:37 srid: yup

16:37 gfredericks: I suppose that ought to be allowed

16:44 I bet it would be a lot harder to allow that though

18:26 devn: hm, this is fun... I just used the haml gem for via jruby in clojure

18:27 gfredericks: devn: now make an uberjar out of that and see how big it is.

18:27 devn: maybe add rhino and haml-js for convenience

18:28 best practice says you should wait till runtime to decide what language to use with your haml

18:28 * gfredericks imagines what a haml sandwich would taste like

18:29 tomoj: much like template spaghetti imo

18:30 gfredericks: must be a meatball sub then?

18:38 devn: gfredericks: heh, any guesses on the size?

18:38 gfredericks: devn: ignoring my rhino comment?

18:39 devn: gfredericks: I'm having trouble picking up on what you're driving at

18:40 gfredericks: 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:40 gfredericks: devn: oh I just thought that a jarfile that includes the entire clojure runtime _and_ ruby runtime might be rather large

18:40 yeah that's a good summary

18:40 devn: gfredericks: what's the harm in a big jar file?

18:41 gfredericks: devn: no harm, just humor

18:41 devn: heh, noted.

18:41 gfredericks: assuming you have such a jar and have measured its size, I'd guess ~50mb, with very low confidence

18:42 devn: gfredericks: I'm just trying to do my damndest to get friends of mine who are rubyists to do some clojure

18:42 gfredericks: devn: oh golly how I know that feeling.

18:42 every time they mutate an array I wince

18:42 devn: gfredericks: wow. i am not alone, apparently.

18:43 everything I see a foo = foo.gsub! or something I think "no!", but then I realize that this is reality

18:44 gfredericks: devn: the worst part is that _they're_ on the cutting edge, generally

18:44 given the big picture

18:44 not compared to clojure, but compared to java and such

18:45 ruby makes functional programming so weird -- it has methods, procs, lambdas, and blocks. wtf?

18:46 devn: gfredericks: heh -- i just wish the std lib included let

18:46 gfredericks: luckily you can get let without a lot of ceremony by doing: def let; yield; end

18:46 in 1.9.2 anyhow

18:47 * gfredericks pauses to consider

18:47 gfredericks: ah I see

18:47 devn: The first thing I do on most projects is go in and add a second and let method to the lib/

18:48 gfredericks: second?

18:48 clojurebot: Motion seconded and carried. Next agenda item.

18:48 devn: heh

18:48 Raynes: gfredericks: Japanese people like competition?

18:48 devn: ,(second [1 2 3])

18:48 clojurebot: 2

18:48 gfredericks: devn: I've never wanted such a thing in ruby. You must be doing things quite functionally :)

18:49 devn: gfredericks: when I can get away with it I will do it

18:49 gfredericks: Raynes: heck if I can figure out what that was in response to

18:49 devn: it's mostly in custom rake tasks and so on

18:49 Raynes: gfredericks: Your commend about it having methods, procs, lambdas, and blocks. wtf?

18:49 comment*

18:49 gfredericks: Raynes: clearly your explanation is the only possible one

18:49 devn: lol

18:50 gfredericks: devn: do you know of any FP lib for ruby? I forget what sorts of things I was imagining it to have...

18:50 ooh

18:50 immutable data structures particularly

18:50 Raynes: My co-workers are currently kind of writing Clojure in Ruby.

18:50 https://github.com/flatland/rupture

18:50 gfredericks: Raynes: that's more comical if I imagine you meant "writing a Clojure runtime ..."

18:51 Raynes: Naw. Just the sequence library and higher order functions.

18:51 ninjudd likes to say that they're writing Clojure in Ruby though, because it sounds cooler.

18:51 devn: gfredericks: only 18 megs for what its worth, which includes jetty, ring, jruby-complete, and some other miscellany

18:51 Raynes: But the library is very cool.

18:51 gfredericks: Raynes: I think the persistent immutable data is what I'd want first

18:52 Raynes: devn might be especially interested in the library.

18:52 gfredericks: devn: nice.

18:52 implementing such data structures in ruby would be hella thrilling for me. I love that kinda thing.

18:53 Raynes: Man I hate that word. 'Hella'.

18:53 gfredericks: Raynes: oh I see the persistent data structures note under "Coming soon".

18:53 Raynes: suggest a different word

18:53 Raynes: 'very'

18:53 gfredericks: s/hella/very

18:53 Raynes: Its origin in California makes me not want to move there anymore.

18:53 devn: Was it Twain who had the comment about using "very"

18:53 gfredericks: now imagine that lazybot can intelligently choose among the last few statements

18:53 devn: Substitute "damn" every time you're inclined to write "very";

18:53 your editor will delete it and the writing will be just as it should be.

18:54 gfredericks: Raynes: does 'hamster' refer to something I don't know about or is it just a funny noun?

18:54 devn: gfredericks: it's hash-mapped tries for ruby

18:54 Raynes: https://github.com/harukizaemon/hamster

18:55 gfredericks: oh so this is exactly what I always wanted?

18:55 devn: "Hash array mapped trie" => HAMT => Hamster

18:55 Raynes: gfredericks: Everything you've ever wanted is one google away.

18:56 gfredericks: Raynes: so what does hamster not have that your lib would want to add?

18:56 Raynes: Not my lib.

18:56 gfredericks: Raynes: your cow-orkers' lib?

18:56 Raynes: Co-workers. I have no part in it.

18:57 No clue. I try to avoid the Ruby parts of my job as much as possible.

18:57 * devn forks and helps

18:57 Raynes: I usually only touch Ruby when I'm replacing a piece of Ruby code with Clojure/ClojureScript.

18:57 ;)

18:57 gfredericks: yeah, replace that legacy language

19:00 devn: Raynes: The right tool for the right job.

19:00 gfredericks: is there a job that ruby is right for?

19:00 devn: Rails is a nice framework.

19:01 Does Clojure have a framework as mature as Rails?

19:01 gfredericks: but is that a property of the language?

19:01 (answer: sorta)

19:02 Raynes: devn: Right, I didn't mean to imply I've been replacing Ruby code just to be replacing it.

19:02 devn: gfredericks: 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:02 gfredericks: devn: no argument from me

19:02 devn: noir, ring, compojure, moustache, and many more -- but there isn't a clear winner there yet

19:03 gfredericks: *nod*

19:03 Raynes: yeah, that's like saying "I like ClojureScript so I'm going to rewrite all of my bash scripts in ClojureScript on nodejs!"

19:04 Raynes: devn: 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:05 And I do write ClojureScript+nodejs scripts rather than bash scripts.

19:05 But that's because I don't know bash.

19:05 http://github.com/Raynes/mkvrename :>

19:06 The README is a bit screwed because I forgot you can embed HTML in markdown.

19:09 devn: Raynes: 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:10 for instance, I can't just hand anyone on UNIX a compiled clojurescript => nodejs script and say "go for it"

19:10 if you need a bootstrap for your bootstrap script, there's something wrong

19:11 well, 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:12 Raynes: I'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:13 srid: http://dpaste.com/616614/ <- what does the compiler error "Unexpected parameter" mean at the (letfn ...) form?

19:15 * gfredericks tries to wittle down srid's code

19:16 Raynes: Wow.

19:16 srid: it 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:17 gfredericks: you're using letfn with an empty body?

19:17 srid: i fixed it, but still same error

19:17 gfredericks: hmm

19:18 srid: can't (letfn ...) form be used as an argument to functions?

19:19 gfredericks: sure

19:19 srid: btw, you don't need to let anything in order to define a recursive function

19:19 you could just as easily have done (fn cpp-seq [...] ...)

19:20 srid: right

19:20 gfredericks: oh I guess you sorta used that with your cpp function

19:20 oh hey

19:20 ,(fn [x & xs :as l] x)

19:20 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.Exception: Unsupported binding form: :as>

19:20 gfredericks: at my repl that gets me your unexpected parameter error

19:21 ,(fn [& [x & xs :as l]] x)

19:21 clojurebot: #<sandbox$eval11777$fn__11779 sandbox$eval11777$fn__11779@db4002>

19:21 gfredericks: try switching it for something like that

19:21 devn: Raynes: It's my opinion, and little more. Also, by a lot I think the number is at 2.

19:22 gfredericks: ,((fn [x & xs] xs) (range 10) (range 100 110) (range 1000 1010))

19:22 clojurebot: ((100 101 102 103 104 ...) (1000 1001 1002 1003 1004 ...))

19:22 Raynes: devn: Well, we've only talked like twice.

19:22 gfredericks: hmm

19:22 srid: gfredericks: http://dpaste.com/616616/ same error

19:22 gfredericks: p00n

19:23 srid: looks apply is not happy with accepting fn and related forms

19:23 devn: Raynes: 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:23 gfredericks: srid: that paste looks the same to me at the relevant point (line 6)

19:23 Raynes: &(apply str (filter #(Character/isUpperCase %) "$#A(*&987Zf")))

19:23 lazybot: ⇒ "AZ"

19:23 Raynes: devn: That makes three, since you disagree with 'a lot'.

19:23 srid: gfredericks: what is the & for?

19:24 devn: ,0xA

19:24 clojurebot: 10

19:24 srid: oh, I see

19:24 my destructuring was missing wrapping []

19:24 gfredericks: srid: that's interesting you ask because I have no idea how to explain it :)

19:24 it just seemed like another thing to try

19:24 devn: Raynes: Err on the side of not taking me too seriously. I think that will smooth things out.

19:24 Raynes: devn: When you say a bootstrap script shouldn't require a bootstrap, were you referring to cake?

19:24 gfredericks: devn: you can't be serious!

19:25 Raynes: It's all good. I was just pointing out that we seem disagree more than usual these days.

19:25 gfredericks: sorry, I couldn't restrain myself...

19:25 Raynes: Everybody has to disagree every now and again.

19:26 Iceland_jack: Raynes: Why do you say that?

19:26 ~Utterly false~

19:26 clojurebot: Excuse me?

19:26 Iceland_jack: Haha don't worry clojurebot, I'm attempting humour

19:27 Raynes: ~botsnack

19:27 clojurebot: Thanks! Can I have chocolate next time

19:27 devn: Raynes: 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:27 paul__: i want a botsnake

19:27 snack

19:27 both

19:27 devn: hahaha

19:27 * devn gives paul__ a botsnake

19:27 devn: (and a botsnack)

19:27 paul__: good

19:27 * gfredericks backs away from paul__

19:28 Raynes: Right. 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:28 * devn looks around the room

19:28 Raynes: Hence ending up with Ruby.

19:29 * devn nods

19:29 devn: That was the decision they made.

19:31 gfredericks: "I'm ruler", said Yertle, "of all that I see. But I don't see enough! That's the trouble with me."

19:31 srid: (<= (int \A) (int x) (int \Z)) -- is the only way to check if a char is uppercase or not?

19:31 devn: gfredericks: I'm guessing I could google "Yertle" and find the source, but what's that from?

19:32 gfredericks: $google yertle the turtle

19:32 lazybot: [Yertle the Turtle and Other Stories - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Yertle_the_Turtle_and_Other_Stories

19:32 gfredericks: devn: Dr. Seuss

19:32 devn: hmph, don't remember that one...

19:32 gfredericks: completely unrelated to clojure, but I was so compelled to share it that the unrelation couldn't stop me

19:33 devn: gfredericks: I for one appreciate that kind of behavior

19:33 3% battery remaining and I'm on a bus -- see you all on the other side

19:33 ciao

19:34 gfredericks: devn: chau

19:34 * gfredericks heard "I'm on a bus" to the tune of "On a Boat"

19:35 gfredericks: srid: so mucking with the arg-list fixed that problem?

19:35 srid: yes.

19:35 gfredericks: cool.

19:36 s/cool/hella

19:36 lazybot: <gfredericks> hella.

20:05 srid: 4clojure timed out on my solution http://dpaste.com/616623/ to problem 31, but it runs fine on my computer

20:06 Raynes: How long does it take on your computer?

20:06 srid: oops, it timed due to the (println ..) form, removing which it doesn't timeout

20:08 Raynes: Keep 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:08 gfredericks: 4clojure has solved the halting problem.

20:09 ...by halting things.

20:09 srid: can't I (recur ...) to the parent (loop ...)?

20:10 ctx - in that paste, I intend to make `cseq` tail-recursive

20:10 gfredericks: srid: it looks good to me

20:24 zodiak: stupid question but, how do I get lein deps to pull a dep from a github repo ?

20:29 gfredericks: zodiak: I don't know whether or not that's possible, but you could probably achieve something similar using checkouts

20:30 zodiak: such a thing might make the underlying mavenness of lein really messy

20:32 zodiak: ah. 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:33 gfredericks: zodiak: clojars is not an option?

20:33 zodiak: gfredericks, can I have private repos ?

20:33 gfredericks: don't think so

20:33 zodiak: then biz will probably have a hissy fit :(

20:33 gfredericks: :)

20:33 welp.

20:34 zodiak: any other thoughts gratefully received :)

20:34 gfredericks: I guess it depends on what you mean by "deploy to 3/4 servers"

20:34 zodiak: ideally, I would like to automate the deployment to 3 or 4 servers as much as possible

20:34 since I don't want to have to do every release ;)

20:34 gfredericks: zodiak: why do your deployment servers need to know about lein/maven?

20:35 zodiak: gfredericks, I was hoping for something as simple as 'lein deps' after the git pull from the private repo

20:35 gfredericks: zodiak: how are you running the program? lein run?

20:35 zodiak: yes indeedly

20:36 gfredericks: zodiak: any reason you can't make an uberjar, copy that to your servers, and then execute it?

20:36 zodiak: could do. that could work.

20:36 was jst wondering if I was missing something 'duh'

20:36 gfredericks: zodiak: another option would be a script in the root of your project that does the necessary legwork, like installing jars locally

20:37 zodiak: you very well might be, but only if I'm missing it too :)

20:37 zodiak: gfredericks, yeah.. I always fall back on good old Makefiles ;)

20:37 gfredericks: and nobody else is speaking up

20:37 zodiak: gfredericks, your input is welcomed and appreciated. I assure you :)

20:38 gfredericks: zodiak: anytime

20:38 sorta

20:38 zodiak: *chuckles* danke

20:40 oh. lein-war plugin. that could work as well.

20:42 gfredericks: huh? what does it do?

20:42 zodiak: gfredericks, makes the java/glassfish standard .war file

20:43 easier deployment

20:43 actually lein-localrepo could rock as well, with a small script

20:45 gfredericks: ,(macroexpand-1 '(defrecord FOO []))

20:45 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

20:46 gfredericks: ew

20:58 DeusExPikachu: I'm having trouble casting a long into an int

20:59 (type 0) ;= java.lang.Long

20:59 (type (int 0)) ;= java.lang.Long

21:00 zodiak: DeusExPikachu, huh.. on clojure 1.2.1 the first gives me int jst fine

21:00 DeusExPikachu: I'm on 1.3-RC0

21:00 zodiak: well, shut my mouth then :D

21:01 wiseen: is 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:02 DeusExPikachu: zodiak, also do you get int, or java.lang.Integer?

21:02 zodiak: DeusExPikachu, java.lang.Integer

21:02 DeusExPikachu: hmm, I need the primitive type int, not java.lang.Integer

21:02 so reverting to a previous version isn't going to help either

21:03 wiseen: shouldn't (instance? js/String "foo") return true, and (instance? js/Object .) always return true ?

21:19 jli: wiseen: I believe js/String is a function: ClojureScript:cljs.user> js/String

21:19 #<function String() { [native code for String.String, arity=1] }

21:19 >

21:22 or maybe I'm wrong

21:24 wiseen: jli, isn't it js String type ?

21:24 jli: the "string?" function works

21:24 wiseen: I don't think so. ClojureScript:cljs.user> (js/String 1)

21:24 "1"

21:25 what do you need "instance?" for?

21:25 wiseen: I don't, but the catch clause uses it

21:25 and I want to catch any exception

21:25 but it expects a type

21:25 and there is no "root object type" in javascript

21:26 afaik

21:26 jli: oh, I ran into this a while ago

21:26 let me see what I did

21:26 wiseen: eg. this is valid but it won't catch the exception (try (throw "foo") (catch js/Object (println "caught?")))

21:28 jli: https://github.com/clojure/clojurescript/wiki/Exception-Handling

21:28 I think I used "Exception" or "Error" for the type

21:30 hm. or maybe this has been changing recently?

21:34 wiseen: jli, well that doesn't work since the code generated uses instance? to check if exception is Error

21:34 js/Error that is

21:35 jli: yeah, I see. it's weird, because I see examples like that in clojurescript. maybe this all changed recently.

21:35 wiseen: well 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:36 so instance? does need to be patched

21:36 to match String/Number

21:36 and Object

21:53 jli: wow, I can get firefox to segfault with my clojurescript program

21:54 gfredericks: man.

21:54 that's like an error 4 levels down

21:56 jli: oh, hmm.

21:57 (defn ^:export main []

21:57 (try (throw (js/Error "?!"))

21:57 (catch js/Error e (js/print "segfault?!"))))

21:57 that seems to do it

21:58 man, wtf

21:59 uh, maybe something's wrong with my firefox. just "<script>print();</script>" makes things go south

22:00 tomoj: south = segfault?

22:00 gfredericks: tomoj: that's my residential experience

22:01 tomoj: over my head?

22:02 gfredericks: oh just making fun of geographical regions of the US

22:02 jli: oh, right. something is broken with firefox printing on this system. doh.

22:02 icey: jli: hopefully you haven't spent too much time chasing down the problem… i hate it when i do that

22:03 gfredericks: is (defrecord Foo [bar] ...) equivalent to (defrecord Foo [bar]) (extend-type Foo ...)?

22:04 ah. no it isn't.

22:04 tomoj: oh, I'm in texas, so over my head indeed I suppose

22:04 I think there is a performance difference, for one thing?

22:05 gfredericks: tomoj: 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:06 e.g., (defrecord Foo [bar]) (extend-type Foo IFoo (fooz [_] bar)) fails to compile

22:06 tomoj: makes sense I guess

22:06 gfredericks: yeah

22:07 oh good I don't think I have to write my code that way anyhow

22:31 icey: man, something like nowjs for clojurescript / clojure would be amazing

22:32 actually, i guess pinot is kind of close, at least for client -> server calls. so that just leaves server -> client

22:48 brehaut: nose

22:49 sorry bout that, wrong window

23:32 srid: 4clojure's "code golf" is interesting, but too bad I can't *see* those concise solutions (even after solving the problem myself)

23:46 brehaut: "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

23:48 * brehaut is having a window fail

Logging service provided by n01se.net