#clojure log - Feb 07 2011

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

0:01 anthony__: What's the recommended way to handle run-time properties? I need to compile my program into a jar, and read some vars from an external file when it runs. In Java, we'd use .properties files, but that doesn't seem like a very Clojurey/'code is data" way of doing it.

0:02 Should my external file just have statements like (def *my-param* "val") (def *my-2nd-param* "val2") and then read-eval it in my main method? Will that work?

0:04 Raynes: anthony__: You could just use regular Clojure data structures. I do that a lot.

0:05 anthony__: You can write a Clojure map to a file and then (read-string (slurp ...)) it, modify it, write it again, rinse, repeat.

0:05 You can, of course, just use a properties file.

0:07 anthony__: Raynes: Thanks for the info. I could use a properties file, but that's not nearly as fun. :-) I just wanted to make sure there wasn't any de facto standard for externally-defined run-time properties.

0:21 sritchie_: brehaut: okay! Here's the best I can do: https://gist.github.com/814028

0:22 brehaut: maybe in the morning, the rest of that pattern will be clear to me... I've just hardcoded the offsets, but I can see that that vector is a mirror image

0:23 oh, the answer is probably to do the opposite of what I did

0:25 to take a set of the good tiles.

0:36 cemerick: math fool question: in 2r111, 2 is the base or radix; what is the 111 called?

0:36 * cemerick used to be a little less foolish in this area :-(

0:48 syberdave: is there a better way to convert a list of chars to a string? (apply str (map str (list \c \h \a \r \s)))

0:52 amalloy: syberdave: ##(apply str (list \c \h \a \r \s)) is one easy way

0:52 sexpbot: ⟹ "chars"

0:53 amalloy: or you can use the string library: ##(do (require '[clojure.contrib.string :as str]) (str/join (list \c \h \a \r \s)))

0:53 sexpbot: java.lang.IllegalArgumentException: Wrong number of args (1) passed to: string$join

0:53 amalloy: hm

0:53 Scriptor: ,(reduce str \a \b \c)

0:53 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (4) passed to: core$r

0:53 Scriptor: er

0:53 ,(reduce (list \a \b \c))

0:53 amalloy: Scriptor: well, that will be the same as apply

0:53 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (1) passed to: core$r

0:54 Scriptor: argh, I said it right when I pm'd sexpbot

0:54 ,(reduce str (list \a \b \c))

0:54 amalloy: oh whoops, i included the wrong string lib

0:55 or you can use the string library: ##(do (require '[clojure.string :as string]) (string/join (list \c \h \a \r \s)))

0:55 sexpbot: ⟹ "chars"

0:55 Scriptor: amalloy: true, but it just seems more of a reduce type thing :)

0:55 amalloy: Scriptor: reduce will be a lot slower, i suspect

0:55 syberdave: oh, thanks :) i read that str calls .toString but didn't know you can call .toString on a list and get all the inner values

0:55 amalloy: syberdave: you can't. str doesn't "just" call .tostring

0:56 it calls tostring on each of its arguments and glues the result together. apply is what does the magic of converting ##(apply str [\a \b \c]) into ##(str \a \b \c)

0:56 sexpbot: (apply str [\a \b \c]) ⟹ "abc"

0:56 (str \a \b \c) ⟹ "abc"

0:57 syberdave: ah, that makes sense

0:58 amalloy: vs ##(str [\a \b]), incidentally

0:58 sexpbot: ⟹ "[\\a \\b]"

1:05 anthony__: One more easy question before I head to bed: what function do I use to find out if an object is in a collection? I thought (contains? ["A" "B" "C"] "A") was what I was looking for, but it isn't. Do I need to do the iteration manually, or is there a built-in function for this?

1:06 amalloy: some

1:07 brehaut: anthony__: contains? is key-wise

1:07 amalloy: &(some #{"Q" "A"} ["A" "B" "C"])

1:07 sexpbot: ⟹ "A"

1:07 amalloy: &(some #{"Q" "A"} ["Z" "B" "C"])

1:07 sexpbot: ⟹ nil

1:08 brehaut: &(contains? [:a :B :c] 1)

1:08 sexpbot: ⟹ true

1:08 anthony__: amalloy: Dangit. I looked at some, but forgot the #{} notation. I had something else instead that was wrong. Thanks, guys.

5:15 Cozey: How should I convert a string to number in Clojure? I'd like to benefit from clojure's Integer/Long/BigInteger parsing, so just Integer/parseInt does not suffice

5:16 should I (read-string "12313i12..." ) ?

5:46 hoeck: Cozey: read-string is probably the only way, but make shure that you have read-time evaluation turned off and remove all non-digit characters, especially whitespaces and readermacro chars before passing the string to read string

5:46 Cozey: at least that is what I would do

5:46 Cozey: hmm I already thought it might not be a good idea- perhaps slow and unsecure

5:49 hoeck: right, but its okay for config files and the like

7:20 babilen: any recommendation on books right now? should I wait for joy of clojure/practical clojure?

7:21 And is there one written for java ecosystem newcomers?

7:25 Dranik: babilen, why should you wait for practical clojure? guess it's ready

7:25 Vinzent: babilen, you can start reading joy of clojure and practical clojure right now. Also I think programming clojure will be a good start

7:25 Cozey: The Pragmatic Programmers / Programming Clojure is nice and comprehensive. has java interop as one of first chapters

7:26 Dranik: programming clojure is a bit out of date, though it is still good fro beginners

7:26 Cozey: true

7:26 babilen: Vinzent: Where can i read it? Yeah, I like "Programming Clojure" (lib@uni has it) but I was just thinking that I might learn things that are severly out of date and which are hard to unlearn later on

7:28 Dranik: babilen, you can easily find Programming Clojure and Practical Clojure on file sharing servers

7:28 babilen: And I am looking for something that explains the whole classpath madness™ for me. I am using cake right now, which gives me a nice repl, but I am still unsure how to actually run things from the CLI. Am I supposed to set CLASSPATH to ~/.cake/whatev" (to get the global project) and adapt it for local ones ...

7:29 Dranik: hehe, ok, well ...

7:29 Dranik: babilen, you may forget about the classpath madness simply by using leiningen

7:29 it does the classpath and repl superior!

7:31 babilen: Dranik: I am using cake and was under the impression that it is more or less the same as leiningen, but has a few advantages ...

7:32 Dranik: babilen, may be. so what the problem with classpath?

7:32 fliebel: babilen: I'd call them differences. This persistent VM is getting me headaches sometimes.

7:32 Dranik: I have the following in the .bashrc:

7:32 Vinzent: babilen, http://www.fogus.me/ for the joy of clojure. I don't think that there are things which you'll have to unlearn, because difference is not so big

7:32 Dranik: alias clojure="java -cp /opt/clojure/jline-0_9_5.jar:/opt/clojure/clojure.jar:/opt/clojure/clojure-contrib.jar:/opt/clojure/swank-clojure-1.2.1.jar:./:./classes/ jline.ConsoleRunner clojure.main"

7:32 you may use it as an example to add your options

7:33 Vinzent: babilen, for outdated things you can use Practical clojure as a reference

7:34 babilen: Dranik: Ok. I would basically like to get VimClojure's nailgun server to run, installed clojure with cake (~/.cake/lib/clojure-*.jar) and was unsure how to configure my classpath in order to be able to start the server.

7:35 Dranik: babilen, I also had this problem

7:35 do you know how I solved it?

7:35 I switched to Emacs! :-)

7:35 babilen: I am thinking a bit too PYTHONPATH like and have "leiningen/cake" == virtualenv in my head now .. but virtualenv (python) adapts the pythonpath (and bin) accordingly, while there is no "cake work_in_this_projects_environment"

7:36 Dranik: That would be an option, but I am quite happy with vim and don't actually see the need to learn emacs.

7:36 Dranik: babilen, so did I. But when I tried the emacs slime and emacs highlighting -- I was really surprised

7:37 actually that's your choice and I don't insist on emacs

7:37 babilen: Vinzent: Great, thank you. Btw, i wasn't thinking about "Practical Clojure" but of the "Joy of Clojure" and "Clojure in Action" combo from Manning. Just not sure what to buy :)

7:37 Dranik: I mean that the nailgun server and the vim plugin for clojure were a bit complex for me

7:38 Vinzent: babilen, btw there is vim-mode or smth like that for emacs

7:38 babilen: Dranik: Sure you don't, but there is always a certain ecosystem you have to learn. I know my share of emacs and would use it if it *really* is so much more superior for clojure development

7:39 Vinzent: I know that. viper is, however, not vim ...

7:39 Dranik: babilen, well, that is really what I think about emacs. It is superior for all lisps

7:40 babilen, all the vim plugins which I've tried for clojure were buggy and lacked some funtion

7:40 babilen: Point is: I would like to use vim and VimClojure seems to be a nice environment and everything I need. I am just not sure how to set it up.

7:40 Dranik: babilen, that is the point! :-)

