On Tue, Feb 8, 2011 at 1:46 AM, Sean Corfield wrote:
> On Mon, Feb 7, 2011 at 10:01 PM, Bill Robertson
> 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
On Tue, Feb 8, 2011 at 12:31 AM, CuppoJava 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 it falls apart.
On Mon, Feb 7, 2011 at 10:01 PM, Bill Robertson
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 by newer language
Mark Fredrickson 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 "I am e"} #:use
> "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 beca
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 wrote:
> The header documentation for clojure.contrib.condition says:
>
> Note: requires AOT compilation.
>
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 t
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"} #:user.Exa
Ooh! Good point. Thanks!
On Feb 7, 2011 6:56 PM, "Meikel Brandmeyer" 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
--
You
On Mon, Feb 7, 2011 at 10:06 PM, CuppoJava 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 yet. It's just a
On Mon, Feb 7, 2011 at 10:18 PM, Benny Tsai 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 into a lazy
>
On Mon, Feb 7, 2011 at 10:06 PM, CuppoJava 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 yet. It's just
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', whic
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" i
On Mon, Feb 7, 2011 at 9:16 PM, Andreas Kostler
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 :)
You're welcome.
Take-until is
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 PM
On Mon, Feb 7, 2011 at 8:09 PM, Andreas Kostler
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))
>
> ; How do I do this?
> (de
On Feb 7, 3:47 pm, Andy Fingerhut 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 off about half a s
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 so
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 matched
(defn destructure [binding-form]
...magic...)
(defmacro let [forms body]
`(let* ~(vec (destructure forms))
~@body))
On Feb 7, 1:46 pm, CuppoJava wrote:
> 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
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 t
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]]
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 that
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 renam
On Mon, Feb 7, 2011 at 3:30 PM, Ken Wesson wrote:
> On Mon, Feb 7, 2011 at 2:49 PM, Andrew Gwozdziewycz wrote:
>> On Mon, Feb 7, 2011 at 2:16 PM, Ken Wesson wrote:
>>> Can't you just use extend-protocol to group your protocol
>>> implementations for each record type in one place?
>>
>> That cert
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 l
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 Feb
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 clojure@goog
On Mon, Feb 7, 2011 at 3:01 PM, Meikel Brandmeyer 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
On Mon, Feb 7, 2011 at 2:49 PM, Andrew Gwozdziewycz wrote:
> On Mon, Feb 7, 2011 at 2:16 PM, Ken Wesson 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:
>
>
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
On Mon, Feb 7, 2011 at 2:16 PM, Ken Wesson 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 [_] ...)
(baz [_] ...)
whi
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 wrote:
> Hi,
>
> Am
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" g
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 provid
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" functi
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
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 8]
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
- allo
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.
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 wrote:
> Hello
>
> I'm not working actively on clojure-hadoop, so maybe eslick's and clizzin's
> forks could be mor
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]
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
Hello everyone,
I am trying to write the following function:
---
Suppose form = [1 2 [3 4 5 6 7 8]]
(destructure '(a b (c d & e)) form)
should return:
{:a 1 :b 2 :c 3 :d 4 :e [5 6 7 8]}
-
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 pro
2011/2/7 Shantanu Kumar :
>> * 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 firing up jEdit ca
47 matches
Mail list logo