#clojure log - Oct 26 2008

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

1:50 larrytheliquid: is there a return function statement to prematurely exit a function?

1:50 Chouser: nope

1:50 writing some imperitive code?

1:51 you could wrap the remained of your function in a "when" or "when-not"

1:54 larrytheliquid: ya no problems, just wanted to know

4:34 viktor: jesi tu?

4:34 jgracin: jesi tu?

4:35 jgracin: viktor: tu sam

4:35 bok

4:35 viktor: moram ti poslat ne?to iz clojurea na ocjenu

4:35 jgracin: ajde

4:35 viktor: (defmacro html-block [& keyword-block-names]

4:35 (map (fn [keyword-block-name] (let [block-name (name keyword-block-name)]

4:35 `(defn ~(symbol block-name) [& se#]

4:35 (reduce str (concat (list (tag ~keyword-block-name (first se#)))

4:35 (if (map? (first se#))

4:35 (rest se#)

4:35 se#)

4:35 (list (str "</" ~block-name ">"))))))) keyword-block-names))

4:35 (defn tag [tag-name attrs]

4:35 (str "<" (name tag-name)

4:35 (if (map? attrs)

4:35 (reduce str

4:35 (map (fn [x] (str " " (name (first x)) "=" "\"" (second x) "\""))

4:35 attrs ))

4:35 )">"))

4:35 (html-block :html :table :p :td :tr)

4:36 (html {:id "12"} (p "jedan paragraf") (table {:class "test"} (tr (td "trva kolona")

4:36 (td "druga kolona"))

4:36 (tr "drugi red prva kolona")))

4:36 evo al nisam prepisivao

4:36 kotarak: Ima paste.lisp.org

4:36 viktor: za konverziju s-expova u html divim se sam sebi na ovom macrou

4:36 jgracin: oops! sorry guys, wrong channel!

4:36 viktor: see you in private channel

6:27 StartsWithK: lisppaste8: help

6:27 lisppaste8: To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.

6:31 StartsWithK pasted "Can't call function on macro argument." at http://paste.lisp.org/display/69229

6:32 StartsWithK: can anyoune explain to me how i can call a function on macro argument in this context?

7:22 rhickey: could you please take a look ate http://paste.lisp.org/new/clojure and tell me why is that line of code not working and is it even posible to do something like that

7:22 (ah ~@args -> ~@a) ..

7:39 pjb3: Paul Graham: "I don't know anything about Clojure." http://tinyurl.com/59frqr

7:40 rhickey: pjb3: I saw that, I guess it's good. He's been making some general statements about languages and at least I know now he's not talking about Clojure :)

7:41 pjb3: rhickey: Seems like kind of an arrogant position to me

7:41 Given the buzz that Clojure is generating, if I were writing a Lisp, I would at least take a look

7:41 rhickey: Have you looked at arc? Just to see what he's doing?

7:42 rhickey: He's got his own priorities

7:45 I was at his original Arc at 3 weeks talk at the Lightweight Languages Workshop at MIT. I didn't get it then and I don't now. Few things that seemed important to him did to me, and apparently vice-versa, other than we both thought cond and let had too many parens.

7:45 That's not to say he's wrong, just that Arc is about different ideas than Clojure

7:46 I find it difficult to read arc code

7:47 pjb3: sure, and if Paul were to say "I saw Rich's talk about Clojure and I just don't get it, it has different idea" that would be one thing

7:47 but to pretend like it doesn't exist, I don't know, I guess like you said, he's got his own priorities

7:50 rhickey: I'm a bit of a languages geek, which may come out in Clojure, but I don't know that that is a prerequisite for being a language designer

7:52 pjb3: Also, you devoted an incredible amount of time and effort to building a strong community around Clojure, which I think is vital for the success of a language

7:53 Paul seems to either not get that or not care: http://www.arclanguage.org/item?id=8462

7:53 rhickey: I'm not offended though - Clojure is doing fine, and I'm more concerned about the people who are interested in it than those who are not

7:54 pjb3: Well for me personally, I really enjoyed the essays that Paul has written and they are what got me to consider lisp in the first place

7:55 then I saw Clojure and I was like, bam, that's it, that's how Lisp should be

7:55 rhickey: agreed, his books and essays were inspirational for me too

7:56 pjb3: It would be cool to have him as an advocate of Clojure, but it doesn't appear that will happen

7:56 but like you said, Clojure is doing fine anyway, so no big deal

7:59 rhickey: I think it's important that both Clojure and Arc exist, they cover different spaces, and I'd hate for people to have ignored Clojure while still waiting for Arc. Now both are released and they can make an informed choice.

8:00 pjb3: What space does Arc cover?

8:02 rhickey: I'd hate to mischaracterize it, but I would say "Lisp from first principles", and effort to find the true atoms underlying Lisp, coupled with a brevity aesthetic

8:04 Whereas in Clojure I care much more about the abstractions - if some of them are implemented in Java for perf/interop reasons I don't care

8:05 pjb3: Ah, I see

8:07 rhickey: Functional programming and immutability is important for Clojure, interop with the outside world, commercial developer's concerns, concurrency etc

8:08 I still need to write software to make a living - if I want to do that in Clojure it a) needs to be practical, and b) needs to be popular

8:09 Plus I have high hopes for the community making Clojure something I could never achieve myself

8:09 pjb3: a) check, b) getting there

8:10 I see something like this pretty much every day on twitter: http://twitter.com/offbytwo/statuses/975397542

8:12 and by "something like this" I mean a positive endorsement for Clojure

8:12 not necessarily a negative on arc

8:13 I like your attitude though, it doesn't have to be an arc v. clojure thing

8:14 rhickey: Exactly - everyone should do what they want

8:14 kotarak: healthy attitude

8:14 pjb3: that happens with ruby v. python way to much, but I suppose it's just human nature

8:15 rhickey: I'm very happy that the Clojure community is such a positive one

8:41 kotarak: How can one specify hierarchy to use in multimethod dispatch?

8:42 rhickey: kotarak: dispatch uses isa? internally, you can use hierarchical types, attributes, metadata etc

8:43 kotarak: I mean: I can do (isa? some-hierarchy ....). Can I do this also with defmulti?

8:44 rhickey: defmulti will compare dispatch values using isa?, so you can use any dispatch function that returns a hierarchical value from any aspect of the argument(s)

8:46 kotarak: ok.

8:51 pjb3: rhickey: What date is considered clojure's "birthday"?

8:53 lisppaste8: rhickey pasted "simple isa dispatch" at http://paste.lisp.org/display/69232

8:53 rhickey: pjb3: October 16

8:54 pjb3: rhickey: 2007 I assume? And what happened then? I'm just looking through the SVN logs, seeing it's actually older than that

8:55 rhickey: pjb3: Oct 16 2007 was the 'release' date, when I first told people it existed, I worked on it for a couple of years before that

8:56 kotarak: rhickey: yes. that part I understand, but one can also have different hierarchies. Let's say, I do (derive :foo :bar) and someone else (derive :bar :foo). I think such conflicts are solved by using one own's hierarchy, no? How can I tell the isa?, which hierarchy to use?

8:56 (I mean the isa? used in the dispatch)

8:56 pjb3: rhickey: Where did you announce it?

8:58 rhickey: you'll note in the example I posted I use ::Rect, that resolves to a namespace-qualified keyword, so ::Rect in one ns is different from ::Rect in another

8:58 kotarak: Ah! Similar to `symbol!

8:58 rhickey: pjb3: on my mailing lists for jFli and Foil

8:59 kotarak: and derive requires ns-qualified keywords or symbols, just so that people won't have conflicts

8:59 kotarak: Ok. Understand now.

9:00 rhickey: thanks for pointing out :: You have to announce such goodies somewhere.

9:01 pjb3: So there it is: http://tinyurl.com/birth-of-clojure

9:01 arbscht: rhickey: is Foil still maintained?

9:02 pjb3: rhickey: Oct 17 2009 is a Saturday, what do you say we plan the first annual ClojureConf in NYC for that day :)

9:03 rhickey: arbscht: I've never had any bug reports, probably due to non-use. I don't actively work on it.

9:03 arbscht: ok

9:03 rhickey: pjb3: sounds promising, there are a lot of users now but pretty widely dispersed. NYC should be accessible to many.

9:08 pjb3: (def clojure-conf {:date "2009-10-07" :location "NYC"})

9:08 kotarak: When I just have a run asking obvious question... How do I round a double?

9:08 pjb3: Unfortunately it's immutable, so the date cannot be changed and no details can be added :)

9:18 Fanda: kotarka: use Math/round

9:19 http://java.sun.com/javase/6/docs/api/java/lang/Math.html

9:20 kotarak: Fanda: In java one has to look in the most abstruse places. I would have expected something like this in Double.... thanks

9:21 Fanda: kotarak: Yes, I was looking for it there too, but no luck :-)

9:21 search for "round double java" worked :-)

9:22 http://www.rgagnon.com/javadetails/java-0016.html

9:25 --- what is the syntax and use of a macro #= ?

9:25 some time ago we talked about #+ and #- ;-)

9:30 please, could you give few examples of use of #= ? thanks!

9:47 kotarak: Fanda: I think #= evaluates the following as expression and uses the result. #=(+ 1 2) => 3, #=(java.lang.String.) => ""

9:48 Fanda_: kotarak: I see. Evaluation at reader time.

9:49 kotarak: Yes. But I'm not sure about the exact semantics.

9:49 Fanda_: I wonder if it can return nothing - not even nil

10:27 rhickey: pjb3: I should have saw "I saw his Arc at 3 weeks" presentation from LL1, I wasn't there for that one

10:45 Lau_of_DK: Greetings gentlemen

11:10 lisppaste8: duck1123 pasted "trouble concat-ing values" at http://paste.lisp.org/display/69239

11:11 duck1123: should I be using concat to put together a string and the value from a struct?

11:12 rhickey: what's the value in the struct?

11:12 duck1123: "44"

11:12 rhickey: the string "44"?

11:12 duck1123: {:id "44" :name "Dan"}

11:13 I tried using the number, but was getting an error

11:13 rhickey: user=> (concat "foo" "44")

11:13 (\f \o \o \4 \4)

11:13 user=> (apply str (concat "foo" "44"))

11:13 "foo44"

11:13 duck1123: I'd prefer it to be an int

11:14 rhickey: user=> (str "foo" (str 44))

11:14 "foo44"

11:14 duck1123: ok, (appy str ) did it, thanks

11:14 I kept getting, clojure.lang.LazyCons@878e636d

11:44 StartsWithK: sorry to repeat my question, but can someone tell me why is this not working and how should i write the line in question - http://pastebin.com/d5cab853f

12:03 fholmstrom: Is there any book on clojure out yet?

12:04 Lau_of_DK: I think l_a_m was working on one such fholmstrom, I dont know if its finished though

12:05 fholmstrom: I really want to learn clojure, kind of got hooked on the whole FP thingie - but I can't find any good resources for clojure and it feels counter intuative to learn Common Lisp or Scheme when I really want to be doing Coljure

12:05 *clojure

12:06 hoeck: StartsWithK: its possible using java reflection, unfortunately, i can't find the snipped rich pasted to the group or somewhere in this channel right now

12:07 gnuvince_: fholmstrom: no book yet, you'll need to go with the documentation on the website and the wikibook.

12:08 Lau_of_DK: fholmstrom, are you familiar with the Euler project ?

12:09 fholmstrom: Lau_of_DK: Never heard of it

12:09 hoeck: StartsWithK: or you wrap your methods in an anonymous fn with memfn

12:09 rhickey: hoeck: http://paste.lisp.org/display/67182

12:10 Lau_of_DK: fholmstrom, on www.projecteuler.net you will find some 200 mathematical problems of varying difficulity, on clojure-euler.wikispaces.com you'll find many solutions to these written in Clojure, the sum of these will show you alot of Clojure, it can be a good starter I think

12:10 gnuvince_: fholmstrom: project euler is a bunch of small problems that can help learn a language

12:10 StartsWithK: hoeck: my problem is ~gx expands to something like G__3472 and not object itself

12:11 so when i check for object type its clojure.lang.Symbol

12:13 hoeck: rhickey: thanks, that was it

12:18 Lau_of_DK: Everyone who has some experience with Qt/Clojure, please raise your hand

12:18 _o/

12:18 hoeck: StartsWithK: but the G__3472 is previously bound in a let to java.lang.JFrame, so (class G__3472) evals to java.lang.JFrame

12:22 fholmstrom: this

12:22 and by this i mean clojure

12:22 it makes me all happy and fluffy inside

12:22 Lau_of_DK: thats a common side-effect :)

