Re: Using a macro to define a function - nested backquotes?

2010-05-04 Thread Bryce
Huh, that is artful. Looks like I need to get my dev environment in shape so I can keep up with the changes! On May 4, 6:57 pm, liebke wrote: > The output is different because you're using my version of the defn-fn > macro, which I checked in late this afternoon. > > > (def f (deriv-fn [x y]  (+

Re: 1.2 release ?

2010-05-04 Thread Luc Préfontaine
My previous post got lost in a black hole somewhere... so lets type a shorter version: Yeppee ! That's a perfect match with my schedule for the next 6 months. We will launch our new projects under 1.2 and port the existing code to it in the following weeks. Our next major deployment toward fall w

Re: Using a macro to define a function - nested backquotes?

2010-05-04 Thread liebke
> When I copy the definition of drive-fn from your link above and then   > invoke macroexpand-1, I get: > user=> (macroexpand-1 '(deriv-fn [a b c] foo bar baz)) > (user/deriv-fn* (quote [a b c]) (quote foo) (quote bar) baz) > > First step is to find out why you aren't getting the same expansion. >

Re: Using a macro to define a function - nested backquotes?

2010-05-04 Thread Douglas Philips
On 2010 May 4, at 4:55 PM, Bryce wrote: For reference, the deriv macro is at http://github.com/liebke/incanter/blob/master/modules/incanter-core/src/incanter/symbolic.clj Unquote splicing and switching to `(fn ~fn-args ~(deriv exp v degree)) both produce errors of the type "count not supported o

Re: Using a macro to define a function - nested backquotes?

2010-05-04 Thread Bryce
For reference, the deriv macro is at http://github.com/liebke/incanter/blob/master/modules/incanter-core/src/incanter/symbolic.clj Unquote splicing and switching to `(fn ~fn-args ~(deriv exp v degree)) both produce errors of the type "count not supported on this type: Symbol". Macroexpand-1 seems

Re: Using a macro to define a function - nested backquotes?

2010-05-04 Thread Jarkko Oranen
On May 4, 10:40 pm, Bryce wrote: > I have a macro, deriv, that produces an expression, and I'd like to > create another macro that turns this into a function.  So far I have > > (defmacro deriv-fn [fn-args exp v degree] >   `(fn ~fn-args (deriv ~exp ~v ~degree))) > > Which of course doesn't work

Re: Using a macro to define a function - nested backquotes?

2010-05-04 Thread Douglas Philips
On 2010 May 4, at 3:40 PM, Bryce wrote: I have a macro, deriv, that produces an expression, and I'd like to create another macro that turns this into a function. So far I have (defmacro deriv-fn [fn-args exp v degree] `(fn ~fn-args (deriv ~exp ~v ~degree))) Which of course doesn't work, sinc

Re: Using a macro to define a function - nested backquotes?

2010-05-04 Thread Sean Devlin
Did you try unquote splicing? i.e. (defmacro deriv-fn [fn-args exp v degree] `(fn ~fn-args ~@(deriv exp v degree))) Also, posting a link your exact macros would help :) Sean On May 4, 3:40 pm, Bryce wrote: > I have a macro, deriv, that produces an expression, and I'd like to > create anothe

Re: Pulling my hair out with swank-clojure...

2010-05-04 Thread Michael Wood
On 4 May 2010 18:47, Phil Hagelberg wrote: > On Mon, May 3, 2010 at 9:20 PM, Patrick Stein wrote: >> Do I need to use an older version of Clojure instead?  I just checked >> out Clojure >> from the trunk today.  Same for swank-clojure (which is where >> basic.clj lives). >> >> It doesn't work wit

Using a macro to define a function - nested backquotes?

2010-05-04 Thread Bryce
I have a macro, deriv, that produces an expression, and I'd like to create another macro that turns this into a function. So far I have (defmacro deriv-fn [fn-args exp v degree] `(fn ~fn-args (deriv ~exp ~v ~degree))) Which of course doesn't work, since it considers the output of deriv as a qu

Re: ClojureQL - joining 3 tables

2010-05-04 Thread Meikel Brandmeyer
Hi, On Tue, May 04, 2010 at 08:37:00AM -0700, David McNeil wrote: > In ClojureQL I do not see how to join three or more tables using the > "join" function. Does anyone know if this is possible? No, not yet. However this problem is known and it is being worked on. For now you have to resort to cl

Re: Help: Rephrasing an English statement into questions.

2010-05-04 Thread Wilson MacGyver
I'm not sure how simple this is. If you want the code to be able to take any English sentence as input, parse it, and reword them as question. It's far more work than a simple email can convey. :) You can probably start with the clj-opennlp as the first step to parse the input. On Monday, May 3,