7:40 Vinzent: babilen, I haven't read Manning combo myself, but some say Joy of clojure is preferrable if you don't want to buy both

7:41 babilen: Dranik: So, you would recommend to use emacs if I want to spend a considerable time programming in Clojure? (like a lot of time)

7:41 Dranik: babilen, you know, I'm not the person whom you should ask the question. I'm a kind of newbie in clojure

7:41 Vinzent: babilen, btw, I think there is no midje-mode for vim (just a note)

7:41 babilen: Dranik: The "not sure how to set it up" is the point?

7:41 midje-mode?

7:42 Dranik: babilen, although I've tried 2 vim plugins, eclispe, netbeans and emacs

7:42 and only emacs was totally OK for me

7:42 babilen: ok, how long have you been using vim before?

7:42 Dranik: about 5 years

7:42 babilen: what is midje more?

7:42 *mode

7:42 * babilen googles

7:43 Vinzent: midje is a testing framework https://github.com/marick/Midje

7:44 babilen: Point is I have to make some decisions soon and am therefore asking more experienced people. If the consensus is "yes, use emacs there is nothing like it for clojure" then so be it.

7:45 Dranik: babilen, may be you should ask fliebel, raek and others. They are usually very responsive and helpfull.

7:46 they also have much experience in clojure

7:46 babilen: I will do that. raek recommended cake before.

7:47 fliebel: Dranik: What about me?

7:47 Dranik: fliebel, I just recommended babilen to ask you about emacs :-)

7:48 fliebel: I don;t know emacs...

7:48 Dranik: o-ops... sorry then

7:48 fliebel: I do use vim :)

7:49 babilen: fliebel: /me is a clojure newbie in the very early stages and unfamiliar with the ecosystem. I am trying to wrap my head around vimclojure and nailgun and cake and classpath and was recommended emacs in lieu of vimclojure

7:49 fliebel: Ah, good news. Do you use vimclojure? And would you mind if I pick your brain about it?

7:49 (later is fine)

7:50 fliebel: I use vimclojure, but without nailgun.

7:50 babilen: ah, so no repl inside vim ...

7:50 why don't you use nailgun?

7:50 fliebel: no, not at the moment. I use cake for that. So I;m not the best example of a vim user I guess.

7:50 Dranik: babilen, that's what I told you :-) emacs offers slime for clojure

7:51 _danb_: I like emacs and inferior clojure; it's fairly easy to setup; swank (superior clojure) can be a little tricky

7:51 fliebel: babilen: I just did not bother to set it up. I should.

7:51 Dranik: _danb_, oh, that's you! :-)

7:51 _danb_: Dranik: I'm a clojure newb

7:52 babilen: fliebel: ok, what i don't get at the moment is: I start my trusted vim. Start to edit a clojure file (:e foo.clj) and would like to play with it in a repl, what do I do?

7:53 fliebel: babilen: Either configure nailgun, or copy/require the code on the cake repl.

7:53 babilen: hehe

7:54 ok, "configure" nailgun seems to be a step shunned by a lot of people ... but tell me, how is this supposed to work (from a jvm/clojure/classpath perspective)

7:55 fliebel: well, nailgun sortof is a persistent vm, like cake. So vimclojure uses that to eval code.

7:55 I don;t know much more about it.

7:55 babilen: my understanding right now is: I start vim it has to know about my classpath .. the classpath is dynamic, based on whatever "project" i am working on (even for single file one off "scripts"). clojure installation + libraries are managed with cake and either installed in the "global" project or a specific one ...

7:55 how does this all fall together?

7:55 AWizzArd: speaking about vimclojure: kotarak updated his website design, and it looks pretty nice: http://kotka.de/

7:56 babilen: AWizzArd: links don't work :)

7:57 fliebel: babilen: I don't know. Maybe you have to provide it with a CP for Clojure and contrib, or maybe it recognizes project.clj files.

7:58 babilen: "it" == vimclojure?

7:58 AWizzArd: babilen: yes, the "news" says that those links are not working yet

8:00 babilen: ok, another question (lets take the vimclojure out of the equation) -- let us assume that I have a foo.clj laying around with a most wonderful program. how do i run it from the CLI? where do I install the dependencies/needed libraries? what are cake/leiningen used for in this scenario?

8:01 Vinzent: babilen, lein uberjar, then java -jar ... to run

8:05 babilen: Is there any book, documentation, blog post, writing in the sand that somehow explains this? I don't want to spend the next weeks bugging #clojure with my newbie talk, when you should spend time discussing how pattern matching, STM, function composition or currying ;)

8:05 s/you should/we should :)

8:05 sexpbot: <babilen> Is there any book, documentation, blog post, writing in the sand that somehow explains this? I don't want to spend the next weeks bugging #clojure with my newbie talk, when we should :) spend time discussing how pattern matching, STM, function composition or currying ;)

8:06 Vinzent: maybe http://learn-clojure.com/ wille be useful?

8:06 babilen: Vinzent: And if I have some of the dependencies installed in cake's global project I would adapt "java -cp" accordingly?

8:07 Vinzent: The name is auspicious

8:08 Vinzent: babilen, currently I'm not using cake, so I don't know. But I suppose cake uberjar packs all project dependecies into the single jar

8:08 and anyway, if someday you decide to try emacs, I think you should start with emacs-starter-kit (and durendal) which provide usable defaults, so you only have to customize keybindings

8:08 babilen: yes, i understand it that way

8:09 ok, thanks all for the input so far. may you all have a nice day

8:10 Vinzent: good luck

8:35 pppaul: is there a way to use apply with records?

