Why can't I use/require namespaces not associated with files?

2011-11-18 Thread Tassilo Horn
Hi all, why does the existance of a namespace not suffice to use or require it? Currently, with clojure 1.3, it has to be associated with a class or clojure file. Here's a simple example REPL session: --8---cut here---start-8--- user (ns test) nil test (defn

Re: Review my code - delay-map

2011-11-18 Thread Chris Perkins
Meikel, That's very helpful. You and I took essentially the same approach - wrap a real map and delegate most operations to it. You used deftype, which I was afraid to try because there seemed to be too many interfaces and too many methods to implement, so I used proxy and APersistentMap to

Literate Programming example

2011-11-18 Thread daly
Many of you asked me to show an example of a literate program and demonstrate the use of the tangle function. I usually use Latex for literate work but I've done this example using HTML and pre id=foo tags. I've written a self-referential literate program that explains the details of the tangle

Re: Review my code - delay-map

2011-11-18 Thread Meikel Brandmeyer (kotarak)
Hi, glad it helped. There are still intresting questions. For example transients. It'd sure be interesting to have this also. Meikel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note

Re: Why can't I use/require namespaces not associated with files?

2011-11-18 Thread Stephen Gilardi
why does the existance of a namespace not suffice to use or require it? Currently, with clojure 1.3, it has to be associated with a class or clojure file. The primary purpose of both use and require is to load code from a file in classpath. So while I can't use or require it, I can refer

Re: Literate Programming example

2011-11-18 Thread Chas Emerick
On Nov 18, 2011, at 7:17 AM, daly wrote: http://daly.literatesoftware.com/lithtml/litprog.html FYI, this is 404 at the moment. - Chas -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com

Re: Literate Programming example

2011-11-18 Thread daly
sigh. Try http://daly.axiom-developer.org/lithtml/litprog.html On Fri, 2011-11-18 at 07:46 -0500, Chas Emerick wrote: On Nov 18, 2011, at 7:17 AM, daly wrote: http://daly.literatesoftware.com/lithtml/litprog.html FYI, this is 404 at the moment. - Chas -- You received this

Re: Why can't I use/require namespaces not associated with files?

2011-11-18 Thread Tassilo Horn
Stephen Gilardi squee...@mac.com writes: Hi! Currently, with clojure 1.3, it has to be associated with a class or clojure file. The primary purpose of both use and require is to load code from a file in classpath. Sure. But when you say primary you imply there's also a secondary purpose.

Re: Literate Programming example

2011-11-18 Thread daly
I believe I fixed it. Please try it again and let me know. Tim On Fri, 2011-11-18 at 07:46 -0500, Chas Emerick wrote: On Nov 18, 2011, at 7:17 AM, daly wrote: http://daly.literatesoftware.com/lithtml/litprog.html FYI, this is 404 at the moment. - Chas -- You received this message

Re: Literate Programming example

2011-11-18 Thread László Török
it works for me. Las 2011/11/18 daly d...@axiom-developer.org I believe I fixed it. Please try it again and let me know. Tim On Fri, 2011-11-18 at 07:46 -0500, Chas Emerick wrote: On Nov 18, 2011, at 7:17 AM, daly wrote: http://daly.literatesoftware.com/lithtml/litprog.html FYI,

All Contributor Agreements from the Clojure/conj have been added

2011-11-18 Thread Christopher Redinger
Over 50 new CAs have been signed. If you have signed one, you should see your name on this list: http://clojure.org/contributing. Thanks everybody! -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: ClojureScript: Should 'advanced optimizations' lead to faster execution? (or just faster loading)

2011-11-18 Thread Stuart Sierra
On Nov 17, 5:18 pm, Paul Richards paul.richa...@gmail.com wrote: Aside from loading times (due to different file sizes) and memory usage (again due to different file sizes, minified field names, etc), do we expect the optimized version to execute faster? Theoretically, yes, because GClosure

Re: Change var in other namespace

2011-11-18 Thread vitalyper
Thanks, Sean. Exactly what I was looking for. IMO, clojure.tools.logging could of made this easier: log implementation from classpath by default with override by client when needed. On Nov 17, 11:32 pm, Sean Corfield seancorfi...@gmail.com wrote: Note: if you just want something that will

Re: Literate Programming example

2011-11-18 Thread bernardH
On Nov 18, 1:17 pm, daly d...@axiom-developer.org wrote: Many of you asked me to show an example of a literate program and demonstrate the use of the tangle function. Thanks to your perseverance, I am looking into practicing literate programming. However, I decided to settle for emacs

Use of eval

