Re: Interop: mutability vs. inheritance

2015-05-27 Thread Tassilo Horn
Mars0i writes: > Is the following correct? > > The only way to define *multiple* mutable instance variables/fields > for a class visible in Java is by using deftype with :volatile-mutable > or :unsynchronized-mutable. The only way to inherit from a concrete > Java class is by using gen-class or

Re: {ANN} defun: A beautiful macro to define clojure functions with pattern match.

2015-05-27 Thread Daniel Szmulewicz
A very instructional presentation about pattern matching in general and defun in particular was given by Sean Johnson at Clojure West. https://www.youtube.com/watch?v=n7aE6k8o_BU Recommended watching. On Sunday, September 14, 2014 at 9:47:28 AM UTC+3, dennis wrote: > > > Hi , i am pleased to

Re: [ANN, GSoC] A Common Clojure Source Metadata Model

2015-05-27 Thread Colin Fleming
At the moment, the extension system is very tied to Cursive and to IntelliJ internals. Several people have asked whether I could extract the functionality so it would be reusable, but since I haven't even had time to get my own API public yet this is unlikely to happen - it's a very significant pie

Re: Interop: mutability vs. inheritance

2015-05-27 Thread Mars0i
Thanks--you're right, of course, Marshall. (I almost added "without writing it in Java" somewhere in the first part of the post. That doesn't mean writing parts in Java isn't worth considering. I'm just trying to figure out what will and won't work in Clojure itself.) -Marshall On Wednesday

Re: Interop: mutability vs. inheritance

2015-05-27 Thread Marshall Bockrath-Vandegrift
Mars0i writes: > I believe these statements are correct, but gen-class is complex and > deftype use has some nuances, so I want to make sure I haven't missed > something. You have missed one possible approach – write a small integration class in Java which delegates behavior to a parameterized s

Interop: mutability vs. inheritance

2015-05-27 Thread Mars0i
Is the following correct? The only way to define *multiple* mutable instance variables/fields for a class visible in Java is by using deftype with :volatile-mutable or :unsynchronized-mutable. The only way to inherit from a concrete Java class is by using gen-class or proxy. gen-class allows a

Re: Using :refer 'sparingly'

2015-05-27 Thread Akiva
I've been using :refer [...] exclusively but I've been growing increasingly disenchanted with it; it's just a nuisance when you're interrupted by having to address the ns to add a command you didn't previously know you needed. On the other hand, not using :as can become just as much of a nuisan

Re: How to use a java web service project in clojure?