8:35 (apply myrec. [1 2 3 4 5])?

8:35 when i try i get exceptions

8:36 if not, can it be done with the other data structure that is like a record (forgot name... struct maybe)

8:44 Vinzent: pppaul, (defstruct foo :a :b :c) (apply (partial struct foo) [1 2 3])

8:45 pppaul: thanks a lot

8:46 Vinzent: pppaul, I'm not sure about records. Dot and new are not functions, but special forms

8:46 pppaul: ok, i'll just use structs

8:46 AWizzArd: pppaul: in real production systems lots of Records will have a factory fn.

8:46 That can be used with map.

8:47 pppaul: oh

9:00 Cozey: how to use :hierarchy option with defmulti ?

9:01 (defmulti foo :tag :hierarchy (make-hierarchy)) throws clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.IRef

9:02 babilen: fliebel: got ng working -- beautiful :)

9:03 fliebel: babilen: Great :) How did you do it?

9:04 babilen: fliebel: Hang on, i'll put it in a pastebin .. damn i need a blarg!

9:08 Vinzent: Cozey, looks like you need to wrap your (make-hierarchy) with ref

9:11 Cozey: oh, ok!

9:13 Vinzent: I have a problem with Moustache. How can I create nested app's with relative urls?

9:13 Here is my attempts: http://paste.lisp.org/+2K5O.

9:19 Cozey: When You keep Your tests in separate files, how do You test the private functions?

9:21 AWizzArd: Cozey: did you try to (in-ns 'into-your-ns)?

9:22 fogus`: Cozey: Does this get you what you need? https://gist.github.com/814421

9:22 Cozey: fogus`: yes, i just needed to pass a var

9:23 fogus`: i.c.

9:23 Cozey: AWizzArd: i see it's possible to import a private fun with a ns-resolve as well

9:24 ha! but in-ns seems even better.

9:24 will check this out

9:26 babilen: fliebel: http://paste.debian.net/106761/

9:27 ejackson: Cozey: there was a discussion of this in the GGroup some time back, a couple of nice solutions: http://groups.google.com/group/clojure/browse_thread/thread/3835e5405ab930f6/

9:28 babilen: fliebel: Something like this should be possible with leiningen too I guess, but I have no idea to to define custom tasks there

9:31 fliebel: omni-completion is working. ah this is much better :)

9:32 Cozey: ejackson: thanks, @#/ hack is pretty cool :-)

9:33 fliebel: babilen: Thanks!

9:47 chouser: heh, that's cool in a retro-perl kinda way

9:47 ,@#'/

9:47 clojurebot: #<core$_SLASH_ clojure.core$_SLASH_@1f530d8>

9:47 chouser: is there a long string of punctuation that's meaningful clojure?

9:49 obviously one could ##'@*&#&*#&*#&*#&*#

9:49 sexpbot: ⟹ (clojure.core/deref *&#&*#&*#&*#&*#)

9:49 chouser: but that's not very interesting

9:49 s/long/longer/

9:50 babilen: fliebel: is it working?

9:50 chouser: ,`^_@#'/

9:51 clojurebot: (clojure.core/deref (var clojure.core//))

9:53 fliebel: babilen: I haven't tried yet. I saved the information in my head, for the day I am going to do my vim configuration properly.

9:53 pppaul: if i want to recursively build a list, using recur, do i need to pass the list as an argument to the function?

9:54 opqdonut: yes, otherwise it won't be tail recursive

9:54 babilen: fliebel: ah, ok. I just really like it and wanted to share the joy :)

9:55 fliebel: pppaul: or use a loop inside

9:55 pppaul: a loop

9:55 Vinzent: chouser, nice :) but first doesn't work for me with No dispatch macro exception

9:55 fliebel: babilen: Yea, thanks for the information. The cake task is neat.

9:55 pppaul: a loop would be like a nested helper function?

9:56 chouser: ,`^_,@#'/

9:56 clojurebot: (clojure.core/deref (var clojure.core//))

9:57 ejackson: chouser: I see your future, and its a fork bomb...

9:58 chouser: :-O

9:59 ejackson: :)

10:01 chouser: ,({[`^_,@#'/]*}+)

10:01 clojurebot: nil

10:02 pdk: it's perl awareness day

10:03 ejackson: the original write-only language.

10:07 fliebel: chouser: What is that!

10:07 chouser: fliebel: nil

10:08 for cases where saying literall "nil" is just too clear and concise.

10:09 fliebel: chouser: you could also have done ##(dotimes [i 100] (inc i))

10:09 sexpbot: ⟹ nil

10:10 fliebel: But that is at least understandable. Your… thing makes me want to try Scheme.

10:10 chouser: :-)

10:10 I'm having some trouble working in ~

10:11 odyssomay: How do I (loop for x in '(1 2 3 4) if (evenp x) collect x) => (2 4) (or similar) in clojure?

10:12 nevermind

10:12 I need to rethink this

10:12 pdk: ,(for [x (range 1 5)] x :when (even? x))

10:12 clojurebot: java.lang.IllegalArgumentException: Wrong number of args (6) passed to: core$for

10:12 pdk: (doc for)

10:12 clojurebot: "([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr ...], :while test, :when test. (

10:13 pdk: (for [x (range 1 5) :when (even? x)] x)

10:13 ,(for [x (range 1 5) :when (even? x)] x)

10:13 clojurebot: (2 4)

10:14 fliebel: Wait, I'm trying to read your code. You're calling map with +, which returns nil. The map contains one key, and one value, which is +, the key is a vector containing… a syntax quoted slash symbol with metadata, but the rest is still magic.

10:14 chouser: ^

10:16 chouser: _ is the symbol that will become the :tag metadata

10:17 #'/ is the var containing the divide function. @ derefs it

10:17 , is of course just whitespace

10:17 clojurebot: java.lang.Exception: Unable to resolve symbol: is in this context

10:17 fliebel: I see, thanks :)

