We have used a monorepo to produce multiple artifacts with lein as
described here:
http://david-mcneil.com/post/160191443293/using-lein-to-produce-multiple-artifacts-from-a
-David
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this
I did a real quick test on one of our projects. I had to upgrade to the
latest compojure (seems the old version used a version of instaparse that
wouldn't compile) but after that it seemed to work and was noticably faster.
-David
--
You received this message because you are subscribed to the
I have not heard from anyone that
http://dev.clojure.org/display/design/Library+Coding+Standards is out of
date, so I take that to mean that the following is still the standard:
Be explicit and minimalist about dependencies on other packages.
(Prefer the :only option to use and require).
I notice the following item at
http://dev.clojure.org/display/design/Library+Coding+Standards
Be explicit and minimalist about dependencies on other packages.
(Prefer the :only option to use and require).
The page was last edited on Mar 29, 2011 and ns usage has been discussed a
fair bit
Does this thread address your need?
https://groups.google.com/forum/?fromgroups=#!searchin/clojure/local$20repository$20/clojure/1Ne8RqiffVI/aGoCPWiiCakJ
-David
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
#(= :clojure.core.match/not-found
%))}]
[match x])
;;= [match nil]
I am curious: is this by design?
Thanks.
-David McNeil
--
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
From what I can see core.match does not support matching a variable length
series of values. For example, in a vector, match a series of 0-to-N values
of 1 followed by a value of 2. I am interested to know whether/how
match patterns like this would fit into core.match.
Thank you.
-David McNeil
On Friday, May 18, 2012 9:59:40 AM UTC-5, David Nolen wrote:
It sounds like you're describing searching for a pattern?
Yes, I think that sounds right. I am not sure how that fits into the
core.match picture.
Thanks.
-David McNeil
--
You received this message because you are subscribed
A couple of more thoughts on this.
On Oct 28, 12:46 pm, Howard Lewis Ship hls...@gmail.com wrote:
(extend-type cascade.Asset
ToAttributeValueString
(to-attribute-value-string [asset] (:client-url asset)))
The reason this is probably not what you really want is that the set
of types which
://david-mcneil.com/post/3495351254/clojure-protocol-adapters
[2] https://github.com/david-mcneil/clojure-adapt
--
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
Razvan Rotaru wrote:
Is there a way to attach metadata to defrecord ?
Is this what you are looking for?
(defrecord MyRecord [a b])
(let [r (with-meta (MyRecord. 1 2) {:extra 100})]
(meta r))
;;- {:extra 100}
-David
--
You received this message because you are subscribed to the Google
or semantic technology experience, but this is a
great place to get it!
If you are interested, email a note and your resume to careers _at_
revelytix.com.
[1] http://revelytix.com/
Thanks.
-David McNeil
--
You received this message because you are subscribed to the Google
Groups Clojure group
On Jun 30, 7:54 am, Stuart Sierra the.stuart.sie...@gmail.com wrote:
Recently the received wisdom has been: protocols are a low-level
implementation detail. Actual APIs should be built with normal functions
that call the protocol methods.
Stuart- I am a bit confused by this statement, and
I noticed the following behavior in Clojure 1.3 related to the new
object literal syntax [1]:
Clojure 1.3.0-master-SNAPSHOT
user= (defrecord Foo [a b])
user.Foo
user= (:a #user.Foo{:a 1 :b 2})
1
user= #java.awt.Point[10 20]
#Point java.awt.Point[x=10,y=20]
user= (.getX #java.awt.Point[10 20])
A couple of aspects of records that I have found useful:
* they provide a type for dispatching. Rather than rooting around in
the map to find out what it is, a multi-method can dispatch directly
on the type of the object.
* having a central definition of the main keys contained in the
structure
For those who duck it in the future, there is more discussion here:
http://groups.google.com/group/clojure-dev/browse_thread/thread/f4907ebca8ef6e11
-David
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
For those who duck it in the future, there is more discussion here:
http://groups.google.com/group/clojure-dev/browse_thread/thread/f4907ebca8ef6e11
-David
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Thank you for your solution, but can you explain why it works ?
As best I recall... in Clojure 1.3 vars are no longer dynamic by
default. In the short-term, to ease the pain of this change, Clojure
1.3 will automatically make vars with earmuffs (e.g. *foo*) into
dynamic variables. But it warns
I am puzzled by the results below. Can anyone explain the difference
in behavior?
-David
(defn mapper [f stream]
`(map ~f ~stream))
(eval (mapper #(+ 1 %) [10 11 12]))
;; - (11 12 13)
(eval (mapper (partial + 1) [10 11 12]))
;; - No matching ctor found for class clojure.core$partial...
Mark - Thanks. I am able to permute it to make it work. However, I
cannot explain why the original code fails.
-David
--
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
I have learned that instances of records do not eval to themselves.
This seems inconsistent to me. I am curious if this is intentional or
if it is a gap in the current record implementation in Clojure.
Thanks.
-David
(defn eval-type [x]
(class (eval x)))
;; instances of structural types
I remember reading about it in the Joy of Clojure. It may be fixed in the
future versions of Clojure.
Ivan - Thanks for the response. I checked Joy of Clojure and I see a
reference at the top of page 191 to the fact that records cannot be
printed and then eval'd. I was aware of this, however
The following code shows surprising behavior related to using protocol
functions in higher order functions. I sort of understand the reason
wrapped-x first fails is that calling extend-protocol in a sense
redefines the x protocol function. I can't decide if I think this is a
bug or just the way
I think not a bug. If you want indirection in your wrapper, you can ask for
it, e.g.:
(defn wrap [f]
(fn [ args]
(apply @f args)))
(def wrapped-x (wrap #'x))
Thank you!
-David
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
.
This is a snapshot of a defrecord2 implementation that I have been
using. Among other things it makes records print in an eval'able form.
https://github.com/david-mcneil/defrecord2
-David
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post
I discuss one solution to this problem here:
http://david-mcneil.com/post/958196603/enhanced-clojure-records-part-2
-David
--
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
http://github.com/alienscience/cache-dot-clj
Thanks for the link. That is helpful.
Would JDBC suit your needs as a storage medium?
I suppose that would work, but I am thinking that an ehcache based
plugin for cache-dot-clj might be a good solution.
-David
--
You received this message
David - Thanks for the tips on definterface and the new statics
feature. I will need to look into these because I am not familiar with
either. What is the difference between gen-interface and definterface?
Thanks.
-David McNeil
--
You received this message because you are subscribed
(let [{x :x/y} {:x/y 20}] x)
20
That will work. Thank you!
-David McNeil
--
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
anyone explain this?
Thank you.
-David McNeil
--
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
Peter-
Thanks for the tip. I was aware of the stack overflow issue you
described, but your comment motivated me to switch to using mvn
clojure:repl instead of mvn clojure:swank to test the code, and
this does appear to work (modulo the REPL printing issue).
Thank you.
-David McNeil
--
You
In ClojureQL I do not see how to join three or more tables using the
join function. Does anyone know if this is possible?
Thank you.
-David McNeil
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure
on with namespaces that I do not
understand and I hope that somewhere here can explain it.
Thank you.
-David McNeil
--
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
Stephan- Thank you, gen-class is what I needed.
-David
--
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
a macro to avoid duplicating the proxy definition.
My question is: is there a better way to accomplish this, perhaps
using a mechanism other than proxy?
Thank you.
-David McNeil
Person.java
=
package demo;
public class Person {
private int id = 0;
private String name;
public
35 matches
Mail list logo