Re: building with Ant vs building with Maven

2008-12-16 Thread Meikel Brandmeyer
Hi, On 16 Dez., 12:47, kkw kevin.k@gmail.com wrote: Should I build using Ant instead of Maven? Using ant is the official way to build Clojure. Sincerely Meikel --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: 'require' doc string out of date?

2008-12-16 Thread Chouser
On Mon, Dec 15, 2008 at 10:41 PM, Daniel Eklund doekl...@gmail.com wrote: 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

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. I

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 06:02, MikeM wrote: You can try this: (let [t (new Thread (fn[] (shutdown-agents)))] (.. java.lang.Runtime (getRuntime) (addShutdownHook t))) It works for me, but seems to take a long time to complete the shutdown. I tried adding this to the module that

Re: Listen on changes to refs

2008-12-16 Thread Stuart Sierra
On Dec 16, 7:50 am, Timothy Pratley timothyprat...@gmail.com wrote: SS wrote a cells that works on refs quite a while ago:http://groups.google.com/group/clojure/browse_thread/thread/d79392e4c... Yeah, it works, but the interface is a little awkward. Rich said he wants to add watchers for

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 07:36, Randall R Schulz wrote: ... So I am still confused about the right way to deal with agents in order to get reliable and prompt exit from the REPL and why an EOF from the terminal hangs (only if agents were started and regardless of whether a shutdown hook

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-16 Thread J. McConnell
On Tue, Dec 16, 2008 at 12:26 AM, Mon Key s...@derbycityprints.com wrote: whoops, chopped of the end of that last message - forgot the nasake-no ichigeki user (seq? '(nil)) ==|]==true '(nil) is a list containing the single element nil. nil is no kind of list whatsoever. So, (seq?

Re: doall and dorun

2008-12-16 Thread Christian Vest Hansen
I think I'll be putting my money on (for) returning a cached lazy seq, and (macroexpand) also tells me that there's a lazy-cons hidin in there: user= (macroexpand '(for [i (range 1 3)] (do (println i) i))) (let* [iter__4007 (clojure.core/fn iter__7 [s__8] (clojure.core/when-first [i s__8]

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 08:03, J. McConnell wrote: ... '(nil) is a list containing the single element nil. nil is no kind of list whatsoever. So, (seq? '(nil)) is true, since '(nil) is a list and lists are seqs and (seq? nil) is false since nil is not a sequence. The quoted list

Re: Getting Started with Gen-Class

2008-12-16 Thread J. McConnell
On Mon, Dec 15, 2008 at 7:33 PM, Rich Hickey richhic...@gmail.com wrote: When pulling new Clojure from SVN, please do: ant clean ant So you know you have a consistent build. If the supported way to build Clojure is to clean before the build, can we just have the init target depend on

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-16 Thread J. McConnell
On Tue, Dec 16, 2008 at 11:23 AM, Randall R Schulz rsch...@sonic.net wrote: It is also the case that empty lists are self-evaluating: user= ''() (quote ()) user= '() () user= () () Ahhh, good to know. Thanks! - J. --~--~-~--~~~---~--~~ You received

Re: Does ANTS.CLJ still work?

2008-12-16 Thread Chouser
On Mon, Dec 15, 2008 at 11:54 AM, Peter Wolf opus...@gmail.com wrote: I get the following error when I try ANTS.CLJ. Has something changed? Recent Clojure from SVN and a recent download of ants.clj from the google group seem to work fine together for me. --Chouser

Re: Listen on changes to refs

2008-12-16 Thread Timothy Pratley
SS wrote a cells that works on refs quite a while ago: http://groups.google.com/group/clojure/browse_thread/thread/d79392e4c79f8cde/f92eae422e4086c5?lnk=gstq=cells+refs#f92eae422e4086c5 If you search the group for cells you'll find quite a bit of discussion

building with Ant vs building with Maven

2008-12-16 Thread kkw
Hi folks, When I run 'mvn install' from the clojure\trunk directory (svn 1160), Maven creates: 16/12/2008 10:37 PM 519,267 clojure-lang-1.0-SNAPSHOT.jar When I run 'ant' from the clojure\trunk directory (svn 1160), Ant creates: 16/12/2008 10:37 PM 1,393,895

Re: Best Way to Ensure a Call to (shutdown-agents)?

2008-12-16 Thread MikeM
You can try this: (let [t (new Thread (fn[] (shutdown-agents)))] (.. java.lang.Runtime (getRuntime) (addShutdownHook t))) It works for me, but seems to take a long time to complete the shutdown. Your question made me wonder if the agent thread pools should use daemon threads - then this

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-16 Thread Stuart Sierra
Thanks, Lennart. That works, although it took me a few minutes to figure out why. (For the record, tree-seq returns a copy of its argument as the first item in the sequence.) This also means that (flatten string) ;= (\s \t \r \i \n \g) I've put in a patch. -Stuart Sierra On Dec 15,

Re: License of/permission for Clojure's logo

2008-12-16 Thread Dudley Flanders
On Dec 16, 2008, at 8:37 AM, Tom Hickey wrote: Hey Rich, Eric and I were also wondering if the logo was under the same license as Clojure itself. If it is, should this be explicitly stated somewhere? I think using a license designed for code is slightly inappropriate for artwork. I

Re: Initialize java.util.TreeSet/TreeMap using clojure set/map value

2008-12-16 Thread Rich Hickey
On Tue, Dec 16, 2008 at 12:11 AM, Feng hou...@gmail.com wrote: Hi, Because clojure set, vector and map all implements java.util.Comparator (indirectly via AFn), they interact with java.util.TreeSet/TreeMap in surprising way due to overloaded ctor (java.util.Comparator). user= (def s

Re: License of/permission for Clojure's logo

2008-12-16 Thread Tom Hickey
Hey Rich, Eric and I were also wondering if the logo was under the same license as Clojure itself. If it is, should this be explicitly stated somewhere? Thanks, Tom On Dec 9, 1:03 am, samppi rbysam...@gmail.com wrote: I've uploaded thelogo'sglyph and added it to Clojure's article. However,

Re: Gorilla: key combinations

2008-12-16 Thread Drew Olson
On Mon, Dec 15, 2008 at 10:08 PM, Alex Burka zapper3...@gmail.com wrote: Thanks for Gorilla. I am using it with MacVim. One (or :bug :pebkac) report... I put plugin/gorilla.vim in /Applications/MacVim.app/Contents/ Resources/vim/runtime/plugin/ and it seems to be loaded when MacVim starts.

Is clojure.core/require documentation out of date ?

2008-12-16 Thread lpetit
Hello, I try to fill the gap from when I discovered clojure several months ago, and I'm trying to understand the lib vs namespace stuff. I go straight to what I consider may be the primary source of documentation by calling (doc require), and I see this : 'require loads a lib by loading its

ClassName. Constructor Notation in Macros?

2008-12-16 Thread Randall R Schulz
Hi, A couple of days ago I was having a lot of trouble getting the (ClassName. ctor-args...) form of constructors to work while (new ClassName ctor-args...) was fine. It eventually occurred to me that the problem had to do with those constructor calls being in macro bodies. Now it turns out

Re: Patch: precompiling Clojure core sources in Ant build script

2008-12-16 Thread Bill Clementson
FYI - I forwarded the patch to Jeffrey Chu and he has patched swank-clojure in git. - Bill On Sun, Dec 14, 2008 at 2:20 PM, Feng hou...@gmail.com wrote: This is due to the change in clojure svn 1158. (.method ClassName ...) syntax has been changed to call java.lang.Class method for

Re: Emtpy (filter ...) Result Yields nil; Could / Should It Be An Empty List?

2008-12-16 Thread J. McConnell
On Tue, Dec 16, 2008 at 11:59 AM, Mon Key s...@derbycityprints.com wrote: This is why flatten's behavior was considered a bug. In Clojure, an empty sequence is equivalent to nil, not to '(nil). This does not comport with the various differences enumerated @ http://clojure.org/lisps Perhaps

Re: Listen on changes to refs

2008-12-16 Thread Rowdy Rednose
There must be a smarter way to achieve this than polling the collection for changes, I guess. On 16 Dez., 21:43, Dave Griffith dave.l.griff...@gmail.com wrote: Right now, you add listeners to agents, but not refs. IIRC, there was talk of adding listeners to refs to enable just the sort of

Re: Problems with gen-and-load-class (defn user-exception-test [] (try (throw (new user.UserException msg: user exception was here!!)) (catch user.UserException e (prn caught exception e)) (fina

2008-12-16 Thread Chouser
On Sun, Dec 14, 2008 at 4:29 PM, Tommy t...@aia.dk wrote: Hello. I am having problems with gen-and-load-class. I have a file with an example from the wiki book: (gen-and-load-class 'user.UserException :extends Exception) (defn user-exception-test [] (try (throw (new

ants.clj demo and old single core CPU

2008-12-16 Thread prhlava
Hello, Is the ants.clj supposed to work on single core ~700MHZ CPU? The program loads and runs, but all ants stay at home (but the CPU is busy). I am using latest svn version of clojure on: java version 1.6.0_0 IcedTea6 1.3.1 Runtime Environment (build 1.6.0_0-b12) OpenJDK Client VM (build

Re: Listen on changes to refs

2008-12-16 Thread Dave Griffith
Right now, you add listeners to agents, but not refs. IIRC, there was talk of adding listeners to refs to enable just the sort of reactive programming you describe, but I don't know the status. --~--~-~--~~~---~--~~ You received this message because you are

Re: ants.clj demo and old single core CPU

2008-12-16 Thread prhlava
Well, Reducing the number of ants helped and it works... Vlad --~--~-~--~~~---~--~~ 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 To unsubscribe from this

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#

Blogging About Clojure?

2008-12-16 Thread Randall R Schulz
Hi, Wordy though I am, I've never done any blogging before, but now that I'm finally beginning to get up-to-speed on Clojure, I think I might have some things to say. So I was wondering if anyone could recommend a good blog site for this purpose? Naturally, I'll want to include source code,

Re: Microsoft SQL Server and the sql contrib

2008-12-16 Thread MikeM
To make sure your driver is really on the classpath, try this from the REPL: (. Class (forName com.microsoft.sqlserver.jdbc.SQLServerDriver)) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post

Re: ClassName. Constructor Notation in Macros?

2008-12-16 Thread Stuart Halloway
Hi Randall, The syntactic sugar forms are reader behavior, and occur too soon: at read time, not macro expansion time. Macros need to expand to real forms, not reader shortcuts. Stuart Hi, A couple of days ago I was having a lot of trouble getting the (ClassName. ctor-args...) form of

Re: ClassName. Constructor Notation in Macros?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 11:32, Stuart Halloway wrote: Hi, ... However, I am left wondering what exactly is the interaction that was causing the dot-suffix form of the constructor call to fail in a macro expansion. I sense it has to do with the fact that symbols (other than

Re: ClassName. Constructor Notation in Macros?

2008-12-16 Thread Rich Hickey
On Dec 16, 2:32 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: Hi Randall, The syntactic sugar forms are reader behavior, and occur too soon: at read time, not macro expansion time. Actually, the dot sugar is not reader magic, but macroexpansion, as documented here:

Re: ClassName. Constructor Notation in Macros?

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 12:37, Rich Hickey wrote: On Dec 16, 2:32 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: Hi Randall, The syntactic sugar forms are reader behavior, and occur too soon: at read time, not macro expansion time. ... Macros need to expand to real forms,

Re: building with Ant vs building with Maven

2008-12-16 Thread kkw
Thanks Meikel and Dave! Much appreciated. Kev On Dec 17, 12:13 am, Dave Newton newton.d...@yahoo.com wrote: --- On Tue, 12/16/08, kkw kevin.k@gmail.com wrote: Since the Ant-built file is bigger, should I build using Ant instead of Maven? It looks like the Ant build is compiling

Re: ClassName. Constructor Notation in Macros?

2008-12-16 Thread Stuart Halloway
This is confusing. First, if you read the docs, they begin with: - (Classname. args*) (new Classname args*) Special form. - Only if you read further do you discover that (Classname. args*) is not a special form but a macro.

confused by Vars, Refs, Agents and Atoms

2008-12-16 Thread falcon
I am fairly familiar with basic functional programming. I've studied a bit of scheme and Haskell. I don't quite understand Vars, Refs, Agents and Atoms. I am a Java developer and have worked with concurrency constructs: locks, synchronized, Executor framework, etc. I've read a couple of

reload library, blowing away old public symbols

2008-12-16 Thread Stuart Halloway
Hi all, I sometimes need to (re)load a library, removing public symbols from previously loaded version of the same lib: (defmacro ns-reload! [ns] `(do (if (find-ns '~ns) (doseq [s# (keys (ns-publics '~ns))] (ns-unmap '~ns s#))) (require :reload-all '~ns))) Use case:

Re: Microsoft SQL Server and the sql contrib

2008-12-16 Thread Scott Jaderholm
I don't think that's a problem: user (. Class (forName com.microsoft.sqlserver.jdbc.SQLServerDriver)) com.microsoft.sqlserver.jdbc.SQLServerDriver On Tue, Dec 16, 2008 at 12:21 PM, MikeM michael.messini...@invista.comwrote: To make sure your driver is really on the classpath, try this from

Re: confused by Vars, Refs, Agents and Atoms

2008-12-16 Thread Andrew Baine
Check out http://blip.tv/file/812787/ which is a video presentation by Rich Hickey on clojure concurrency; it ends with an description of an ant simulation that uses refs and agents -- it really helped my own intuitive feel of when to use those two constructs. Best, Andrew

Re: confused by Vars, Refs, Agents and Atoms

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 13:54, Andrew Baine wrote: Check out http://blip.tv/file/812787/ ... Rich's video presentations are also available via the iTunes store. Search for Clojure, of course—you won't get any false hits. Best, Andrew Randall Schulz

Re: Clojure classes graph (was chart.png)

2008-12-16 Thread Randall R Schulz
On Sunday 14 December 2008 13:47, Chouser wrote: I've updated the Clojure classes graph (thanks for the push, R. Schulz!) The new version includes the newest classes as well as Java interfaces that are applicable. These latter are shown inside diamonds. ... I won't be maintaining the

Patch available: unifies entry points, fixes (read-line) for clojure.main/repl, provides source-only jar

2008-12-16 Thread Stephen C. Gilardi
The enclosed patch updates clojure.main to fix a bug and implement changes discussed here recently. Details below. Feedback welcome. --Steve [1] clojure.main no longer calls gen-class. Instead there is now a stub clojure.main class written in Java so it is always available with Clojure's

Re: reload library, blowing away old public symbols

2008-12-16 Thread Stuart Sierra
I would find this useful; I've even tried writing it in the past. Perhaps it could go in clojure.contrib.ns-utils. A thought -- would it be more thorough to use remove-ns? -the other Stuart (Sierra) On Dec 16, 4:32 pm, Stuart Halloway stuart.hallo...@gmail.com wrote: Hi all, I sometimes

Re: reload library, blowing away old public symbols

2008-12-16 Thread Allen Rohner
On Dec 16, 4:55 pm, Stuart Sierra the.stuart.sie...@gmail.com wrote: I would find this useful; I've even tried writing it in the past. Perhaps it could go in clojure.contrib.ns-utils. A thought -- would it be more thorough to use remove-ns? -the other Stuart (Sierra) On Dec 16, 4:32 pm,

creating new sequences

2008-12-16 Thread Mark Volkmann
If I create a new sequence by adding data to an existing one, does Clojure allow the two sequences to share data as opposed to copying the original sequence? For example, (def coll1 [1 2]) (def coll2 (cons 3 coll1)) Does coll2 share the data in coll1 or have a copy of it? I'm guessing the

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

2008-12-16 Thread lpetit
OK, thank you for the link. 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. In which ways does the notion of lib

Re: creating new sequences

2008-12-16 Thread Stephen C. Gilardi
On Dec 16, 2008, at 6:29 PM, Mark Volkmann wrote: If I create a new sequence by adding data to an existing one, does Clojure allow the two sequences to share data as opposed to copying the original sequence? For example, (def coll1 [1 2]) (def coll2 (cons 3 coll1)) Does coll2 share the data

Re: creating new sequences

2008-12-16 Thread Stephen C. Gilardi
On Dec 16, 2008, at 6:35 PM, Stephen C. Gilardi wrote: It shares the data--which is safe because of immutability and efficient because Rich designed and implemented Clojure's persistent data structures carefully and well. But Mark was talking about sequences, not persistent data

Re: Bug in unchecked operations?

2008-12-16 Thread J. McConnell
On Sun, Dec 14, 2008 at 3:24 PM, Michel Salim michel.syl...@gmail.com wrote: My mistake; unchecked operations work just fine if their arguments (including constants) are given type hints. What happens if unchecked- add/sub/... is given an argument of unknown type, though? It still seems to

clojure wrapper for Saxon XSLT 2.0 library

2008-12-16 Thread Perry Trolard
Hi All, For any of you who do XSLT 2.0 processing, I've written a simple Clojure wrapper around Saxon's (saxonica.com) high-level Java API. It's at http://github.com/pjt/saxon/tree/master Best, Perry --~--~-~--~~~---~--~~ You received this message

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 the

Re: question about (commute messages conj msg)

2008-12-16 Thread Randall R Schulz
On Tuesday 16 December 2008 18:10, wubbie wrote: Hello, My question is that conj takes two argument and how conj finds the first argument? Is it somehow provided by commute? Consider the documentation for (commute ...) (at http://clojure.org/api):

Re: question about (commute messages conj msg)

2008-12-16 Thread wubbie
Thanks Randall. My background is mostly in imperative languages, including perl and perl has closure, so it looks commute uses closure concept to implement this. Is it right? Thanks again, sun On Dec 16, 9:28 pm, Randall R Schulz rsch...@sonic.net wrote: On Tuesday 16 December 2008 18:10,