Re: Monorepos with separate artifacts?

2017-05-01 Thread David McNeil
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 grou

Re: [ANN] Clojure 1.7.0-beta2

2015-04-24 Thread David McNeil
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 G

Re: Coding Standard - ns usage

2012-11-11 Thread David McNeil
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)." -Da

Coding Standard - ns usage

2012-11-08 Thread David McNeil
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

Re: Build Issues with Eclipse

2012-10-29 Thread David McNeil
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 clo

core.match - matching missing map values

2012-05-25 Thread David McNeil
[{:x (x :when #(= :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

Re: core.match - variable length match patterns

2012-05-18 Thread 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

core.match - variable length match patterns

2012-05-18 Thread David McNeil
>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.ma

Re: Trickiness with protocols and extends (1.3.0)

2011-10-29 Thread David McNeil
A couple of more thoughts on this. On Oct 28, 12:46 pm, Howard Lewis Ship 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 satisfy the As

Re: Trickiness with protocols and extends (1.3.0)

2011-10-28 Thread David McNeil
ress it at dev time in the blog post [1]. -David [1] http://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

Re: metadata for records

2011-10-01 Thread David McNeil
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 Gro

Revelytix hiring Clojure developers

2011-09-23 Thread David McNeil
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"

Re: Any ways to prevent protocol functions from being hardcoded in?

2011-07-08 Thread David McNeil
On Jul 2, 3:07 pm, Christophe Grand wrote: > Protocols are designed with the implementer in mind, not the user. > Sometimes user-facing API and implementer-facing API overlap but it's > not a given. So, from the user point of view, protocols are an > implementation detail, they are somewhat "low-l

Re: Any ways to prevent protocol functions from being hardcoded in?

2011-07-01 Thread David McNeil
On Jun 30, 7:54 am, Stuart Sierra 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 judging by this thread others

Re: Idiomatic use of records vs. maps

2011-05-31 Thread David McNeil
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 is

Clojure 1.3 - Embedding Java literal objects

2011-05-31 Thread David McNeil
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] # user=> (.getX #java.awt.Point[10 20]) CompilerException java.lang.Run

Re: eval'ing records

2011-04-16 Thread David McNeil
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 clojure@g

Re: partial vs anonymous function?

2011-04-16 Thread David McNeil
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 clojure@g

Re: def and ;dynamic

2011-04-15 Thread David McNeil
> 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 y

Re: def and ;dynamic

2011-04-15 Thread David McNeil
Try removing the "*" characters from the names. E.g change *session- manager-name* to session-manager. -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 membe

Re: eval'ing records

2011-04-14 Thread David McNeil
> 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

Re: partial vs anonymous function?

2011-04-14 Thread David McNeil
> Will this be any > better or worse: (defn m [f s] (fn [] (map f s))) then doing (foo) > instead of (eval foo)? Armando - Generally I agree that the "m" function you defined is clearly preferred over a solution based on eval. However, this is a special case (too much to relate) where I needed a f

eval'ing records

2011-04-14 Thread David McNeil
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

Re: partial vs anonymous function?

2011-04-14 Thread David McNeil
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 n

partial vs anonymous function?

2011-04-14 Thread David McNeil
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..

Re: Protocol functions & higher order functions

2011-04-06 Thread David McNeil
> 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

Protocol functions & higher order functions

2011-04-06 Thread David McNeil
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 pro

Re: Struct vs. Record: Now and Future

2011-01-28 Thread David McNeil
records more > pleasant. 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 &quo

Re: Reading back record instances

2011-01-26 Thread David McNeil
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 f

Re: disk-backed memoize?

2010-09-18 Thread David McNeil
> 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 beca

Re: disk-backed memoize?

2010-09-17 Thread David McNeil
> I highly recommend using redis for this. There is even a clojure redis client. > > http://github.com/ragnard/redis-clojure Thanks for the tip. It looks interesting, but in this case it is not appropriate to add a separate process to the mix. I need to find a good solution that is just a library.

disk-backed memoize?

2010-09-17 Thread David McNeil
Is there a disk-backed memoize available? I have an application where I would like the cache of values to survive restarts of the app. Thank you. -David McNeil -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, sen

Re: Protocol type hints - Java interface

2010-06-12 Thread David McNeil
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 to the

Protocol type hints - Java interface

2010-06-12 Thread David McNeil
s with gen-interface. Does anyone know if there are long term plans to use the hints to type the values in the interface? Or maybe I am just doing something wrong? Thanks. -David McNeil -- You received this message because you are subscribed to the Google Groups "Clojure" group. To pos

Re: Destructuring namespace qualified map keys

2010-05-13 Thread David McNeil
> (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 moder

Destructuring namespace qualified map keys

2010-05-13 Thread David McNeil
Is there a way to destructure namespace qualified map keys? I want to do something like this: (let [{:keys (y)} {:y 20}]) Except with namespace qualified keys: (let [{:keys (?)} {:x/y 20}]) Thank you. -David McNeil -- You received this message because you are subscribed to the Google Groups

Re: Cyclical refs fail on Clojure 1.2?

2010-05-11 Thread David McNeil
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. -D

Cyclical refs fail on Clojure 1.2?

2010-05-11 Thread David McNeil
fail. Can 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

ClojureQL - joining 3 tables

2010-05-04 Thread David McNeil
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, s

Defining a namespace inside a let

2010-04-27 Thread David McNeil
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 m

Re: Extending Java class in Clojure with multiple constructors

2010-04-19 Thread David McNeil
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 p

Extending Java class in Clojure with multiple constructors

2010-04-18 Thread David McNeil
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