2011-11-18 Thread vitalyper
Came across this code in clojure.tools.logging (defn cl-factory Returns a Commons Logging-based implementation of the LoggerFactory protocol, or nil if not available. [] (try (Class/forName org.apache.commons.logging.Log) (eval `(do (extend

Blog: SQL in Clojure

2011-11-18 Thread Herwig Hochleitner
Hello, I wanted to summarize my thoughts on the current state of SQL in clojure, with respect to the new library, Korma, to get a discussion going. It turned out to be too long for the ML, so I blogged it: http://thinkrevoactevo.blogspot.com/2011/11/sql-in-clojure.html enjoy --

Re: Use of eval

2011-11-18 Thread Gary Trakhman
My speculation is that the eval is required in the case that commons-logger is not in the classpath. The code wouldn't compile without it. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com

Re: Use of eval

2011-11-18 Thread vitalyper
I don't think you are right - it does compiles without it. After more thinking my guess is that eval is used to combine extend and reify in the same function. Let's see if somebody else could shed a light on this. On Nov 18, 12:45 pm, Gary Trakhman gary.trakh...@gmail.com wrote: My speculation

Re: Debugging Java heap space memory error with lazy sequences.

2011-11-18 Thread Julian Kelsey
Thanks! To confirm my understanding: in my original version I defined (using def) a reference to a lazy sequence. I then evaluated it, using nth to pick a value from the sequence. Because I have a reference to the beginning of the sequence all the lazily generated items are retained. I.e. the

Re: Latest Bagwell paper for a new implementation of Clojure vectors ?

2011-11-18 Thread logan
Are there currently any plans to eventually replace PersistentVector? Looking at the code, the upper limit for the number of elements that can be stored in PersistentVector is 32^6, which is quite a lot but still might become a real limitation in the near future. -- You received this message

Re: Literate Programming example

2011-11-18 Thread daly
On Fri, 2011-11-18 at 07:07 -0800, bernardH wrote: On Nov 18, 1:17 pm, daly d...@axiom-developer.org wrote: Many of you asked me to show an example of a literate program and demonstrate the use of the tangle function. Thanks to your perseverance, I am looking into practicing literate

repl dodges ns :use :only ?

2011-11-18 Thread Andrew
I'm surprised that I can do the following. Am I wrong about namespaces? 1. M-x clojure-jack-in 2. at the repl, execute (ns my-proj.core) 3. compile my core.clj (see ns snippet below) 4. back in the repl, use a function from a library that wasn't included in the :only clause from

Re: repl dodges ns :use :only ?

2011-11-18 Thread Chas Emerick
The :as clause establishes an alias for the entire clj-webdriver.core namespace. The value of :only lists the vars from that namespace that are referred into my-proj.core, which you can use without qualification e.g. `(attribute …)` will work, but `(start …)` won't. Both `(cw/attribute …)`

Re: Use of eval

2011-11-18 Thread Gary Trakhman
I get this when i try it in a blank project, removing the eval and the quote: Unknown location: error: java.lang.ClassNotFoundException: org.apache.commons.logging.Log core.clj:16:8: error: java.lang.ClassNotFoundException: org.apache.commons.logging.Log (core.clj:16) Compilation failed.

Re: repl dodges ns :use :only ?

2011-11-18 Thread Andrew
Oh, thanks. Is there a way to import some functions and not others such that the others cannot be used at all? -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new

Re: repl dodges ns :use :only ?

2011-11-18 Thread Sam Ritchie
Sure, just remove the :as argument: (ns example.ns (:use [clojure.string :only (join)]) On Friday, November 18, 2011, Andrew ache...@gmail.com wrote: Oh, thanks. Is there a way to import some functions and not others such that the others cannot be used at all? -- You received this message

Re: Probabilistic programming in clojure

2011-11-18 Thread Nils Bertschinger
On Nov 18, 8:05 am, Konrad Hinsen googlegro...@khinsen.fastmail.net wrote: --On 17 novembre 2011 15:09:11 -0800 Nils Bertschinger nils.bertschin...@googlemail.com wrote: The two approaches are somewhat complementary to each other. Your monad does exact inference on discrete distributions by

Re: Change var in other namespace

2011-11-18 Thread Sean Corfield
On Fri, Nov 18, 2011 at 6:35 AM, vitalyper vitaly...@yahoo.com wrote: IMO, clojure.tools.logging could of made this easier: log implementation from classpath by default with override by client when needed. I agree but when I brought the issue up, there didn't seem to be much support for making

Re: Literate Programming example

2011-11-18 Thread Daniel Jomphe
On Friday, November 18, 2011 7:17:08 AM UTC-5, TimDaly wrote: Many of you asked me to show an example of a literate program and demonstrate the use of the tangle function. I usually use Latex for literate work but I've done this example using HTML and pre id=foo tags. I've written a

Re: Literate Programming example

2011-11-18 Thread TimDaly
On Fri, 2011-11-18 at 20:02 -0800, Daniel Jomphe wrote: On Friday, November 18, 2011 7:17:08 AM UTC-5, TimDaly wrote: Many of you asked me to show an example of a literate program and demonstrate the use of the tangle function. I usually use Latex for literate work but