Re: making code readable

2008-12-31 Thread Daniel Eklund
> This is the excuse continually trotted out by people too lazy to > comment, or who think themselves superior to merely mortal programmers > who have to work in teams and actually communicate with people. > Redundancy in communication is almost never redundant; think of it as > a checksum.

Re: Understanding how to use namespaces

2008-12-30 Thread Daniel Eklund
Hey Mark, In addition to Meikel's explanation above, have a look at this message http://groups.google.com/group/clojure/msg/17ada41fcb5ef667 from the overall thread http://groups.google.com/group/clojure/browse_frm/thread/ff80d120c996ba1a/9bfbfe1b08246035# This was the post that finally made

Re: Stumped - Java hangs when using Swing in Slime

2008-12-19 Thread Daniel Eklund
> Anyone have any ideas? I'm pretty confused as to what might be going > on. Some sort of deadlock in the thread pool that isn't allowing the > AWT event thread any cycles? I'm looking at the thread pool in JSwat > and I see a lot of Swank threads, but I can't tell exactly what's > going on. I li

Re: Typo on "Refs and Transactions" page

2008-12-18 Thread Daniel Eklund
> > Fixed - thanks for the report. > ahh since you're here and responding, there is a reference to 'boot.clj' at http://clojure.org/getting_started which is no longer valid.. this page also points to sourceforge ... any plans for a bug/typo tracking system so we don't fill up the group with to

Re: FAQ

2008-12-18 Thread Daniel Eklund
> Suggestions for entries welcome here. > > Rich How about: What language constructs/objects may be found in the function position of an expression? Ii like the fact that sets, maps and vectors are all 'functions of their keys', and that keywords and symbols are functions of maps. ((([ + - ap

Re: Is clojure.core/require documentation out of date ?

2008-12-16 Thread Daniel Eklund
> > I know don't feel comfortable with the notion of lib. I currently > assume that it is more or less similar to a namespace : it looks like > a namespace, it tastes like a namespace, but still does seem to be not > considered a namespace. > I understand your pain. I am right now going through

Re: Is clojure.core/require documentation out of date ?

2008-12-16 Thread Daniel Eklund
> If I'm wrong, could you please help me understand, maybe by giving me > a URL I may have missed ? > > Regards, > > -- > Laurent PETIT yes it is out of date... check the post 5 posts down: http://groups.google.com/group/clojure/browse_frm/thread/4a4c2e3e7aab5325# --~--~-~--~~--

Re: 'require' doc string out of date?

2008-12-16 Thread Daniel Eklund
> In general, clojure-contrib is a good place to look to find examples > of properly laid-out libs, as well as generally idiomatic Clojure > code. > > --Chouser Yeah, just recently I've taken to scanning the code in 'webjure' and 'swank' to see how things are done, rather than relying on the APIs

Re: understanding quoting

2008-12-15 Thread Daniel Eklund
> How did you know that it delegates to 'get'? sorry, I rushed that part. the keyword and symbol are instances of clojure.lang.Keyword and clojure.lang.Symbol which are _java_ classes found in Keyword.java and Symbol.java (I found these in the src/jvm directory) These are what the invoke( ) m

Re: understanding quoting

2008-12-15 Thread Daniel Eklund
> Looks like an if then else version of the map lookup?? > ie: (if (%1 %2) (%1 %2) %3) > Is this a special feature of maps in general, such that you can look > up a key but return something else if it doesn't exist? > I hadn't come across it yet, but it sounds useful :) This is exactly right (I j

'require' doc string out of date?

2008-12-15 Thread Daniel Eklund
I've been trying to get 'ns' right. The doc for 'require' tells me the following about library loading: "The root resource path is derived from the root directory path by repeating its last component and appending '.clj'. For example, the lib 'x.y.z has root directory /x/y/z; root resource

Re: Lisp/Clojure doesn't have syntax?

2008-12-11 Thread Daniel Eklund
> I've been reading the latest chapter from Stuart's book, Chapter 7: > Macros, and he makes this statement: > > "Clojure has no special syntax for code. Code is simply Clojure data. > This is true for normal functions, but also for special forms and > macros. Consider a language with syntax, su

Re: My quest to modify a leaf node in an arbitrarily deep map (question posed)

2008-12-10 Thread Daniel Eklund
> > user> (path-rebind nested-structure [:nested1 :nested2 :final-data] > > "new data") > > {:nested1 {:nested2 {:final-data "new data", :level 2}, :level > > 1}, :level 0} > > Congratulations, you've implemented 'assoc-in'  :-) > > user=> (assoc-in nested-structure [:nested1 :nested2 :final-data]

Re: My quest to modify a leaf node in an arbitrarily deep map (question posed)

2008-12-10 Thread Daniel Eklund
> > One thing I immediately ran up against were certain situations where > > I have a map and want to "modify" a value several levels deep into > > the hierarchy.  Imagine the following structure: > > > (def nested-structure { :level 0, > >                         :nested1 { :level 1, > >        

My quest to modify a leaf node in an arbitrarily deep map (question posed)

2008-12-10 Thread Daniel Eklund
Hi all, I am relatively new to clojure. I am trying to port some toy code I wrote for common lisp a few years ago (a boggle-like game which needs a dictionary prefix trie to trim possible word matches). My old code was fairly imperative in nature when creating the dictionary trie, and so now I a

Re: Elegant but very slow

2008-12-04 Thread Daniel Eklund
ahhh... to answer my own question (and if I had looked at the code and the API a bit closer), it turns out that "recur" can only be used in tail-position... and your code (as a tree-recursor) would not benefit from this. On Dec 4, 5:39 pm, Daniel Eklund <[EMAIL PROTECTED]&g

Re: Elegant but very slow

2008-12-04 Thread Daniel Eklund
oops... I am just learning the language right now and just quickly looked at what you did... Would the use of "recur" instead of self-calls potentially help consuming stack space? http://clojure.org/special_forms#toc10 On Dec 4, 5:37 pm, Daniel Eklund <[EMAIL PROTECTED]> w

Re: Elegant but very slow

2008-12-04 Thread Daniel Eklund
I On Dec 4, 2:55 pm, PeterB <[EMAIL PROTECTED]> wrote: > Hi, > > I downloaded clojure_20080916.zip and had a go with a simple tree > benchmark (cut-down version of the one in the computer language > shootout  http://shootout.alioth.debian.org/). > > The Java version is pretty simple and runs in a

Re: Clojure HTML Documentation

2008-11-21 Thread Daniel Eklund
beautiful ! thanks... i was just looking for something like this On Nov 21, 3:17 am, Mark McGranaghan <[EMAIL PROTECTED]> wrote: > I've created some experimental HTML docs for Clojure. You can see them > on S3:http://clj-doc.s3.amazonaws.com/tmp/doc-1116/index.html > > Or, just for kicks, on Ama