12:22 fholmstrom: it's so beautifull, what have I been doing all these frekin years?

12:23 and i suspect i only grasp 25% or so of it yet, Im still waiting for that eureka/epiphany moment

12:40 kotarak: How can I identify whether some x is a function as returned by fn? fn? checks on IFn, but then we also get maps, etc...

12:43 StartsWithK: (fn? {}) is true

12:44 kotarak: yes, since {} implements IFn

12:44 StartsWithK: and you would like to exclude maps and sets from that check?

12:45 kotarak: Yes.

12:45 Only fn's.

12:46 StartsWithK: (and (fn? x) (not (or (map? x) (set? x))))

12:46 something like that?

12:46 kotarak: Hmm... That could be. Maybe also (instance? AFn x)? Have to check the inheritance tree.

12:46 StartsWithK: i quess (vector? x) should go in there too

12:47 kotarak: and keyword?

12:47 StartsWithK: yes, and keywords

12:49 i have this snippet to check is something callable,

12:49 http://pastebin.com/f7ad9ee14

12:49 so if something is fn? i think you should also check is it a special form

12:49 kotarak: No. Checking AFn doesn't, I'll probably have to go with the monster check excluding everything else.

12:50 Geez.

12:59 rhickey: kotarak: why do you want to do that?

13:00 fholmstrom: is there any web effort in the clojure community ?