10:19 chouser: ,({[*`~-@#'/]\%}+^:$!?<>&-._|,=)

10:19 clojurebot: #<core$_EQ_ clojure.core$_EQ_@154ae5a>

10:19 khali: so it it by design that to setup slime for clojure is an exercise in frustration? :/

10:19 TimMc: ,!@#$%^&*()

10:19 clojurebot: java.lang.Exception: Unable to resolve symbol: ! in this context

10:19 TimMc: :-P

10:20 chouser: TimMc: it's carefully engineered!

10:20 TimMc: Now I want to write one that only uses the shift-numeric symbols, and each one only once.

10:21 fliebel: chouser: This is what it is ##({:blah 1} 1 2)

10:21 sexpbot: ⟹ 2

10:26 chouser: (meta ^:$!?<>&-._|,=)

10:26 oops, sorry

10:26 fliebel: I just ran the exact same command.

10:26 &:$!?<>&-._|

10:26 sexpbot: ⟹ :$!?<>&-._|

10:28 chouser: right, just a keyword

10:28 that's the cheatingest bit

10:29 fliebel: chouser: It'd be more magic if you used the map to actually get the value.

10:30 chouser: fliebel: yes, but I think that would require repeating some chars which for some reason I was avoiding

10:31 something like ##({\%[*`~-@#'/]+^:$!?<>&-._|,=}\%)

10:31 sexpbot: ⟹ [#<core$_STAR_ clojure.core$_STAR_@1cf5b66> #<core$_ clojure.core$_@4f8595> #<core$_SLASH_ clojure.core$_SLASH_@1c5293d>]

10:33 chouser: Note to anyone who might be turned off to clojure by this monstrosity: the above is NOT idiomatic or common clojure. It's just an exercise in obfuscation, which is a practice that generally meets success in any language.

10:33 pdk: clojure.core couldve done the half time show last night

10:34 it also has slash as a guest star apparently

10:36 fogus`: I like to use (*) and (+) to build binary numbers.

10:36 ,[(*)(+)(*)(+)(*)(+)]

10:36 clojurebot: [1 0 1 0 1 0]

10:36 fliebel: fogus`: You're brilliant!

10:38 ejackson: lol, that's hilarious

10:38 odyssomay: -_-

10:42 fogus`: This forms the root of an entire system of computation that I like to call Fooljure.

10:44 ejackson: fogus`: it reminds me of the binary stuff in Reasoned Schemer, actually.

10:44 of course, there was a reason for that

10:44 fogus`: ejackson: I will look at that tonight as a refresher. :-)

10:44 ejackson: fogus`: oh, and it should be F(+)(+)ljure

10:45 * fogus` LOLs

10:45 * fogus` L(+)Ls

10:45 * ejackson reciprocates

10:46 * fogus` (*)(+)(*)s

10:46 ejackson: chouser: this is all your fault.

10:47 fliebel: &((fn[[?<&,%*+,$*|]](?<&,%*+,$*|))({[^:<?>,'*$][+(+(*)(*))(*,3(*))]}['*$]))

10:47 sexpbot: ⟹ 5

10:47 hoeck: take this javascript!

10:48 fogus`: fliebel: fn?!? How dare you?!

10:48 fliebel: fogus`: I'm sorry.

10:50 fogus`: ;-)

10:53 chouser: fliebel: but, obfuscated on a couple more levels than mine. Nice!

10:54 fliebel: chouser: Thanks :)

10:55 Hm, I think it would be useful for #0 to refer to the anonymous function itself, like bash's $0

10:56 s/#0/%0

10:56 sexpbot: <fliebel> Hm, I think it would be useful for %0 to refer to the anonymous function itself, like bash's $0

10:56 amalloy: fliebel: that's a good point, although it's hard to see it being useful that often

10:56 mrBliss: does marginalia support custom css?

10:59 fliebel: &(((((((((((fn a [] a)))))))))))

10:59 sexpbot: ⟹ #<sandbox9582$eval12870$a__12871 sandbox9582$eval12870$a__12871@8b9ddc>

11:00 fliebel: amalloy: That is one useful case ;)

11:00 amalloy: fliebel: for given values of "useful", i see

11:01 seriously though, if you want a direct-recursive function, then what you're doing is non-trivial enough that it merits at least a (fn) form

11:03 * amalloy finally catches up with the #clojure log. that is some disgusting punctuation, chouser and fliebel. you should be ashamed

11:05 fliebel: amalloy: But you must admit that #(%0) is better in that respect :)

11:06 amalloy: fliebel: but that'd be different from (fn a [] a)

11:06 it would be the same fork bomb as (#(% %) #(% %))

11:12 fliebel: amalloy: Brilliant!

11:12 fogus`: A fun way to get at individual elements of a vector:

11:12 ,(let [S [1 2 3] _ #(%(+)) __ #(%(*)) ___ #(%(+(*)(*)))] #{(_ S) (__ S) (___ S)})

11:12 clojurebot: #{1 2 3}

11:13 fogus`: extrapolate from there

11:13 fliebel: fogus`: Lots of (*)

11:14 amalloy: fogus`: a macro please, so i don't have to extrapolate :)

11:14 mrBliss: fogus`: Does marginalia allow custom css?

11:14 fogus`: mrBliss: Not easily (at the moment)

11:14 fliebel: amalloy: That is brilliant as well! Imagine all these ~ and ' and ~

11:16 amalloy: mrBliss, chouser: fork it and change the clojure brush is all it would take, though, right?

11:17 not a very general solution, i realize

11:20 mrBliss: fogus`: are you planning to add a possibility to generate a 'normal' doc? Normal being not 'uber', so external js and css and maybe separate html files for every namespace.

11:21 fogus`: mrBliss: We are yes. It's slow going at the moment, but it's a feature on the list. Patches welcomed! :-)

11:22 mrBliss: fogus`: I'll see what I can do :-)

11:22 fogus`: mrBliss: Basically some flag that allows user to choose one or the other. Design session over. ;-)

11:24 mrBliss: fogus`: would you just pass the flag to the marginalia command or also store it (and some custom settings as well) in a .marg file (or project.clj ;-)

11:26 fogus`: I think we prefer project.clj/pom.xml as flag storage

11:26 mrBliss: fogus`: ok, thanks.

11:27 fogus`: Thank you

11:34 mefesto: hey everyone. i'm experimenting around with some ring/moustache stuff. typically in war files you list the resources you depend on in the web.xml/resource-ref sections. when using ring/lein-ring is there a way to configure the local jetty instance with these jndi resources setup for the local environment?

11:35 Vinzent: One more question about moustache: how can I create nested apps with relative urls?

11:35 mefesto: i'd like to be able to test locally with lein ring server but later deploy the uberwar to jboss or something

11:35 Vinzent: description here: http://paste.lisp.org/display/119436

