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
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)))
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
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
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,
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
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
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
(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
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,
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
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
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
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
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
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
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
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
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
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.
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,
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]
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
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:
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
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
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
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
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
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
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:
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
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
33 matches
Mail list logo