#clojure log - Mar 04 2010

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

1:46 konr: test

1:55 TheBusby: You are about to enter another dimension. A dimension not only of sight and sound, but of mind. A journey into a wondrous land of imagination. Next stop, the Twilight Zone!

1:55 (which is the hours the US West sleeps, until EU awakes)

2:08 zmila: pre-US awaken

2:09 gregh: it's prime time for down under

2:23 langtree: Does anyone know who supports the Ubuntu clojure package ?

2:37 cads: langtree: seems to be a guy named peter collingbourne: http://packages.debian.org/sid/devel/clojure

2:38 langtree: also, this is the first time I've heard of this, thanks!

2:41 langtree: No problem. It needs to get the readline type thing integrated.

4:03 esj: Good Morning Parentherati

4:09 zmila: u 2

8:48 esj: i'm trying to define a macro that returns a function who's name is constructed, but I'm failing: (defmacro alter-name [name] `(defn (symbol ~name) [x#] x#)). Any hints ?

8:49 cgrand: esj: (defmacro alter-name [name] `(defn ~(symbol name) [x#] x#))

8:51 esj: splendid, thanks.

8:58 aldebrn: Shot-in-the-dark noob question: to implement a distributed linear algebra algorithm (conjugate gradient solver, on an implicitly-defined matrix, such that there will be some inter-node communication), should one look at Cascading/Hadoop?

9:01 esj: potentially uninformed answer: but conj-grad is pretty serial in nature, ie after each iter you get to a point in spcae, and recalc your gradient. Hadoop is better for batch jobs, ie where you calculate a bunch of stuff in parallel and the bring it all together. So I don't think its a good match. No doubt somebody can correct me, though ;)

9:05 maybe I misunderstood - if the gradient calculation based on your implicitly defined matrix is what you're looking to do in parallel, then it makes more sense. I'm not sure what the overhead in living in Hadoop for that would be.

9:09 aldebrn: esj, all your intuitions are right. The matrix itself is implicitly defined and is pleasingly parallel, and the solution vector that's being solved for is too large to fit on one node. So each node would store a chunk of the solution vector, and code for the implicit operation.

9:10 esj: wow, that's some serious crunching.

9:11 aldebrn: My HPC colleagues are going to jump on this and do it in their custom MPI-like frameworks, but I'd like to learn more about using Cascading/Clojure on such problems.

9:13 Yeah, if y=Ax, y is "short" and each node has that; x is very "tall" and has to be distributed-stored. A is short-and-fat, and is basically an FFT matrix (with a pre-multiplier). And I will need to do CG repeatedly, changing that pre-multiplier till convergence.

9:13 esj: enjoy

9:13 aldebrn: I meant, A is a concatenation of multiple FFT matrixes, /fix

9:26 esj: If I understand, you can definitely do this is a Hadoop setup. Your distributed calculation looks like Ax = A_1*x_1 + ... + A_n*x_n, where each i happens on a machine in the cluster. So the map part is A_i*x_i, and the reduce is the sum. Then you have Ax. Is that what you're after ?

9:29 so you do that, fiddle your A according to CG or whatnot, distribute it to the cluster, wash, repeat.

9:39 powr-toc: Does clojure have a bidirectional map at all?

9:50 ok, I can make one with: (let [m {:foo "foo" :bar "bar"}] (merge m (apply hash-map (mapcat (fn [[a b]] [b a]) m))))

9:51 aldebrn: esj, quite right. That's encouraging. I've been searching for some literature on math + hadoop/cascading (I'd rather use Cascading), nothing yet, besides some matrix-multiply examples from Hama and an example for computing digits of pi with Hadoop

9:52 chouser: ,(into {} (for [[b a] {:foo "foo" :bar "bar"}] [a b]))

9:52 clojurebot: {"foo" :foo, "bar" :bar}

9:52 esj: aldebrn: this might have some interesting stuff http://lucene.apache.org/mahout/

9:55 aldebrn: esj, quite so, I was slightly discouraged though by this statement there, 'They are not intended for applications requiring vectors or matrices that exceed the size of a single JVM, though such applications might be able to utilize them within a larger organizing framework.'

9:55 It does seem like that could be a part of the solution

9:56 esj: bummer, it was a stab in the dark, sorry.

10:06 powr-toc: is there anyway for a function to know the name of the symbol or var it is bound to?

10:07 or do I need to do a big search of ns-interns?

10:14 Infact, is there a way for a function to get a hold its own value... i.e. is there a concept of this or self?

10:17 chouser: you can name a function locally and then use that name

10:24 stuartsierra: ,((fn thisfn [] (prn thisfn)))

10:24 clojurebot: #<sandbox$eval__11043$thisfn__11045 sandbox$eval__11043$thisfn__11045@c6344f>

10:28 powr-toc: chouser: cool

10:29 chouser: can you reuse the names?

10:29 without overwriting function definitions?

10:29 i'm guessing you can

10:33 chouser: they're local names -- same scope as the fn's parameters

10:40 jcromartie: I've got compojure set up to serve files with (GET "/*" (or (serve-file (:* params)) :next))

10:40 and public/404.html exists, among other things

10:41 but I still get java.io.FileNotFoundException for any route

10:41 I have (ANY "*" (page-not-found)) set up too

10:42 slime seems to be running in my home directory

10:42 hmm

10:46 what's the proper way to start swank-clojure-project so that the current directory of the clojure process is the project dir?

10:50 I think I just have to run my dev REPL from the command line?

10:52 spariev__: are you using lein ? lein swank + slime-connect work flawlessly for me

10:53 jcromartie: ah, I haven't used that before

10:53 I'll try it

10:55 bsteuber: jcromartie: I ran into a similar issue with swank-clojure-project - when loading a file, my current directory was src, not the project root

10:56 so I wrote a function that recursed outwards until I was at the project root

10:56 which smells very fishy, of course :)

10:56 jcromartie: ah, yes

10:56 yes it does

10:56 I mean ideally we'd not be depending on the current directory at all

11:00 spariev__: I wish Clojure was free of all these Java oddnesses while keeping wast amount of libs and reliable VM :)

11:00 bsteuber: :)

11:01 maybe swank-clojure-project and lein swank should set something like *project-directory*

11:01 or maybe they do already and I don't know

11:03 jcromartie: spariev__: I just see it as a working directory thing

11:03 all processes have to deal with it

11:03 but I guess other processes can cd

11:03 java can't?

11:03 spariev__: yep, you're right

11:05 http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4045688 - here's relevant bug with WontFix resolution

11:09 DeusExPikachu: i can't import java.util.concurrent, is there something I need to change in my classpath?

11:09 my java version is 1.6.0

12:25 stuartsierra: DeusExPikachu: you can't import a package.

12:27 DeusExPikachu: stuartsierra, ok, I see my problem now

12:42 esj: I was puzzling around an equivalent of the GoF Decorate pattern for Clojure. I've put together an idea of what it could look like http://gist.github.com/321938. Any thoughts ?

12:44 doubtless it can be done my a clueful person in 3 lines :)

12:44 chouser: did you consider storing the decorations in the collection's metadata?

12:45 esj: i had not. i'm not sure they're orgothonal though. will need to think about that.

12:46 chouser: not sure either. I don't quite see what decorators are doing yet. :-)

12:52 esj: yeah, its probably totally twisted up. The idea is just to have a polymorphic function which composes itself based on an attribute of the state passed in.

12:53 So in my work you have a collection, and an add function. Now for some collections you want them to be db-backed, and or of fixed size. So you decorate the collection such that (add ...) will add data, write to the db, resize etc according to the collections decorations.

12:55 mattrepl: technomancy: any reason not to add "resources/" to classpath in `swank-clojure-project`?

12:55 esj: this was the first time I've actually used macros, so that was quite fun

12:57 mattrepl: esj: that sounds very side-effect-y

12:58 esj: actually its all functional

12:58 everything is threaded

12:58 no side-effects at all

13:00 ok, other than writing to the DB, but that's just in the example

13:00 mattrepl: ah, I was thinking of 'add' in the sense of math operator. yeah, that part is difficult to avoid and get thing done though. =)

13:02 technomancy: mattrepl: I think it does now

13:02 chouser: esj: in your examples you're mutating test-fn, aren't you?

13:03 esj: chouser: this is true, in the exact sense that (def-method ...) mutates a multimethod.

13:03 mattrepl: technomancy: in elpa?

13:04 I'm looking at 1.1.0 from elpa

13:05 esj: chouser: woops, I'm wrong. test-fn just calls the a multifunction, once defined its not altered. The macros just add methods to the multifunction

13:08 duncanm: anyone good with Swing here? I'm adding a component to a JToolbar, how can I set the size (width) of the component so it doesn't span the entire toolbar?

13:15 arohner: I think I remember hearing someone wrote an (assert) function that printed the arguments when the assert failed. Is that true?

13:15 i.e. (assert (foo? bar)) would print the eval'd value of bar in the assert exception message

13:19 technomancy: mattrepl: no, I haven't released a new version

13:19 so far it's just in git

13:19 I hope to give it some attention and maybe a new release soon

13:21 mattrepl: technomancy: cool, thanks for maintaining it

13:21 technomancy: maintaining is probably too strong a word for what I'm doing with it, but sure. =)

14:14 stuartsierra: arohner: clojure.test does that, more or less

14:46 wthidden: I have a list of keys and a list of values how do i transform this pair of lists to a hashmap?

14:47 i thought there was a function that did this nicely, but I forgot where?

14:47 _fogus_: ,(doc zipmap)

14:47 clojurebot: "([keys vals]); Returns a map with the keys mapped to the corresponding vals."

14:47 bosie: how would one go about using a immutable data structure for a concurrency program?

14:48 _fogus_: wthidden: ^^^^^^^^

14:48 wthidden: ah.. no hash in the function name what so ever.. :) thanks _fogus_

14:52 _fogus_: wthidden: my pleasure

14:53 technomancy: bosie: like this: (send (agent []) conj 1)

14:53 but that is a pretty vague question.

14:54 bosie: technomancy: right. but isn't that pretty much the same as using threads in java?

14:54 technomancy: at that point

14:55 technomancy: bosie: that example is so trivial that it's meaningless to compare it to non-FP approaches, yes.

14:55 bosie: technomancy: ?

14:55 technomancy: whatever you do, if the datat structure is immutable i have to enforce thread isolation

14:56 technomancy: I just mean your initial question is so broad as to be difficult to give a useful answer for.

14:56 you don't have to enforce thread isolation with immutable data structures, no.

14:56 bosie: sorry i meant mutuable

14:56 since i won't use the datastructure from clojure

14:57 technomancy: oh, I see. yes, that's much trickier. putting it in an agent will enforce thread isolation.

14:58 there are other ways, but that's the most straightforward I think.

14:58 chouser: well, not really. putting it in an agent and promising to not change the value outside the agent does work.

14:58 but calling it enforcement might be a bit much.

14:59 technomancy: true, it's not actually isolation. you just have to promise to always modify it inside send.

14:59 chouser: using a cell comes closer to enforcement, but they're not fully baked yet

15:02 bosie: great

15:04 that takes the fun out of clojure

15:04 triyo_: Any work or thoughts happening around Clojure and support for actor model for distributed programming?

15:05 chouser: trying to do multithreads with uncontrolled mutable objects isn't fun in any language

15:06 bosie: chouser: true but is there any documentation out there in clojure?

15:06 chouser: because at least java is documented/has a concurrency book out that is rather decent

15:07 _fogus_: bosie: I assume you mean the Goetz book no?

15:07 bosie: yes

15:08 chouser: all the Java concurrency features are available, and if you're using someone else's mutable objects, applicable.

15:09 bosie: chouser: COLT :/

15:09 chouser: Incanter?

15:10 bosie: chouser: yea maybe, but the features of incanter aren't looking that impressive so far

15:10 chouser: I just wondered if you were using it, as there might be examples of what you want there.

15:11 hiredman: and the problem with using colt directly is what?

15:11 chouser: you're asking me?

15:11 hiredman: anyone

15:11 bosie: hiredman: wouldn't that give me mutable data structures?

15:11 chouser: oh. I assume just that colt's matrix objects are mutable

15:11 bosie: chouser: yea me too

15:12 _fogus_: bosie: I'm not sure that Incanter was written to solve the problems of concurrent programming.

15:12 hiredman: bosie: yes, and?

15:12 as chouser said all the java concurrency stuff is available for use with java style mutable objects

15:12 bosie: hiredman: but why bothering with clojure then?

15:14 Chousuke: because it's better in other ways too :)

15:14 chouser: clojure's agents and cells (if you're feeling adventurous) can be helpful and more convenient than similar constructs in Java.

15:14 hiredman: because even when using locking instead of the stm clojure still has all the benefits of a lisp

15:14 chouser: Also macros, REPL, seq abstraction, multimethods, etc.

15:14 bosie: hiredman: being slow? ;)

15:14 hiredman: code as date & macros, much nicer to read and write than java

15:14 bosie: why do you think lisp is slow?

15:15 bosie: hiredman: not lisp, just clojure

15:15 hiredman: why do you think clojure is slow?

15:15 bosie: just a feeling i get ;)

15:15 hiredman: well, you feel wrong

15:15 bosie: looking at some blogs i guess i am right

15:16 technomancy: bosie: reflection is slow, and clojure can use a lot of reflection.

15:16 but that doesn't mean clojure can't be fast.

15:16 hiredman: bosie: so it's not a feeling, it's from some blog posts you've read

15:16 bosie: technomancy: i can make ruby fast too by using inline C, but that ain't ruby

15:17 hiredman: and when i think about it. how can one outperform another language if its written in the language and adds tons of features?

15:17 technomancy: I can make ruby fast too by putting it on a train going at a high speed, but that is also irrelevant to the discussion.

15:18 bosie: technomancy: i am open to any articles you have about how you get performance out of clojure

15:18 technomancy: clojurebot: google ato benchmarking wide finder

15:18 clojurebot: First, out of 833 results is:

15:18 jessenoller.com - Python Threads and the Global Interpreter Lock

15:18 http://jessenoller.com/2009/02/01/python-threads-and-the-global-interpreter-lock/

15:18 technomancy: clojurebot: no botsnack for you!

15:18 clojurebot: da da king of the road

15:18 hiredman: bosie: speed is about the generated bytecode

15:18 and what the jit does with it

15:19 technomancy: bosie: if you're in the mood for a long, in-depth read: http://meshy.org/2009/12/13/widefinder-2-with-clojure.html

15:19 chouser: or: speed is about algorithms and having the time and ability to implement good ones.

15:19 technomancy: clojurebot: widefinder is optimized by _ato: http://meshy.org/2009/12/13/widefinder-2-with-clojure.html

15:19 clojurebot: Ack. Ack.

15:20 bosie: technomancy: by optimize you mean rape a dynamic language by providing type hints?

15:20 chouser: bosie: is there something we can help you with?

15:20 bosie: chouser: not really

15:22 but if anybody wants to have a crack at it: http://leon.bottou.org/projects/sgd

15:23 _fogus_: bosie: Is that your project?

15:23 bosie: no

15:27 _fogus_: does that matter?

15:28 _fogus_: bosie: not at all

15:31 bosie: technomancy|away: in the 'final thoughts' of your link: "We can’t compete with a lower-level language like C or C++ on this sort of data crunching"

15:32 chouser: bosie: if you'd like to use C, by all means please do.

15:33 bosie: chouser: i won't. just wanted to paste that line because i got attacked before for even thinking clojurer was slow

15:33 * _fogus_ missed the attacks

15:33 bosie: yea ok not 'attacks'

15:34 joegg: Is there any particular place to announce clojure meetings? I setup a Pittsburgh Clojure Users Group on meetup.com, and I'd like to get the word out.

15:34 bosie: corrections

15:34 mattrepl: joegg: the mailing list and here

15:36 _fogus_: joegg: If you tweet it then it might get picked up by http://disclojure.org/

15:37 joegg: mattrepl: Okay, thanks! In that case:

15:37 I'd like to invite everyone to the first meeting of the Pittsburgh Clojure Users Group.

15:37 http://www.meetup.com/Clojure-PGH/

15:37 We're meeting next Wednesday at 7pm at The Library (a bar).

15:37 mattrepl: awesome bar name

15:37 hiredman: http://github.com/texodus/saturnine <-- oooo

15:37 joegg: In addition to a great language, we have a nifty logo.

15:39 Chousuke: arr, there needs to be some kind of public announcement discouraging single-segment namespaces

15:39 hiredman: "Common functionality built-in, including Handlers for Bytes, Strings, (simple) streaming XML, HTTP, JSON, XMPP and Clojure forms." :D

15:40 chouser: Chousuke: there are people still advocating it

15:41 mattrepl: Chousuke: ns.core or com.somedomain.ns or either?

15:42 hiredman: I think the most recetn lein release defaults to projectname.core

15:43 Chousuke: mattrepl: either.

16:17 dnolen: nice, http://enfranchisedmind.com/blog/posts/what-killed-lisp-could-kill-haskell-as-well/#comment-37144

16:40 arohner: to disable pre/post conditions, *assert* needs to be false at compile time, right?

16:40 or run time?

16:44 chouser: compile time

16:50 arohner: ,(alter-var-root (var clojure.core/*assert*) (constantly false))

16:50 clojurebot: DENIED

16:51 arohner: that doesn't seem to work

16:55 aha, it was also bound in my thread

17:12 DeusExPikachu: I'm trying to implement the Executors interface using proxy and I'm getting the "No matching ctor found for..." error, How should i go about this?

17:13 kotarak: DeusExPikachu: paste the problematic code?

17:14 hiredman: DeusExPikachu: are you strying to call a constructor?

17:14 trying

17:14 DeusExPikachu: I'll get the code pasted, one sec

17:18 http://paste.lisp.org/+220Z

17:19 kotarak: How can defaultThreadFactory be called on a Interface?

17:20 Maybe you have to pass some arguments to the constructor of Executors?

17:20 DeusExPikachu: kotarak, huh that's not the interface, I just need that for the method execute

17:20 from the java API docs, there are not required args to the constructor for Executor

17:21 http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/Executor.html

17:21 duncanm: when did clojure.contrib.io got accepted?

17:22 technomancy: duncanm: mid-february?

17:22 kotarak: DeusExPikachu: Executors does not have a public constructor it seems. Maybe you meant Executor in the proxy?

17:22 hiredman: DeusExPikachu: Executors and Executor are different

17:22 DeusExPikachu: oh crap, figured out problem, there's a difference between Executors and Executor

17:22 yeah

18:11 is there a given way to get all the thread names or do I have to track that myself?

18:13 technomancy: ,(Thread/getAllStackTraces)

18:13 clojurebot: java.security.AccessControlException: access denied (java.lang.RuntimePermission getStackTrace)

18:13 technomancy: DeusExPikachu: ^

18:14 hugod: technomancy, what can I do to get an updated package regexp into swank-clojure?

18:15 technomancy: hugod: if you're interested in helping out I can give you commit rights to put it in directly

18:15 hugod: ok, I could do that

18:16 technomancy: would allow you to bypass the fact that I'm a pretty crappy maintainer when it comes to swank.

18:16 aedon: could anyone give me a cannonical way to add folders to classpath when using swank/slime/clojure from elpa? or is elpa discouraged?

18:17 hugod: technomancy: better a maintainer than no maintainer

18:17 technomancy: aedon: no, elpa is great. but how the classpath is calculated depends on how you launch slime.

18:17 aedon: technomancy: so far I was doing m-x slime

18:17 but I tried slime-project? too

18:17 technomancy: aedon: you can set the emacs swank-clojure-classpath defvar to a list of jars/directories; just be sure it includes the path to clojure.jar and swank-clojure.jar

18:18 hugod: I have to projects that I might get round to with swank - debugging with jdi, and restarts for error-kit

18:18 technomancy: hugod: are you hugoduncan on github?

18:18 hugod: I am

18:18 mattrepl: there's also swank-clojure-extra-classpaths

18:18 aedon: technomancy: does it matter where in your .emacs you set that?

18:18 technomancy: hugod: cool; added

18:18 hugod: technomancy: thanks

18:19 technomancy: mattrepl: they're actually aliases for each other

18:19 -extra is the old name

18:19 aedon: shouldn't matter

18:19 mattrepl: oh, didn't know that changed

18:19 technomancy: btw: if anyone else wants to help out with swank maintenance please let me know

18:20 hugod: if you can keep work out of the master branch until it's well-tested that would be great.

18:20 hugod: I like to run it by at least one other person before merging as a rule.

18:20 aedon: technomancy: thanks for the help

18:20 hugod: technomancy: sounds wise to me

18:22 technomancy: hell of a regex you got there

18:22 (for detecting metadata-having ns forms)

18:23 hugod: if you have other suggestions....

18:23 technomancy: not at all, just commenting on the verbosity of the elisp regex flavour

18:23 plus it's a tricky thing to have to match.

18:23 hugod: it's not overly reliable in the face of {} in the doc string, or escaped quotes

18:24 technomancy: might end up being cleaner using something like forward-sexp

18:24 but this is definitely an improvement

18:24 hugod: at least it picks up a few more cases

18:24 technomancy: yep, good stuff.

18:26 DeusExPikachu: technomancy, does Thread/getAllStackTraces print out blocking threads? It seems to be missing some threads I believe should exist

18:27 technomancy: hugod: feel free to merge the ns detection regex patch; consider it reviewed

18:28 and thanks for putting that together

18:31 hugod: technomancy: will do in while - I have to go cook for the kids...

18:32 technomancy: have some good noms.

18:32 Apage43: man

18:32 i've been secretly using clojure at work

18:33 technomancy: DeusExPikachu: hrm; I think it does, but I'm not sure. You could try just spinning up a few manually to check.

18:33 Apage43: great way to learn =P

18:33 the-kenny: Does this patch does something like (clojure.core/select<TAB> -> (clojure.core/select-keys ? If so, it would be the second-best addition to swank I can think of.

18:34 technomancy: the-kenny: uh... that already works. =)

18:35 the-kenny: technomancy: huh? Not with fuzzy I think. It just expands to (clojure/core

18:35 s/\/\./

18:35 technomancy: works for me using tab in the repl and dabbrev in regular buffers

18:35 oh... I don't remember if I have fuzzy enabled

18:36 the-kenny: Maybe it's a problem with fuzzy

18:49 DeusExPikachu: for some reason (loop [] (when *foo* (recur))) does not increase my cpu usage when I run it and *foo* is true, is there some optimization going in the background?

18:51 crap nm, I realized I'm running it remotely... hehe

18:59 tomoj: how would you deal with a java library which expects you to use synchronized statements?

19:00 hiredman: synchronizing is locking

19:00 ,(doc locking)

19:00 clojurebot: "([x & body]); Executes exprs in an implicit do, while holding the monitor of x. Will release the monitor of x in all circumstances."

19:01 tomoj: great

19:01 I hadn't ever seen locking before

19:01 technomancy: hiredman: you coming to Zoka tonight?

19:01 tomoj: thanks

19:02 hiredman: technomancy: yessir

19:02 technomancy: cools

19:03 I'm staking out the table as we speak.

19:08 hiredman: excellent, have to beat the rush...

19:21 kotrin: trying to make a shoutbox with clojure/compojure and when i submit the form it does not update the shouts listing until i restart the jetty server. anyone know why? not much on google... code: https://gist.github.com/1179a9055eea507867f6

20:40 maxhodak: has anyone here used allegrograph?

21:14 technomancy: hugod: went ahead and applied your ns-with-metadata patch to swank; thanks.

21:15 err--never mind

21:15 hugod: technomancy: I think I beat you to it

21:16 technomancy: yup; nice

21:31 hugod: technomancy: looks like you've been busy...

22:57 technomancy: hugod: mostly just cleanup

22:57 old branches to prune

22:58 hugod: technomancy: anything pressing that needs doing?

23:01 technomancy: hugod: I really want to get the debug-repl working in swank

23:03 but it's currently getting confused about inputstreams

23:03 hugod: technomancy: is it on a branch?

23:04 technomancy: no, I haven't done anything towards that yet.

23:05 hugod: by debug-repl you mean using the new env support?

23:05 technomancy: yeah

23:05 http://georgejahad.com/clojure/debug-repl.html

23:06 hugod: I'll take a look...

23:06 technomancy: that would be great!

23:06 right now it only works from the inferior-lisp buffer

23:07 hugod: I get very frustrated with the lack of inspection in the stack trace

23:07 technomancy: yeah, that's been another top complaint

23:10 integrating the clj-stacktrace prettification library would be a big win too

23:11 hugod: and adding a 'go to the end of the exception cause chain' option

23:14 technomancy: that would be great

23:31 pdk: test

23:37 rickmode: I'm using swank-clojure-project and leiningen. Do path and filenames need to match up with namespaces for (require 'foo) and (require 'foo.bar) to work?

23:39 actually I used (use 'foo) just not instead of (require 'foo)... I'm a little unclear about the distinction there as well

23:43 dnolen: rickmode: file name and directory path has to match.

23:44 rickmode: dnolen: is that true in general, or just with use with leiningen?

23:44 dnolen: rickmode: true in general

23:44 rickmode: ic

23:45 dnolen: similar to java then. not a bad idea... keeps things easy to find

23:45 dnolen: I think it is actually imposed by Java (always forget). also note that dash becomes underscores.

23:45 rickmode: for some reason I though the namespace marker in a file trumped

23:45 dnolen: com.foo.bar.my-file -> com/foo/bar/my_file.clj

23:45 rickmode: that - to _ is odd, but easy to remember

23:46 dnolen: again Java thing, - not allowed in file names.

23:46 if something seems wack in Clojure 99% of the time it's because you can't work around it because it's imposed by Java.

23:47 rickmode: dnoles I guess that's the price we pay vs. CL's package madness.

23:47 dnolen: of course there's _plenty_ of goodness from Java as well.

23:47 rickmode: CL package madness always blew my mind.

23:48 at one point I understood it and thought, super powerful but too many subtleties

23:48 rickmode: I *really* wanted to use CL and gave it an honest shot.

23:48 dnolen: I also chanced upon Clojure because of dabbling in CL.

23:49 rickmode: what got me in the end was more that there didn't seem to be enough hackers involved to keep things going. Plus the ASDF thingy doesn't really deal with versions of dependences like leiningen (and maven in java)

23:49 at least not as far as I could see

23:50 anyway - can you explain the practical difference between the use and require forms? I get that a source file ought to use ns, but in the REPL, which one and why?

23:51 dnolen: rickmode: use bring all definitions in the library into your namespace, require brings those things in but you have to use the whole namespace to refer to something.

23:51 use is convenient but name clashes likely. require with an alias is common if you want to avoid typing

23:51 (:require [some.cool.lib :as cool])

23:51 rickmode: dnolen... aaaaah... is that it? sheesh.. I"m overthinking it

23:52 dnolen: also

23:52 (:use [some.coo.lib :only [foo bar]]) handy

23:54 rickmode: ya... i think i see why i got confused... both allow aliases but "require" aliases packages while "use" aliases symbols

23:54 ... it hink

23:54 ... er ... i think

23:54 dnolen: personally I don't see the point of alias + use, but perhaps somebody knows better.

23:54 for me its' either, use, use + only, require, require + as

23:57 joshua-choi: How many people here use REPLs to develop Clojure?

23:57 Like, actually? I've always just run tests, and I've never figured out how to really productively integrate the REPL into my programming.

23:57 Raynes: I'd venture a guess that everybody does. If you use Clojure without an REPL, I'm not sure how you get anything done.

23:58 joshua-choi: Yeah, sometimes I wonder that myself. :P

23:58 Raynes: I don't think I'm capable of coding in a language without one anymore. :o

23:58 joshua-choi: Whatever project I'm working on has a script full of tests that refer to my actual project code. I just run it every time I modify my project.

23:59 I just don't "get" the REPL right now. Maybe it's because I'm not using an IDE.

23:59 Raynes: Neither am I.

23:59 dnolen: joshua-choi: i only use REPL, but Emacs makes it easier. Enclojure's REPL support seemed passable.

23:59 Raynes: I use Emacs.

Logging service provided by n01se.net