Re: Better documentation and error messages are needed for the ns macro

2009-11-13 Thread John Harrop
On Fri, Nov 13, 2009 at 1:23 PM, Chouser wrote: > On Wed, Nov 11, 2009 at 4:24 PM, John Harrop wrote: > > One question: how would Java class imports be dealt with? I think it > should > > be unified: > > (ns foo > > (uses java.io :only [File FileInputStream] :as io)) > > I think this is a bad

Re: Better documentation and error messages are needed for the ns macro

2009-11-13 Thread Chouser
On Wed, Nov 11, 2009 at 4:24 PM, John Harrop wrote: > One question: how would Java class imports be dealt with? I think it should > be unified: > (ns foo >   (uses java.io :only [File FileInputStream] :as io)) I think this is a bad idea. Java (or other host) classes are not Clojure functions, no

Re: Better documentation and error messages are needed for the ns macro

2009-11-13 Thread Andrew Boekhoff
With clojure-in-clojure on the horizon (if not around the corner) I wonder if an imports clause would be appropriate, and solve some of the complexities of discerning between clojure and java/clr/javascript/objectivec/(go?) (ns foo (uses clojure.contrib.repl-utils) (imports java.util [List M

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread Jason Wolfe
I like almost all of this a lot. My only disagreement is on prefix lists ... I wouldn't want to lose them, and in fact would prefer to see them extended to recursive prefix lists (trees). -Jason On Nov 11, 10:12 am, "Stephen C. Gilardi" wrote: > On Nov 10, 2009, at 9:08 PM, John Harrop wrote: >

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread John Harrop
On Wed, Nov 11, 2009 at 3:54 PM, Laurent PETIT wrote: > 2009/11/11 Andrew Boekhoff : > >> > (:uses [clojure.core :exclude [read]) > >> > [clojure.contrib.graph] > >> > [clojure.contrib.fcase] > >> > [clojure.contrib.stream-utils :as su] > >> > [clojure.contrib.def

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread Laurent PETIT
2009/11/11 Andrew Boekhoff : >> >  (:uses [clojure.core :exclude [read]) >> >         [clojure.contrib.graph] >> >         [clojure.contrib.fcase] >> >         [clojure.contrib.stream-utils :as su] >> >         [clojure.contrib.def :refer-all true] >> >         [clojure.contrib.except :refer-all tr

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread Christophe Grand
Hi! On Wed, Nov 11, 2009 at 7:12 PM, Stephen C. Gilardi wrote: > Here are some of the ideas I've liked best for how to do it. I like where this is heading. > - don't "refer" any names from the target namespace into the current > namespace by default YES! >  - support ":only []", ":rename {}",

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread Chouser
On Wed, Nov 11, 2009 at 1:12 PM, Stephen C. Gilardi wrote: > > Here are some of the ideas I've liked best for how to do it. Thanks for pulling this together. I like the whole direction you're going here. > - require that each "libspec" (reference to a lib) be a vector, disallowing > naked symbo

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread Andrew Boekhoff
> > (:uses [clojure.core :exclude [read]) > > [clojure.contrib.graph] > > [clojure.contrib.fcase] > > [clojure.contrib.stream-utils :as su] > > [clojure.contrib.def :refer-all true] > > [clojure.contrib.except :refer-all true] > > [clojure.contrib.se

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread John Harrop
On Wed, Nov 11, 2009 at 1:12 PM, Stephen C. Gilardi wrote: > Before: > > (:refer-clojure :exclude [read]) > (:require (clojure.contrib [graph :as graph] [fcase :as fcase]) >[clojure.contrib.stream-utils :as su]) > (:use [clojure.contrib def except server-socket] >clojure.con

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread Stephen C. Gilardi
On Nov 10, 2009, at 9:08 PM, John Harrop wrote: (ns foo.bar.baz (:use [clojure.contrib.core :only (seqable?)])) (and thus violates the usual clojure rule of using vectors rather than lists for groupings that are not invocations -- that is, function calls, macro calls, or special form cal

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread Miron Brezuleanu
Hello, On Wed, Nov 11, 2009 at 2:57 PM, Albert Cardona wrote: > YES please. If I could upvote this message I would. > > A half-a-dozen of examples on ns/in-ns and require/use/refer and the > differences in using them at the prompt or inside a ns would be > fantastic. Some more ns documentation i

Re: Better documentation and error messages are needed for the ns macro

2009-11-11 Thread Albert Cardona
YES please. If I could upvote this message I would. A half-a-dozen of examples on ns/in-ns and require/use/refer and the differences in using them at the prompt or inside a ns would be fantastic. The ns macro is one of the obscure corners of clojure. It relates to the java class path problem, and

Re: Better documentation and error messages are needed for the ns macro

2009-11-10 Thread David Brown
On Tue, Nov 10, 2009 at 09:08:31PM -0500, John Harrop wrote: >In case anyone was wondering, apparently it wants > >(ns foo.bar.baz > (:use [clojure.contrib.core :only (seqable?)])) > >(and thus violates the usual clojure rule of using vectors rather than lists >for groupings that are not invocati

Re: Better documentation and error messages are needed for the ns macro

2009-11-10 Thread John Harrop
On Tue, Nov 10, 2009 at 9:11 PM, Richard Newman wrote: > > (ns foo.bar.baz > > (:use [clojure.contrib.core :only (seqable?)])) > > > > (and thus violates the usual clojure rule of using vectors rather > > than lists for groupings that are not invocations -- that is, > > function calls, macro ca

Re: Better documentation and error messages are needed for the ns macro

2009-11-10 Thread Richard Newman
> (ns foo.bar.baz > (:use [clojure.contrib.core :only (seqable?)])) > > (and thus violates the usual clojure rule of using vectors rather > than lists for groupings that are not invocations -- that is, > function calls, macro calls, or special form calls). It works fine with a vector. user=

Better documentation and error messages are needed for the ns macro

2009-11-10 Thread John Harrop
So I have (ns foo.bar.baz) and I want to grab clojure.contrib.core/seqable? What do I do? (ns foo.bar.baz (use clojure.contrib.core :only seqable?)) # (ns foo.bar.baz (use [clojure.contrib.core :only seqable?])) # (ns foo.bar.baz (:use [clojure.contrib.core :only seqable?])) # etc.