Re: Pulling my hair out with swank-clojure...

2010-05-04 Thread Phil Hagelberg
On Mon, May 3, 2010 at 9:20 PM, Patrick Stein wrote: > Do I need to use an older version of Clojure instead?  I just checked > out Clojure > from the trunk today.  Same for swank-clojure (which is where > basic.clj lives). > > It doesn't work with svn/tags/1.0 version of Clojure either for me. It

Re: Pulling my hair out with swank-clojure...

2010-05-04 Thread Michał Marczyk
Um, the "Clojure 1.1.0-alpha-SNAPSHOT" version reported by Clojure in the above and the "svn/tags/1.0" version of Clojure that you mention lead me to ask: Where do you get your clojure.jar / Clojure sources from? These days you're supposed to use one of the following, depending on your stability

Pulling my hair out with swank-clojure...

2010-05-04 Thread Patrick Stein
I've spent most of the afternoon trying to get swank-clojure to work for me. I tried ELPA. I tried Lein. I tried directly pulling in the git repositories. No matter what I try, I get the following: java.lang.Exception: Unable to resolve symbol: with-bindings in this context (basic.clj:469

Help: Rephrasing an English statement into questions.

2010-05-04 Thread JT
I need to write a program that will rephrase an English statement into a question as many different ways as possible. Which libraries will be good for creating a simple version of that? Examples will be nice too. Thanks a lot. JT -- You received this message because you are subscribed to the G

Re: refs towards ref

2010-05-04 Thread Sean Devlin
When I here refs of refs, it's a code smell. Granted, sometimes they are needed, and you very well may have one of those cases. Here's a few things to consider... 1. Is a tree really the right way to represent your data? Perhaps you should consider a collection of edges instead. i.e, [{:paren

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, send email to clojure@googlegr

Re: refs towards ref

2010-05-04 Thread David Nolen
On Tue, May 4, 2010 at 10:44 AM, Nicolas Oury wrote: > Dear all, > > I have a problem where a lot of concurrency could be gained by having > a tree of references. > ie a tree where each nodes contain a ref to a set of similar tree. > > (I know that having mutable trees is asking for troubles, but

Re: refs towards ref

2010-05-04 Thread Laurent PETIT
Hi Nicolas, First to answer, but not necessarily the most accurate answer you'll get. Be warned ! :-) You can nest refs into refs. But in that case, don't mismatch the ref and a particular value of the ref in your mental model. You will be reminded of this in your code because you'll have to der

refs towards ref

2010-05-04 Thread Nicolas Oury
Dear all, I have a problem where a lot of concurrency could be gained by having a tree of references. ie a tree where each nodes contain a ref to a set of similar tree. (I know that having mutable trees is asking for troubles, but that is quite necessary for the things I wish to do.) I read that

Re: Equivalent of commute without return value?

2010-05-04 Thread Nicolas Oury
Thank you very much for the quick answer. That makes a lot of sense. If there were no return value, there would be a need to throw exception on subsequent reads. You're right, that would add a lot of complexity. I wanted that because I have a bunch of set updates (insertions) in a transaction and

Re: Equivalent of commute without return value?

2010-05-04 Thread Rich Hickey
On May 4, 2010, at 9:30 AM, Nicolas Oury wrote: Dear all, Is there an equivalent of commute without return value? A part of the usage of commute just want to change something without knowing the result. (For example, I want to extend a set). I know it is not very expensive but computing twic

Equivalent of commute without return value?

2010-05-04 Thread Nicolas Oury
Dear all, Is there an equivalent of commute without return value? A part of the usage of commute just want to change something without knowing the result. (For example, I want to extend a set). I know it is not very expensive but computing twice a function - if there is a bit of contention, but

Re: 1.2 release ?

2010-05-04 Thread Rich Hickey
On May 3, 2010, at 10:26 PM, lprefonta...@softaddicts.ca wrote: Hi all, it's not that I want to put pressure on anyone here but there has been a number of discussions about the 1.2 release and I was wondering what's the horizon for a first release ? We are still in prod with 1.0 but some

Re: Monad problem: rewriting a recursive domonad call to not blow up the stack

2010-05-04 Thread Konrad Hinsen
On 04.05.2010, at 05:39, David Barksdale wrote: > I tried to define "n-times" using the pattern of none-or-more and came > to the realization that the state-m-until does not handle a parser > that fails. So here is m-until for the parser monad and my n-times > using it: That looks like a good app

Re: 1.2 release ?

2010-05-04 Thread Sean Devlin
IANRH :) When it's all said & done, I'd say 1 to 3 months. Patches are flying around like crazy right now, and they're mostly related to getting the last bits & pieces in order before an RC. Rich has mentioned that there's going to a bit longer RC period this time around, this is to accommodate