It has worked like a charm.
Thanks.
Juan Manuel
On 11 abr, 16:45, Meikel Brandmeyer wrote:
> Hi,
>
> On 11 Apr., 16:35, babui wrote:
>
> > (ns b
> > (:use a :as mya))
>
> You want require here, not use. (ns b (:require [a :as mya]))
>
> Sincerely
> Meikel
--
You received this message bec
Hi,
On 11 Apr., 16:35, babui wrote:
> (ns b
> (:use a :as mya))
You want require here, not use. (ns b (:require [a :as mya]))
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@google
I'm having trouble avoiding name collisions with protocols. A third-
party librery defines:
(ns a)
(defprotocol PA
(fa [this ...])
(ga [this ..])
(ha [this ..])
.)
And i want to be able to use some of this protocol for a type I'm
defining. So I do
(ns b
(:use a :as mya))
(d
Do protocols respect namespace rewriting? For instance:
We define a protocol in a namespace:
(ns a)
(defprotocol P
(p [this]))
(defn g[] )
This works:
(ns b
On 6 abr, 00:02, Stuart Sierra wrote:
> You can omit clojure.core/first from your namespace like this:
>
> (ns your.namespace
You can omit clojure.core/first from your namespace like this:
(ns your.namespace
(:refer-clojure :exclude (first)))
Users of your library could do the same, and also `(:use your.namespace)` to
have access to your alternate definition of `first`.
-Stuart Sierra
clojure.com
--
You received t
You can't turn clojure.core/first into a protocol - it's already a
bare function. When you define a protocol with a first method, you
define a new function in your namespace called first, which delegates
to protocol implementations. The compiler is complaining that you're
shadowing clojure.core/fir
I'm trying out some protocol code. Here's what I'm trying:
(defprotocol AFirst
(first [s]))
this blows up with :
(defprotocol AFirst (first [f]))
Warning: protocol #'foo/AFirst is overwriting function first
WARNING: first already refers to: #'clojure.core/first in namespace:
foo, being replaced