13:02 StartsWithK: fholmstrom: http://github.com/weavejester/compojure/tree/master

13:02 rhickey: http://groups.google.com/group/compojure

13:03 not to negate any others, Compojure seems to have the most traction at present

13:03 kotarak: rhickey: man, you sure ask the right questions.... While explaining I notice, that I don't have to check this.

13:05 rhickey: I'm working on the proposed ClojureCheck. I thought combined generators would a fn, but since we use multimethods, one simply defines a new method.... So no need to check.

13:07 gnuvince_: ClojureCheck as in port of QuickCheck to Clojure?

13:07 kotarak: yes

13:07 gnuvince_: *thumbs up*

13:07 kotarak: Was suggested by Stuart on the list. Since it was in my todo list for quite some time now, I volunteered to look into it.

13:08 I'm just writing an email with the proposed API with a request for comments.

13:17 Lau_of_DK: I have a question I would like you guys' input on before we do anything. A couple of us have considered making a substitute for Vim/Emacs built on and for Clojure coding. It would be an up-2-date version of emacs, with special features for Clojure specifically and customizeable UI, and it would sport hotkeys and layouts from both Vim/Emacs. Thats the thoughts that are up right now. I would like to hear all views FOR and especially against such a venture.

13:19 albino: Lau_of_DK: Like Readylisp or Lispbox but for clojure?

