Re: easier way to write "not not"?

2013-07-16 Thread Alex Baranosky
`boolean`. Agreed. On Tue, Jul 16, 2013 at 11:13 PM, Shantanu Kumar wrote: > > > On Wednesday, 17 July 2013 11:42:10 UTC+5:30, JvJ wrote: >> >> Not that it's a big deal, but is there a standard library function for >> #(not (not %))? > > > Just say `boolean` maybe? > > Shantanu > > -- > -- > You

Re: easier way to write "not not"?

2013-07-16 Thread Shantanu Kumar
On Wednesday, 17 July 2013 11:42:10 UTC+5:30, JvJ wrote: > > Not that it's a big deal, but is there a standard library function for > #(not (not %))? Just say `boolean` maybe? Shantanu -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

easier way to write "not not"?

2013-07-16 Thread JvJ
Not that it's a big deal, but is there a standard library function for #(not (not %))? -- -- 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 -

Re: [ANN] simple-sheck - A QuickCheck inspired testing tool

2013-07-16 Thread Alex Baranosky
Hi Reid, I dig how nicely it integrates with clojure.test. Does simple-check implement some form of shrinking? On Tue, Jul 16, 2013 at 12:20 PM, Reid Draper wrote: > Derp, I fat-fingered my own library name in the subject :) > > > On Tuesday, July 16, 2013 2:18:54 PM UTC-5, Reid Draper wrote:

Re: core.async: close! and control channels

2013-07-16 Thread Alan Shaw
My code is at https://github.com/nodename/async-plgd . Here I reproduce Hoare's coroutines from the CSP paper, and find that none of the examples with pipelined coroutines work reliably. I'd appreciate any advice. On Tue, Jul 16, 2013 at 4:34 PM, Alan Shaw wrote: > It appears that you cannot ca

Socket.IO and Clojure?

2013-07-16 Thread Sean Corfield
At work we're starting down the path of building a new piece of functionality based on WebSockets and the external team we're working with is a Node.js shop so their go to solution is Socket.IO and they've produced a very nice front end in CoffeeScript and a prototype back end on Node.js. I'd real

ANN: core.match 0.2.0-rc4

2013-07-16 Thread David Nolen
Yet another core.match release candidate this time addressing outstanding ClojureScript support issues as well as some breaking changes for ClojureScript users - I've reorganized the namespaces, documented here - http://github.com/clojure/core.match/blob/master/CHANGES.md Feedback welcome! http:/

Re: --> macro proposal

2013-07-16 Thread Gary Johnson
Ugh. What a pointless thread. Someone could have just said: --- It's already in clojure 1.5. The form you are looking for is called as->. Your original example would be written like this: (as-> 3 x (+ 1 x 4) (prn "answer:" x)) --- Done. Yeesh. On Sunday, July 14, 2013 12:34:02 PM UTC-4,

Re: Request for clojure help

2013-07-16 Thread Sean Corfield
NP. Many of us are only too happy to help folks new to Clojure get over these humps and become productive! :) On Tue, Jul 16, 2013 at 6:57 PM, Keith Maynard wrote: > Wow Awesome Sean, I dropped your code in and it worked immediately > > It's quite a challenge figuring out the various idio

Re: Request for clojure help

2013-07-16 Thread Keith Maynard
Wow Awesome Sean, I dropped your code in and it worked immediately It's quite a challenge figuring out the various idioms in all these amazing languages. Thanks for clearing up my attempt at a multimethod :) Regards, Keith On Tuesday, July 16, 2013 6:03:14 PM UTC-4, Sean Corfield wrote

Re: OAuth2

2013-07-16 Thread Chas Emerick
Hi Steven, I'm sorry to hear you didn't find Friend easy to use. FWIW, you (and whoever is following along) might find this helpful: https://friend-demo.herokuapp.com/ There are live examples of apps using OpenID, OAuth (via github), and more pedestrian stuff like forms and HTTP Basic

