Hi,
Am Montag, 22. August 2011 16:08:20 UTC+2 schrieb lpetit:
>
> 2011/8/22 Dave Ray
>
>> I'm not sure why this code was written this way, but Marginalia has no
>> problem using docstrings. Compare it's own docs:
>> [...]
>
> ok, thanks Dave
>
that Marginalia also understands docstrings notwith
Hi,
the commute case can be understood:
user=> (send thread (fn [agt aref] (dosync (commute aref + 100)
(Thread/sleep 8000) agt)) account)
#
user=> (time (dosync (ref-set account 2000)))
"Elapsed time: 0.369415 msecs"
2000
user=> @account
2000
;; wait a few seconds
user=> @account
2100
So, the
The call to alter already wrote to the Ref, this requires a write-lock on
the ref (see LockingTransaction.java/doSet). After that it sleeps a while
and gets to its commit phase. The other transactions retries in the
meantime. Consider the following code, which introduces some atoms for
count
Hm,
while I was just reading the source of the STM implementation in Ref.java
and LockingTransaction.java two new questions came up for me.
1. Is there any use of the msecs field in the inner TVal in Ref? I don't see
any and if it's not used anymore, at least two calls to
System.currentTimeMil
Hi,
using a current git checkout of master (git describe says
'clojure-1.3.0-beta2-2-g0689c47') I ran the test-code from
http://clojure.org/refs like this:
(time (run 100 10 10 100))
"Elapsed time: 18413.314789 msecs"
Actually I ran that code several times until I would see no improvement
Hi,
there is another paper in the wild which very nicely describes, how
Clojure's implementation of STM works and how it compares to other
management strategies for resolving conflicts.
http://vbn.aau.dk/files/32587755/report.pdf
Definitely worth a read, I think.
Best,
Stefan
--
You receiv
Hi Chris,
could you please elaborate a bit on the swank-clojure issue? Alternatively
just point me to the threads that I should have read more closely.
Thanks and kind regards,
Stefan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this
hi,
> why does clojure want to cast the result to IFn?
>
if I parse that correctly, you have two parens around the let-expression.
That leads to Clojure evaluating the let-expression, taking the result
(which is the return value of the line you mentioned: a Boolean) and trying
to call that as
Hi,
On Tuesday, September 6, 2011 3:35:08 PM UTC+2, HamsterofDeath wrote:
>
>
> (every? (= parameter player) currow
> i'd like to write something like:
>
> do i have to define the function via letfn before, or is there a way
> to do it nested in the code?
>
you can create a function anytime using
Hi,
a little off-topic ...
On Wednesday, September 7, 2011 1:12:05 AM UTC+2, stuart@gmail.com
wrote:
>
> This is by design. Function position indicates that the data structure is a
> collection, not a (logical) record.
>
AFAIK there a lots of well designed things in Clojure which reflect d
Hi,
On Wednesday, September 7, 2011 3:02:00 PM UTC+2, Meikel Brandmeyer
(kotarak) wrote:
>
> Hi,
>
> Am Mittwoch, 7. September 2011 14:05:57 UTC+2 schrieb Stefan Kamphausen:
>>
>> the explanation why speed is the default and not safety (if I may
>> summarize th
Hi,
yeah, maybe I should have chosen my words more wisely. I think it comes
from my CL background where you can
(declare (optimize (speed 3) (safety 0))
to achieve this behavior. Not to be nitpicking here. An Exception is
obviously 'safer' than a silent truncation and then the decision betwe
TL;DR: There is small patch which improves speed of STM
Hi,
in the light of the upcoming 1.3 you might be interested in a rather trivial
patch which can lead to significant speedup of STM processing.
1. Background
I was studying the implementation of STM for a talk at this year's
SourceTalk [
FWIW I just could run the test-suite on a quad-core VMWare which lead to
12-15% speed-up. (No detailed report available)
--
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
Maybe the example becomes clearer with a little less foo and a little more
bar and baz:
shell> lein repl
REPL started; server listening on localhost port 64913
user=> (defn foo [arg] "foo")
#'user/foo
user=> (defn bar->baz [a b] "bar->baz")
#'user/bar->baz
user=> (foo (bar->baz "a"))
java.lang.Il
Hi,
On Monday, September 12, 2011 8:07:22 PM UTC+2, Chouser wrote:
>
>
> https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/AFn.java#L436
>
looks like a subtle bug, doesn't it? The compiler translates '-' to '_'
(Compiler.java:2619) and '>' to '_GT_' (Compiler.java:2623). Toge
Just some more, maybe even simpler examples:
Clojure 1.3.0-master-SNAPSHOT
user=> (defn foo>>bar [] "")
user=> (foo>>bar "a")
ArityException Wrong number of args (1) passed to: user$foo-GT
clojure.lang.AFn.throwArity (AFn.java:439)
user=> (defn foo++bar [a] "")
user=> (foo++bar)
ArityException
Hi,
On Tuesday, September 13, 2011 6:28:01 AM UTC+2, Ken Wesson wrote:
>
>
> They're trees of arrays of 32 items, and the trees can in principle
> have arbitrary depth. So the 2^31 limit on Java arrays doesn't impact
> the Clojure collections, it seems.
>
are you sure? As far as I understood thi
Hi,
just a few follow-ups...
On Wednesday, September 14, 2011 4:13:47 AM UTC+2, frye wrote:
- ? howto list modes engaged
Aside from the already mentioned C-h m (aka M-x describe-mode) you will want
to use
* C-h k (M-x describe-key) followed by some keybinding to find out what that
keybi
Hi,
we're getting totally OT here and should probably better head for
gnu.emacs.help. Anyway, just one more bark from me and then I'll be quiet
(but will respond to mail ;-)
On Thursday, September 15, 2011 2:08:28 AM UTC+2, frye wrote:
>
> In Vim , you press *Ctrl-d* and *Ctrl-u* to go down an
Hi,
is there any particular reason not to use a Set instead of a vector? It
solves the issue of distinct values. Or am I missing something?
Regards,
Stefan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to cloju
Hi,
On Friday, September 23, 2011 5:25:34 PM UTC+2, stuart@gmail.com wrote:
>
> I would have hoped that changes to refs during an transaction wouldn't
> affect the in-transaction value of the ref
>
>
you usually don't want that. When you start working on more than one value
in a transaction
Hi,
regarding the writing of a game in Clojure, I think
http://codethat.wordpress.com/2011/09/10/writing-tetris-in-clojure/ is a
good post to read.
Regards,
Stefan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email t
Hi,
I hope, people are aware that Oracle considers OpenJDK to be the standard
choice for Linux users now and removed the special distributor's license.
See http://robilad.livejournal.com/90792.html
Kind regards,
Stefan
--
You received this message because you are subscribed to the Google
Gr
Hi.
You might consider reading Peter Seibel's excellent Practical Common Lisp
which has some nice macro-work in it. If after that you're still hungry for
more, consider Let Over Lambda by Doug Hoyte.
Admitted, both cover Common Lisp, but the differences will not keep you from
getting a deepe
Hi,
To my humble ears this sounds like the best idea so far. Something like
ClojureRTException ...
Regards,
Stefan
--
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 n
Just for the record: That's how I understood Ivan's idea, too. Introduce a
special exception type which is used nowhere else and unwrap that
automatically.
I am not experienced enough a Java programmer to know all the implications
that may arise here and there.
Regards,
Stefan
--
You receiv
Why do you think, there is a bug?
You are referring to the /code/, i.e. the implementation, of things, which
is not a defined interface. At the same time, the /documentation/ describes
the actual behavior quite well.
Chunked seqs are supposed to realize more elements than you consume. That's
f
Hi,
just to be sure: are you are aware of Marginalia?
https://github.com/fogus/marginalia
Regards,
Stefan
--
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
Clojure moved off the local optimum of common lisp
>
I can't help, but I really like that quote. Nice meme :-)
Stefan
--
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 f
Hi,
while all the other answers already offered explanations and solutions I
feel like I should add, that macros like -> and ->> work on the
source-code. So using -> does not mean 'pass the first thing as an
argument to the function call in the second thing', it means 'take the
first thing an
Thanks for pointing my error out. I was not only oversimplifying things,
worse, I simplified something away that was crucial to the original
question.
Regards
Stefan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email
On Thursday, December 1, 2011 8:23:33 PM UTC+1, Alan Malloy wrote:
>
> 1) I agree this seems silly but I don't think it's ever bitten me
Ain't this the difference between a language, that's been around for QAW
(Quite A While, maybe even long enough to become a standard, e.g. ANSI) and
a newco
Hi,
to be honest I'd rather not see any magic behavior of the importing
mechanism. Better to fail early, but with a suitable error message, no?
Cheers,
Stefan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo
On Friday, December 2, 2011 8:44:07 AM UTC+1, Tassilo Horn wrote
>
> JVM does some sort of pooling. It seems there's exactly one Long for
> any long value in the range [-128...127], but you shouldn't rely on
> that.
>
And I always thought it was 1024, but
user=> (identical? 127 127)
true
use
Hi,
On Tuesday, December 27, 2011 1:18:52 PM UTC+1, James Reeves wrote:
>
> It might be an idea to figure out some standard syntax we could use,
> like Markdown, that could be used for formatting docstrings.
>
IMHO the missing homoiconicity of docstrings in all flavors of Lisp that I
worked with
Hi,
On Friday, January 20, 2012 9:40:53 AM UTC+1, Norman Gray wrote:
>
> Thus C-M-(, C-M-), C-M-f, -b, -u, -d and -k do most of what one wants, in
> terms of creating and moving around balanced brackets.
why did nobody mention C-M-Space, yet? To me it's one of the most
important keystrokes ac
Hi,
On Monday, January 23, 2012 1:27:51 PM UTC+1, lpetit wrote:
>
> 2012/1/23 Stefan Kamphausen
>
>> Hi,
>>
>>
>> On Friday, January 20, 2012 9:40:53 AM UTC+1, Norman Gray wrote:
>>>
>>> Thus C-M-(, C-M-), C-M-f, -b, -u, -d and -k do most of w
On Nov 9, 6:08 pm, David Sletten wrote:
> I don't want to start any language wars, but this is
> funny:http://gosu-lang.org/comparison.shtml
Yeah, I had a good laugh this morning. ;-)
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to thi
Hi,
finally I find some time to dive into the development with Clojure for
Googles AppEngine.
My first question is: which library should a newcomer use, appengine[1] or
appengine-magic[2]? Or can you give me some hints in which way they
differ? They both seem to be actively developed. And h
Hi,
On Sunday, January 9, 2011 6:37:58 PM UTC+1, Constantine Vetoshev wrote:
>
>
> I'm the author of appengine-magic, so my opinion is necessarily biased
> in its favor. :)
>
fine with me. The authors are most likely to be the ones to be able to tell
the differences. :-)
> I optimized the
Hi,
I can't verify that a REPL created by lein behaves differently. Did you
perhaps update an old project.el without running lein deps?
In addition to that: your defproject has too many ]'s
Regards,
Stefan
--
You received this message because you are subscribed to the Google
Groups "Clojur
Hi,
just for the record: from what I have done in the past I wholeheartedly
agree with Bob. Of course the developers of Clojure have the final say on
this. It's just my 2ct.
Kind regards,
Stefan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To
Hi,
you may be interested in reading the code from our book which a) includes
the code for doing exactly what you did (evolve a string) and b) shows how
multithreading can change your way of doing GAs (get rid of the concept of
generations).
The book and the code are written in German which ma
201 - 244 of 244 matches
Mail list logo