13:20 Lau_of_DK: I am not familiar with any of those, my experiences go as far as VIm/Chimp and Emacs/Swank

13:21 albino: Lau_of_DK: ReadyLisp -> http://www.newartisans.com/software/readylisp.html

13:21 He basically bundles a lisp with emacs

13:22 Lau_of_DK: Then no, its a bit more ambitious than that, it would be building an editor from scratch, completely customized to have an interactive development environment for Clojure coding

13:23 kotarak: Something more like Lispworks probably

13:23 Lau_of_DK: Ive seen Lispworks, and its more in that direction, yes

13:23 Chouser: if it's not sufficiently flexible and powerful enough to use for all my text editing, I don't think I'd be interested.

13:24 Lau_of_DK: But if you could use all your keyboard-bindings from Vim, wouldnt that basically be all you need ?

13:25 kotarak: A vim style editor really scriptable (I mean *really* scriptable) with Clojure.... That would be nice.

13:26 Chouser: kotarak: that's what I dream of.

13:26 kotarak: Lau_of_DK: syntax highlighting, indenting etc. Vim and Emacs do that for hundreds of languages.... Lot of work...

13:26 Lau_of_DK: This would be strictly Clojure in that regard

13:27 kotarak: No. That's bad. It should Clojure to begin with, but it should be easily extendable as Vim or Emacs.

