needs a reader syntax for floats

2012-08-14 Thread Matthew Kennedy
While doing image processing in Clojure recently it occured to me that it would be handy to have a specifier suffix for distinguishing between doubles and floats as libraries in this domain often use single precision floats instead of double precision (or mixtures of both). My code frequently

Re: Ideas for interactive tasks

2012-08-14 Thread dmirylenka
It's really great that you are going to teach Clojure at BSU. I have no clue about teaching, but my impression is that back in my days, we didn't learn much about how to write good code. Maybe things were different in 'informatics', but in 'applied mathematics', for instance, we only had

Re: Overtone - Live @ Arnolfini

2012-08-14 Thread charlie
Exciting times indeed! On Wed, Aug 8, 2012 at 10:46 AM, lambdatronic gwjoh...@uvm.edu wrote: Eppccc!! On Friday, August 3, 2012 6:47:50 AM UTC-4, Sam Aaron wrote: Hi everyone, for those interested, I just put up a screencast of a performance I did with Overtone on

Re: Question about sets

2012-08-14 Thread Gary Trakhman
+1 On Tuesday, August 7, 2012 3:20:44 AM UTC-4, abp wrote: I use literals for collection-construction from arbitrary values too. Just haven't run into that issue. So, please: Put hash maps and hash sets back to the way they were -- they worked perfectly fine. Use the duplicate key

Re: ANN lein-expectations 0.0.7

2012-08-14 Thread semperos
With testing frameworks, there's nothing like trying all of them with a medium-sized code base. I use both clojure.test and Midje for clj-webdriver, but have recently used (and enjoyed) Expectations to test a parser/code-generator. Midje is the most batteries-included of the three and provides

Re: Question about sets

2012-08-14 Thread Herwig Hochleitner
I agree that the current throw-on-duplicates behavior is broken, because it renders literals with variable keys useless. 1. Simplicity is partially about having orthogonal primitives. A duplicate-removing collection factory cannot be sensibly used to implement a throw-on-duplicates collection

ANN: core.cache v0.6.2

2012-08-14 Thread Fogus
core.cache v0.6.2 Release Notes === Source code and README at https://github.com/clojure/core.cache Wiki (in progress) at https://github.com/clojure/core.cache/wiki core.cache is a Clojure contrib library providing the following features: Overview * An

[ANN]: clj-http 0.5.3 released

2012-08-14 Thread Lee Hinman
Hi all, I'm pleased to announce the 0.5.3 release of clj-http. clj-http is an idiomatic clojure http client wrapping the apache client (like ring in reverse). You should be able to use it from Clojars[1] using leiningen with the following: [clj-http 0.5.3] Since I have not announced releases of

Re: needs a reader syntax for floats

2012-08-14 Thread Sean Corfield
On Mon, Aug 13, 2012 at 11:14 PM, Matthew Kennedy burnsid...@gmail.com wrote: [(float 0.12) (float 0.33) (float 0.56)]. That's a sequence of Float objects not a float[], just FYI. As far as I can tell there's no way to do this with user code. I think it would have to be done within the

Re: needs a reader syntax for floats

2012-08-14 Thread Matthew Kennedy
On Tuesday, August 14, 2012 3:33:03 PM UTC-5, Sean Corfield wrote: Could you use the extensible reader literal approach? I know the syntax wouldn't be quite as clean, but if you genuinely need float[] as well as float values, that might be more convenient in the long run. In some

recursion question

2012-08-14 Thread John Holland
I've been doing some programming exercises in Clojure, I've run into one I don't know how to approach. If anyone can just give me the strategy to use on this that'd be great. Here is the problem statement: Given an array of ints, is it possible to choose a group of some of the ints, such that

Re: recursion question

2012-08-14 Thread Raoul Duke
¿ take the first #. subtract that from the goal. now ask if the remaining #s can sum to the now-lesser goal. lather rinse repeat. don't forget a base case. watch your cpu heat very quickly up on even slightly longer lists. ? On Tue, Aug 14, 2012 at 4:13 PM, John Holland jbholl...@gmail.com wrote:

Re: recursion question

2012-08-14 Thread Raoul Duke
sorry take the first# actually is meant to be worded as, in turn, take out 1 of each of the #s, and recurse on what remains so that you are doing the permutations at each level of the recursion/tree. On Tue, Aug 14, 2012 at 4:15 PM, Raoul Duke rao...@gmail.com wrote: ¿ take the first #.

Re: recursion question

2012-08-14 Thread John Holland
I thought of doing something like that, but part of the requirements is that the sum could be achieved with *some of the numbers in the vector. On Tuesday, August 14, 2012 7:15:27 PM UTC-4, raould wrote: ¿ take the first #. subtract that from the goal. now ask if the remaining #s can sum

Re: recursion question

2012-08-14 Thread Raoul Duke
On Tue, Aug 14, 2012 at 4:17 PM, John Holland jbholl...@gmail.com wrote: I thought of doing something like that, but part of the requirements is that the sum could be achieved with *some of the numbers in the vector. in the stupidest approach that is just the same thing as all of the numbers in