[ANN] bouncer 0.2.3-beta4

2013-07-16 Thread Leonardo Borges
Hi all, bouncer is a validation DSL for Clojure apps Github: https://github.com/leonardoborges/bouncer Clojars: https://clojars.org/bouncer New in version 0.2.3-beta4: - Validator sets can now be used at the top level call to validate and valid? - Added tests and a doc section around validation

core.async: close! and control channels

2013-07-16 Thread Alan Shaw
It appears that you cannot call close! within a go block and so to signal the end of input to a channel you have to use another channel upon which the receiver can alt!. Some channels that are not stateful, such as a plain copier, would need no such mechanism. Or would it be good to use such a thi

Re: [ANN] Vertigo: fast, idiomatic C-style structs

2013-07-16 Thread Zach Tellman
Yeah, one nice property of this is that all the underlying objects play nicely with byte-streams [1], so it's trivial to do something like: --- (def s (vertigo.core/wrap type "some-huge-file")) (let [indices (sort-by #(vertigo.core/get-in s [% :foo :bar]) (range (count s))] (doseq [idx indices

Re: Request for clojure help

2013-07-16 Thread Sean Corfield
On Tue, Jul 16, 2013 at 2:16 PM, Keith Maynard wrote: > (defn perms > ( [] [[]]) This is not pattern matching in Clojure. It defines an alternative arity version of the function so that (perms) would return [[]]. > ([xs] > > (for [x xs p (perms (removeFirst x xs))] (cons x p)) ) > > ) Yo

Request for clojure help