13:27 Chouser: oh, no, I still need to edit C++, JavaScript, HTML, etc. I'm not going to keep switching between text editors depending on the type of file I'm editing.

13:27 kotarak: I'm a bit more megalomanic and think about "replacement". ;)

13:27 rhickey: Lau_of_DK: I'd wonder why it wouldn't pay to contribute to enclojure

13:28 Chouser: I hope this isn't taken to be divisive (that's not my point!) and it may change at some point, but right now it's pretty hard to contribute to enclojure.

13:28 Lau_of_DK: rhickey, It might, I'm not updated on their progress. But to me the leanness of emacs is very appealing compared to a Netbeans/Enclojure environment. Produtivity really is the key issue

13:29 rhickey: Chouser: I understand, I don't think that's a long-term problem though

13:30 Chouser: I hope that's true. I do have great hopes for enclojure, but have given up on it for a few months. I'll have to take a look again.

13:30 kotarak: Can it do editing vi style?

13:30 Chouser: kotarak: there's a plugin for netbeans that does a pretty stand-up job.

13:30 rhickey: I'd hope that many of the big useful features, to be written in Clojure, wouldn't be trapped in any one editor or IDE

13:30 kotarak: It's not a killer argument, but I''m so terribly used to it....

13:30 Chouser: it's called jvi

13:31 kotarak: Hmmm... Maybe I have to have a look.

13:31 Chouser: I wrote a patch early on to get jvi to work properly with enclojure's repl. It wasn't included for a long time, and I sorta lost interest. I dunno if jvi works out of the box now or not.

13:32 rhickey: pprint, completion engines, who-calls, namespace browsers etc

13:32 Lau_of_DK: rhickey, you work out of Aquamacs right ?

13:32 rhickey: Chouser: I know the enclojure team, they are swamped until after the election

13:34 Lau_of_DK: for now yes, although I am an embarrassingly bad emacs user

13:34 Lau_of_DK: rhickey, okay, what is your primary reason for choosing Aqua instead of Enclojure?

13:35 rhickey: I really hate ctrl-this ctrl-that combos, and haven't bothered to remap many things

13:35 Lau_of_DK: ok

13:35 kotarak: I tried Aquamacs a few weeks ago. But it's really hard to get going, when you actually want to concentrate on something else. Maybe I have to allocate some dedicated time.

13:36 These things (emacs, eclipse, netbeans, ..) are so huge....

13:36 Lau_of_DK: I suppose I do see great benefits in completeing Enclojure instead of undertaking a new venture, as it has great possibilities. But Im not sure if I have the patience to go that way.

13:43 Chouser: the election!?

13:44 kotarak: Is it bad style to define a multimethod for an actual value? (def x (fn [] :xxx)) (defmethod foo x [_] (x))

13:48 Lau_of_DK: Does anybody know who this guy 'jamii' is, who does these lisp-pastes on Qt/Clojure?

13:51 rhickey: Chouser: http://thortech-solutions.com/

13:55 Chouser: hm, interesting.

14:02 Pupeno: Hello.

14:04 Chouser: Hi.

14:05 Pupeno: Do you know a smart way to have the dependency jars in the classpaths when working with Maven when you run the REPL?

14:05 * Pupeno thinks it would be nice if Maven just dropped all the .jars in a single directory in ~/.m2/

14:10 akopa: I wonder if it would be possible/worthwhile to port slime to JEmacs http://jemacs.sourceforge.net/?

14:12 Pupeno: It seems the only way would be to manually set the classpath before running Slime, but I'm not sure how to do it other than running emacs from a console, which I dislike...

14:12 kotarak: akopa: Update (2005-10-19)! Hmmm... Is it still alive?

14:12 akopa: Or have clojure as an extension language for JEmacs?

