Why does Clojure at times use Java classes as their base type?

2014-02-03 Thread Adrian Mowat
In a broader sense, it's because Clojure was designed to embrace the underlying runtime. As well as eliminating problems with leaky abstractions (as others have pointed out), it also encourages post to other runtimes like the CLR and JavaScript (clojurescript) Does anyone have a link to a

Review request for a double quoted string parser in parsatron

2014-02-03 Thread Kashyap CK
Hi, I tried out a double quoted string parser in parsatron. I'd appreciate it very much if someone could review it and let me know if it looks okay. (ns mycode.core (:require [the.parsatron :as p])) (p/defparser optional [p default-value] (p/either (p/attempt p) (p/always default-value)))

Re: Idiomatic way to construct potentially time bound target channel in core.async

2014-02-03 Thread Jan Herich
Ok, so i'm thinking about such one-shot detachable input pipe channels... (ns async-util.input-pipe (:require [clojure.core.async.impl.protocols :as impl] [clojure.core.async :refer [! close! go-loop]])) (defprotocol InputPipe (detach* [p])) (defn input-pipe Creates and

Re: Review request for a double quoted string parser in parsatron

2014-02-03 Thread Philipp Meier
Hi, Am Montag, 3. Februar 2014 10:26:56 UTC+1 schrieb Kashyap CK: (p/defparser -char-parser [] (p/let- [ _e (optional (p/char \\) nil) _c (if _e (p/token #(#{\ \\ \n \r \t} %)) (p/token #(not= % \))) ] (p/always (if _e (escape-map _c) _c

Re: Review request for a double quoted string parser in parsatron

2014-02-03 Thread Kashyap CK
Thank you very much Phillip for the tip - #(#{\ \\ \n \r \t} %)) ;; = #{\ \\ \n \r \t} I use the escape-map to get the value of various escape sequence - for example, I want to transform \n in the input text to \newline. Regards, Kashyap On Monday, February 3, 2014 6:56:52 PM UTC+5:30,

How to organize clojure functions? A clojure newbie here...

2014-02-03 Thread Aravindh S
Hi All, I am new to clojure and have been working with the language for the past one week. I have got a basic hold of the constructs in clojure. I have been programming for 4 years in C# now. One thing I am not able to comprehend is how clojure programs are structured. In an OO world, I

ANN: Reagent 0.3.0 - now with async rendering

2014-02-03 Thread Dan Holmsand
Reagent, a minimalistic interface between React.js and ClojureScript, is now at 0.3.0. The new release adds a couple of bugfixes, and async rendering. Read more here: http://holmsand.github.io/reagent/news/reagent-is-async.html The project page is here: https://github.com/holmsand/reagent

Re: How to organize clojure functions? A clojure newbie here...

2014-02-03 Thread Jim - FooBar();
I suggest you check this out: https://github.com/jimpil/MultiSnake/blob/master/src/multi_snake/core.clj It is within the LOC you asked and shows a complete snake-game. It has been adopted and extended from the book Programming Clojure, to handle 2 snakes and some other stuff like dying when

Programming clojure second Edition

2014-02-03 Thread action
(defn index-filter [pred coll] (when pred (for [[idx elt] (indexed coll) :when (pred elt)] idx))) (index-filter #{\a \b} abcdef) - (0 1) but I don't know why use when pred in the code, and why (index-filter {\a \b} abcdef) doesn't work? -- You received this message because you are

Re: How to organize clojure functions? A clojure newbie here...

2014-02-03 Thread Jason Felice
Hi Aravindh! I've found the leiningen source very clean and well organized. It was one of the first production products that I read through, and it has the benefit that you're probably familiar with what it does and will probably want to extend or configure it. On Mon, Feb 3, 2014 at 2:47 AM,

Re: Programming clojure second Edition

2014-02-03 Thread Jim - FooBar();
a vector is a function of its indices a map is a function of its keys a set is a function of its elements does this help at all? Jim On 03/02/14 15:29, action wrote: (defn index-filter [pred coll] (when pred (for [[idx elt] (indexed coll) :when (pred elt)] idx))) (index-filter #{\a

Re: ANN: Another binary parser combinator - this time for java's streams

2014-02-03 Thread Stathis Sideris
Hello, Is it possible to use 'repeated with a dynamic size if the length-defining prefix does not directly precede the content? For example, see PNG chunks: http://en.wikipedia.org/wiki/Portable_Network_Graphics#.22Chunks.22_within_the_file The codec would be: (def chunk (b/ordered-map

lispy.el - a vi-like Paredit. Some Clojure features added.

2014-02-03 Thread Benjamin Peter
Hello Oleh, thank you, this looks cool. Haven't tried such addon yet but this looks inviting. Bye Ben. -- 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

Re: ANN: Another binary parser combinator - this time for java's streams

2014-02-03 Thread Steffen Dienst
I would use header for this: (def chunk (header :int-be #(ordered-map :type (b/repeated :byte :length 4) :data (b/repeated :byte :length %) :crc (b/repeated :byte :length 4)) #(count (:data % The

cljs sound synthesis

2014-02-03 Thread t x
Hi, Are there any tutorials for doing sound synthesis in _cljs_, using latest firefox/chrome features? I'm not looking for http://www.chris-granger.com/2012/02/20/overtone-and-clojurescript/ .. which wraps Overtone . I'm looking for something where the actual synthesis is done in js land as

Re: Programming clojure second Edition

2014-02-03 Thread Justin Smith
if pred is false or nil (the two cases when would rule out), it would be an error to apply it to an argument #{\a \b} is a literal set syntax, containing keys \a and \b. {\a \b} is a literal hash-map syntax, with one key \a mapped to the value \b. As far as index-filter is concerned, it only

GSoC 2014: org applications now open

2014-02-03 Thread Daniel Solano Gómez
Hello, all, Apparently, it's already time for organisations to apply for Google Summer of Coder 2014 [1]. This is a great program, and there have been several notable projects that have benefited as a result. For example, last year's successful projects included: * Enhance Neko for

What's the status of clojure for Android?

2014-02-03 Thread Erlis Vidal
Hi group, I'll be starting a project in Android and I was wondering if I could use clojure as my programming language. Any update/recommendation about this. Will the application have acceptable performance? If not the entire app, can I write at least some libraries in clojure and call them from

Why do I get stackoverflow error?

2014-02-03 Thread Andy Smith
Hi, I am working through the 4clojure questions, I have a few different solutions to problem 87 but all of them run out of stack space. I tried to convert to using recur but I still have the problem. Why does this fail for large n? ((fn pascal ([n] (pascal n [1])) ([n row] (if (= n 1) row

Re: Why do I get stackoverflow error?

2014-02-03 Thread Andy Smith
Correction problem #97 I mean On Monday, 3 February 2014 21:19:36 UTC, Andy Smith wrote: Hi, I am working through the 4clojure questions, I have a few different solutions to problem 87 but all of them run out of stack space. I tried to convert to using recur but I still have the problem.

Re: Why do I get stackoverflow error?

2014-02-03 Thread Mars0i
I don't get a stack overflow error, I get ArithmeticException integer overflow. It's trying to compute an integer that's too big. Try changing [1] to [1M] in (pascal n [1]). On Monday, February 3, 2014 3:19:36 PM UTC-6, Andy Smith wrote: Hi, I am working through the 4clojure questions,

Re: Why do I get stackoverflow error?

2014-02-03 Thread Mars0i
Oops--I do get a stack overflow error if I give it 959 or greater as the argument, instead of 500. It looks like the error is not from the explicit recursion, but is due to concat. Someone who knows more than I do will have to explain this. user= ((fn pascal ([n] (pascal n [1M])) ([n row]

Code re-use in Speclj

2014-02-03 Thread Karsten Schmidt
Hi, I've been getting quite excited about integrating Speclj via its auto-runner into my mixed CLJ/CLJS Org-mode/Babel setup, but now feeling a bit lost how to go about wrapping a number of test characteristics ((it) forms in speclj parlance) into re-usable units. In the assertions below I'd like

partial function revisited (exercise in macros)

2014-02-03 Thread rrs
Hello all, For various reasons, and despite the convenience of anonymous functions, I'd like to have a proper positional parameter binding partial function application. (Actually, I'd like to have by-name parameter binding, but that's another story.) For example, the following seems to work:

Code re-use in Speclj

2014-02-03 Thread Glen Mailer
My usual approach is to use a macro that expands to the appropriate (it) forms, or have a helper function that is called inside each (it) -- 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

Re: Why do I get stackoverflow error?

2014-02-03 Thread Leif
As Mars0i says below, this is due to concat; more specifically, since map, partition, and concat all return lazy sequences, with recursion you are constructing a large chain of nested lazy sequences, as explained here: http://stackoverflow.com/questions/5294055/why-am-i-getting-a-stackoverflow

To post to this group

2014-02-03 Thread actioncao2012
To post to this group actioncao2012 -- 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

Re: What's the status of clojure for Android?

2014-02-03 Thread Zach Oakes
Alex put together a great website that may answer your questions: http://clojure-android.info/ If you have any questions afterwards, feel free to post to the clojure-android group: https://groups.google.com/forum/#!forum/clojure-android On Monday, February 3, 2014 3:17:46 PM UTC-5, Erlis

Re: Programming clojure second Edition

2014-02-03 Thread action
I got it, Think you very much! 在 2014年2月4日星期二UTC+8上午2时01分50秒,Justin Smith写道: if pred is false or nil (the two cases when would rule out), it would be an error to apply it to an argument #{\a \b} is a literal set syntax, containing keys \a and \b. {\a \b} is a literal hash-map syntax, with

Re: GSoC 2014: org applications now open

2014-02-03 Thread Ambrose Bonnaire-Sergeant
Hi Daniel, Thanks for chasing this up. I will volunteer for mentoring and any administration that needs doing. I'll send you my username. Thanks, Ambrose On Tue, Feb 4, 2014 at 3:59 AM, Daniel Solano Gómez cloj...@sattvik.comwrote: Hello, all, Apparently, it's already time for

Re: What's the status of clojure for Android?

2014-02-03 Thread Erlis Vidal
Great! Thanks for the info! On Mon, Feb 3, 2014 at 10:48 PM, Zach Oakes zsoa...@gmail.com wrote: Alex put together a great website that may answer your questions: http://clojure-android.info/ If you have any questions afterwards, feel free to post to the clojure-android group:

Re: lispy.el - a vi-like Paredit. Some Clojure features added.

2014-02-03 Thread Benjamin Peter
Thanks but it is playing way too fast considering you have to monitor two windows. (buffer and keys). -- 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

Re: [ClojureScript] ANN: Reagent 0.3.0 - now with async rendering

2014-02-03 Thread Dan Holmsand
I don't think that is from Reagent. But maybe it comes from css? It does look a bit like a clearfix (or somesuch) css rule gone wrong. /dan On 4 feb 2014, at 04:53, ritchie turner blackdo...@gmail.com wrote: Hi Dan This is a long shot, but I do have some wierd stuff going on at the