Re: Datatypes and protocols - update

2009-12-11 Thread ataggart
On Dec 11, 11:44 pm, ataggart wrote: > On Dec 11, 4:14 pm, Jason Wolfe wrote: > > > > > > > I've been trying out the new branch, and on the whole I like it a lot. > >  I know it'll take some time to learn how do things properly the "new" > > way, and I've figured out how to do most of the thing

Re: Datatypes and protocols - update

2009-12-11 Thread ataggart
On Dec 11, 4:14 pm, Jason Wolfe wrote: > I've been trying out the new branch, and on the whole I like it a lot. >  I know it'll take some time to learn how do things properly the "new" > way, and I've figured out how to do most of the things I want to do > thus far.  Thanks, Rich! > > One thing

Re: Code arrangement for understandability

2009-12-11 Thread ataggart
On Dec 11, 10:33 pm, Richard Newman wrote: > > (reduce (fn [model f] (assoc model f (inc (get model f 1 > >        {} features)) > > > Do Clojurians usually arrange like that? Can it be rearrange for more > > understandability? > > I can't speak for everyone, but I don't think it's common to

Re: Code arrangement for understandability

2009-12-11 Thread Richard Newman
> (reduce (fn [model f] (assoc model f (inc (get model f 1 >{} features)) > > Do Clojurians usually arrange like that? Can it be rearrange for more > understandability? I can't speak for everyone, but I don't think it's common to jam *everything* on one line. I imagine Rich was layi

Re: Code arrangement for understandability

2009-12-11 Thread ngocdaothanh
Below is a snippet from Rich's presentation at QCon 2009 (http:// qconlondon.com/london-2009/file?path=/qcon-london-2009/slides/ RichHickey_Clojure.pdf): (reduce (fn [model f] (assoc model f (inc (get model f 1 {} features)) Do Clojurians usually arrange like that? Can it be rearrange

Re: Leiningen in Python

2009-12-11 Thread Mike K
All, I tried to use this script on Windows and it blew up real good! I'm a Clojure, Java, and Leiningen newbie, so perhaps a kind soul can help me out. 1. lein self-install "worked". It downloaded leiningen-1.0.0- standalone.jar. However, that contradicts the description at http://zef.me/2470

Re: how 'bout a debug-repl?

2009-12-11 Thread Sean Devlin
Hmmm... functions as commands at a REPL. Now I feel silly for considering the keyword approach :) On Dec 11, 5:26 pm, Dan Larkin wrote: > On Dec 11, 2009, at 3:04 PM, Sean Devlin wrote: > > > Wouldn't ::quit do the same thing? > > It wouldn't, because the repl is evaluating in the context of wh

Re: AbstractMethodError question

2009-12-11 Thread Keith Irwin
On Dec 11, 3:31 pm, ataggart wrote: > On Dec 11, 12:27 pm, Keith Irwin wrote: > > Folks-- > > > I've got a class I can't change which has an abstract method I'd like > > to override using the proxy macro in Clojure. > > > The class looks something like: > > > public abstract class Foo { > > >

Re: AbstractMethodError question

2009-12-11 Thread Keith Irwin
On Dec 11, 3:33 pm, ataggart wrote: > On Dec 11, 12:44 pm, Keith Irwin wrote: > > > > > > > On Fri, Dec 11, 2009 at 12:27 PM, Keith Irwin wrote: > > > public abstract class Foo { > > > >    private Map stuff; > > > >    private void initStuff() { > > > >        stuff = new HashMap(); > > >   

Re: Datatypes and protocols - update

2009-12-11 Thread Jason Wolfe
I've been trying out the new branch, and on the whole I like it a lot. I know it'll take some time to learn how do things properly the "new" way, and I've figured out how to do most of the things I want to do thus far. Thanks, Rich! One thing I haven't figured out how to do cleanly without inher

Re: Idiomatic way to return the key of a map, which matches a vector containing a search value.

2009-12-11 Thread ataggart
On Dec 11, 10:44 am, mudphone wrote: > Thanks for the suggestions. > > I think since the original version short circuits when it finds a > result (using "some"), that's probably what I have to stick with. Sean's solution does as well. -- You received this message because you are subscribed to

Re: AbstractMethodError question

2009-12-11 Thread ataggart
On Dec 11, 12:44 pm, Keith Irwin wrote: > On Fri, Dec 11, 2009 at 12:27 PM, Keith Irwin wrote: > > public abstract class Foo { > > >    private Map stuff; > > >    private void initStuff() { > > >        stuff = new HashMap(); > >        stuff.put("a", new Object()); > >        addStuff(stuff);

Re: AbstractMethodError question

2009-12-11 Thread ataggart
On Dec 11, 12:27 pm, Keith Irwin wrote: > Folks-- > > I've got a class I can't change which has an abstract method I'd like > to override using the proxy macro in Clojure. > > The class looks something like: > > public abstract class Foo { > >    private Map stuff; > >    private void initStuff(

Re: AbstractMethodError question

2009-12-11 Thread Keith Irwin
On Fri, Dec 11, 2009 at 12:27 PM, Keith Irwin wrote: > public abstract class Foo { > >    private Map stuff; > >    private void initStuff() { > >        stuff = new HashMap(); >        stuff.put("a", new Object()); >        addStuff(stuff); >    } > >    protected void abstract addStuff(Map stuf

AbstractMethodError question

2009-12-11 Thread Keith Irwin
Folks-- I've got a class I can't change which has an abstract method I'd like to override using the proxy macro in Clojure. The class looks something like: public abstract class Foo {    private Map stuff;    private void initStuff() {        stuff = new HashMap();        stuff.put("a", new O

Re: Idiomatic way to return the key of a map, which matches a vector containing a search value.

2009-12-11 Thread mudphone
Thanks for the suggestions. I think since the original version short circuits when it finds a result (using "some"), that's probably what I have to stick with. One thing I didn't mention in the original problem statement is that my "players" map can be large. Again, thanks for the ideas. Kyle

Re: more dumb noob pain ("2dplot.clj")

2009-12-11 Thread Erik Price
On Fri, Dec 11, 2009 at 12:15 PM, rebcabin wrote: > > Any hints for me? I'm sure it's because I really don't know at all how > to find out where java things are installed and how to refer to them > if they're installed in weird places yadda yadda. > Are the Java 3D jar files in your CLASSPATH?

Re: how 'bout a debug-repl?

2009-12-11 Thread Dan Larkin
On Dec 11, 2009, at 3:04 PM, Sean Devlin wrote: > Wouldn't ::quit do the same thing? It wouldn't, because the repl is evaluating in the context of wherever you put the (debug-repl) call, so its namespace won't be "dr". What about instead of using keywords for commands, we use functions for co

Re: Latest news on ClojureQL

2009-12-11 Thread rb
> > And a suggestion: having migrations in CQL would be great! > > Could you elaborate a little? Migrations are a way to manage the evolution of a schema of a database. I'm familiar with migration in Ruby on Rails which are explained here: http://api.rubyonrails.org/classes/ActiveRecord/Migration.

Re: how 'bout a debug-repl?

2009-12-11 Thread Laurent PETIT
s/symbols/keywords/ 2009/12/11 Laurent PETIT > namespacing symbols seems sufficient, indeed. > > 2009/12/11 Stephen C. Gilardi > > >> On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote: >> >> But then, we could even go one level deeper: not only provide a particular >> instance that would allow t

Re: how 'bout a debug-repl?

2009-12-11 Thread Laurent PETIT
namespacing symbols seems sufficient, indeed. 2009/12/11 Stephen C. Gilardi > > On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote: > > But then, we could even go one level deeper: not only provide a particular > instance that would allow to quit the REPL, but a set of instances. And if > the retu

Re: Code arrangement for understandability

2009-12-11 Thread ataggart
On Dec 11, 1:14 am, ngocdaothanh wrote: > > Do you come from a Python background? > > For the sake of this discussion, I would say I come from Erlang. > > > Judging by you examples, I looks like you're still getting used to the lisp > > style of coding.  Everything is a chained function call. > >

Re: how 'bout a debug-repl?

2009-12-11 Thread Sean Devlin
Wouldn't ::quit do the same thing? On Dec 11, 11:57 am, "Stephen C. Gilardi" wrote: > On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote: > > > But then, we could even go one level deeper: not only provide a particular > > instance that would allow to quit the REPL, but a set of instances. And if

Re: Deploying Leiningen project as WAR file?

2009-12-11 Thread Graham Fawcett
On Fri, Dec 11, 2009 at 11:51 AM, Sean Devlin wrote: > While we're at it, how 'bout an EAR file? Never encountered one of those before -- maybe that is a good thing! :) After a little study, I was able to write a simple servlet, compile it with Leiningen, and make a WAR using Maven. This might b

Re: Code arrangement for understandability

2009-12-11 Thread Richard Newman
> This makes Clojure code hard to understand I'd phrase this "This makes it hard for me to understand Clojure code". Lots of us do just fine most of the time. Try spending some time reading point-free Haskell: there are *no* local names. You can do that in Clojure, too. > Is this style of "l

more dumb noob pain ("2dplot.clj")

2009-12-11 Thread rebcabin
I've been having pretty good luck writing my own programs and running lots of samples from the contribute-files section of this google group, but hit a roadblock this morning: trying to run "2dplot," I installed java3d and it passes the tests on https://j3d-webstart.dev.java.net/test/ but when I

Re: how 'bout a debug-repl?

2009-12-11 Thread Stephen C. Gilardi
On Dec 11, 2009, at 5:08 AM, Laurent PETIT wrote: > But then, we could even go one level deeper: not only provide a particular > instance that would allow to quit the REPL, but a set of instances. And if > the returned value of the call to the REPL returns one of the instances in > the set, th

Re: Deploying Leiningen project as WAR file?

2009-12-11 Thread Sean Devlin
While we're at it, how 'bout an EAR file? Sean On Dec 11, 11:36 am, Graham Fawcett wrote: > Hi folks, > > Does anyone have advice (recipe, blog article, etc.) for building a > servlet WAR based on a Leiningen project? > > Is there interest in developing a 'lein war' plugin? I'm a novice at > Ant

Deploying Leiningen project as WAR file?

2009-12-11 Thread Graham Fawcett
Hi folks, Does anyone have advice (recipe, blog article, etc.) for building a servlet WAR based on a Leiningen project? Is there interest in developing a 'lein war' plugin? I'm a novice at Ant, WAR, etc., but It seems to me that most of the mechanics are already present in 'lein uberjar' -- it's

Re: Latest news on ClojureQL

2009-12-11 Thread LauJensen
> I'm wondering: how would you compare the use of ClojureQL and clj- > record(which sadly doesn't show much activity currently)? Isn't CQL > going back to the SQL level or database queries, whereas clj-record is > at a higher level? Would it be easy to code this higher level layer on > top of cql?

Re: Renaming 1.1.0-alpha-SNAPSHOT is causing problems with projects on Clojars

2009-12-11 Thread liebke
Here's the error I'm getting when I do 'lein deps' on this example (http://incanter-blog.org/2009/11/29/incanter-webapp/), which used to work. [null] An error has occurred while processing the Maven artifact tasks. [null] Diagnosis: [null] [null] Unable to resolve artifact: Mi

Re: Datatypes and protocols - update

2009-12-11 Thread Chris Kent
Rich Hickey gmail.com> writes: > > An updated version of the code for datatypes[1] and protocols[2] is > now available in the 'new' branch[3]. I've converted some code that used gen-class to use deftype and defprotocol and the results are great so far. The code is shorter, easier to write and

Re: Latest news on ClojureQL

2009-12-11 Thread rb
On Dec 11, 11:58 am, LauJensen wrote: > Hi all, > > ClojureQL is now moved to Gradle and Jars are pushed to Clojars as > version 0.9.7 > > Blogpost on > status:http://www.bestinclass.dk/index.php/2009/12/clojureql-where-are-we-go... Very interesting. I wondered some days ago what is the best way

Re: Possible BUG: NPE

2009-12-11 Thread Rich Hickey
On Wed, Dec 9, 2009 at 10:39 PM, Feng wrote: > > > On Dec 7, 9:39 pm, David Nolen wrote: >> http://github.com/jochu/swank-clojure/blob/master/src/main/clojure/sw... >> >> Is the offending line. > > It's really hard to reason about it in clojure source code. I see, in > jswat debbuger, the root ca

Re: dumb noob ceremony question

2009-12-11 Thread rebcabin
thanks much! On Dec 10, 7:28 pm, Richard Newman wrote: > > (clojure.set/union #{1} #{2}) > > > what'd I do wrong, please & thanks? > > Nothing wrong! > > Try this: > > (use 'clojure.set) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to thi

Latest news on ClojureQL

2009-12-11 Thread LauJensen
Hi all, ClojureQL is now moved to Gradle and Jars are pushed to Clojars as version 0.9.7 Blogpost on status: http://www.bestinclass.dk/index.php/2009/12/clojureql-where-are-we-going/ Thanks, Lau -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: Code arrangement for understandability

2009-12-11 Thread Jarkko Oranen
> ((comp negate inc) 6) -> -7 Hm, I was sure negate existed... But seems like it doesn't. Oh well. (comp - inc) works. :) -- 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

Re: Code arrangement for understandability

2009-12-11 Thread Jarkko Oranen
On Dec 11, 11:14 am, ngocdaothanh wrote: > Because of indents, my previous Clojure code lied to my eyes that x, > y, f, g are not at the same block level. This is my difficulty with > Clojure. In short, I can't see a rough algorithm from any Clojure code > any more just by seeing the shape (leve

Re: how 'bout a debug-repl?

2009-12-11 Thread Laurent PETIT
Great ! thanks Konrad ! Another, presumably more "general" solution, but implying modifications (by adding another optional attribute) to clojure.main/repl, would be to give to the REPL a particular instance whose meaning could be interpreted by the reader as "end the current reader". This instan

Re: how 'bout a debug-repl?

2009-12-11 Thread Konrad Hinsen
On 10 Dec 2009, at 21:34, George Jahad wrote: > are you using slime? Currently, you need to use a non-slime repl, (I > think because of how slime handles io redirection) I don't use slime, but I had a similar issue with Counterclockwise/ Eclipse, which doesn't quite understand that end-of-stre

Re: Code arrangement for understandability

2009-12-11 Thread ngocdaothanh
> Do you come from a Python background? For the sake of this discussion, I would say I come from Erlang. > Judging by you examples, I looks like you're still getting used to the lisp > style of coding. Everything is a chained function call. You're correct. Comming from Erlang: * I tend to see

Re: Renaming 1.1.0-alpha-SNAPSHOT is causing problems with projects on Clojars

2009-12-11 Thread bOR_
Not sure what was causing it, but leiningen / clojars couldn't get its deps yesterday. I thought it was caused by clojure and clojure-contrib no longer being on clojars.org, but maybe the renaming on build.clojure.org has something to do with it. On Dec 11, 6:18 am, Phil Hagelberg wrote: > liebke

Re: Slides that accompany the Rich's QCon talk

2009-12-11 Thread Dragan Djuric
Thanks :) On Dec 11, 6:17 am, Krukow wrote: > On Dec 11, 12:21 am, Dragan Djuric wrote: > > > HI, > > > I have just watched Rich's QCon talk and in some parts he is referring > > to the slides that are not displayed in the video. Of, course, the > > talk is perfectly fine without that, but I nee

Re: Refs scalability

2009-12-11 Thread Dragan Djuric
Then, let's say there is a million refs, each transaction involves only a couple of refs, and there is a number of concurrent transactions typical for a web application that runs on one server (let's say 10-100). Of course that the real answer is in measuring it, but I wanted to know, before I buil