11:37 fliebel: &(let[_,#(apply +,3,%&)<>(->>,#(%)#(%)#(%)#(%)#(%)#(%)#(%)#(%))]((((((((<>,_)_)_)_)_)_)_)_))

11:37 sexpbot: ⟹ 3

11:37 companion_cube: -_-

11:38 obsfucated clojure contest ?

11:38 ohpauleez: &(doc <>)

11:38 sexpbot: java.lang.Exception: Unable to resolve var: <> in this context

11:38 ohpauleez: ohh that's in the let block

11:38 fliebel: companion_cube: I don;t know about a contest, but some obfuscated code has based by, yes.

11:40 jcromartie: what's the idiomatic way to test if all elements of a sequence satisfy a predicate?

11:40 fliebel: every?

11:40 clojurebot: everyday is Rich Hickey Appreciation Day

11:41 jcromartie: every? yeah that's i t

11:41 why is it "some" and "every?"

11:41 dur

11:41 I answered my own question

12:20 Vinzent: How can I reload current ns?

12:21 raek: Vinzent: (require 'the-ns :reload)

12:21 Vinzent: raek, thanks

12:21 raek: or in emacs: C-c C-k in the source file buffer

12:25 Vinzent: Hm, wait, when I C-c C-k I've got "foo already refers to..." exception, so looks like it only compiles, not cleanes ns

12:27 raek: that can happen when you move things around between namespaces

12:28 that error means that previously 'foo' was used from another another namespace, but now you try to define it in the current namespace

12:28 Vinzent: yes

12:29 raek: you're not supposed to get that when you don't have moved stuff around

12:30 (remove-ns 'the-ns) can be used so start from scratch (though you have to step into another namespace to do that, and also remove all namespaces that are using it)

12:30 but yes. C-c C-k only reloads the namespace and doesn't remove it.

12:31 Vinzent: I'm talking exactly about such cases. Usually I simply rerun lein-swank, and looks like it would be faster than (remove-ns)

12:32 babilen: hi all. I have configured datka's vimclojure with nb, but omni-completion for clojure.contrib (specifically contrib) is not working. I configured it like this: http://paste.debian.net/106761/ Any ideas what the problem might be?

12:33 odyssomay: How do I attach metadata to a string?

12:33 raek: Vinzent: you can also (ns-unmap 'the-ns 'the-var) if only a few of the vars cause problems

12:33 babilen: ng (nailgun) that is :)

12:34 Dranik: babilen, seems like you are halfway to emacs :-)

12:34 babilen: Dranik: What is missing?

12:34 raek: odyssomay: you can't. :) metadata is a clojure feature and strings are from java-land.

12:36 odyssomay: ok, that just made metadata a lot less useful

12:36 Vinzent: raek, probably iterating over (ns-interns *ns*) and ns-unmap'ing should do the trick. Thank you for an advice.

12:37 hiredman: ,(doc remove-ns)

12:37 clojurebot: "([sym]); Removes the namespace named by the symbol. Use with caution. Cannot be used to remove the clojure namespace."

12:37 hiredman: clojure.core it should say I think

12:38 raek: Vinzent: yes. although that solution sounds very much like what remove-ns (modulo :import'ed classes and namespace aliases)

12:39 Dranik: babilen, I'm just kidding

12:39 babilen, seems like you have chosen too complex way bcs vim plugins are a bit buggy

12:40 babilen: Dranik: What do you mean? I rather think that it is a problem with my cake/classpath/whatever setup ..

12:41 amalloy: odyssomay: wrap the string in a vector and put meta on that

12:41 Dranik: babilen, I've tested SlimV and it disconnected from the repl in some cases

12:41 babilen, VimClojure seemd the way out to me but it was to hard to get it working

12:42 amalloy: Vinzent: (doseq [[sym var] (ns-publics *ns*)] (ns-unmap *ns* sym))?

12:43 Vinzent: amalloy, yes, that's what I meant

12:44 odyssomay: amalloy, yes, but then I'll have to acquire it later on, which takes away the point of having metadata in the first place

12:44 amalloy: Vinzent: won't work because that's only for vars defined in the current namespace, though. you can use ns-refers to get the external vars

12:47 babilen: raek: Thanks again for your recommendation and the link the other day. cake is working great and I am starting to wrap my head around it :)

12:54 Vinzent: amalloy, ok, thank you! I'll try it tomorrow, now off to bed

13:13 fliebel: amac: How's the graph doing?

13:25 amalloy: fliebel: haha just saw the email address you use for github

13:26 fliebel: amalloy: I stole the idea from defn I think. Have you seen my contact page? http://pepijndevos.nl/pages/contact-943

13:27 amalloy: meh. rot13 is so last century :)

13:28 fliebel: amalloy: Best would be to have something that is a valid address to a bad regex :)

13:31 raek: fliebel: lol!

13:34 fliebel: Oh, well, I guess a bad regex will already find the address in 'crcvwaqribf@tznvy.pbz'.encode('rot13')

14:02 Guest35232: sexpbot: #()

15:27 amalloy: Guest35232: ##()?

15:27 sexpbot: ⟹ ()

15:29 Guest35232: amalloy: i wanted to know where #() was expanded by source code, is that possible using $findfn?

15:29 amalloy: Guest35232: what do you mean, where it was expanded?

15:29 Guest35232: amalloy: anyway that is expanded by the reader i guess

15:29 amalloy: right

15:30 Guest35232: amalloy: but how do you use $findfn to search for function definitions or macro definitions?

15:30 $findfn constancy

15:30 sexpbot: java.security.PrivilegedActionException: java.lang.Exception: Unable to resolve symbol: constancy in this context (NO_SOURCE_FILE:0)

15:30 amalloy: Guest35232: you're just looking for source, not findfn

15:30 $source ->

15:30 sexpbot: -> is http://is.gd/Cnm2kU

15:30 Guest35232: ah $source

15:31 i got confused between the two

15:31 :)

15:31 amalloy: thanks

15:31 amalloy: $findfn 1 inc 2

15:31 sexpbot: [clojure.core/->>]

15:31 amalloy: wow that works way better than i thought

15:31 Guest35232: i should look into the source code / wiki of the sexpbot some time soon

15:32 amalloy: $whatis sexpbot

15:32 sexpbot: sexpbot is http://github.com/Raynes/sexpbot

15:33 Guest35232: amalloy: yep saw the github page today :)

15:33 amalloy: saving it for the weekend

15:33 amalloy: how does 1 inc 2 return ->> ?

15:40 raek: ,(read-string "#()")

15:40 clojurebot: (fn* [] ())

15:51 __name__: $source fn*

15:51 sexpbot: Source not found.

15:54 amalloy: __name__: fn* is a reader-level special form

15:55 &(doc fn*)

15:55 sexpbot: java.lang.IllegalArgumentException: Wrong number of args (6) passed to: core$eval13072$--GT-

15:55 __name__: amalloy: i figured just after i typed

15:55 semperos_: I have a simple project with two namespaces, say foo.core and foo.util

15:55 I want to compile and package with lein uberjar

15:56 how do I properly use/import foo.util inside foo.core so it's properly compiled and included in my jar?

15:57 amalloy: semperos_: it should get included in the jar automatically if it's in the src directory, and you're able to use it from the repl with (use 'foo.util)

15:57 semperos_: yes, I am

15:57 I get an error about that says...

15:58 I am able to compile and jar the project, in fact

15:58 but I get an error when I call a certain function in foo.util

15:58 wanted to make sure I was setting it up correctly

15:59 so if I just (:use foo.util) in my ns declaration, it should be included properly when compiled?

15:59 amalloy: semperos_: yes, it "should". it would be easier to help with fewer "i get an error" and more gists of a stacktrace :)

15:59 semperos_: yep, I know

15:59 had a few stacktraces, can't find the right one

15:59 amalloy: you can also try $ jar tf myproj.jar and see if foo/util.clj is in there

15:59 semperos_: so I'm running it again

16:00 alrighty

16:00 I'll be gisting up the stacktrace momentarily, thought I had the right one in front of me

16:05 kencausey: I don't suppose Brian Marick's robozzle.mov is mirrorred anywhere? github is not well today it seems. The vimeo page is not of much use to me because I can't fullscreen (stupid flash on multi-head system). If I'm overlooking a pop-out button, let me know.

16:05 semperos_: I hate developing on windows, can't copy/paste out of this terminal

16:05 kencausey: putty?

16:06 semperos_: nah, custom tabbed command-line program

16:06 kencausey: oh

16:06 fliebel: semperos_: Try shift, or good old right click.

16:06 semperos_: shift

16:06 kills me

16:06 fliebel: thanks

16:07 mattmitchell: is there a way to set a global connection for clojure.contrib.sql ?

16:07 LauJensen: mattmitchell: no, use clojureql :)

16:08 semperos_: amalloy: a hiccup.core function causes it: https://gist.github.com/815207

16:08 I'm just using hiccup.core/html to generate some basic html, works fine at the repl

