Just wanted to say I had a great time at the meetup. Really fun to
see people using Clojure in earnest and hear Rich talk about stuff. I
blogged it a bit here:
http://tech.puredanger.com/2009/06/10/clojure-rich-hickey/
On Jun 4, 11:44 am, Paul Mooser wrote:
> I wanted to say thank you to eve
> fmap maps a function on the values in a data structure, returning an
> equivalent data structure containing the function results. This is
> different from map that applies a function to a sequence and returns
> another sequence.
Very neat, Konrad! That sure saves some typing.
I always find loo
On 11.06.2009, at 06:52, alfred.morgan.al...@gmail.com wrote:
> Again, thanks for all the help. One last question, though- how would
> I apply the 'map' function to an actual associative mapping? I mean-
>
> (defn testFunc [x] (* x 2))
> (println (map testFunc {:a 1 :b 2 :c 3}))
(use 'clojure.
Thanks. See reponses inline.
On Jun 10, 6:22 am, Toralf Wittner wrote:
> On Wed, Jun 10, 2009 at 5:14 AM, Robert Lehr wrote:
e in your system.
>
> > Q - What stops Clojure's agent send-off function from becoming a DOS
> > ("denial of service") vulnerability in a server?
>
> As you noted, send-o
> Again, thanks for all the help. One last question, though- how would
> I apply the 'map' function to an actual associative mapping? I mean-
>
> (defn testFunc [x] (* x 2))
> (println (map testFunc {:a 1 :b 2 :c 3}))
The items in a associative container come out as a pair, which you can
dest
Thanks for all the tips, particularly on the subject refs and atoms-
that makes things substantially simpler now. (Pointer math...
Grrr...)
> I also wonder why you consider the construction of the network graph
> (as above) to be an inherently stateful activity. And why you choose
> to have tho
Actually, ClojureCLR is also DLR-based, relying on Expression Trees
V2, but not the hosting goodies. Thus, it might be runnable directly
in .NET 4.0 without the DLR.
For ClojureCLR: Performance of the core libraries is quite good.
Startup time is quite good. Of compiled Clojure code, not so go
Thanks, these are useful posts.
On Thu, Jun 11, 2009 at 4:49 AM, Nicolas Buduroi wrote:
>
> I've got an even faster version using memory-mapped file I/O. It also
> simplify the code a little bit.
>
> (defn fast-read-file [#^String filename #^String charset]
> (with-open [cin (. (new FileInputStr
I've got an even faster version using memory-mapped file I/O. It also
simplify the code a little bit.
(defn fast-read-file [#^String filename #^String charset]
(with-open [cin (. (new FileInputStream filename) getChannel)]
(let [size (. (new File filename) length)
char-buffer (. B
Can I help from the test-is side? Could test-expect be added to
clojure-contrib?
-Stuart
On Jun 10, 1:36 pm, Matt Clark wrote:
> Thanks for these ideas, I will give them a try tonight and update the
> adapter namespace with the changes. If anyone knows of a more
> idiomatic way I could have i
On Wed, 10 Jun 2009 12:44:00 -0600
Daniel Lyons wrote:
> On Jun 10, 2009, at 12:03 PM, Toralf Wittner wrote:
> > On Wed, 2009-06-10 at 10:22 -0600, Daniel Lyons wrote:
> >> If the actions are executed serially, what is the benefit of having
> >> multiple threads per agent?
> >
> > There is none.
On Wed, 2009-06-10 at 12:44 -0600, Daniel Lyons wrote:
> However, I still feel like I am not understanding when agents should
> be used or what an appropriate use of them would constitute, though.
Well, since agents run independently and asynchronously I found them to
be most useful when you ha
On Tue, Jun 9, 2009 at 8:31 PM, John "Z-Bo" Zabroski wrote:
>
> I am basically in love with Clojure. It fixes everything I ever found
> annoying about Lisp dialects, except for type safety (which I can live
> without for many scenarios).
>
> But I feel like my love is unrequited: Clojure is a JV
David Nolen writes:
> The n has to be held onto to complete the computation, so the tail
> call optimization cannot be performed.
That's right.
> ;; can be tail call optimized
> (define (add-tail n)
> (add-iter n 0))
>
> (define (add-iter iter result)
> (if (= iter 0)
> result
>
On Jun 10, 2009, at 12:03 PM, Toralf Wittner wrote:
> On Wed, 2009-06-10 at 10:22 -0600, Daniel Lyons wrote:
>> If the actions are executed serially, what is the benefit of having
>> multiple threads per agent?
>
> There is none. Did anybody say there are multiple threads per agent?
> There are t
On Wed, 2009-06-10 at 10:22 -0600, Daniel Lyons wrote:
>
> On Jun 10, 2009, at 4:22 AM, Toralf Wittner wrote:
> > As written above the serial execution of an Agent's actions makes this
> > thread-safe.
>
>
> If the actions are executed serially, what is the benefit of having
> multiple thread
Stuart, it is wonderful to hear that someone out there is using test-
expect. I'll get the CA signed so its migration to contrib can
proceed.
-Matt
On Jun 10, 7:52 am, Stuart Halloway wrote:
> Hi Matt,
>
> I would definitely like to see test-expect added to contrib. If you
> will sign the CA
Thanks for these ideas, I will give them a try tonight and update the
adapter namespace with the changes. If anyone knows of a more
idiomatic way I could have implemented the problem reporting
functionality that would prevent the necessity of these "hacky"
solutions, I'm all ears.
- Matt
On Jun
On Jun 10, 2009, at 4:22 AM, Toralf Wittner wrote:
> As written above the serial execution of an Agent's actions makes this
> thread-safe.
If the actions are executed serially, what is the benefit of having
multiple threads per agent?
—
Daniel Lyons
http://www.storytotell.org -- Tell It!
-
The examples given for Scheme and Common Lisp also blow the stack (I checked
the Scheme example in PLT Scheme). Consider the following:
;; cannot be tail call optimized
(define (add n)
(if (= n 0)
0
(+ 1 (add (- n 1)
;; can be tail call optimized
(define (add-tail n)
(add-iter n
Why not, but just understand that by doing you, you would give a good
answer to the wrong question :-)
So maybe better keep your energy when the right question shows up :-) :-)
I say so, because I guess a good answer would not necessarily
demonstrate (as its key 'selling point') mutually recursi
I know, but wouldn't it be nice to show that using Clojure you can
write a solution that "really" works?
On Jun 10, 5:38 pm, Laurent PETIT wrote:
> I don't see the solutions provided for other languages solving the
> tail call problem. And I also don't see the problem explictly stating
> that a
I don't see the solutions provided for other languages solving the
tail call problem. And I also don't see the problem explictly stating
that a tail call optimized version is required.
It seems rather to me that the page just want to exhibit that the
language allows mutual recursion of calls, per
On Jun 9, 10:32 am, Stuart Sierra wrote:
> Join us Tuesday, June 9 from 7:00-9:00 for Stuart Sierra's
> presentation:
>
> Implementing AltLaw.org in Clojure
Slides and video here: http://lispnyc.org/wiki.clp?page=past-meetings
We'll try to get something lighter than a 3GB mpeg soon.
-Stuart
On Jun 10, 10:39 am, Stuart Halloway
wrote:
> (defn use-test-is! []
> (require 'mdc.common.test-expect.test-is-adapter)
> (def report-problem (ns-resolve 'mdc.common.test-expect.test-is-
> adapter 'report-problem)))
>
> This feels a little hacky, but is there a better way?
It's not much less
Matt Clark's test-expect library includes two versions of a report-
problem function: a standalone version, and another that integrates
with test-is. The comments suggest two ways to active the test-is
version: wrapping calls to expect in a binding, and interning the
specialized version of
Thank you for the answers. I now understand why this cannot work with
trampoline.
Is there another way to avoid stack overflow? I'd like to submit the
code to http://rosettacode.org/wiki/Mutual_Recursion to improve the
Clojure coverage and also to learn more stuff myself...
--~--~-~--~
I guess trampoline allows to emulate tail call optimization on
mutually recursive functions, that is functions that, without
trampoline and in an environment that would do TCO automatically, have
a tail call to the other function, and the other function also has a
tail call to another function ...
On Tue, Jun 9, 2009 at 6:04 PM, arasoft wrote:
>
> I tried this:
>
> (declare F)
>
> (defn M [n]
> (if (zero? n)
>0
>(- n (F (M (dec n))
>
> (defn F [n]
> (if (zero? n)
>1
>(- n (M (F (dec n))
>
> and for large n I got the expected stack overflow. Then I tried to
> tramp
Hi Matt,
I would definitely like to see test-expect added to contrib. If you
will sign the CA I will move it there. I have a bunch of existing
tests that are simply using binding to do cheap stubbing, and will be
converting those tests to test-expect over the next several days.
Thanks for
On Jun 10, 2:09 am, Richard Newman wrote:
> > I am very fond of the relational functions in Clojure. That was one of
> > the first things that started winning me over actually.
>
> Indeed, they're very nice to have!
>
> > Forgive me if this is an obvious question, but what exactly is the
> > di
I tried this:
(declare F)
(defn M [n]
(if (zero? n)
0
(- n (F (M (dec n))
(defn F [n]
(if (zero? n)
1
(- n (M (F (dec n))
and for large n I got the expected stack overflow. Then I tried to
trampoline the functions:
(declare F)
(defn M [n]
(if (zero? n)
0
Hi! I would expect the implementation of any neural network to be
dictated by the particular mathematical/algorithmic description. I am
not at all sure what description might have given rise to your code.
Do you have any particular type of neural network in mind? Or any
particular task to perfo
I am basically in love with Clojure. It fixes everything I ever found
annoying about Lisp dialects, except for type safety (which I can live
without for many scenarios).
But I feel like my love is unrequited: Clojure is a JVM language, and
all my core libraries at .NET.
The rest of this post di
Hi Matt,
I would like to move this to contrib, if you will sign the CA. I'll be
moving my simple binding-based stubs to use this and will send along
suggestions if I have any.
Thanks for writing this!
Stu
P.S. Apologies if variants of this message show up twice. Mail client
wonkiness...
On Wed, Jun 10, 2009 at 5:14 AM, Robert Lehr wrote:
> Q - What stops Clojure's agent send-off function from becoming a DOS
> ("denial of service") vulnerability in a server?
As you noted, send-off uses a cached thread pool, so there is no
protection from creating more threads than your system can
Stuart Sierra wrote:
> Join us Tuesday, June 9 from 7:00-9:00 for Stuart Sierra's
> presentation:
Will there be any video recording?
Regards,
BG
--
Baishampayan Ghose
oCricket.com
signature.asc
Description: OpenPGP digital signature
Hi,
disclaimer: I'm only a hobbyist with almost no clue
about the concurrency. So take this with a grain of
salt. The following are only my expressions how this
stuff works.
Am 10.06.2009 um 05:14 schrieb Robert Lehr:
Q - What stops Clojure's agent send-off function from becoming a DOS
("denia
Meikel,
Could I be allowed to join your online class:)
Regards,
Emeka
--~--~-~--~~~---~--~~
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 fro
Based on the discussion in this thread with Chouser, I've checked in
code for "throwable maps with stack traces" at
clojure.contrib.condition. It's a very generic scaffolding for
flexible error handling. Here's Chouser's example implemented with
clojure.contrib.condition:
40 matches
Mail list logo