Re: Change the CCW compile output catalog

2012-12-02 Thread Vladimir Tsichevski
You aswers had everything I needed to know to move forward. Did not notice anything strange in them. It were late hours here in Moscow thought :-) On Sunday, December 2, 2012 2:32:45 AM UTC+4, lpetit wrote: > > 2012/12/1 Laurent PETIT >: > > Hello, > > > > 2012/12/1 Vladimir Tsichevski >: > >

[ANN] vectorz-clj - high performance vector maths for Clojure

2012-12-02 Thread Mikera
Hi All, I just open sourced a new Clojure library vectorz-clj with support for high performance vector maths in Clojure. It's fairly general purpose, and designed for use in 3D games, simulations and machine learning applications. I'm using it for my own machine learning apps and it is working

exception in 'map' mutates result to nil -- bug?

2012-12-02 Thread Hank
I'm mapping a function that throws an exception over a collection: => (def mapped (map (fn [_] (throw (Exception.))) [1 2 3])) #'user/mapped 'map' is lazy so we're not expecting to see the exception until we're trying to access the result: => mapped Exception user/fn--709 (NO_SOURCE_FILE:1) A

Re: (iterate inc 2) vs (drop 2 (range)) in corecursion

2012-12-02 Thread maclo
Hi user=> (def primes > (cons 2 > (filter > (fn isprime[n] > > (every? > #(pos? (mod n %)) > (take-while #(<=(* % %)n) primes))) > (iterate inc 3 > user=> (take 50 primes) > (2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

STM - a request for "war stories"

2012-12-02 Thread Paul Butcher
All, I have a request which I hope the members of this group are uniquely positioned to help with. I have recently started working on a new book for The Pragmatic Programmers with the working title "Seven Concurrency Models in Seven Weeks" (it follows on from their existing "Seven Languages" an

Re: math expression simplifier, kibit implementation

2012-12-02 Thread David Nolen
On Sat, Dec 1, 2012 at 12:24 AM, Jonas wrote: > > * Predicates on logic vars: > [(foo (? x number?)) (bar ?x)] => match (foo 42) but not (foo :bar) > This is now possible since we have constraints. > * Segment vars: > [(* ??x 1 ??y) (* ??x ??y)] => (* 4 3 2 1 2 3 4) would turn into (*

Can anyone point me to that library that supports quasiquoting without full namespace expansion?

2012-12-02 Thread Conrad
I remember seeing it somewhere recently but I can't find it now... As you probably know, if you quasiquote in clojure it automatically adds namespaces: > `[foo ~1] [mylibrary.core/foo 1] The library I am looking for lets you write: > (template [foo ~1]) [foo 1] Thanks for your help! -- You

Re: Can anyone point me to that library that supports quasiquoting without full namespace expansion?

2012-12-02 Thread Conrad
Never mind, I just found it on clojars. It is: https://github.com/brandonbloom/backtick On Sunday, December 2, 2012 12:24:29 PM UTC-6, Conrad wrote: > > I remember seeing it somewhere recently but I can't find it now... > > As you probably know, if you quasiquote in clojure it automatically adds

Re: math expression simplifier, kibit implementation

2012-12-02 Thread Jonas
On Sunday, December 2, 2012 7:33:17 PM UTC+2, David Nolen wrote: > > On Sat, Dec 1, 2012 at 12:24 AM, Jonas >wrote: > >> >> * Predicates on logic vars: >> [(foo (? x number?)) (bar ?x)] => match (foo 42) but not (foo :bar) >> > > This is now possible since we have constraints. > Awesome. I

working with multiple handlers

2012-12-02 Thread Frank Lee
Hi, I'm trying to write an xmpp, which after receiving a message, pushes the messages with a websocket using async-push. I can't figure out how to do this because both xmpp and async-push use event handlers -- how do I chain them together. This code doesn't work, but I guess you get the idea of

(def some? (comp not nil? some))

2012-12-02 Thread Tom Hall
Hi Guys, We seem to have not-any? but not an any? function, I know we have some but it is not a predicate and I found myself defining some? above today. Why not have some? or any? in the core? Cheers, Tom -- You received this message because you are subscribed to the Google Groups "Clojure" gro

[ANN] modern-cljs - tutorial 9 on testing (part 1)

2012-12-02 Thread Mimmo Cosenza
Hi, I just published the 9th tutorial of the series modern-cljs. It talks about testing. It uses the CLJS proposed patch as a true sample case to work on. HIH My best Mimmo -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: (def some? (comp not nil? some))

2012-12-02 Thread Jim - FooBar();
Its perfectly fine to use some as a predicate as far as I know...works excellent with if-let/when-let - what is the problem? Jim On 02/12/12 19:47, Tom Hall wrote: Hi Guys, We seem to have not-any? but not an any? function, I know we have some but it is not a predicate and I found myself def

small error on clojure.org/reader

2012-12-02 Thread Otto Allmendinger
(I couldn't figure out where to put this so I might as well just post it here) The page says > Syntax-quote (` where it should say > Syntax-quote `( Otto -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clo

Re: (def some? (comp not nil? some))

2012-12-02 Thread Ben Wolfson
On Sun, Dec 2, 2012 at 12:48 PM, Jim - FooBar(); wrote: > Its perfectly fine to use some as a predicate as far as I know...works > excellent with if-let/when-let - what is the problem? There might be cases in which it matters whether something returns nil (as 'some' does) or false (as 'some?' wou

Re: [ANN] modern-cljs - tutorial 9 on testing (part 1)

2012-12-02 Thread Michael Klishin
2012/12/3 Mimmo Cosenza > I just published the 9th tutorial of the series modern-cljs. > > It talks about testing. It uses the CLJS proposed patch as a true sample > case to work on. > HIH > The link: https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-09.md Thank you! -- MK ht

Re: [ANN] vectorz-clj - high performance vector maths for Clojure

2012-12-02 Thread Mikera
Sure - added instructions and uploaded version 0.0.1 to Clojars. Hopefully that works smoothly, any issues let me know. On Sunday, 2 December 2012 13:56:07 UTC, Michael Klishin wrote: > > 2012/12/2 Mikera > > >> The Clojure library is here: https://github.com/mikera/vectorz-clj >> > > Please add

Re: [ANN] modern-cljs - tutorial 9 on testing (part 1)

2012-12-02 Thread Mimmo Cosenza
ops. thanks mimmo On Dec 2, 2012, at 10:15 PM, Michael Klishin wrote: > 2012/12/3 Mimmo Cosenza > I just published the 9th tutorial of the series modern-cljs. > > It talks about testing. It uses the CLJS proposed patch as a true sample > case to work on. > HIH > > The link: > https://gith

Re: small error on clojure.org/reader

2012-12-02 Thread Andy Fingerhut
The full sentence is this: Syntax-quote (`, note, the "backquote" character), Unquote (~) and Unquote-splicing (~@) It looks like perhaps someone started writing this: Syntax-quote (`), Unquote (~) and Unquote-splicing (~@) and then added some more explanatory text inside the parenthes

Re: Change the CCW compile output catalog

2012-12-02 Thread Dave Ray
Hey Laurent, For what it's worth, I was a little surprised that CCW used it's own output folder rather than Eclipse's, but I understand why you'd do it that way. One thing that was a little problematic was that CCW automatically created the folder and added it to the Eclipse classpath when all I

Re: Can anyone point me to that library that supports quasiquoting without full namespace expansion?

2012-12-02 Thread Brandon Bloom
I just published a new 0.2.0-SNAPSHOT that includes a fix parallel to Rich Hickey's change to handling of records in Clojure 1.5. On Sunday, December 2, 2012 10:27:46 AM UTC-8, Conrad wrote: > > Never mind, I just found it on clojars. It is: > https://github.com/brandonbloom/backtick > > On Sund

confused about the scope of variables, or is it something else? ClojureScript

2012-12-02 Thread Arash Bizhan zadeh
I am playing with clojurescript, and I have this code: (defn prepare [number] (def targets (take 4 (drop (* 4 (- number 1)) (dom/getElementsByClass "place-div" (def target-objects (map #(make-target %) targets)) (for [drag draggables target target-objects] (.addTarget drag target))

Re: Proposed change to let-> syntax

2012-12-02 Thread Terje Norderhaug
On Thu, Nov 15, 2012 at 5:17 PM, Alan Malloy wrote: > The primary point of let-> is that you can insert it into an existing -> > pipeline. > > (-> foo > (stuff) > (blah) > (let-> foo-with-stuff > (for [x foo-with-stuff] > (inc x))) This use case of the macro now renamed

Re: confused about the scope of variables, or is it something else? ClojureScript

2012-12-02 Thread Sean Corfield
Part of it is laziness: map is lazy so it doesn't do anything unless you use the result. In the REPL, you print the result so map runs across the whole sequence. In the function, only the last expression (draggables) is returned so it is the only thing fully evaluated. Your code is very procedural

Re: Proposed change to let-> syntax

2012-12-02 Thread Terje Norderhaug
Here is the short form of the proposal below: 1. Make as-> in Clojure 1.5 have a syntax and semantic matching how fn is used in pipelines. 2. Rename as-> to fn-> reflecting its similarity to fn. -- Terje Norderhaug On Sun, Dec 2, 2012 at 5:30 PM, Terje Norderhaug wrote: > On Thu, Nov 15, 2012 a

Ann: cljs-uuid-utils (Re: CLJS: UUID generator for ClojureScript)

2012-12-02 Thread Frank Siebenlist
I've wrapped my random uuid generator up in a little library at: https://github.com/franks42/cljs-uuid-utils --- cljs-uuid-utils ClojureScript micro-library with an implementation of a type 4, random UUID generator compatible with RFC-4122 and cljs.core/UUID (make-random-uuid), a uuid-string c

Re: Can anyone point me to that library that supports quasiquoting without full namespace expansion?

2012-12-02 Thread Armando Blancas
You can do: user=> `[~'foo 1] [foo 1] On Sunday, December 2, 2012 10:24:29 AM UTC-8, Conrad wrote: > > I remember seeing it somewhere recently but I can't find it now... > > As you probably know, if you quasiquote in clojure it automatically adds > namespaces: > > > `[foo ~1] > [mylibrary.core/f

Re: math expression simplifier, kibit implementation

2012-12-02 Thread David Nolen
On Sun, Dec 2, 2012 at 1:42 PM, Jonas wrote: > > > On Sunday, December 2, 2012 7:33:17 PM UTC+2, David Nolen wrote: > >> On Sat, Dec 1, 2012 at 12:24 AM, Jonas wrote: >> >>> >>> * Predicates on logic vars: >>> [(foo (? x number?)) (bar ?x)] => match (foo 42) but not (foo :bar) >>> >> >> This

Re: [ANN] ClojureScript release 0.0-1535 with G.Closure 0.0-2029

2012-12-02 Thread David Nolen
On Sun, Dec 2, 2012 at 2:11 AM, Evan Mezeske wrote: > > That said what's the compelling reason these days for lein-cljsbuild to >> depend on a specific version of ClojureScript? Are you relying on certain >> aspects of the analyzer or compiler's API and find that they change quite >> frequently?

Re: exception in 'map' mutates result to nil -- bug?

2012-12-02 Thread julianrz
Hmm.. I think you are raising both a technical and a philosophical issue - what exactly should a higher-order function return when some application of the supplied function throws exception... The behaviors could be: 1) throw 2) return null 3) return an empty collection (do not continue after 1st

Re: exception in 'map' mutates result to nil -- bug?

2012-12-02 Thread Hank
I've got this narrowed down to what seems an interaction issue between macros and closures in lazy-seq. Run this code: (defn gen-lazy [] (let [coll [1 2 3]] (lazy-seq (when-let [s (seq coll)] (throw (Exception.)) ) ) ) ) (def lazy (gen-lazy)) (try (prin

Re: exception in 'map' mutates result to nil -- bug?

2012-12-02 Thread Hank
Julian, see my other post, it has nothing to do with map per se. Apart from philosophical questions, the reason I need this to consistently raise an exception, is that I want to interrupt the map evaluation when it is slow, throwing an InteruptedException. I then want to recommence evaluation l

Re: (iterate inc 2) vs (drop 2 (range)) in corecursion

2012-12-02 Thread Christophe Grand
Hi maclo, Your code assume there is two "primes" sequences: the result and the one being constructed. But there's only one and which is infinite. You define your sequence as being (cons 2 something) and computing "something" requires evaluating (every? #(pos? (mod 3 %)) (cons 2 something)) since (