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

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 jharrop...@gmail.com 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

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 chou...@gmail.com wrote: On Wed, Nov 11, 2009 at 4:24 PM, John Harrop jharrop...@gmail.com 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

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,

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 sapri...@gmail.com 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

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

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 squee...@mac.comwrote: 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]

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.server-socket

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 squee...@mac.com 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

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 squee...@mac.com 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 [],

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

2009-11-11 Thread Laurent PETIT
2009/11/11 Andrew Boekhoff boekho...@gmail.com:  (: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

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 laurent.pe...@gmail.comwrote: 2009/11/11 Andrew Boekhoff boekho...@gmail.com: (:uses [clojure.core :exclude [read]) [clojure.contrib.graph] [clojure.contrib.fcase] [clojure.contrib.stream-utils :as su]

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 squee...@mac.com wrote: On Nov 10, 2009, at 9:08 PM, John

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?)) #CompilerException java.lang.IllegalArgumentException: Don't know how to create ISeq from: Boolean (NO_SOURCE_FILE:0) (ns foo.bar.baz (use

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= (ns

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 holyg...@gmail.com 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,

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 invocations --