2011/2/7 Shantanu Kumar kumar.shant...@gmail.com:
* Is your intent to replace eventually the java version with the
clojure version ? If so, how do you deal with the concern of quick
startup time ?
An idea: jEdit optionally lets you start a background server during
system startup so that
For some reason, whenever I use one of the clojure-contrib 1.3 jars in
my leiningen project file (e.g. org.clojure/contrib/logging) and then
install that (using lein install) into my local repo, I get errors
about the generated pom file to be invalid whenever I try to depend on
the project (the
Nice. I get about 1/3 of the run time on the two systems I've tested
on, too, including one that isn't terribly far off in hardware from
the 64-bit benchmark machine used by the shootout web site.
I'll contact you off list about how this gets submitted to the web site.
Thanks!
Andy
On Feb
Checking out clojure.core/destructure and clojure.core/let might be
helpful.
Here's a macro I hacked together. It doesn't work with :keys, :as,
or :or. I take no responsibility if you use it for anything real. But
maybe it will provide you with some ideas.
(defmacro destructure-map
[bvec val]
Thank you, Alex, for the response and your work on the code. And
thank you for getting the ball rolling on coordinating clojure-hadoop
dev work as well.
On Feb 6, 3:58 am, Alex Ott alex...@gmail.com wrote:
Hello
I'm not working actively on clojure-hadoop, so maybe eslick's and clizzin's
Hey all,
So, for a random project, I found myself using a single protocol
extended to a bunch of record types. I did this using the support
in `defrecord` itself, but what I dislike about it is that the
definitions for each method of the protocol are spread out amongst
multiple sections of code.
Hi All,
Just released v0.2.2 of HTTP Asynchronous Client.
Featuring following changelog http://bit.ly/hc9dxt
- get-encoding helper works w/o Content-Type header
- upgrade async-http-client to v1.5.0
- exposed more configuration options
- zero byte copy mode
- allow providing your own poll
-
I have a library called Evalive (http://github.com/fogus/evalive) that
could help. Specifically I added a macro named `destro` that will do
_mostly_ what you want. Basically, it looks like the following:
(destro [a b [c d e]] [1 2 [3 4 5 6 7 8]])
Which returns:
{vec__2183 [1 2 [3 4 5 6 7
Can't you just use extend-protocol to group your protocol
implementations for each record type in one place?
--
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
Sorry, I wasn't being very clear about my needs.
I need this function to run at *run-time*.
So the following:
(def values [1 2 [3 4 5 6 7 8]])
(def form '(a b (c d e)))
(destructure form values)
Should return:
{:a 1 :b 2 :c 3 :d 4 :e [5 6 7 8]}
I was wondering whether the destructure function
Hi,
Am 07.02.2011 um 18:20 schrieb Justin Kramer:
Checking out clojure.core/destructure and clojure.core/let might be
helpful.
Here's a macro I hacked together. It doesn't work with :keys, :as,
or :or. I take no responsibility if you use it for anything real. But
maybe it will provide you
Hi,
Am 07.02.2011 um 20:26 schrieb CuppoJava:
I was wondering whether the destructure function can be written
using the existing let form. Thanks for your help.
Ah ok. Nevermind.
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups Clojure group.
Thanks for your answer Meikel.
Your answer isn't that ugly. It's very similar to what I have as
well.
I would like to know if you think it's possible to re-use let to do
this. I feel like I'm re-inventing the wheel somewhat.
-Patrick
On Feb 7, 2:44 pm, Meikel Brandmeyer m...@kotka.de wrote:
On Mon, Feb 7, 2011 at 2:16 PM, Ken Wesson kwess...@gmail.com wrote:
Can't you just use extend-protocol to group your protocol
implementations for each record type in one place?
That certainly works, but it's really not much different than:
(defrecord Bar [x y]
Foo
(bar [_] ...)
Hi,
Am 07.02.2011 um 20:51 schrieb CuppoJava:
Thanks for your answer Meikel.
Your answer isn't that ugly. It's very similar to what I have as
well.
I would like to know if you think it's possible to re-use let to do
this. I feel like I'm re-inventing the wheel somewhat.
I don't think
On Mon, Feb 7, 2011 at 2:49 PM, Andrew Gwozdziewycz apg...@gmail.com wrote:
On Mon, Feb 7, 2011 at 2:16 PM, Ken Wesson kwess...@gmail.com wrote:
Can't you just use extend-protocol to group your protocol
implementations for each record type in one place?
That certainly works, but it's really
On Mon, Feb 7, 2011 at 3:01 PM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 07.02.2011 um 20:51 schrieb CuppoJava:
Thanks for your answer Meikel.
Your answer isn't that ugly. It's very similar to what I have as
well.
I would like to know if you think it's possible to re-use let to do
Since this program eliminates so much of the work, it's disappointing
that
there wasn't more of a speedup.
Can you (or anyone) speed it up even further?
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to
Actually that would be fine as a solution as well. I'm stumped as to
how to avoid repeating the same thing twice (once in function world
and once in macro world).
ie. Let's assume that we have this destructuring function. How do we
use that do program a destructuring let macro?
-Patrick
On
On Feb 7, 2011, at 12:37 PM, Bill James wrote:
Since this program eliminates so much of the work, it's disappointing
that
there wasn't more of a speedup.
Can you (or anyone) speed it up even further?
I spent some time doing some small tweaks.
On one machine I have, your version runs in as
On Mon, Feb 7, 2011 at 3:30 PM, Ken Wesson kwess...@gmail.com wrote:
On Mon, Feb 7, 2011 at 2:49 PM, Andrew Gwozdziewycz apg...@gmail.com wrote:
On Mon, Feb 7, 2011 at 2:16 PM, Ken Wesson kwess...@gmail.com wrote:
Can't you just use extend-protocol to group your protocol
implementations for
Dear fellow clojurians,
I'd like to announce release 1.4 of the clojuresque plugin for gradle. It makes
gradle clojure aware and helps with compiling and testing clojure code in
gradle-powered projects.
Changes to 1.3:
* compatible with gradle 0.9
* leiningen style deps task
* ueberjar is
Hi,
Yes, I would like to replace Java version with Clojure. For the
shorter startup time, I will try to do some threading (for menu
building and configuration reading) and compile clj files of boostrap
module (not existing yet) to .class. If the problem would lay in
clojure itself then I hope
Playing around a bit more:
(defprotocol Foo
(bar [_] do bar)
(baz [_] do baz))
(defmacro defp [name arglist proto bodies]
(let [pairs (partition 2 bodies)
protocol (resolve proto)
namekw (keyword name)
impls (reduce (fn [accum [t body]]
(let
Hi,
Am 07.02.2011 um 23:53 schrieb Andrew Gwozdziewycz:
Though, it doesn't return (satisfies? Foo String) correctly, but, I'll
either figure that out later, or ultimately not care.
satisfies? is about instances.
Sincerely
Meikel
--
You received this message because you are subscribed to
(defn destructure [binding-form]
...magic...)
(defmacro let [forms body]
`(let* ~(vec (destructure forms))
~@body))
On Feb 7, 1:46 pm, CuppoJava patrickli_2...@hotmail.com wrote:
Actually that would be fine as a solution as well. I'm stumped as to
how to avoid repeating the same thing
Hi all,
Is it possible to read from a lazy input sequence? I have a telnet
connection using commons.telnet and I want to do something like:
(def telnet (TelnetClient.))
(def in (. telnet getInputStream))
; How do I do this?
(def read-until
; read from a lazy input sequence UNTIL prompt is
The header documentation for clojure.contrib.condition says:
Note: requires AOT compilation.
What do I therefore do differently? How should my program text change?
Conditions seem to work in the REPL, but not in my program. I don't know if
that's due to the mysteries of AOT compiling or
On Feb 7, 3:47 pm, Andy Fingerhut andy.finger...@gmail.com wrote:
(defn find-index [f coll]
(loop [i (int 0)
s (seq coll)]
(if (f (first s))
i
(recur (unchecked-inc i) (rest s)
I didn't realize how slow my version of this was.
This change alone shaves
On Mon, Feb 7, 2011 at 8:09 PM, Andreas Kostler
andreas.koestler.le...@gmail.com wrote:
Hi all,
Is it possible to read from a lazy input sequence? I have a telnet
connection using commons.telnet and I want to do something like:
(def telnet (TelnetClient.))
(def in (. telnet getInputStream))
Thank's Ken, that's doing what I want. However, being the noob I am, I don't
quite understand what's going on.
Do you mind elaborating a little bit on the functions? Your help is greatly
appreciated :)
Cheers
Andreas
On 08/02/2011, at 12:00 PM, Ken Wesson wrote:
On Mon, Feb 7, 2011 at 8:09
On Mon, Feb 7, 2011 at 9:16 PM, Andreas Kostler
andreas.koestler.le...@gmail.com wrote:
Thank's Ken, that's doing what I want. However, being the noob I am, I don't
quite understand what's going on.
Do you mind elaborating a little bit on the functions? Your help is greatly
appreciated :)
I've thought about that actually. And it wouldn't work.
So (defn destructure [form value]
...magic...)
(defmacro let [forms body]
`(let* ~(vec (destructure forms body)) - at this point, body is
not known yet. It's just a symbol.
~@body)
This approach won't work because body is
The blip.tv video of Tom Faulhaber's Lisp, Functional Programming,
and the State of Flow talk from Clojure Conj showed me 'fill-queue',
which seems like a good fit here.
'fill-queue' is a way to turn input from any source into a lazy
sequence. You give it a one-arg function, 'filler-func', which
On Mon, Feb 7, 2011 at 10:06 PM, CuppoJava patrickli_2...@hotmail.comwrote:
I've thought about that actually. And it wouldn't work.
So (defn destructure [form value]
...magic...)
(defmacro let [forms body]
`(let* ~(vec (destructure forms body)) - at this point, body is
not known
On Mon, Feb 7, 2011 at 10:18 PM, Benny Tsai benny.t...@gmail.com wrote:
The blip.tv video of Tom Faulhaber's Lisp, Functional Programming,
and the State of Flow talk from Clojure Conj showed me 'fill-queue',
which seems like a good fit here.
'fill-queue' is a way to turn input from any source
On Mon, Feb 7, 2011 at 10:06 PM, CuppoJava patrickli_2...@hotmail.com wrote:
I've thought about that actually. And it wouldn't work.
So (defn destructure [form value]
...magic...)
(defmacro let [forms body]
`(let* ~(vec (destructure forms body)) - at this point, body is
not known
Ooh! Good point. Thanks!
On Feb 7, 2011 6:56 PM, Meikel Brandmeyer m...@kotka.de wrote:
Hi,
Am 07.02.2011 um 23:53 schrieb Andrew Gwozdziewycz:
Though, it doesn't return (satisfies? Foo String) correctly, but, I'll
either figure that out l...
satisfies? is about instances.
Sincerely
Meikel
Is the following behavior correct or a bug:
user (defrecord Example [data] clojure.lang.IFn (invoke [this] this)
(invoke [this n] (repeat n this)))
user.Example
user (def e (Example. I am e))
#'user/e
user e
#:user.Example{:data I am e}
user (e 2)
(#:user.Example{:data I am e}
Thanks for the reply Ken.
While the macro is executing body will be bound to an
s-expression (basically, source code parsed to an AST but no further;
source code as processed by the reader).
This is the part where it falls apart. body is actually bound to a
single symbol.
For example in the
https://github.com/technomancy/leiningen/blob/master/sample.project.clj
try adding
:aot [clojure.contrib.condition]
to your project.clj ?
On Mon, Feb 7, 2011 at 17:56, Brian Marick mar...@exampler.com wrote:
The header documentation for clojure.contrib.condition says:
Note: requires
Programming Clojure is also a good book, but it is now
somewhat dated as to what is happening in the language.
In what ways?
I am reading the book now, and I would like to know if there are any
sections that might be superseded by newer language features.
--
You received this message because
Mark Fredrickson mark.m.fredrick...@gmail.com writes:
Is the following behavior correct or a bug:
user (defrecord Example [data] clojure.lang.IFn (invoke [this] this)
(invoke [this n] (repeat n this)))
user.Example
user (def e (Example. I am e))
#'user/e
user (e 2)
(#:user.Example{:data
On Mon, Feb 7, 2011 at 10:01 PM, Bill Robertson
billrobertso...@gmail.com wrote:
Programming Clojure is also a good book, but it is now
somewhat dated as to what is happening in the language.
I am reading the book now, and I would like to know if there are any
sections that might be superseded
On Tue, Feb 8, 2011 at 12:31 AM, CuppoJava patrickli_2...@hotmail.com wrote:
Thanks for the reply Ken.
While the macro is executing body will be bound to an
s-expression (basically, source code parsed to an AST but no further;
source code as processed by the reader).
This is the part where
On Tue, Feb 8, 2011 at 1:46 AM, Sean Corfield seancorfi...@gmail.com wrote:
On Mon, Feb 7, 2011 at 10:01 PM, Bill Robertson
billrobertso...@gmail.com wrote:
Programming Clojure is also a good book, but it is now
somewhat dated as to what is happening in the language.
I am reading the book
46 matches
Mail list logo