14:13 kotarak: it's still alive in the kawa distribution, which is also still alive.

14:19 Lau_of_DK: Somebody once showed me a nice little .sh script, which looped all my .jars adding them to the -cp arg, anybody got that lying around ?

14:21 Pupeno: Argh, even appassembler adds them one per directory.

14:23 So, am I the only one using Maven to write Clojure apps?

14:52 Lau_of_DK: Somebody once showed me a nice little .sh script, which looped all my .jars adding them to the -cp arg, anybody got that lying around ?

14:59 http://github.com/jochu/clojure-extra/tree/master/sh-script/clojure

14:59 Its here if anybody else wants it

14:59 Pupeno: Lau_of_DK: I have something that can do that in a Maven project, it's still a pain to get it to Clojure.

15:00 Lau_of_DK: ok :) Im blank on Maven, only ever used it to compile the Clojure source

15:00 Are you working out of Enclojure ?

15:00 Pupeno: It seems it's painful to work in Lisp even when it's something like Clojure :(

15:00 Lau_of_DK: no, Emacs + Slime.

15:00 Lau_of_DK: k

15:01 Pupeno: Lau_of_DK: you are using Enclojure?

15:01 Lau_of_DK: No, I tried it back when I first got into Clojure some 4 months ago, had trouble, got no help from the team, dropped it again :)

15:01 Pupeno: Lau_of_DK: what then?

15:03 Lau_of_DK: Emacs

15:04 Pupeno: Lau_of_DK: slime or inferior-lisp?

15:04 Lau_of_DK: inferior-lisp

15:05 Pupeno: Lau_of_DK: how do you manage your dependencies/classpath?

15:05 Lau_of_DK: I'm trying that script that I just linked now

15:07 Pupeno: Lau_of_DK: and you set that script as inferior-lisp?

15:07 Lau_of_DK: yes

15:07 Pupeno: Lau_of_DK: and you download your jars manually, and place them manually in some directory and update them manually when you manually found that there are updates? (sorry :P)

15:09 Lau_of_DK: Yes sir - What is the alternative ?

15:11 Pupeno: Lau_of_DK: well, with Maven you define your dependencies and it downloads it automatically. The only problem is that they are not in one dir. I've found a way to get a text file with the needed classpath and I'm now trying to see how to get it easily into Emacs environment.

15:11 achim_p: Pupeno: http://www.bitbucket.org/achimpassen/clojure-ties/wiki/Home - i haven't worked on this for quite a while ...

15:12 Pupeno: i'd be glad to know if it works for you, but note it's in a *very* early stage of development and completely undocumented :)

15:13 Pupeno: lisppaste8: url

15:13 lisppaste8: To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.

15:14 Pupeno pasted "CLASSPATH in my Clojure" at http://paste.lisp.org/display/69257

15:17 Pupeno: Ok, it seems there's a huge impedance missmatch with Slime being global and a project containing a set of dependencies...

15:20 achim_p: it looks interesting. I really don't know what the proper solution is though.

15:20 It would be nice to have something simple.

15:20 to use I mean.

15:21 achim_p: my idea was to use maven for jars + dependencies + retrieval , but get rid of xml config files

15:21 they're too bulky for smaller scripting-like things, in my opinion

15:22 Pupeno: achim_p: agreed.

15:22 Why can't it be like Python, you just import and that's it...

15:23 * Chouser hides

15:25 achim_p: i like the idea of PLT scheme's planet - you can do a (require (planet "library")) and everything is taken care of, including downloading the lib. this is what "ties" tries to do for maven-coordinates

15:25 Pupeno: Chouser: don't hide!

15:26 achim_p: I actually prefer to leave installing to my package system, and program should just pick stuff from where it is installed. All this automatic installing is messy.

15:27 Chouser: Pupeno: when I once suggested Java's hanlding of .jars was poor compared to Python's handling of modules, I got a dressing down. Apparently Java's way of doing it is very good, I just don't understand the deficiencies of Pyton's system.

15:28 Pupeno: Chouser: I see. Well, don't see what java does except let you solve the problem by yourself.