2013-07-16 Thread Keith Maynard
(defn removeFirst [x xs] (if (= x (first xs)) (rest xs) (cons (first xs) (removeFirst x (rest xs) (defn perms ( [] [[]]) ([xs] (for [x xs p (perms (removeFirst x xs))] (cons x p)) ) ) Good day, I have been studying a functional approach to the design and analysis of algorithm

Re: [ANN] simple-sheck - A QuickCheck inspired testing tool

2013-07-16 Thread Reid Draper
Derp, I fat-fingered my own library name in the subject :) On Tuesday, July 16, 2013 2:18:54 PM UTC-5, Reid Draper wrote: > > I'm happy to announce the first non-snapshot version (0.1.0) of > simple-check, a QuickCheck inspired testing tool: > https://github.com/reiddraper/simple-check. > > simp

[ANN] simple-sheck - A QuickCheck inspired testing tool

2013-07-16 Thread Reid Draper
I'm happy to announce the first non-snapshot version (0.1.0) of simple-check, a QuickCheck inspired testing tool: https://github.com/reiddraper/simple-check. simple-check is a fairly faithful port of a subset of Haskell's QuickCheck, with some additional inspiration from Erlang QuickCheck. With

Re: [ANN] - 17th tutorial - Enlive by REPLing - of the modern-cljs series

2013-07-16 Thread Giacomo Cosenza
Thanks Greg, your appreciation is very helpful in finding the energy to go on creating new tutorials for the series. thanks so much again Mimmo On Jul 16, 2013, at 6:20 PM, Greg wrote: > Excellent work as usual Mimmo! > > I continue to find your tutorials very helpful. Thank you very much for

Re: [ANN] Fluokitten - Category theory concepts in Clojure - Functors, Applicatives, Monads, Monoids and more

2013-07-16 Thread Dragan Djuric
Hi Ben and everyone who participated in the discussion. Most of the issues we have been discussed (most notably mdo and agnostic return) have been implemented in the newly released version 0.3.0. No macrology was necessary for agnostic return :) Please try the new version and post your feedback.

[ANN] Fluokitten 0.3.0 - Monads and more - now features

2013-07-16 Thread Dragan Djuric
Fluokitten - Category Theory in Idiomatic Clojure has just been upgraded to 0.3.0 Get started guide: http://fluokitten.uncomplicate.org/articles/getting_started.html The library is in the clojars, so lein will pick it up easily. There are lot of new features: - mdo macro as a syntactic suga

Re: [ANN] - 17th tutorial - Enlive by REPLing - of the modern-cljs series

2013-07-16 Thread Greg
Excellent work as usual Mimmo! I continue to find your tutorials very helpful. Thank you very much for creating them! -Greg -- Please do not email me anything that you are not comfortable also sharing with the NSA. On Jul 14, 2013, at 11:53 AM, Mimmo Cosenza wrote: > Hi all, I just publishe

Re: OAuth2

2013-07-16 Thread Bastien
Hi all, Dave Della Costa writes: > Here are some more in-depth examples: > > https://github.com/ddellacosta/friend-oauth2-examples Thanks for this examples, very useful! I'm trying to finish integrating friend within a Luminus-based webapp project, but I'm stuck, I'd glad to get some help. Us

Re: Comma separated String values from vector

2013-07-16 Thread sunilmuvas
Thanks everyone for contributing. => (clojure.string/join "," (map #(str \" % \") my-strings)) works perfectly for my case and that will do for now. /Sunil. On Tuesday, July 16, 2013 3:52:03 PM UTC+1, Luc wrote: > > I assume here that the strings are already escaped. Which might not be > true

Re: OAuth2

2013-07-16 Thread Steven Degutis
I heard good things about friend , so I tried to use it for OpenID (to sign-in with Google). But I couldn't figure out how, so I just used openid4java . On Mon, Jul 15, 2013 at 8:57 PM, Plínio Balduino wrote: > Hi there

Re: is it possible to join on lazy seqs?

2013-07-16 Thread mond
I am trying to produce a list of records where the keys match. It makes sense to me ;-) The examples from the docs show this: *(join animals personalities {:kind :species}) * and the third argument is a key map to show which fields from the two collections should be treated as the same key * *

Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
I assume here that the strings are already escaped. Which might not be true at all. pr-sr is safer in this regard but 6 times slower. Luc P. > (apply str (interpose "," (map #(str "\"" % "\"") [...]))) > > Not the most efficient way but short. > > Luc P. > > > > Hi All, > > > > I'm new to C

Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
Pr-str is very slow compared to string concats Luc P. > Jay beat me to it. :) > > I'll add the documentation for pr-str: > http://clojuredocs.org/clojure_core/clojure.core/pr-str > > Jonathan > > > On Tue, Jul 16, 2013 at 4:39 PM, Jay Fields wrote: > > > this seems to do what you want:

Re: is it possible to join on lazy seqs?

2013-07-16 Thread Michael Klishin
2013/7/16 mond > check-delta-feeds.core=> (set/join changed-records feed-entries {:ID > :dh-uuid}) > ClassCastException clojure.lang.LazySeq cannot be cast to java.util.Map > clojure.lang.RT.find (RT.java:733) > You can use clojure.set/join on lazy sequences but joining a list (produced by a se

is it possible to join on lazy seqs?

2013-07-16 Thread mond
Sorry if this is a RTFM style question ... this is what I have in terms of types and was wondering if there is another form of join or another library / collection combination that can achieve the same relational join? Thanks in advance, Ray check-delta-feeds.core=> (def changed-records (map f

Re: Comma separated String values from vector

2013-07-16 Thread Softaddicts
(apply str (interpose "," (map #(str "\"" % "\"") [...]))) Not the most efficient way but short. Luc P. > Hi All, > > I'm new to Clojure - > > I'm defining a vector containing string values. The requirement for me is > to retrieve the String values separated by comma from the input vector.

Re: Comma separated String values from vector

2013-07-16 Thread Jonathan Fischer Friberg
Jay beat me to it. :) I'll add the documentation for pr-str: http://clojuredocs.org/clojure_core/clojure.core/pr-str Jonathan On Tue, Jul 16, 2013 at 4:39 PM, Jay Fields wrote: > this seems to do what you want: (clojure.string/join ", " (map pr-str > my-strings)) > > > On Tue, Jul 16, 2013 at

Re: Comma separated String values from vector

2013-07-16 Thread Jay Fields
this seems to do what you want: (clojure.string/join ", " (map pr-str my-strings)) On Tue, Jul 16, 2013 at 10:17 AM, Cedric Greevey wrote: > (apply str "\"" (interpose "\", \"" my-strings) "\"") might work... > > > On Tue, Jul 16, 2013 at 9:53 AM, wrote: > >> Hi All, >> >> I'm new to Clojure -

Re: Comma separated String values from vector

2013-07-16 Thread Maximilian Karasz
hi, i might be wrong but it seems you're looking for something like https://github.com/clojure/data.csv cheers, -Max On Jul 16, 2013, at 3:53 PM, sunilmu...@gmail.com wrote: > Hi All, > > I'm new to Clojure - > > I'm defining a vector containing string values. The requirement for me is to

Re: Comma separated String values from vector

2013-07-16 Thread Cedric Greevey
(apply str "\"" (interpose "\", \"" my-strings) "\"") might work... On Tue, Jul 16, 2013 at 9:53 AM, wrote: > Hi All, > > I'm new to Clojure - > > I'm defining a vector containing string values. The requirement for me is > to retrieve the String values separated by comma from the input vector.

Comma separated String values from vector

2013-07-16 Thread sunilmuvas
Hi All, I'm new to Clojure - I'm defining a vector containing string values. The requirement for me is to retrieve the String values separated by comma from the input vector. Example: => (def my-strings ["one" "two" "three"]) ;; My expected output should be ;; *"one", "two", "three"* I tr

Re: OAuth2

2013-07-16 Thread Plínio Balduino
Thank you =) On Tue, Jul 16, 2013 at 6:47 AM, Dave Della Costa wrote: > Here are some more in-depth examples: > > https://github.com/ddellacosta/friend-oauth2-examples > > Please do use version 0.0.4 or above as anti-CSRF protection is > incorporated. I still owe Chas a pull request with an up t

Re: [ClojureScript] core.async - IOC in go blocks

2013-07-16 Thread David Nolen
Yes that won't work. If something locks up the JavaScript process with an infinite loop those other go blocks will never get a chance to run. I believe even wrapping the final loop/recur in a go block won't help the issue. But I don't think this is a limitation in practice. On Tue, Jul 16, 2013

Re: cljs.core.async: Uncaught ReferenceError: state_machine__5113__auto____$1 is not defined

2013-07-16 Thread Mike Longworth
Thanks Tassilo, As you point out, if I move the nested function outside the go then the problem is fixed. This test case is only a simplification of the original code so I can't do this in my actual code however after much head scratching I now understand the purpose of take! and it addresses

Re: OAuth2

2013-07-16 Thread Dave Della Costa
Here are some more in-depth examples: https://github.com/ddellacosta/friend-oauth2-examples Please do use version 0.0.4 or above as anti-CSRF protection is incorporated. I still owe Chas a pull request with an up to date version of friend-oauth2. Please note, it is in development, still rather

Re: cljs.core.async: Uncaught ReferenceError: state_machine__5113__auto____$1 is not defined

2013-07-16 Thread Tassilo Horn
Mike Longworth writes: > I'm trying to use cljs.core.async to convert async code to > synchronous, I've hit a problem chaining some calls. I'm getting a > runtime state machine problem, here is a test case for the issue: Since the go macro transforms its body, you cannot have function defs using

cljs.core.async: Uncaught ReferenceError: state_machine__5113__auto____$1 is not defined

2013-07-16 Thread Mike Longworth
I'm trying to use cljs.core.async to convert async code to synchronous, I've hit a problem chaining some calls. I'm getting a runtime state machine problem, here is a test case for the issue: (defn td [id t] > (let [c (chan)] > (window/setTimeout (fn [] (go (>! c (name id t) > c >