2015-05-27 Thread Shantanu Kumar
Leiningen doesn't work with local JARs, rather it requires the Maven coordinates for dependencies so that it can download those. I'd suggest you figure out the Maven coordinates of your WEB-INF/lib/*.jar files and specify those in project.clj Should you have local JARs not available on any Mave

Re: clojure edn function reader

2015-05-27 Thread ronen
Ok ill expand the question a bit hoping to make it clearer :) I'm well aware of read/read-string and the security implications they bring (not interested in those), Clojure EDN has support for literal tags and the ability of extending i

Re: How to use a java web service project in clojure?

2015-05-27 Thread Peng Lin
Yes, this works. I added javax to dependencies, and the errors about this disappeared. But there is a lot of jars i used (in the WEB-INF/lib), how to add all these jars once and ever? i found jvm-opts -Djava.library.path, but i don't know how to use it 在 2015年5月27日星期三 UTC+8下午9:01:15,Shanta

Re: clojure edn function reader

2015-05-27 Thread Andy Fingerhut
I am not sure I understand your question. I will answer some questions with some of the same key words in them, and then you can decide if one of them was close to yours :) Clojure includes clojure.core/read [1] and clojure.core/read-string, which can read any Clojure code, but they can be danger

Re: How to add headers to a clojure.java.io/resource response

2015-05-27 Thread Jonathon McKitrick
I'll give that a shot, thanks! On Wednesday, May 27, 2015 at 8:12:10 AM UTC-4, James Reeves wrote: > > Oh, my apologies. You also need to pass the request map to the render > method. > > (-> (io/resource "public/html/confirm.html") > (cr/render request) > (resp/header "Cache-C

clojure edn function reader

2015-05-27 Thread ronen
Hey, I'm looking for an edn data read for clojure functions (similar to https://github.com/Datomic/day-of-datomic/blob/master/resources/day-of-datomic/clojure-data-functions.edn) Is there any known implementation? Thanks -- You received this message because you are subscribed to the Google G

Re: How to use a java web service project in clojure?

2015-05-27 Thread Shantanu Kumar
You should probably include the right dependencies in project.clj, e.g. :dependencies [[javax.ws.rs/jsr311-api "1.1.1"]] You might actually need an implementation, e.g. Apache-CXF, or RestEasy etc. as dependency but I am not sure. Shantanu On Wednesday, 27 May 2015 16:28:54 UTC+5:30, Peng Lin

Re: [Component] - Remove (dissoc) component from system

2015-05-27 Thread Édipo Luis Féderle
Hi Stuart, I got it. Well, maybe I was not clear enough. My idea, is that I will "build" the system which base in some configuration file.Maybe I need "invert" be approach, and not remove components, but create the system which "with right components" once (with base in a configuration file, i

Re: How to add headers to a clojure.java.io/resource response

2015-05-27 Thread James Reeves
Oh, my apologies. You also need to pass the request map to the render method. (-> (io/resource "public/html/confirm.html") (cr/render request) (resp/header "Cache-Control" "no-cache, no-store")) You could also write it as: (-> (resp/resource-response "public/html/confirm.

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-27 Thread Alex Miller
I've logged http://dev.clojure.org/jira/browse/CLJ-1738 for this and I'll discuss with Rich. On Wednesday, May 27, 2015 at 2:06:19 AM UTC-5, Marshall Bockrath-Vandegrift wrote: > > On Tue, May 26, 2015 at 11:29 PM Alex Miller wrote: > > >> The point I was getting at is really whether you sho

Re: How to add headers to a clojure.java.io/resource response

2015-05-27 Thread Jonathon McKitrick
Hmm. I tried this: (-> (io/resource "public/html/confirm.html") (cr/render) (resp/header "Cache-Control" "no-cache, no-store")) and got this: Exception in thread "main" java.lang.IllegalArgumentException: No single method: render of interface: compojure.response.Rende

How to use a java web service project in clojure?

2015-05-27 Thread Peng Lin
Hi guys, i'm new to clojure, and we have built our production using java. It's a web service, named "ddi", which runs on tomcat. i use eclipse to build a clojure project, and set in project.clj: :java-source-paths ["/Users/apple/ife/ddi/src"] then, set project.Properties.Lib

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-05-27 Thread Colin Yates
Thanks Stuart. > On 27 May 2015, at 08:53, Stuart Sierra wrote: > > JSVC (Apache Commons daemon for Unix) is excellent for this sort of thing. > There's a Windows Services version too. > –S > > > On Tuesday, May 26, 2015 at 12:38:30 PM UTC+1, Colin Yates wrote: > Hi, > > I am venturing into n

Re: Advice when running java -jar rather than a managed server like tomcat?

2015-05-27 Thread Stuart Sierra
JSVC (Apache Commons daemon for Unix) is excellent for this sort of thing. There's a Windows Services version too. –S On Tuesday, May 26, 2015 at 12:38:30 PM UTC+1, Colin Yates wrote: > > Hi, > > I am venturing into new territory using http-kit, as I usually use a > 'managed' web server contain

Re: [Component] - Remove (dissoc) component from system

2015-05-27 Thread Stuart Sierra
Hi Édipo, I'm not sure I understand the question. Why do you want to remove a component from the system after it has been started? Systems are just records, which behave like maps, so `assoc` and `dissoc` should work normally. But the process of starting a system creates copies of components t

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-27 Thread Marshall Bockrath-Vandegrift
On Tue, May 26, 2015 at 11:29 PM Alex Miller wrote: > The point I was getting at is really whether you should consider this to > be broken with the old behavior too. > Such APIs are tricky to use correctly from Clojure via seqs, but it is possible to do so with the "normal" automatic clojure.la