Laurent PETIT <laurent.pe...@gmail.com> writes:
>> The same logic could suggest we remove "or" because we can express it
>> with "and" and "not".
>
> Except nobody complains about "or", "and" or "not" ;-)

Actually, they are a right pain when writing my library, because I
wanted to use them to mean something else. some was irritating for the
same reason.


>> And cause frustration for people who find typing
>>
>> (:require clojure.test :refer :all)
>>
>> when they used to type
>>
>> (:use clojure.test)
>
> Code is read more often than written.
> Clojure makes default choices "easy", and non default choices "harder"
> for a reason: to guide people.

And again, I an struggling to see when being able to write

(deftest hello 
  (is true))

is a bad thing. I agree, using many namespaces is problematic, I do
often use one.

>
> It's like the mantra "if you find it hard to write, you may be doing
> it wrong (though it's still possible to do)".
>
> Also, for the REPL, there will still be the (use 'clojure.tests) call
> that you can use in your REPL bootstrapping code.
>
>> To me, the discussion seems to be confused; I understand why making an
>> implementation simpler is important. But removing a simple declaration
>> to replace it with a more complex one doesn't seem to make things
>> simpler to me.
>
> I don't think I'm confused, AFAIC: I'm not even thinking from the
> implementation perspective, but from the consumer perspective.
> It's also psychological: if you remove :use, even at the cost of
> keeping :refer :all, that's one less top-level 'ns directive to
> remember.


I said the discussion was confused not you!

So far, I have see three main reasons for removing use.

1) It offends my idea of truth and beauty: only clojure.core should be
   unnamespaced. 

Counter argument 1: using deftest makes life a lot easier. And I have
files which have 100s of calls to a one namespace and none to
clojure.core. 

Counter argument 2: the functionality will remain anyway.

Counter argument 3: so, don't use it then.

2) ns is too complex

Counter Argument:

Yes, it is, and it does confuse newcomers. I got confused, not least
because it accepts both vectors and lists (so two syntaxes with no
difference AFAICT). So

(ns a 
 [:use b])

(ns a
 (:use b))

are the same.

It also has short cuts: so

 (:use [a.b.c]) is the same as 
 (:use [a.b c]), (use library "a.b.c")

 (:use [a.b c]) is different from 
 (:use [a b c]) (first is "use a.b.c" second is "use a.b and a.c").

It's got :as which means you need nesting. and you can combine this with
aliases. And I think you can drop the brackets so:

(ns a
  (:use [b]))

is the same as 

(ns a
  (:use b))

All of this remains. It's still going to be complex. 

Don't quote me on any of the statements made here; I was trying to do it
from memory to see if I remembered correctly.

3) Removing use will make things simpler

Counter Argument:

Only for people who don't use it, and they don't use it so who cares?
For people who do use it, we now have to do (:require x :refer :all)
instead of the more simple (:use x). And does refer all support exclude?
So can I do

(:require x :refer :all :exclude [a b c])?


> I agree that it is micro-optimization, but this counts too, noticeably
> because it's one of the first things a newcomer is confronted to when
> he starts seriously with the language.

I agree that it's good to simplify things. Confused as to how this
helps.

Phil

-- 
-- 
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 members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to