15:28 Chouser: Since there is more that I don't know than there is that I know, and because I respect the other opinions of the person telling me this, I'm resolved to avoid the issue.

15:29 * Chouser goes back into hiding.

15:29 achim_p: Pupeno: where does your package system install jars? is there some cross-platform default for this?

15:30 Pupeno: achim_p: I actually don't know, and it seems that's messy as well, with many jars there not being "discoverable". It doesn't have to be cross-platform.

15:31 I think the problem here is that the REPL is not run in a project-contextual way, because Emacs doesn't have 'projects'. This is something an IDE like NetBeans *solves*.

15:33 rhickey: Chouser: one thing missing from that conversation was -Djava.ext.dirs, which I wasn't aware of being generally available at the time, which gives you a 'drop your jars here' solution without lots of manual classpath junk

15:33 Pupeno: The idea that every project has a set of dependencies and that those are defined manually somewhere and that it cannot pick them from a global location doesn't work with the idea of a global REPL at all. You either have global libraries and global REPL or you have per-project libraries and per-project REPL. I don't think Emacs can do per-project REPL.

15:35 rhickey: can you tell us how do you deal with this? do you use Maven for Clojure projects? or what do you do?

15:37 rhickey: I put global libs in my system ext dir, others on command-line classpath. I really don't have the problem you are wrestling with at all in my work

15:37 I find maven and ant and all that XML complexity baffling and unnecessary

15:38 tWip: I think the idea behind Maven is actually quite ok... it's just a "plugin execution" framework and dependency manager

15:39 the XML stuff (as always) just takes it to a whole new level of complexity

15:43 the maven pom xml files are something like cross between configuration file and a serialized format of the whole project model

15:44 sohail: rhickey, THANK YOU

15:44 Pupeno: I'm ok with both ways of working, but I always fail to mix them. I think this same thing drove me away from Common Lisp and Scheme.

15:44 sohail: I just got started witht his maven thing

15:44 so complicated

15:45 good to know a Java pro thinks so too ;-)

15:46 rhickey: I'm not arguing against those tools, but rather for doing the simplest thing that works

15:46 sohail: sure. getting started with clojure was easy as pie though :-)

15:47 Pupeno: now if I could force a lookandfeel into Netbeans, I would use it and that's it.

15:49 jgracin: Pupeno: I use maven-dependency plugin to collect the dependencies for me.

15:50 lisppaste8: jgracin pasted "Maven deps" at http://paste.lisp.org/display/69260

15:50 jgracin: and then I have a start.sh script in which I put: export CLASSPATH="$TOPDIR/target/dependencies/*"

15:51 Pupeno: jgracin: and how do you get that to be picked up by Clojure inside Smile?

15:51 Slime I mean.

15:52 jgracin: (setq swank-clojure-binary "~/src/project/start.sh") and in start.sh

15:52 I start, there's the classpath setting

15:52 sohail: Pupeno, I do (setq swank-clojure-extra-classpaths (directory-files "/path/to/deps" t ".*.jar"))

15:52 Pupeno: mmhh... that might work... I'll give it a try after dinner.

15:52 Thanks.

15:54 arohner: namespaces don't support doc strings yet, do they?

15:54 rhickey: arohner: no metadata on namespaces yet

15:55 arohner: I was just starting a module, writing comments at the top and thought "hey, this should be in :doc metadata"

15:56 jgracin: I highly recommend Maven. The most useful feature for me is that it collects all dependencies in one place. I just declare what libraries I need, and Maven fetches them (with caching, of course).

15:57 arohner: has anyone tried ties?

15:57 http://www.bitbucket.org/achimpassen/clojure-ties/src/

16:00 Pupeno: Thank you all for putting up with me and your recommendations, I'll try to put it all together and post a continuation to my "How to create a Clojure application" (http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/).

16:00 lisppaste8: Lau_of_DK pasted "Mimic me!" at http://paste.lisp.org/display/69262

16:00 Pupeno: bah, wrong url.

16:01 Lau_of_DK: Gentlement, Ive got all the jars loaded and a Qt Repl running in my normal Repl, how do I mimic this simple code ? Please annote if you can answer this question

