Re: Macros, macros, macros

2011-03-08 Thread Andreas Kostler
On 09/03/2011, at 4:24 PM, Alan wrote: > On Mar 8, 9:14 pm, Andreas Kostler > wrote: >> Hi Daniel, >> Thanks for your reply. >> On 09/03/2011, at 11:57 AM, Daniel Solano Gomez wrote: >>> On Wed Mar 9 11:16 2011, Andreas Kostler wrote: Hi all, >> I need a macro to basically outputs th

Re: Macros, macros, macros

2011-03-08 Thread Alan
On Mar 8, 9:14 pm, Andreas Kostler wrote: > Hi Daniel, > Thanks for your reply. > On 09/03/2011, at 11:57 AM, Daniel Solano Gomez wrote: > > On Wed Mar  9 11:16 2011, Andreas Kostler wrote: > >> Hi all, > > >> I need a macro to basically outputs this: > > >> (macroexpand '(chain-field-queries reco

Re: Macros, macros, macros

2011-03-08 Thread Andreas Kostler
Hi Daniel, Thanks for your reply. On 09/03/2011, at 11:57 AM, Daniel Solano Gomez wrote: > On Wed Mar 9 11:16 2011, Andreas Kostler wrote: >> Hi all, >> >> I need a macro to basically outputs this: >> >> (macroexpand '(chain-field-queries record "location" "name" "country")) >> (. (. (. record

Re: Macros, macros, macros

2011-03-08 Thread Daniel Solano Gomez
On Wed Mar 9 11:16 2011, Andreas Kostler wrote: > Hi all, > > I need a macro to basically outputs this: > > (macroexpand '(chain-field-queries record "location" "name" "country")) > (. (. (. record (field "location")) (field "name")) (field "country")) > > Which chains method calls on a java ob

Macros, macros, macros

2011-03-08 Thread Andreas Kostler
Hi all, I need a macro to basically outputs this: (macroexpand '(chain-field-queries record "location" "name" "country")) (. (. (. record (field "location")) (field "name")) (field "country")) Which chains method calls on a java object. e.g. record.field("location").field("name").field("country

Re: Rebinding Defs

2011-03-08 Thread Timothy Baldridge
> Is there a reason you're using a var rather than an atom or a ref? > I think I over-simplified what I'm doing a bit. What I'm really doing is writing a prototype port of Clojure to PyPy. I'm planning to make symbols resolvable at compile-time. It sounds like in most cases, like for defs, I should

Re: Rebinding Defs

2011-03-08 Thread James Reeves
Typically an atom or a ref is used when you want a variable On 8 March 2011 23:59, Timothy Baldridge wrote: > If in a namespace I bind a var: > > (def foo 3) > > And then later on in my program re-bind that var: > > (def foo 1) > > Will all parts of my program instantly see that update? How is it

Re: Rebinding Defs

2011-03-08 Thread Alan
On Mar 8, 3:59 pm, Timothy Baldridge wrote: > If in a namespace I bind a var: > > (def foo 3) > > And then later on in my program re-bind that var: > > (def foo 1) > > Will all parts of my program instantly see that update? How is it > possible to have any sort performance when we're basically hav

Rebinding Defs

2011-03-08 Thread Timothy Baldridge
If in a namespace I bind a var: (def foo 3) And then later on in my program re-bind that var: (def foo 1) Will all parts of my program instantly see that update? How is it possible to have any sort performance when we're basically having a namespace function lookup for every single function cal

Re: Clojure & CEDET?

2011-03-08 Thread Phil Hagelberg
On Mar 7, 5:44 pm, Fred Concklin wrote: > Just wondering if anybody uses CEDET with clojure or anybody would be > interested in clojure language support for smart code completion. > > http://cedet.sourceforge.net/ I'm curious because I've never seen Cedet in action: what does it offer that you do

Re: arithmetic progression

2011-03-08 Thread Fred Concklin
Thanks! fpc -- 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. To unsubscribe from this group, send e

Re: overriding keyword behavior?

2011-03-08 Thread Stuart Sierra
Oh yeah, you can't extend an interface to a new class. So it won't work. This is why protocols exist, in fact. Silly me. -S -- 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 po

Re: Issue with lein-ring...

2011-03-08 Thread Michael Ossareh
On Tue, Mar 8, 2011 at 11:31, John Szakmeister wrote: > I've been working on a web app, and it was using leiningen-war. The > author of that suggest moving to the lein-ring plugin on his github > site... so, I did that. However, when I run "lein ring server" I get > a traceback, which I show be

Re: arithmetic progression

2011-03-08 Thread Ken Wesson
On Tue, Mar 8, 2011 at 2:28 PM, Alan wrote: > On Mar 8, 10:27 am, Ken Wesson wrote: >> On Tue, Mar 8, 2011 at 10:42 AM, Chris Perkins >> wrote: >> > You'll probably want to add checks for special cases, like an empty or >> > one-element sequence, too. >> >> Better yet, clojure.core should amend

Re: having trouble with http.async.client

2011-03-08 Thread Rob Wolfe
Kevin Archie writes: > I'm trying to use http.async.client to do a PUT request (where I don't > care about the response) and my code is hanging -- apparently after > succesfully completing the PUT, from the server's perspective. > > This isn't quite what I'm doing, but exhibits the same behavior:

Lift and Clojure

2011-03-08 Thread Fred Concklin
I'm looking for examples and resources about using Lift (Scala Web Framework) and clojure together. Anybody know of anything good? fpc -- 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 Not

Issue with lein-ring...

2011-03-08 Thread John Szakmeister
I've been working on a web app, and it was using leiningen-war. The author of that suggest moving to the lein-ring plugin on his github site... so, I did that. However, when I run "lein ring server" I get a traceback, which I show below. Two lines stand out to me: at ring.util.tracker$e

Re: arithmetic progression

2011-03-08 Thread Alan
On Mar 8, 10:27 am, Ken Wesson wrote: > On Tue, Mar 8, 2011 at 10:42 AM, Chris Perkins > wrote: > > You'll probably want to add checks for special cases, like an empty or > > one-element sequence, too. > > Better yet, clojure.core should amend = so that (=) and (= x) return > true instead of thr

Re: Are there sets that keep the insertion order?

2011-03-08 Thread Tassilo Horn
Tassilo Horn writes: Hi again, >>> https://github.com/ninjudd/ordered-set >> >> Oh, yes, that looks exactly as what I was looking for. And judging >> from the implementation, it looks promising performance-wise for my >> usecase. > > I've now switched to that, and I get some slight performance

Re: arithmetic progression

2011-03-08 Thread Ken Wesson
On Tue, Mar 8, 2011 at 10:42 AM, Chris Perkins wrote: > You'll probably want to add checks for special cases, like an empty or > one-element sequence, too. Better yet, clojure.core should amend = so that (=) and (= x) return true instead of throwing an arity exception. That would make the behavio

Discount for 2-Day public course on Clojure in Chicago in April

2011-03-08 Thread Doug Bradbury
Save $50 this week on "Clojure: Functional Programming on the JVM" a 2- day course in Chicago with Colin Jones with discount code CLJ50. In this 2-Day course, you'll grow your knowledge and skill to the point where you're ready to embark on your first Clojure project. With numerous hands-on exerc

Re: arithmetic progression

2011-03-08 Thread Brian Martin
Depending on your use, you may want to deal with a sequence that is empty or is length 1. Right now there's an uncaught exception in that case: user=> (arithmetic-progression? [1]) java.lang.IllegalArgumentException: Wrong number of args (0) passed to: core$-EQ- (NO_SOURCE_FILE:0) Brian On Tue

Re: arithmetic progression

2011-03-08 Thread Chris Perkins
On Mar 8, 10:26 am, Fred Concklin wrote: > Tests whether list is arithmetic progression. > > Thoughts, feedback: > > (defn arithmetic-progression? [intlist] >   "tests if list is arithmetic progression." >   (apply = >    (map >     #(apply - %) >     (partition 2 1 (reverse intlist) > You lo

arithmetic progression

2011-03-08 Thread Fred Concklin
Tests whether list is arithmetic progression. Thoughts, feedback: (defn arithmetic-progression? [intlist] "tests if list is arithmetic progression." (apply = (map #(apply - %) (partition 2 1 (reverse intlist) fpc -- You received this message because you are subscribed to th

Re: Are there sets that keep the insertion order?

2011-03-08 Thread Tassilo Horn
Tassilo Horn writes: Hi Justin, >> https://github.com/ninjudd/ordered-set > > Oh, yes, that looks exactly as what I was looking for. And judging > from the implementation, it looks promising performance-wise for my > usecase. I've now switched to that, and I get some slight performance improve

Re: Are there sets that keep the insertion order?

2011-03-08 Thread Tassilo Horn
Justin Kramer writes: Hi Justin, > https://github.com/ninjudd/ordered-set Oh, yes, that looks exactly as what I was looking for. And judging from the implementation, it looks promising performance-wise for my usecase. And it seems to be equivalent to Ken's deftype. Thanks a ton for the point

Re: Clojure & CEDET?

2011-03-08 Thread Baishampayan Ghose
>> Just wondering if anybody uses CEDET with clojure or anybody would be >> interested in clojure language support for smart code completion. > > I use Clojure, and I use CEDET (not just for Clojure), and I'd certainly > like to have code completion for Clojure in CEDET. +1 Regards, BG -- Baish