16:09 mattmitchell: LauJensen: :) well OK. Actually this is for an existing project that uses clojure.contrib.sql

16:09 LauJensen: mattmitchell: :(

16:09 semperos_: you can use both

16:09 in principle, that is

16:09 amalloy: semperos_: this looks like misuse of laziness&bindnig

16:10 ie, nothing wrong with your jar, but it only works in the repl because the repl forces the lazy sequence right away

16:11 if you don't force the lazy sequence until after the binding form is done, the var it depends on will have the wrong binding (or none, here)

16:12 semperos_: I understand

16:12 amalloy: i haven't used hiccup so i don't know what the fix is, but a simple doall (or dorun, depending) will probably suffice

16:12 semperos_: that makes sense

16:12 the value that hiccup returns here

16:12 is being written to a file

16:12 not to the repl, so that's a bit confusing

16:31 brehaut: morning

16:32 amalloy: 'lo brehaut

16:32 ohpauleez: brehaut: I've been enjoying your posts lately

16:32 nice work man

16:32 brehaut: ohpauleez: cheers

16:33 ohpauleez: I used fnparse around September or October to write a parser for a mini-language at work

16:33 brehaut: i discovered it about a year ago, but hadnt actually learnt how to use it till yesterday

16:38 ohpauleez: have you looked at fnparse 3 alphas at all?

16:39 ohpauleez: brehaut: I've looked at it, but it wasn't anywhere for me to use it when I was working with it

16:40 brehaut: is it cool stuff?

16:40 brehaut: i have no idea ;)

16:40 ive only used 2.2.7

16:42 semperos_: amalloy: in that hiccup stacktrace, it says "hiccup.core/render-attrs is unbound"

16:43 just grepped the code base, render-attrs isn't there

16:43 thoughts?

16:43 amalloy: semperos_: which codebase?

16:43 semperos_: hiccup's

16:43 and my own, for that matter

16:43 amalloy: hmmm. puzzling

16:43 semperos_: I've tried forcing evaluation of possibly lazy bits of my code

16:43 to no avail

16:45 ossareh: Morning all

16:46 I have a string that references the name of a var (a record) how can I get the actual var?

