I think the extend function is made exactly to support the concrete
implementation of protocols. It takes a type, and then any number of
protocol + function map pairs, where keyword names map to functions.
Checkout the protocol docs on assembla and look for extend:
On 8 Feb 2010, at 16:53, Boris Mizhen - 迷阵 wrote:
Hello all,
I am playing with the idea of a little library for dependency injection.
The idea is to declare injectable values as metadata-to-function map.
I started with a sketch of what the client code may look like.
Please let me know
On Tue, Feb 9, 2010 at 12:27 PM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
maybe I don't understand the problem. Why can't the system provide
some kind of local repository? The package system (deb, rpm, ports,
whatever) just installs the dependencies there. A wrapper script reads
in the
D'oh! Thanks.
I fall for that trap yet again. Sounds so simple when explained.
2010/2/9 Sean Devlin francoisdev...@gmail.com:
The problem is that map returns a lazy seq, and the lazy seq is
evaluated outside of the binding by the REPL. If you add a doall
inside the binding, it behaves as you
I agree, the error reporting from the compiler can often be hard to
dig through. Besides showing both the location of the macro
definition and its usage, it would be nice to hide all of the
clojure.lang.* calls in the stack trace by default, or fold them into
a single line. That way the user
On 09.02.2010, at 02:14, Stuart Sierra wrote:
On Feb 8, 6:13 pm, aria42 ari...@gmail.com wrote:
(defprotocol Span
(start [self])
(stop [self])
(span-length [self]))
Now I know I can just make span-length a function on Span as opposed
to part of the protocol. Is that what one should
Hi!
For example:
(ns exaple_class
(:gen-class))
(defn -main [args*] (...do smth...))
(defn -method_name1 [args*] (...do smth...))
(defn- -method_name2 [args*] (...do smth...))
(def -a 5)
(defn fun1 [args*] (...do smth...))
(defn- fun2 [args*] (...do smth...))
(def b 5)
As I understand, in
Hi,
On Feb 9, 4:22 pm, Аркадий Рост arkr...@gmail.com wrote:
For example:
(ns exaple_class
(:gen-class))
(defn -main [args*] (...do smth...))
(defn -method_name1 [args*] (...do smth...))
(defn- -method_name2 [args*] (...do smth...))
(def -a 5)
(defn fun1 [args*] (...do smth...))
Thaks for yor answer. It's really help me with studying.
--
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
Oh...So to make methods I must declare them in gen-class clause and if
some function wasn't include in gen-class clause, it wouldn't be a
method even if it had a prefix from gen-class clause.
I mean:
(ns example.class
(:gen-class
:prefix pre-
:methods [[method_name1 [... arg types here
And one more, when and why methods should be used? (except main)
--
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
Hi,
I also am confused about gen-class, looking for a pointer to some code
examples.
Thanks,
Brian
??? wrote:
Oh...So to make methods I must declare them in gen-class clause and if
some function wasn't include in gen-class clause, it wouldn't be a
method even if it had a prefix
On Mon, Feb 8, 2010 at 8:37 PM, Wardrop t...@tomwardrop.com wrote:
That seems like what I'm after, thanks. I assume this would be pretty
reliable across all platforms running the JVM.
By the way, I did google the Java API with various keywords but never
cam across this object property.
It
That's exactly what Debian does. For every Java package also provide
the maven xml file and the jar is discoverable from maven. The
installed packages on the local system acts as a local maven repo.
http://wiki.debian.org/Java/MavenRepoSpec
I see they also solved the problem of not
If this situation is common enough, shouldn't defprotocol support
optional implementations which are implicitly merged?
On Feb 9, 6:01 am, Konrad Hinsen konrad.hin...@fastmail.net wrote:
On 09.02.2010, at 02:14, Stuart Sierra wrote:
On Feb 8, 6:13 pm, aria42 ari...@gmail.com wrote:
Hi,
I wrote up a post: http://tr.im/NwCL
Hope it helps.
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@googlegroups.com
Note that posts from new members are moderated - please be patient
Hi,
Am 09.02.2010 um 18:10 schrieb Аркадий Рост:
Oh...So to make methods I must declare them in gen-class clause and if
some function wasn't include in gen-class clause, it wouldn't be a
method even if it had a prefix from gen-class clause.
I mean:
(ns example.class
(:gen-class
:prefix
On 9 Feb 2010, at 22:29, aria42 wrote:
If this situation is common enough, shouldn't defprotocol support
optional implementations which are implicitly merged?
Yes, if it is common enough. It's perhaps too early to decide.
Konrad.
--
You received this message because you are subscribed to
18 matches
Mail list logo