Re: recursion question

2012-08-14 Thread Raoul Duke
On Tue, Aug 14, 2012 at 4:17 PM, John Holland jbholl...@gmail.com wrote: I thought of doing something like that, but part of the requirements is that the sum could be achieved with *some of the numbers in the vector. the other way of looking at it is that the recursion just quits once the sum

Re: recursion question

2012-08-14 Thread Andy Fingerhut
An additional step on top of Raoul's: Take the first #, subtract it from the goal, recursively ask if the remaining #s can sum to the now-lesser goal. If so, return yes, or the set of numbers that worked (which should include whatever was returned from the recursive call, plus the first #)

Re: recursion question

2012-08-14 Thread John Holland
Thanks for all the help! On Tuesday, August 14, 2012 7:38:58 PM UTC-4, Andy Fingerhut wrote: An additional step on top of Raoul's: Take the first #, subtract it from the goal, recursively ask if the remaining #s can sum to the now-lesser goal. If so, return yes, or the set of numbers

ANN: clojure-maven-plugin 1.3.12

2012-08-14 Thread Mark Derricutt
clojure-maven-plugin 1.3.12 A small patch release of the clojure-maven-plugin has been pushed out to Maven Central: Support for Colin James REPL-y project. Simply add a project dependency on REPL-y and it will be used for the clojure:repl goal. A new configuration flag

Handling setting different profiles between different environments

2012-08-14 Thread Dave Kincaid
Being new to functional programming and Lisp in particular there is something that's been bugging me for a while. How do people handle having different configurations during development for development, testing and production? For example, things like data sources, server names, etc are often

Rich's The Value of Values and REST

2012-08-14 Thread Conrad
Hi Everyone... Quick question about Rich's latest talk: In it he eloquently argues that you don't want to systems to communicate with each other by calling each other's methods. Instead it is better to just move values between systems that can also be queued. It occurs to me that RESTful web

Re: recursion question

2012-08-14 Thread John Holland
Ended up with the following wondering if loop/recur is possible in this case? (defn groupSum [a x] (cond (= (count a) 0) false (= (first a) x) true ( (first a) x) (if ( (count a) 1) (groupSum (rest a) x) false)

Re: Handling setting different profiles between different environments

2012-08-14 Thread Sean Corfield
On Tue, Aug 14, 2012 at 5:49 PM, Dave Kincaid kincaid.d...@gmail.com wrote: So I'm wondering how others handle this. In one project recently I setup a global map using ^:dynamic and then switched in the appropriate map from a command line argument. This somehow doesn't seem the right way to do

Re: clojure.logic project.clj file

2012-08-14 Thread Brent Millare
Well just using leiningen2 and then lein repl, and then user= (require 'clojure.core.logic) FileNotFoundException Could not locate clojure/core/logic__init.class or clojure/core/logic.clj on classpath: clojure.lang.RT.load (RT.java:432) If I change it, then it works. On Tuesday, August 14,

Re: clojure.logic project.clj file

2012-08-14 Thread David Nolen
On Tue, Aug 14, 2012 at 10:09 PM, Brent Millare brent.mill...@gmail.com wrote: Well just using leiningen2 and then lein repl, and then user= (require 'clojure.core.logic) FileNotFoundException Could not locate clojure/core/logic__init.class or clojure/core/logic.clj on classpath:

Re: clojure.logic project.clj file

2012-08-14 Thread Brent Millare
Well just looking at the source, :source-path is never looked up, only :source-paths. All project.clj files that are prepped for leiningen2 use :source-paths to my knowledge. On Tuesday, August 14, 2012 10:20:50 PM UTC-4, David Nolen wrote: On Tue, Aug 14, 2012 at 10:09 PM, Brent Millare

Re: Handling setting different profiles between different environments

2012-08-14 Thread Dave Kincaid
Thanks, Sean. I really like that approach. I wasn't even aware of the delay macro. Very cool. So much awesome stuff in Clojure I feel like I'll never learn it all. On Tuesday, August 14, 2012 8:33:49 PM UTC-5, Sean Corfield wrote: On Tue, Aug 14, 2012 at 5:49 PM, Dave Kincaid

Re: Handling setting different profiles between different environments

2012-08-14 Thread Nelson Morris
On Tue, Aug 14, 2012 at 7:49 PM, Dave Kincaid kincaid.d...@gmail.com wrote: Being new to functional programming and Lisp in particular there is something that's been bugging me for a while. How do people handle having different configurations during development for development, testing and

Re: clojure.logic project.clj file

2012-08-14 Thread David Nolen
On Tue, Aug 14, 2012 at 10:31 PM, Brent Millare brent.mill...@gmail.com wrote: Well just looking at the source, :source-path is never looked up, only :source-paths. All project.clj files that are prepped for leiningen2 use :source-paths to my knowledge. Should core.logic support specific