16:47 amalloy: &(resolve (read-string "first))

16:47 sexpbot: java.lang.Exception: EOF while reading string

16:47 amalloy: &(resolve (read-string "first"))

16:47 sexpbot: java.lang.SecurityException: You tripped the alarm! resolve is bad!

16:47 amalloy: ,(resolve (read-string "first"))

16:47 clojurebot: #'clojure.core/first

16:47 brehaut: ,(doc boundfn)

16:47 clojurebot: Titim gan éirí ort.

16:47 brehaut: ,(doc bound-fn)

16:47 clojurebot: "([& fntail]); Returns a function defined by the given fntail, which will install the same bindings in effect as in the thread at the time bound-fn was called. This may be used to define a helper fun...

16:48 ossareh: amalloy: right, so I tried that but then assume (foo (resolve "some-fn") {}) - I get : No implementation of method: :content of protocol: #'clj-boilerplate/Page found for class: clojure.lang.Var

16:48 brehaut: ,(doc bound-fn*)

16:48 clojurebot: "([f]); Returns a function, which will install the same bindings in effect as in the thread at the time bound-fn* was called and then call f with any given arguments. This may be used to define a hel...

16:48 amalloy: ossareh: deref it

16:48 brehaut: ##(doc bound-fn*) doesn't cut it off

16:48 sexpbot: java.lang.IllegalArgumentException: Wrong number of args (6) passed to: core$eval13072$--GT-

16:49 amalloy: dang it sexpbot what is your problem today

16:49 brehaut: ##(doc bound-fn*) doesn't cut it off

16:49 sexpbot: java.lang.IllegalArgumentException: Wrong number of args (6) passed to: core$eval13072$--GT-

16:49 amalloy: er sorry didn't mean to send that again

16:49 brehaut: ##(doc bound-fn*) doesn't cut it off

16:49 sexpbot: java.lang.IllegalArgumentException: Wrong number of args (6) passed to: core$eval13072$--GT-

16:49 amalloy: wtf

16:49 something wrong with client, sorry, leaving

16:49 brehaut: its like ground hog day all of a sudden

16:49 semperos_: lol

16:50 brehaut: semperos: i think bound-fn* might be useful for your lazy eval / dynamic scopes problem

16:51 semperos_: looking...

16:52 brehaut: not sure how it applies

16:52 brehaut: if you have something that is loosing its binding because a lazy seq is being returned but not realised

16:53 semperos_: I understand that, but I'm not sure exactly what's going wrong

16:53 bc the stack-trace is saying a var in the hiccup.core namespace isn't bound

16:53 which is true, because the var doesn't exist in the code base at all

16:53 brehaut: oh right

16:53 my bad, i must have missed that

16:53 semperos_: but thanks, good to know about bound-fn*

16:53 no worries

16:54 I'm happy for any help :)

16:54 amalloy: semperos_: it must exist, though; it can't be unbound if it doesn't exist. if it didn't exist at all, you would get an unable to resolve symbol or some such

16:54 semperos_: right

16:54 amalloy: &#'dfve08f

16:54 sexpbot: java.lang.Exception: Unable to resolve var: dfve08f in this context

16:54 semperos_: so I don't understand where the 'render-attrs' var is coming from

16:57 brehaut: semperos: what version hiccup is listed in your project.clj ?

16:57 semperos_: 0.3.1

16:58 checked that specific tag

16:58 i.e. for the render-attrs var

16:58 brehaut: is osc_scrape your app?

16:59 semperos_: yep

17:03 brehaut: im all out of ideas

17:03 semperos_: and now all-of-a-sudden when i lein compile, it's complaining NoClassDefFound for my *.util namespace

17:04 I'm sure my own stupidity is all over this, I'll be sure to tell how once I figure it out

17:04 brehaut: amalloy thanks for your help so far

17:06 kencausey: Does anyone have an emacs config handy with org-mode babel's ob-clojure working?

17:07 I guess I should add in the context of lein

17:13 brehaut: huh. theres a ring-jetty-async-adapter branch of ring. totally need to look into that some more

17:16 semperos: so a little progres

17:16 s/progres/progress

17:16 sexpbot: <semperos> so a little progress

17:17 semperos: (been wanting just to try it)

17:17 um, if i just call hiccup's (html) with very simple structures that don't have anything lazy going on

17:17 it works fine

17:17 smth like (html [:body [:h1 "Hello world"]])

17:17 works

17:18 in my original call, i had a for form

17:18 which I assume was the culprit

17:18 fliebel: brehaut: Anything to do with Aleph?

17:19 brehaut: fliebel: not directly, http://groups.google.com/group/ring-clojure/browse_thread/thread/243f452c915356c8/ef6d820b874bbe49?#ef6d820b874bbe49

17:20 ossareh: amalloy: thanks! I got there evetually - turns I wasn't fully grokking where parts of a macro where taking place, so I was resolving a var in the wrong namespace

17:22 fliebel: brehaut: Cool!

17:25 semperos: I've tried different combinations, so maybe a better question is

17:25 in hiccup, how do I put a for form to generate a list ([:ul [:li]]) and have the for get realized?

17:26 ossareh: semperos: its usually realised as it is delivered to the client, you want it realised before that?

17:27 semperos: I'm not using it in a web app, per se

17:27 brehaut: semperos: i dont really know hiccup but would wrapping it in vec do the job?

17:27 semperos: I'm outputting results to an html file, so I'm using clojure.core/spit to write the results to file

17:27 well, (html) is supposed to generate a string

17:28 ossareh: semperos: ahh, so when you call spit you're getting (for blah blah) instead of [:ul [:li "something"]] ?

17:28 semperos: no, I'm getting the stacktrace seen here:

17:28 https://gist.github.com/815207

17:29 ossareh: can we see util.clj around lines 48 ?

17:29 but random that render-attrs cannot be see

17:29 n

17:29 semperos: 48 is the beginning of a call to hiccup.core/html

17:30 which includes some for expressions

17:30 bit of a mess atm, as I'm debugging it

17:31 ossareh: OK

17:31 So I find it weird that the code is trying to reference something that doesn't exist - what version of hiccup is being referenced in your project.clj ?

17:32 semperos: was using 0.3.1, trying 0.3.4

17:32 stacktrace is for 0.3.1

17:32 ossareh: are you using lein to manage your project?

17:32 semperos: yep

17:32 ossareh: are there multiple copies of hiccup in lib?

17:32 semperos: nope

17:32 ossareh: have you run lein clean recently?

17:33 semperos: as I'm no re-compiling, yes

17:33 does a lein clean for each lein uberjar I run

17:33 kencausey: technomancy: I'm a little confused. As far as I can tell I don't have swank-clojure.el anywhere yet 'lein swank' and 'durendal-jack-in' work. What is providing the elisp side of swank support for slime? I ask because I'm trying to get babel's ob-clojure to work in the context of a lein project.

17:33 ossareh: do you notice if between clean and uberjar whether the classes directory is destroyed?

17:33 semperos: I've manually destroyed it

17:34 hasn't made any diff

17:34 kencausey: technomancy: A little more info: I'm using your elpa repository

17:34 ossareh: semperos: hm. let me noodle this for a moment.

17:34 semperos: sure, any and all help is greatly appreciated

17:34 technomancy: kencausey: M-x lein-swank must be your own stuff; I don't think I packaged that anywhere. durendal-jack-in is from durendal.el

17:34 semperos: even if we never come to a resolution, I always learn along the way

17:34 technomancy: those ought to be orthogonal to org-babel though

17:34 ossareh: semperos: yup, we learn a lot from failing quickly

17:35 semperos: and just to double check - you get the exact same exception with 0.3.4 ?

17:35 kencausey: technomancy: not lein-swank elisp I mean 'lein swank' as durendal uses it, or I can do manuall (at the shell)

17:35 the swank lein command

17:36 technomancy: kencausey: that's either in project.clj dev-deps or in ~/.lein/plugins

17:36 semperos: ossareh: actually haven't checked identical functions

17:36 I've been stripping out parts of my long call to (html) in attempts to figure out why it's failing

17:36 ossareh: semperos: would you mind re-gisting the current exception?

17:36 semperos: sure

17:36 kencausey: technomancy: perhaps I should also clarify that I'm using a git checkout of lein

17:36 semperos: I'm back to that point now

17:36 I know which form is causing the error

17:37 technomancy: kencausey: could be src/leiningen/lib/dev then?

17:37 semperos: ossareh: give me a minute, it takes a bit to run through the code

17:37 kencausey: technomancy: OK, but I think that misses the point of my question regarding swank-clojure.el

17:38 Is the swank lein command magically supplying that somehow? How does slime know how to interface with the clojure swank interface?

17:38 technomancy: kencausey: durendal replaces the bulk of swank-clojure.el

17:38 durendal basically teaches emacs how to launch a swank server (among other things)

17:38 kencausey: Oh? hmm

17:38 I guess there was less to swank-clojure than I thought

17:39 technomancy: yeah, it was a very thin layer

17:39 clojurebot: I don't understand.

17:39 technomancy: (the elisp side)

17:39 kencausey: technomancy: yeah, thanks

17:39 technomancy: clojurebot: you got that right

17:39 clojurebot: I don't understand.

17:41 kencausey: technomancy: Maybe I'm expecting too much of babel's ob-clojure in terms of it understanding how to start slime. It has to know about durendal otherwise.

17:41 technomancy: I haven't used org-babel, but I would expect it to require you to start your own slime session.

17:41 I've been wrong before though.

17:42 kencausey: No, I think it is designed to do so automatically, the instructions reference swank-clojure setup that seems to be no longer relevant

17:42 like swank-clojure-classpath

17:43 semperos: finally, I fixed it

17:44 had a feeling it was my use/abuse of Enlive, but wasn't sure

17:44 basically, I needed to pull information about all of the PDF's on one of my company's websites, used Enlive to scrape all the data that I needed

17:45 instead of dismantling the nodes that Enlive returns into my own custom structure, I just kept a vector of enlive nodes as part of my scraping

17:45 so when pulling values from those nodes (which are just structmaps), I needed a doall to realize them

17:45 amalloy: so you were right

17:46 I doall'ed everything except the enlive stuff, so there ya go, my own stupidity, as I said

17:46 technomancy: kencausey: sounds like it's just out of date then =(

17:46 semperos: thanks brehaut amalloy ossareh for all your help and patience

17:49 amalloy: oh good. when you highlighted me i saw the huge chunk of conversation i missed; glad i don't have to read back through it to help :)

17:49 semperos: heh

17:49 nope, your work is done on this one

17:50 ossareh: semperos: awesome

17:50 (inc amalloy)

17:50 ,(inc amalloy)

17:50 clojurebot: java.lang.Exception: Unable to resolve symbol: amalloy in this context

17:50 * ossareh shrugs

17:53 amalloy: huh

17:53 Raynes: I smell breakage.

17:53 (inc Raynes)

17:53 sexpbot: You can't adjust your own karma.

17:53 amalloy: (inc Raynes)

17:53 Raynes: amalloy: ^ Or not. Maybe it just doesn't like you.

17:54 (inc ossareh)

17:54 Nope, it's broken.

17:55 kencausey: technomancy: right, so I'm trying to figure out how to update/adapt

18:00 technomancy: just fyi, in fact even with a clojure/slime repl up and running ob-clojure chokes because it insists that swank-clojure is required. I guess I'll hack on it.

18:15 technomancy: again fyi, I'm having some success after commenting out the check for swank-clojure and manually running durendal-jack-in before try to do any babel stuff

18:27 technomancy: good; hopefully it can be incorporated upstream

18:46 TimMc: ,*ns*

18:46 clojurebot: #<Namespace sandbox>

18:47 TimMc: ,(do (in-ns 'Math) (def PI 3) (in-ns 'sandbox) Math/PI)

18:47 clojurebot: DENIED

18:47 TimMc: haha

18:54 sritchie_: hey all -- does anyone know how to add a new java.library.path directory to a cake project?

18:54 I see that I'm supposed to add it to .cake/config -- I created that and added what looks like the proper line, but no dice

18:55 amalloy: sritchie_: wait, what do you want to do that for?

18:55 sritchie_: amalloy: I have some native bindings for GDAL, and I've put them into /Library/Java/Extensions for leiningen --

18:56 amalloy: two teammates are using textmate, so they need cake support, which doesn't add that directory to the library path

18:56 amalloy: hm. been a long time since i dealt with jni

18:57 sritchie_: amalloy: I suppose I'm just looking to know how to format .cake/config

19:00 amalloy: sritchie_: ask in #cake.clj

19:15 rata_: hi

21:03 joshua__: Hmm, I have a coding problem that isn't very related to clojure.

21:04 hiredman: ~#30

21:04 clojurebot: 30. In programming, everything we do is a special case of something more general -- and often we know it too quickly.

21:04 hiredman: joshua__: does that help?

21:04 joshua__: hiredman, well, I'll throw out my problem generally..

21:04 hiredman: how about...

21:04 ~#6

21:05 clojurebot: 6. Symmetry is a complexity-reducing concept (co-routines include subroutines); seek it everywhere.

21:05 joshua__: hiredman, my teacher is teaching things that I already know so I want to push ahead. Thing is, there is a lot of stuff in the book that goes way over my head in the sense that I can try to tackle it but don't know if I'm *actually* tackling it..

21:05 hiredman, so I need an answer key to check how I'm doing..

21:05 hiredman, but I don't have one ;p

21:06 hiredman: have you approached your teacher?

21:06 joshua__: Doing exercises in Marak Allen Weiss "Data Structures and Algorithm Analysis in C++"

21:06 amalloy: joshua__: the compiler is pretty good at telling you whether your code does what you want

21:06 joshua__: I haven't, I was planning to talk to him when we get to break.

21:06 amalloy: it is theoretical

21:07 hiredman: ~#23

21:07 clojurebot: 23. To understand a program you must become both the machine and the program.

21:07 hiredman: mmm... yes

21:08 brehaut: joshua__: learn coq, and write a formal proof; the compiler is pretty good at telling you whether your proof does what you think ;)

21:08 joshua__: hiredman, excellent advice!!!

21:09 brehaut, could that 'really' help?

21:10 brehaut: joshua__: no. its probably the worst you'll ever be given

21:10 s/worst/worst advice/

21:10 sexpbot: <brehaut> joshua__: no. its probably the worst advice you'll ever be given

21:10 joshua__: brehaut, closest the cox window.. =(

21:10 brehaut: coq scares haskell programmers

21:11 joshua__: Whoever added that to sexpbot is brilliant.

21:11 brehaut: (haskell programmers who are not scared of coq are coq programmers slumming it in the real world ;)

21:13 joshua__: Hmm. Going to go back to looking for an answer key for now =)

21:13 brehaut: joshua__: how about finding someone to teach what you think you know to; that'll show you if you understand or not

21:14 joshua__: brehaut, what do you mean?

21:14 brehaut: you have material in a book that you think you understand right?

21:15 joshua__: brehaut, and I don't think I know what I'm learning, just to be clear. I don't really get it very well. I do get what he is teaching though: he is explaining pointers to the class at the moment.

21:15 I get the C++ review. I don't get the algorithm analysis. He is teaching pointers at the moment.

21:16 hiredman: ~#55

21:16 clojurebot: 55. A LISP programmer knows the value of everything, but the cost of nothing.

21:16 joshua__: That is the idea of getting an answer key. Something to test my understanding against.

21:17 brehaut: hiredman: is there a trick to this, or are all the numbers just so insightful it always works?

21:17 joshua__: LOL

21:17 ~#42

21:17 hiredman: brehaut: yes

21:17 clojurebot: 42. You can measure a programmer's perspective by noting his attitude on the continuing vitality of FORTRAN.

21:17 hiredman: http://www.cs.yale.edu/quotes.html

21:18 brehaut: ah, perlis :) grand

