>> (ns foo
>>  [require [clojure.string :as c]])

>> I've never seen that before. What does it do?

It's exactly the same as a normal require. Ns allows vectors/seqs
symbols/keywords to be used interchangeably. Some people use (:require)
others use (require), ns just uses ns/namespace to get the data on the
first of each item after the symbol.


Yeah, there's a bug in the code, but let me try to redefine the problem.
Assume I have a namespace called foo that defines a protocol (and hence an
interface) called bar. I then also have a namespace called foo.bar. How do
I tell the new syntax to import each? If I simply say "go get foo.bar" what
are you going to load, the .clj file, or the java interface?

Timothy


On Tue, Aug 6, 2013 at 9:39 AM, Phillip Lord
<phillip.l...@newcastle.ac.uk>wrote:

> Greg <g...@kinostudios.com> writes:
>
> >> I am dubious about distinguishing between lists and vectors. Currently,
> >> as far as I can tell, the ns is agnostic, and only cares about them
> >> being sequential. This is probably one of the sources of confusion for
> >> beginners -- they see both and don't see why
> >
> > The reason for distinguishing between lists and vectors is as you say,
> it's
> > confusing for beginnings. Also, it allows the syntax to have greater
> > functionality/power.
>
> Really dubious about this. Having to keep in my head when I need to use
> [] and when I need to use () is a significant problem when starting. It
> was my realisation that for the ns declaration you don't that made
> things easier.
>
> >> Also, I am confused as to how you distinguish between
> >> [core [matrix math bs]] being equivalent to :use while
> >> Is [one reload middleware] also :use? Or :require?
> >
> > Nested vectors = :use.
> >
> > Thus, as the comment says, [core [matrix math bs]] => (:use (core matrix
> math
> > bs))
> >
> > It's a bit confusing in the current syntax (if I have it correct),
> because
> > from it, it's not clear why "core" isn't "used".
> >
> > [one reload middleware]
> >
> > Is equivalent to:
> >
> > (:require [one.reload :as reload]
> >           [one.middleware :as middleware])
>
> Scares me to be honest. You now have an implicit alias ":as reload", and
> are distinguishing between having an alias and having no qualification
> by nesting or otherwise.
>
> I do like the idea of enforcing nesting though in
>
> [core [matrix math bs]]
>
> 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.
>
>
>


-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

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