Re: Setting Compiler.LOADER or USE_CONTEXT_CLASSLOADER before initialization

2010-03-22 Thread J. McConnell
On Mon, Mar 22, 2010 at 7:42 AM, Paul Ingles wrote: > > I'm trying to find a way of ensuring that when the Clojure runtime > kicks in the class loader can be bound to something provided from the > Java adapter side (see > > http://github.com/pingles/crawly/blob/master/src/com/eightylegs/customer/

Re: Mocking?

2009-09-27 Thread J. McConnell
On Sun, Sep 27, 2009 at 12:55 AM, Mark Derricutt wrote: > > > How are people handling mocking/stubbing in clojure? > For mocking clojure code, I would have a look at clojure.contrib.mock (1). I haven't used it, but plan to check it out soon. Recently, while doing some performance testing of some

Re: Class function alwayrs returns java.lang.class??

2009-09-10 Thread J. McConnell
On Thu, Sep 10, 2009 at 1:20 PM, Seth Burleigh wrote: > Ah. So class returns the class of the instance, and does not find the > class with the name given. > Yes. > So , if I wanted to get the class of a ExecutionEvent, I would > > Have to go (Class/forName "org.eclipse.core.commands.ExecutionEv

Re: clojureshell-maven-plugin - easier clojure startup with maven

2009-09-04 Thread J. McConnell
On Fri, Sep 4, 2009 at 3:35 AM, Fredrik Appelberg < fredrik.appelb...@gmail.com> wrote: > On Fri, Sep 4, 2009 at 3:58 AM, J. McConnell wrote: > >> On Thu, Sep 3, 2009 at 12:40 PM, Fredrik Appelberg < >> fredrik.appelb...@gmail.com> wrote: >> >>> >&

Re: clojureshell-maven-plugin - easier clojure startup with maven

2009-09-03 Thread J. McConnell
On Thu, Sep 3, 2009 at 12:40 PM, Fredrik Appelberg < fredrik.appelb...@gmail.com> wrote: > > I've just released the first tentative version of Clojureshell. It's a > simple maven plugin that allows you to easily start a clojure REPL or run a > Swank server in the context of any maven project. Th

Re: Unable to build a simple project with clojure-ant-tasks

2009-08-30 Thread J. McConnell
On Sun, Aug 30, 2009 at 1:02 PM, Ivan Chernetsky wrote: > 2009/8/30 J. McConnell : > > > What versions of Clojure and Clojure-Contrib are you using? > > The freshest ones. This appears to be the problem. If I use the HEAD version of Clojure, I get the same error and it goes

Re: Unable to build a simple project with clojure-ant-tasks

2009-08-30 Thread J. McConnell
On Sun, Aug 30, 2009 at 10:15 AM, Ivan Chernetsky wrote: > > Either of clojure/core.clj and clojure/core__init.class is on > classpath, I think. What am I doing wrong? > Hmmm ... This builds fine for me (with the inclusion of edn.main in the element). I've uploaded what I have here so you can t

Re: How to migrate definitions to another namespace ?

2009-08-28 Thread J. McConnell
On Aug 28, 2009, at 11:55 PM, Vagif Verdi wrote: > > I often refactor my code and move some functions to new modules. > Unfortunately i cannot load them, because clojure says that function > with such name is already loaded from another namespace. I could not > find nothing better but to close my

Re: with-open should use a close multimethod?

2009-08-28 Thread J. McConnell
+1 On Fri, Aug 28, 2009 at 4:27 AM, Mike Hinchey wrote: > I have a suggestion for the with-open macro. It calls .close when it's > finished. I'd like it to have a (defmulti close type) so it's behavior is > extensible. A standard method could be defined for java.io.Closeable and a > :default

Re: XML vs. JSON

2009-08-25 Thread J. McConnell
On Tue, Aug 25, 2009 at 10:24 AM, Licenser wrote: > > I wonder what is the reason clojure uses XML standard wise and not > JSON. I don't think Clojure has standardized in any way on XML. There just happens to be an XML parsing lib in Clojure proper because it's a useful thing to have. There is

Re: Annotations and gen-class

2009-08-24 Thread J. McConnell
On Mon, Aug 24, 2009 at 3:00 AM, ngocdaothanh wrote: > > I'm new to Clojure. How can I add @ChannelPipelineCoverage("one") > annotation to a proxy as in? > > http://viewvc.jboss.org/cgi-bin/viewvc.cgi/netty/trunk/src/main/java/org/jboss/netty/example/http/snoop/HttpResponseHandler.java?view=markup

Re: Quirk with filter

2009-08-18 Thread J. McConnell
On Tue, Aug 18, 2009 at 7:37 PM, Sean Devlin wrote: > > user=> (filter #{false} [true false false true]) > () > > Obviously, this is not what I intended. The best I could do was the > following > > user=> (filter (comp not nil? #{false}) [true false false true]) > (false false) > > Does anyone el

Re: deadlocks and race conditions

2009-08-17 Thread J. McConnell
On Mon, Aug 17, 2009 at 1:56 PM, Mark Volkmann wrote: > > Does Clojure STM eliminate the possibility of deadlock? When two > transactions have a contention for the same Ref, Clojure gives > preference to the transaction that has been running the longest > (unless it has only been running for a ver

Re: Problems with AOT compiled Clojure on Azul

2009-08-14 Thread J. McConnell
On Fri, Aug 14, 2009 at 1:04 AM, Krukow wrote: > > When running the AOT compiled Clojure (clojure.jar) on an Azul box I > get an error during startup (in particular in the class-initializer > for clojure.main). This error does not occur in the clojure-slim.jar. > The stacktrace is this: > > k...@

Re: ANN: Clojure Ant Tasks

2009-08-12 Thread J. McConnell
On Wed, Aug 12, 2009 at 12:03 PM, J. McConnell wrote: > On Wed, Aug 12, 2009 at 4:00 AM, C. Florian Ebeling < > florian.ebel...@gmail.com> wrote: > >> >> Thanks for sharing this. What I miss a bit is the ability to set the >> *compile-path* to something other

Re: ANN: Clojure Ant Tasks

2009-08-12 Thread J. McConnell
On Mon, Aug 10, 2009 at 9:07 AM, Chas Emerick wrote: > > We have a couple of ant macros that do all of our clojure building for us > (including auto-detecting namespaces within source directories, compiling > only those clojure files that have changed since the last build, etc). > I've added sup

Re: ANN: Clojure Ant Tasks

2009-08-12 Thread J. McConnell
On Wed, Aug 12, 2009 at 4:00 AM, C. Florian Ebeling < florian.ebel...@gmail.com> wrote: > > Thanks for sharing this. What I miss a bit is the ability to set the > *compile-path* to something other than "classes". Thanks for your input! Yes, this was always planned, I just didn't have a need for

Re: ANN: Clojure Ant Tasks

2009-08-10 Thread J. McConnell
On Mon, Aug 10, 2009 at 9:07 AM, Chas Emerick wrote: > Looks like a good start. I initially didn't grok what was going on, until > I realized that you were aiming for an "actual" ant library. > Yes, I wasn't very familiar with Ant Tasks (as in org.apache.tools.ant.Task) or macros until I looked

Re: ANN: Clojure Ant Tasks

2009-08-10 Thread J. McConnell
sembla.com/spaces/clojure/tickets/168 > > Regards, > > -- > Laurent > > 2009/8/10 J. McConnell > > Most of the Ant setups I've seen for building and testing Clojure code, >> including some of my own, have suffered from the fact that compilation and >> test

ANN: Clojure Ant Tasks

2009-08-09 Thread J. McConnell
Most of the Ant setups I've seen for building and testing Clojure code, including some of my own, have suffered from the fact that compilation and test failures still result in a "Successful" build in Ant's eyes. This can be confusing at best, but can cause real problems if you aren't paying close

Re: REQUEST: Add seqable? to core

2009-07-29 Thread J. McConnell
On Wed, Jul 29, 2009 at 11:06 PM, John Harrop wrote: > How about defining seqable? in terms of whether seq works, using try catch? > I think this is the only DRY way to do it, but I know Rich has expressed in the past the he does not approve of using exception handling as a form of flow control.

Re: Clojure knows what is a pure function?

2009-07-27 Thread J. McConnell
No, this is not currently possible. One problem is that in a call like (foo bar), it is not possible at compile time to determine bar's type and it may very well be an impure function. Regards, - J. On Mon, Jul 27, 2009 at 10:30 AM, André wrote: > > Hi to everyone, it's my first post here on t

Re: Bug with struct-maps and *print-dup*

2009-07-10 Thread J. McConnell
On Thu, Jul 9, 2009 at 11:31 PM, Mark Engelberg wrote: > > I'm running Clojure 1.0. > > Could someone please check and see whether this is still a bug in the > most current version? Yup, I still see the same behavior in HEAD. - J. --~--~-~--~~~---~--~~ You receiv

Re: Best way to create nonref variable?

2009-07-09 Thread J. McConnell
On Thu, Jul 9, 2009 at 7:56 PM, Conrad wrote: > > I'm trying to optimize an inner loop and need a variable that mutates > to make this work. It does NOT need to be a thread-safe variable. > What's the best way to create a "plain ol' mutating variable" in > Clojure? I know I can always use an Atom,

Re: The API docs are gone!

2009-06-27 Thread J. McConnell
On Jun 27, 2009, at 12:28 PM, Four of Seventeen wrote: > > On Jun 27, 1:53 am, CuppoJava wrote: >> It was a server maintenance for wikispaces.org which is the hosting >> site for the Clojure website. > > But the Clojure website is clojure.org. NOT clojure.wikispaces.org or > something. DNS i

Re: Clojure and JAX-WS

2009-06-24 Thread J. McConnell
On Wed, Jun 24, 2009 at 5:15 AM, Rock wrote: > > I have almost succeeded in convincing the company I work for here in > Italy to give Clojure a try, and see if it can be adopted for an > important project. > > Now, the only problem is that, among other things, we need to > implement a SOAP web se

Re: Poll for a new name for clojure eclipse plugin 'clojure-dev'

2009-06-23 Thread J. McConnell
On Tue, Jun 23, 2009 at 7:47 AM, Laurent PETIT wrote: > > Would you help us find a new name, by giving ideas of voting for your > favorite ? enclave: n. A distinctly bounded area enclosed within a larger unit. - J. --~--~-~--~~~---~--~~ You received this messag

Re: Is it possible to tweak *compile-path* ?

2009-06-22 Thread J. McConnell
On Mon, Jun 22, 2009 at 7:15 AM, Thibaut Barrère wrote: > > I read that I should be able to change *compile-path* (I'd like to set > it to the same folder where the .clj files is). > > Is it possible and how can I achieve that ? Yup, you can either using binding to create a thread-local value fo

Re: Which map access is more idiomatic

2009-06-18 Thread J. McConnell
On Thu, Jun 18, 2009 at 7:30 PM, Howard Lewis Ship wrote: > > I have code that gets passed a map (actually a struct-map), should I > > (my-map :my-key) > or > (:my-key my-map) > > I'm beginning to gravitate towards the latter, as it is more tolerant of the > map being nil. I tend to prefer the

Re: Adding source file information to compiler exceptions

2009-06-17 Thread J. McConnell
On Wed, Jun 17, 2009 at 2:55 PM, vseguip wrote: > > or is there a preferred way to communicate patches? This is new: http://clojure.org/patches - J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: No OO restrictions is good. why not still add dependency injection?

2009-06-16 Thread J. McConnell
On Tue, Jun 16, 2009 at 12:18 PM, hari sujathan wrote: > > I was trying to look from some mathematical concepts by representing - > OOP's inheritance by tree/graph structurtes(tree for single , and > graph > for multiple inheritence) with classes acting as  each node. > With functional programmin

Re: breaking early from a "tight loop"

2009-06-12 Thread J. McConnell
On Fri, Jun 12, 2009 at 12:35 PM, joshua-choi wrote: > > Is the function of the "filter identity" call to make (map > isInteresting pixels) a lazy sequence? I thought that the sequences > map returned were already lazy, but I could be mistaken. I believe the idea is that mapping isInteresting o

Re: Why is this using reflection?

2009-06-08 Thread J. McConnell
On Mon, Jun 8, 2009 at 11:41 AM, tsuraan wrote: > > > I thought it might be fun to try out the new repl-utils expression-info > fn > > on > > this. > > Is this just in source control, or is it in a release? I'm using > 1.0.0, and I don't seem to have that function. repl-utils is a library in c

Re: VimClojure v2.1.1 is released

2009-06-08 Thread J. McConnell
On Sun, Jun 7, 2009 at 6:37 PM, Meikel Brandmeyer wrote: > Am 07.06.2009 um 17:41 schrieb Emeka: > >> And it took Meikel three weeks to make out time to talk to me. >> > > Huh? Did I miss something? Meikel, You've been incredibly open and helpful on this list and we all appreciate it. Thanks f

Re: New library 'redis-clojure': Feedback and questions

2009-06-05 Thread J. McConnell
On Fri, Jun 5, 2009 at 2:09 PM, Ragnar Dahlén wrote: > > This turned out to be problematic since a couple of the commands have > the same names as some clojure.core functions, most notably get and > set. > > I solved this by checking if *ns* already contained a mapping for the > name, and if so,

Re: What's the function that checks if an object is "sequence-able"?

2009-06-03 Thread J. McConnell
On Wed, Jun 3, 2009 at 12:53 PM, CuppoJava wrote: > > Is there a function that will return true iff calling seq on it's > argument will not throw an error? I thought it was seq?, but (seq? [1 > 2 3]) returns false. I was looking for this the other day as well and didn't see it. However, this mig

Re: Slurping structs from file fails with whitespace string attributes

2009-05-29 Thread J. McConnell
On Thu, May 28, 2009 at 4:23 PM, Perttu wrote: > > I use a store-function like this: > > (defn store-customer-db [customer-db filename] > (spit filename (with-out-str (print customer-db I believe this is your problem. The print/println functions print in a format suitable for human consump

Re: The dreaded "Dont' know how to create ISeq from: Symbol"

2009-05-13 Thread J. McConnell
On Wed, May 13, 2009 at 1:09 PM, Stephen C. Gilardi wrote: > > On May 13, 2009, at 11:57 AM, Juergen Gmeiner wrote: > >> I don't think it would be a good idea to print out the coll in every >> case - after all, it might be some >> huge Java collection that somehow is not seq-able.  But for >> jav

Re: More trouble with m-seq in a macro

2009-05-12 Thread J. McConnell
On Tue, May 12, 2009 at 11:22 AM, samppi wrote: > > Oh, no...I understand now—it looks like I've incorrectly explained my > problem. > > I want to use the macro like this: (a 1 2 3) equivalent to (m-seq [1 2 > 3]). > > Clojure 1.0.0- > user=> (use 'clojure.contrib.monads) > nil > user=> (defn a [

Re: Concerns About Pushing Clojure 1.0.0 to Maven Central Repo?

2009-05-07 Thread J. McConnell
> I guess only Rich can make the choice: statu quo, clojure (breaks > maven artifact id), clojure-lang (breaks build.xml). Not that I have a strong stake in this, but I'd vote for going with "clojure" and getting it right for 1.0. - J. --~--~-~--~~~---~--~~ You r

Re: keyword question

2009-01-09 Thread J. McConnell
On Fri, Jan 9, 2009 at 6:31 AM, Stuart Halloway wrote: > > From the docs: "Keywords are like symbols, except ... They cannot > contain '.' or name classes ..." > > What goes wrong with a keyword that contains "." or names a class? > Nothing blows up immdiately at the REPL: > > user=> :java.lang.

Re: test-is nesting

2008-12-30 Thread J. McConnell
On Mon, Dec 29, 2008 at 9:12 PM, Larrytheliquid wrote: > > This is what I'm thinking, let me explain: http://gist.github.com/41468 > (If you are familiar with RSpec, here is the equivalent RSpec example > http://rspec.info/examples.html) I really like the look of this so far. Nice work! > Anoth

Re: Best practice for handling errors inside macros?

2008-12-23 Thread J. McConnell
On Tue, Dec 23, 2008 at 1:38 PM, Meikel Brandmeyer wrote: > Am 23.12.2008 um 17:10 schrieb J. McConnell: > >> This was my intuitive guess as well. However, looking at condp, it >> seems that Rich prefers (at least in that case) option 2 (note the (= >> 0 n) clause in the

Re: Best practice for handling errors inside macros?

2008-12-23 Thread J. McConnell
On Tue, Dec 23, 2008 at 10:15 AM, Adam Harrison (Clojure) wrote: > > I have been trying to work out how best to validate the structure of > arguments passed into macros. It would appear that there are several > ways of tackling this and I was wondering which is considered best > practice. As an e

Re: Exercise: how to print multiplication table?

2008-12-22 Thread J. McConnell
2008/12/22 Brian Doyle : > > 2008/12/22 J. McConnell >> >> 1:1 user=> (defn multiplication-row [n k] >> (map (partial * k) (range 1 (inc n >> #'user/multiplication-row >> 1:3 user=> (defn multiplication-table [n] >> (map (partia

Re: namespace function

2008-12-22 Thread J. McConnell
On Mon, Dec 22, 2008 at 11:10 AM, Rich Hickey wrote: > > On Dec 22, 10:40 am, "Mark Volkmann" > wrote: >> On Mon, Dec 22, 2008 at 9:10 AM, Rich Hickey wrote: >> >> > On Dec 22, 8:55 am, "Mark Volkmann" wrote: >> >> >> I thought that every symbol and keyword was in some namespace, >> >> default

Re: Exercise: how to print multiplication table?

2008-12-22 Thread J. McConnell
On Mon, Dec 22, 2008 at 10:23 AM, Piotr 'Qertoip' Włodarek wrote: > > Being new to Clojure, to Lisp and to functional programming in > general, I have some trouble wraping my head around it. > > As the first exercice, I would like to print multiplication table of > specified order, like: > (print-

Re: How to encapsulate local state in closures

2008-12-22 Thread J. McConnell
On Mon, Dec 22, 2008 at 2:25 AM, Mark Engelberg wrote: > > Aside from the memoization example for > which it was invented, I am hard-pressed to think of a good use for > atoms. Not having used them myself, I can't think of many good examples either. However, one in addition to the cache example

Re: doc strings for multimethods?

2008-12-22 Thread J. McConnell
On Sun, Dec 21, 2008 at 12:07 AM, Jason wrote: > > Thanks all. The patch looks interesting to me, although I'd only use > it if it was integrated into the main build. You and me both ;) - J. --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: doc strings for multimethods?

2008-12-20 Thread J. McConnell
On Fri, Dec 19, 2008 at 8:05 PM, Jason wrote: > > Am I mistaken, or is there currently no nice syntax for giving doc > strings to methods? Sure, I can do > > (defmulti #^{:doc "documentation"} my-method my-dispatch-fn) > > but for consistency with defn and defmacro it would be nice to have a > d

Re: FAQ

2008-12-17 Thread J. McConnell
On Wed, Dec 17, 2008 at 12:06 PM, Rich Hickey wrote: > On Dec 17, 11:50 am, "J. McConnell" wrote: >> On Wed, Dec 17, 2008 at 10:32 AM, Rich Hickey wrote: >> >> > The Clojure FAQ will be here: >> >> >http://code.google.com/p/clojure/wiki/FAQ >

Re: FAQ

2008-12-17 Thread J. McConnell
On Wed, Dec 17, 2008 at 10:32 AM, Rich Hickey wrote: > > The Clojure FAQ will be here: > > http://code.google.com/p/clojure/wiki/FAQ > > Suggestions for entries welcome here. I recently found out about Google Moderator (http://moderator.appspot.com/), which might be a good fit here. From what I'

Re: Bug in unchecked operations?

2008-12-16 Thread J. McConnell
On Sun, Dec 14, 2008 at 3:24 PM, Michel Salim 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 work, though slowly.

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 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 they need to be

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 wrote: > > It is also the case that empty lists are self-evaluating: > > user=> ''() > (quote ()) > > user=> '() > () > > user=> () > () Ahhh, good to know. Thanks! - J. --~--~-~--~~~---~--~~ You received this m

Re: Getting Started with Gen-Class

2008-12-16 Thread J. McConnell
On Mon, Dec 15, 2008 at 7:33 PM, Rich Hickey 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 clean? Attached is

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 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? '(nil)) is true, since '

Re: Gorilla: Release of Version 1.1.0

2008-12-13 Thread J. McConnell
On Sat, Dec 13, 2008 at 11:17 AM, Brian Doyle wrote: > I'm sure I'm doing something stupid but I can't start up gorilla. > > Exception in thread "main" java.lang.NoClassDefFoundError: de/kotka/gorilla > Caused by: java.lang.ClassNotFoundException: de.kotka.gorilla > at java.net.URLClassLoader

Re: (use '[... and classpath

2008-12-12 Thread J. McConnell
On Fri, Dec 12, 2008 at 6:37 PM, Oscar Picasso wrote: > > java.io.FileNotFoundException: Could not locate closure/ You've got cloSure instead of cloJure. - J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cloju

Patch to get test-clojure up-to-date [Was: Re: clojure.contrib.test-is: first major rewrite]

2008-12-12 Thread J. McConnell
On Sun, Dec 7, 2008 at 10:51 AM, Stuart Sierra wrote: > > As of clojure-contrib SVN 283, there's a new clojure.contrib.test-is. > This is a pretty major rewrite of the library. I've tried to > streamline the code and make it easier to plug in custom reporting and > assertion functions. Unfortuna

Re: why can't I set! stuff in user.clj?

2008-12-12 Thread J. McConnell
On Fri, Dec 12, 2008 at 11:08 AM, Rich Hickey wrote: > On Fri, Dec 12, 2008 at 11:03 AM, Stephen C. Gilardi wrote: >> >> 'do' doesn't work when an early form uses a namespace and a later form >> depends on that. >> >> java -cp clojure.jar clojure.main -e "(use 'clojure.set)" -e "(union >> #{:a}

Re: XML Namespaces :xmlns, was Re: xml/parse

2008-12-12 Thread J. McConnell
On Fri, Dec 12, 2008 at 9:49 AM, J. McConnell wrote: > On Fri, Dec 12, 2008 at 9:39 AM, Chouser wrote: >> >> I think it's often desirable to also maintain (somewhere) the original >> document's shortcut names, and use those where applicable when >>

Re: XML Namespaces :xmlns, was Re: xml/parse

2008-12-12 Thread J. McConnell
On Fri, Dec 12, 2008 at 9:39 AM, Chouser wrote: > > On Fri, Dec 12, 2008 at 9:15 AM, J. McConnell wrote: >> >> {:tag :root, :attrs nil, :content [ >> {:tag :fragment, :attrs nil, :content [ >>{:tag :<http://purl.org/dc/elements/1.1/>:title, :attrs nil,

Re: XML Namespaces :xmlns, was Re: xml/parse

2008-12-12 Thread J. McConnell
On Thu, Dec 11, 2008 at 8:49 PM, Robert Koberg wrote: > > Given an XML structure like: > > http://purl.org/dc/elements/1.1/"; > > http://www.w3.org/1999/xhtml";> > A HEAD Title > A BODY Title > > http://www.w3.org/1999/xhtml";> > A HEAD Title > A BODY Title > > > > whi

Re: Learning Clojure

2008-12-10 Thread J. McConnell
On Wed, Dec 10, 2008 at 4:32 PM, Brian Will <[EMAIL PROTECTED]> wrote: > > A Java reference type is basically any type allocated on the heap. The > four Clojure reference types are particular Java reference types. My > complaint is this is exactly the sort of weirdness that causes > learners to sc

Re: In core structure editor, anyone?

2008-12-10 Thread J. McConnell
On Wed, Dec 10, 2008 at 4:06 PM, Chouser <[EMAIL PROTECTED]> wrote: > > I'm a vim user, but although I don't envy the multitude of > configuration issues it sound like emacs/slime/swank users seem to > have, I'm certainly a bit envious of the deep integration between repl > and editor. > > I wish

Re: In core structure editor, anyone?

2008-12-10 Thread J. McConnell
On Wed, Dec 10, 2008 at 3:35 PM, Chouser <[EMAIL PROTECTED]> wrote: > > It's by no means emacs *or even vim* yet Ouch, that hurts ;) - J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: Learning Clojure

2008-12-10 Thread J. McConnell
On Wed, Dec 10, 2008 at 1:27 PM, Brian W <[EMAIL PROTECTED]> wrote: > > Another issue I had is we don't have a good blanket term for Vars, > Refs, Agents, and Atoms. Rich sometimes calls them "reference types", > but that term already has a different meaning in Java. I considered > "meta-reference

Re: why can't I set! stuff in user.clj?

2008-12-10 Thread J. McConnell
On Wed, Dec 10, 2008 at 2:08 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote: > > Alternatively, we could make those hooks be functions that one can > (optionally) define in user.clj. The platform entry point would call them if > they exist: > (ns user) > (defn init > [] > (set! *compile-path

Re: Non-NS-qualified hierarchies

2008-12-09 Thread J. McConnell
On Tue, Dec 9, 2008 at 7:05 PM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > Thanks. I think it does a bit too much - I only want to relax the > requirement for namespace-qualification, not any of the other > assertions (e.g. that the participants are either Named or Classes, > can't be = etc). Righ

Re: clojure.contrib.test-is: first major rewrite

2008-12-08 Thread J. McConnell
On Mon, Dec 8, 2008 at 9:24 PM, Stuart Sierra <[EMAIL PROTECTED]> wrote: > > On Dec 8, 3:53 pm, "J. McConnell" <[EMAIL PROTECTED]> wrote: >> Great! Will the planned thrown-with-msg? support regex matching? I >> used something like that in clojure.contr

Re: Patch to add doc string support to defmulti [Was: (doc)strings after param in defn]

2008-12-08 Thread J. McConnell
On Mon, Dec 8, 2008 at 5:35 PM, Chouser <[EMAIL PROTECTED]> wrote: > > On Mon, Dec 8, 2008 at 3:40 PM, J. McConnell <[EMAIL PROTECTED]> wrote: > > > This is a breaking change for some (granted rather unsual) cases: > > (defmulti foo {:a 1 :b 2}) > (defmethod fo

Re: clojure.contrib.test-is: first major rewrite

2008-12-08 Thread J. McConnell
On Sun, Dec 7, 2008 at 10:51 AM, Stuart Sierra <[EMAIL PROTECTED]> wrote: > > 1. More "is" predicates, including regular expressions and "thrown- > with-msg?" Great! Will the planned thrown-with-msg? support regex matching? I used something like that in clojure.contrib.test-clojure.evaluation, wh

Patch to add doc string support to defmulti [Was: (doc)strings after param in defn]

2008-12-08 Thread J. McConnell
On Fri, Dec 5, 2008 at 9:22 AM, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > On Thursday 04 December 2008 23:23, Meikel Brandmeyer wrote: >> Hi, >> >> On 5 Dez., 00:38, Randall R Schulz <[EMAIL PROTECTED]> wrote: >> >> > And am I mistaken in my reading of the API docs for (defmulti ...) >> > and

Re: Non-NS-qualified hierarchies

2008-12-08 Thread J. McConnell
On Mon, Dec 8, 2008 at 9:05 AM, Rich Hickey <[EMAIL PROTECTED]> wrote: > > On Dec 7, 9:01 am, Mibu <[EMAIL PROTECTED]> wrote: >> Is it possible to remove the asserts in derive that restrict the >> parent and child to namespace-qualified names? >> >> It would be much more useful if the asserts are m

Re: (doc)strings after param in defn

2008-12-04 Thread J. McConnell
On Thu, Dec 4, 2008 at 6:45 PM, Mon Key <[EMAIL PROTECTED]> wrote: > > So, is it idiomatic Clojure to wrap docstring in a #^{}? > > e.g. is this considered bad form: > > (defn foo > "naked docstring is ok, but rather bad form while still nice for the > relative terseness of format" > [x] > (+ x 1)

Re: Building regex pattern literals (Noob question)

2008-12-03 Thread J. McConnell
On Wed, Dec 3, 2008 at 3:10 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > You're using a reader notation unrelated to regular expressions. > Instead, #(...) is a shorthand notation for an anonymous function > definition. You can read more about the other reader macros here: http://clojure.

Re: clojure.contrib.repl-ln available

2008-12-03 Thread J. McConnell
This looks awesome, great work Stephen! On Wed, Dec 3, 2008 at 9:27 AM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote: > > I was just about to do that, Randall. :-) > > clojure.contrib.repl-ln is a repl that supports lines and line > numbers. Here's a session that demonstrates it. > > --Steve > >

Re: Can Clojure functions be anonymous, curried and allow composition?

2008-11-25 Thread J. McConnell
On Mon, Nov 24, 2008 at 6:46 PM, Randall R Schulz <[EMAIL PROTECTED]> wrote: > > On Monday 24 November 2008 15:14, dokondr wrote: >> >> And what is 'comp'? > > When in doubt: > > - Clojure native API > > > - comp > Or: user=> (doc comp)

Re: Patch: universal main() with repl/script/compile

2008-11-25 Thread J. McConnell
On Tue, Nov 25, 2008 at 12:06 PM, Perry Trolard <[EMAIL PROTECTED]> wrote: > > Sorry -- inadvertent send: the Ant task is the first case that's gotta > work, so I think the best option is to catch the ClassNotFound > exception, unless there's another alternative I'm not thinking of I don't have a

Re: Patch: universal main() with repl/script/compile

2008-11-24 Thread J. McConnell
On Mon, Nov 24, 2008 at 1:49 PM, Michael Wood <[EMAIL PROTECTED]> wrote: > > This looks great :) Yes, it does! > On Mon, Nov 24, 2008 at 6:57 PM, Stephen C. Gilardi <[EMAIL PROTECTED]> wrote: > [...] > > Here are some examples of using the proposed clojure.main via "java - > > jar clojure.jar":

Re: Eclipse Plugin- any plans for this?

2008-11-22 Thread J. McConnell
On Sat, Nov 22, 2008 at 1:22 PM, lpetit <[EMAIL PROTECTED]> wrote: > > I thought about making an eclipse update site available for the current > state of the plugin. But for the moment I don't known where I could > host it. If it's any help, I have seen at least one other Eclipse plug-in host the

Re: Newbie: Creating a MapEntry

2008-11-21 Thread J. McConnell
On Fri, Nov 21, 2008 at 12:03 AM, samppi <[EMAIL PROTECTED]> wrote: > > Is it possible to create a MapEntry from scratch? The reason why I'm > asking is because I want to mess with sequences of two-sized vectors, > and it would be really cool if I could use the key and val functions > on them rath

Re: pattern matching in function parameters

2008-11-19 Thread J. McConnell
On Wed, Nov 19, 2008 at 4:16 PM, Mark Volkmann <[EMAIL PROTECTED]> wrote: > > I'm reading an excellent article on functional programming at > http://www.defmacro.org/ramblings/fp.html. Toward the end there is a > section on pattern matching. They give the following example which > uses a fictional

Re: Use of unprintable/readable values

2008-11-19 Thread J. McConnell
On Wed, Nov 19, 2008 at 10:01 AM, Rich Hickey <[EMAIL PROTECTED]> wrote: > On Nov 19, 9:01 am, "J. McConnell" <[EMAIL PROTECTED]> wrote: >> >> (eval (eval '(list + 1 2 3))) >> >> should I be testing to >> ensure that the above form prod

Use of unprintable/readable values

2008-11-19 Thread J. McConnell
In writing up tests for clojure.contrib.test-clojure that cover the Evaluation page of clojure.org, I came across the fact that the following threw a CompilerException due to a "java.lang.ClassNotFoundException: clojure._PLUS___224": (eval (eval '(list + 1 2 3))) After the AOT changes, this no l

Re: Alioth binary-tree benchmark

2008-11-18 Thread J. McConnell
On Tue, Nov 18, 2008 at 5:58 AM, Simon Brooke <[EMAIL PROTECTED]> wrote: > > However Giraud uses the Common > LISP ASH (arithmetic shift) function, and, if there's a built-in > function in Clojure, I did not find it; find-doc is your friend in this case: user=> (find-doc "shift") ---

Re: POLL: Domain name for project hosting site.

2008-11-17 Thread J. McConnell
I'm liking projecture On Mon, Nov 17, 2008 at 2:52 PM, Drew Crampsie <[EMAIL PROTECTED]> wrote: > > Hey All, > > I've finally found some time to start getting the project hosting site > together, and i need a name.. so lets put it to a vote. > > Here are some suggestions so far, but please feel f

Re: A question about test-is

2008-11-05 Thread J. McConnell
On Tue, Nov 4, 2008 at 8:47 PM, Chanwoo Yoo <[EMAIL PROTECTED]> wrote: > Thank you for your kind exaplanation. :) To a newbie like me, list and > vector seemed that they have no significant difference. No problem, I think everyone runs into these kinds of issues when they first look at Clojure. H

Re: STM criticisms from Bryan Cantrill (Sun)

2008-11-04 Thread J. McConnell
I just started reading through that article a couple days ago and a couple things jumped out at me right away with respect to Clojure. The most important, it seems, is that the STM system in Clojure is not the concurrency hammer for the language, immutable data structures are. All of the articles

Re: A question about test-is

2008-11-03 Thread J. McConnell
> I have one more trivial question. It seems good that Clojure > consistently manages all data structures as sequence. But operator > like 'assoc' can be applied to map and vector, except list and string. > I'm curious about the reason of this decision. What would (assoc (list 1 2 3) x y) mean? W

Re: Chimp Patch - MacroExpand command

2008-10-28 Thread J. McConnell
On Tue, Oct 28, 2008 at 4:44 PM, mb <[EMAIL PROTECTED]> wrote: > > I added \me for macroexpand and \m1 for macroexpand-1. Great, thanks Meikel! - J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group.

Chimp Patch - MacroExpand command

2008-10-28 Thread J. McConnell
For anyone using Meikel Brandmeyer's Chimp plugin for Vim, below is a patch that adds a MacroExpand command, which sends a (macroexpand-1 ...) for the inner s-expr. Hope someone finds it useful. - J. Index: chimp.vim === --- chimp.v

Re: use spit from clojure.contrib.duck_streams

2008-10-24 Thread J. McConnell
On Fri, Oct 24, 2008 at 9:44 AM, stephan <[EMAIL PROTECTED]> wrote: > > I downloaded the svn trunk of clojure-contrib, used ant to build the > jar-file, and copied that into a directory included in the classpath. Unfortunately, jars within directories in the classpath aren't picked up by the clas

Re: Vim syntax support for BigDecimal literals

2008-10-23 Thread J. McConnell
> Just a technical note: please consider diff -u or > diff -c for patches. It provides more context and > also helps in case the hunk moved in the meantime. Ahhh ... the -u is what I was looking for ... couldn't think of it. I'll remember that from now on, thanks! - J. --~--~-~--~~-

Vim syntax support for BigDecimal literals

2008-10-23 Thread J. McConnell
Here's a tiny patch against the VimClojure syntax file to allow Vim to recognize BigDecimal literals (numbers suffixed with "M"): kant[~/.vim/syntax]$ diff clojure.vim.orig clojure.vim 162c162 < syn match clojureNumber "\<-\?[0-9]\+\>" --- > syn match clojureNumber "\<-\?[0-9]\+M\?\>" Hope s

Re: Testing Clojure (was Re: Bug? Strange set equality (r1075))

2008-10-22 Thread J. McConnell
> Run tests with: > >(require 'clojure.contrib.test-clojure) I don't see clojure.contrib.test-clojure. Are you going to be committing that? Thanks, - J. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clo

Re: On macros

2008-10-21 Thread J. McConnell
On Tue, Oct 21, 2008 at 2:20 PM, Krukow <[EMAIL PROTECTED]> wrote: > > I was watching one of the presentation videos for Java programmers. > Rich mentions that > > ClassName. is a macro for (new ClassName), > > e.g., > > user> (macroexpand '(Object.)) > (new Object) > user> > > I was wondering how

Re: unit tests

2008-10-21 Thread J. McConnell
On Tue, Oct 21, 2008 at 12:34 PM, Timothy Pratley <[EMAIL PROTECTED]> wrote: > > I'm a bit stuck on how to load test_is... > I've added a tiny section to the wiki because I couldn't find any > instructions on using contrib, and well I made a lot of mistakes along > the way that other people might

Re: Modified doto

2008-10-21 Thread J. McConnell
> On 21 Okt., 17:24, Chouser <[EMAIL PROTECTED]> wrote: >> I don't see much wrong with "doto->", though "do-with" or "do->" might >> be okay. I'd probably vote against "do-unto-others-as" > I would vote for do-with. + 1 --~--~-~--~~~---~--~~ You received this mes

  1   2   >