22:20 jkdufair: is there some way to do testing at the repl with appengine-magic?

22:42 gfrlog: ,(atom nil)

22:42 clojurebot: #<Atom@1a5ba75: nil>

22:42 gfrlog: is it weird that I feel bad for making an atom at the repl and then not using it for anything?

22:43 the concurrency constructs seem easier to anthropomorphize than other objects

22:43 I bet that atom is lonely; nobody is swapping it.

22:44 mattdw: gfrlog: I feel even worse for agents, they just sit there waiting for a message forever

22:45 brehaut: ,(swap! *1 (constantly 2))

22:45 clojurebot: java.lang.IllegalStateException: Var clojure.core/*1 is unbound.

22:45 brehaut: rats

22:45 gfrlog: yeah, the clojurebot atoms are the worst. Do they know they're immediately inaccessible? who tells them?

22:48 amalloy: &(let [a (atom (*))] (Thread/sleep 3000) (swap! a inc))

22:48 sexpbot: ⟹ 2

22:48 amalloy: gfrlog: gotta keep em around awhile just in case

22:50 gfrlog: I bet that one felt special

22:50 jkdufair: anyone working with appengine-magic?

22:51 hiredman: ugh, I hate doing ssl with java

22:51 technomancy: jkdufair: I've done a bit of appengine work, but not in Clojure.

22:53 jkdufair: i'm finding myself building a bunch of routes to data access functions and it's all very repetetive. perhaps i should just build some sort of macro that builds routes based on my data access functions?

22:53 "best practice" ideas?

22:56 it's not a ton of routes (6-8), but my next app will have dozens

22:56 technomancy: I only had 2 in mine.

22:57 jkdufair: i'm attracted to the idea of a rest-ful interface to a functional language. the functional web

22:57 i can just see macro-URLs

22:58 gfrlog: I'm using clojure.test -- if I make assertions in a different thread, are they not tallied for the final report?

22:58 (seems like not)

22:59 joshua__: jkdufair, I've done a personal site with appengine. It didn't have enough db queries that I needed to use an especially clever abstraction.

23:00 jkdufair: joshua__: yeah, i may not overengineer it for now. next app. this is my lo-fi attempt at appengine-magic

23:00 we have 29 chickens and too many eggs. making a reservation system for friends/neighbors

23:00 technomancy: jkdufair: literally?

23:01 jkdufair: yes, that was not a metaphor :-)

23:01 we give them away for the most part, though co-workers and more distant acquaintances pay $2/doz to cover feed costs

23:01 it's a fun hobby

23:01 technomancy: ok, wasn't sure there =)

23:02 joshua__: Okay, so how sane would this alternative route system be.

23:02 jkdufair: sanity is in the eye of the beholder

23:02 joshua__: Put dynamically generated functions into a session dict. The key to the function is generated as a link.

23:03 jkdufair: but my idea is to set up some sort of regex that perhaps does some sort of dynamic dispatch perhaps

23:03 regex on the route def that is

23:03 but my lack of knowledge of compojure may be showing

23:08 gfrlog: (def *report-counters* nil) ; bound to a ref of a map in test-ns

23:09 anybody understand this line from clojure.test?

23:09 oh I see -- test-ns is a function

23:10 so this being a var is why my tests are being tallied :(

23:10 aren't*

23:11 since I don't understand namespaces well enough, I'll assume it just has to be that way and figure out some-other-how

23:14 I set the binding manually in the other thread and now it's happy

23:20 cheezey: urghh so im kinda nub if anyone can point me how to support jni with leinigen locally only, that would be cool? like how can i add it to the project.clj file and have it be grabbed from maven.. :x

Logging service provided by n01se.net