16:04 Pupeno: Lau_of_DK: is there a Qt Clojure wrapper or you are just trying to replicate that Java code?

16:05 jgracin: rhickey: any chance you could share with us your thoughts on functional-relational programming? I'm beginning to understand that I don't really need OO system to get all the benefits

16:05 of classical OO languages. However, being used to ORM, I don't have a clear picture of how to substitute it functional approach.

16:05 Lau_of_DK: Pupeno, not sure I understand the question?

16:06 Pupeno: Lau_of_DK: I've used Qt only in C++, I understand you are using some Java bindings, right?

16:06 Chousuke: Lau_of_DK: doesn't directly translating that java code work?

16:06 Lau_of_DK: Im using QtJambi for the bindings

16:06 Chousuke, I dont know, I wasnt able to do it

16:07 Chousuke: you said you have a qt-repl?

16:07 jgracin: rhickey: I've read Out of the Tar Pit, but it's leaves the details out.

16:07 Lau_of_DK: Chousuke, oh youre right

16:07 Direct translation works

16:08 *shame on me*

16:08 No mystery here gents

16:08 rhickey: jgracin: the basic idea is to use uniform generic data structures (like Clojure's) for the 'information' in your application

16:08 Tar pit suggests a relational model for interacting with that data - you can do some of that with clojure.set

16:08 lisppaste8: Pupeno annotated #69262 with "What about this?" at http://paste.lisp.org/display/69262#1

16:08 Pupeno: Oh, too late.

16:09 rhickey: But I think the relational model is a bit awkward for application logic, and hae been looking into integrating Datalog

16:09 which is more Prolog-like, supports recursion, and could be directly bound to Clojure data

16:10 arohner: rhickey: that would be awesome. I've been thinking similar ideas

16:11 jgracin: I've checked IRIS and Datalog, but what I don't understand is how Datalog is backed by DB. I'm probably confused with AllegroCache and its use of Prolog. Is that what you have in mind with Datalog?

16:14 rhickey: jgracin: oh, to/from db could be anything, no I'm talking about in-memory data manipulation

16:15 I personally am fine with interacting w SQL w/o an intervening layer

16:16 but you could probably use metadata to preserve a relationship between data in memory and its source in the db

16:17 Lau_of_DK: Pupeno, thanks for the annnotation :)

16:18 jgracin: rhickey: much clearer now, thanks.

16:19 chmu: is swank/start-server the correct function to use if you want to start the swank-server manually outside of emacs?

16:45 arohner: sigh. I get ties all set up, only to find out that the project I want to use isn't listen in the centeral maven repo, and ties doesn't support not-default repos yet

17:13 achim_p: I tried out ties. it looks pretty cool

17:15 achim_p: arohner: cool - you got it running? i never tried it on anything but my own system. it's more of an idea by now, probably not really useful. any feedback appreciated!

17:16 arohner: I did run into one error:

17:16 [ties] Error: java.lang.RuntimeException: java.net.MalformedURLException: no protocol: /Users/arohner/.clojure-ties/poms/commons-attributes-api-2.2.pom

17:16 it looks like the xml/parse was complaining that the file path didn't start with a file://

17:17 in maven/deps

17:19 after hacking transport to return file:// on the transfer file name, it worked fine

17:21 I was surprised at how hard it is to find maven sources for some projects. I expected it to be more widespread

17:21 achim_p: okay, thanks! i'll fix that ... real soon :)

17:22 can't do coding for the next two weeks, exams coming up. after that, i'll have lots of time

17:26 arohner: if there are any bugs/features you'd like to see, please feel free to add them to the wiki page or create an 'issue' for them

17:28 arohner: sure

17:35 akopa: Is this channel archived anywhere public?

17:36 arohner: akopa: http://clojure-log.n01se.net/date/

17:36 akopa: arohner: Thanks.

22:31 arohner: man, the more time I spend it Java, the more I'm glad I didn't waste my time on it previously

22:31 * arohner is dealing with DB connection pooling and application servers right now

22:52 arohner: in slime, is there a way to show the cause of an exception?

22:52 when one exception wraps another?

22:54 oh, apparently I have an old slime

Logging service provided by n01se.net