On Sun, May 16, 2010 at 3:19 PM, Fabio Kaminski wrote:
> Sorry about using the list like twitter..
>
> but i thought this is a pretty good "article" about functional programming
> side effects, and why actors are not very good design decision..
>
> Actors not good for concurrency model :
>
> http:
A new version is out, and can be checked out here: http://www.try-clojure.org/
This new version fixes some bugs with the old version. Thanks to some
clever work by Heinz, def has been allowed, so you can define
functions and such.
The other bug thing is that I have started on a tutorial. It's jus
Hi,
On Tue, May 18, 2010 at 11:11:48PM +0200, Heinz N. Gies wrote:
> Hmm this is slowish, you walk ks twice that way, i think the if-let
> way is better, performance wise. Not sure if it really matters but for
> really nested maps this might make a difference.
If we restrict key "sequences" to v
On May 18, 2010, at 23:08 , Meikel Brandmeyer wrote:
> Hi,
...
> It's always a good idea to use things we already have:
...
> (get (get-in m (butlast ks)) (last ks) not-found)))
Hmm this is slowish, you walk ks twice that way, i think the if-let way is
better, performance wise. Not sure if it
Hi,
On Tue, May 18, 2010 at 04:16:01PM -0400, Russell Christopher wrote:
> Although that would return the default for a key with a nil value. So you're
> probably right reduce would have to change.
>
> On Tue, May 18, 2010 at 3:49 PM, Russell Christopher <
> russell.christop...@gmail.com> wrote:
Although that would return the default for a key with a nil value. So you're
probably right reduce would have to change.
On Tue, May 18, 2010 at 3:49 PM, Russell Christopher <
russell.christop...@gmail.com> wrote:
> (defn get-in
> ([m ks]
> (reduce get m ks))
> ([m ks not-found]
>(
Hi folks
I had the same issue and i got round the problem desinstalling clojure-
mode and slime-repl from elpa before installing swank-clojure (which
installs the previous two again)
My env is a liitle bit strange. I have Vista with Clojure Box (with
its own installation of slime-swank-clojure) an
If it doesnt fit, use a bigger hammer.
This one isn't perfect, but works even with a Maven-started swank.
; use with (System/setOut (sys-out-replacer))
(import (java.io PrintStream PipedInputStream PipedOutputStream))
(defn sys-out-replacer []
(let [pin (PipedInputStream.)
out (Pr
(defn get-in
([m ks]
(reduce get m ks))
([m ks not-found]
(if-let [res (get-in m ks)] res not-found)))
Longer but still uses reduce
On Tue, May 18, 2010 at 12:20 PM, Stefan Kamphausen
wrote:
> Hi,
>
> On May 17, 9:34 pm, braver wrote:
> > If get-in is to be consistent with get, i
> I'm not sure why a getValue/setValue is any different from an ='s
> sign. Instability and unpredictability still results. Be they actors
> or threads, neither really solves any sort of problem save perhaps
> atomic updates.
My (unproven) gut feeling is that people are afraid of machine
concurren
Hi.
(add-hook 'slime-connected-hook 'slime-redirect-inferior-output)
works for me if I start Clojure with M-x slime
But if I start it with Maven, and try to connect, it prevents the REPL
from starting.
Mini Buffer says:
"error in process filter: No inferior lisp process"
Hm.
(I actually didnt
That is a very useful bit of information. Thanks!
On Tue, May 18, 2010 at 6:01 AM, Moritz Ulrich
wrote:
> Slime supports redirecting the inferior-lisp-output to the repl:
>
> Add
>
> (add-hook 'slime-connected-hook 'slime-redirect-inferior-output)
>
> to your .emacs
>
> On Tue, May 18, 2010 at 4:
Slime supports redirecting the inferior-lisp-output to the repl:
Add
(add-hook 'slime-connected-hook 'slime-redirect-inferior-output)
to your .emacs
On Tue, May 18, 2010 at 4:39 AM, Dave Fayram wrote:
> It doesn't suppress output, it just doesn't propagate it to your repl
> buffer. Check for t
On Mon, May 17, 2010 at 11:20 PM, Peter Schuller
wrote:
>> Actors in Erlang DO have mutable state, you're just discouraged from
>> using it. ;) No really, erl -man get and set. Sometimes you're forced
>> to use this despite the best of intentions.
>
> I don't think anyone is trying to claim that i
Er, to clarify: I believe I wiped out all elpa *packages* before using
the new package.el, not the elpa dir itself.
Good luck,
Justin
On May 18, 12:50 pm, Justin Kramer wrote:
> I should note that I wiped out my elpa dir before using the new
> package.el. Also, there is this other package.el fr
I should note that I wiped out my elpa dir before using the new
package.el. Also, there is this other package.el from Phil's emacs-
starter-kit, which may or may not provide different results:
http://github.com/technomancy/emacs-starter-kit/raw/master/package.el
Justin
On May 18, 11:05 am, Terre
On 18 May 2010 16:31, Terrence Brannon wrote:
> Per http://riddell.us/ClojureOnUbuntu.html
>
> I tried to build clojure contrib but there were 18 build errors.
I get the same issue, which is odd, because the continuous integration
server works.
Regardless, would I be correct in guessing that you
Hi,
On May 17, 9:34 pm, braver wrote:
> If get-in is to be consistent with get, it better allow to specify a
> default value:
>
> (get-in nested-structure [k1 k2 ... kN] :default something)
>
> -- would it make sense to add that to the standard get-in?
while I certainly agree from the users poin
My bad... ".jar" was left off the the first argument :)
On Tue, May 18, 2010 at 12:04 PM, Terrence Brannon wrote:
> re: http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Emacs
>
>
> """java -cp path/to/clojure.jar clojure.main"""
>
> this suggestion fails:
>
> metap...@locohost:~/prg
re: http://www.assembla.com/wiki/show/clojure/Getting_Started_with_Emacs
"""java -cp path/to/clojure.jar clojure.main"""
this suggestion fails:
metap...@locohost:~/prg/tmp$ java -cp /home/metaperl/.clojure/clojure
clojure.main
Exception in thread "main" java.lang.NoClassDefFoundError: clojure/m
Hi,
On Tue, May 18, 2010 at 4:59 PM, braver wrote:
> On May 18, 10:47 am, "Heinz N. Gies" wrote:
> > Out of curiosity, can you remove the pmap and run them in the opposite
> order? as first (time (reps-sorted1? dreps)) then (time (reps-sorted2?
> dreps))?
>
> user=> (time (reps-sorted1? dreps))
Sorry for the noise.
protocols and datatypes are amazingly cool by the way.
On Tue, May 18, 2010 at 3:51 PM, Adrian Cuthbertson <
adrian.cuthbert...@gmail.com> wrote:
> > Actually, it seems to do what I thought.
>
> Right, indeed
>
> (satisfies? PStr ss)
> -> true
>
> --
> You received this
On Tue, May 18, 2010 at 1:34 AM, Justin Kramer wrote:
> Per Phil Hagelberg's suggestion on IRC, I downloaded and used his
> package.el, which fixed the issue for me:
>
> http://github.com/technomancy/package.el/raw/master/package.el
I copied that package.el over ~/emacs.d./elpa/package.el and now
2010/5/18 braver :
> On May 18, 10:27 am, David Nolen wrote:
>> On Tue, May 18, 2010 at 10:18 AM, braver wrote:
>> The documentation is pretty clear about how pmap works. Your work needs to
>> be greater than the coordination overhead. You probably need to batch your
>> work before trying to call
On May 18, 10:47 am, "Heinz N. Gies" wrote:
> Out of curiosity, can you remove the pmap and run them in the opposite order?
> as first (time (reps-sorted1? dreps)) then (time (reps-sorted2? dreps))?
user=> (time (reps-sorted1? dreps))
"Elapsed time: 8254.967 msecs"
true
(defn reps-sorted2? [drep
> Actually, it seems to do what I thought.
Right, indeed
(satisfies? PStr ss)
-> true
--
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 -
Hi,
On May 18, 4:24 pm, Nicolas Oury wrote:
> I tried satisfies? but it does not seem to do what I supposed it did.
What did you actually think it does?
user=> (defprotocol P (bar [x]))
P
user=> (satisfies? P (reify :as this P (bar [])))
true
user=> (satisfies? P 5)
nil
(Note: this was an old
On May 18, 2010, at 16:18 , braver wrote:
> user=> (time (reps-sorted2?
> dreps))
> "Elapsed time: 127606.905 msecs"
> true
> user=> (time (reps-sorted1? dreps))
> "Elapsed time: 8368.616 msecs"
> true
>
> As you can see, the imperative solution vastly outperforms the
> functional one, even thou
> What is the canonical way to know whether something satisfies (is satisfies
> the right terminology?) a protocol.
You're looking for extends? ...
(doc extends?)
-
clojure.core/extends?
([protocol atype])
Returns true if atype extends protocol
(defprotocol PStr "String
Actually, it seems to do what I thought.
My bad, problem of loaded stuff in REPL... Shame on me.
On Tue, May 18, 2010 at 3:24 PM, Nicolas Oury wrote:
> Dear all,
>
> I am trying to play with the features of 1.2.
>
> What is the canonical way to know whether something satisfies (is satisfies
> th
On May 18, 10:27 am, David Nolen wrote:
> On Tue, May 18, 2010 at 10:18 AM, braver wrote:
> The documentation is pretty clear about how pmap works. Your work needs to
> be greater than the coordination overhead. You probably need to batch your
> work before trying to call pmap.
David -- note tha
On Tue, May 18, 2010 at 10:18 AM, braver wrote:
> I have a huge graph of the form
>
> {"john" {1 {"alice" 1, "bob" 3}, 4 {"alice" 2, "stan" 1}, "alice" {1
> {"john" 1, "mandy" 2}, 2 {"john" 3, "stan" 2}}}
>
> It shows for each user days on which he communicated, and for each
> day, with whom and
Dear all,
I am trying to play with the features of 1.2.
What is the canonical way to know whether something satisfies (is satisfies
the right terminology?) a protocol.
I tried satisfies? but it does not seem to do what I supposed it did.
May someone more knowledgeable than me explain me?
Best
I have a huge graph of the form
{"john" {1 {"alice" 1, "bob" 3}, 4 {"alice" 2, "stan" 1}, "alice" {1
{"john" 1, "mandy" 2}, 2 {"john" 3, "stan" 2}}}
It shows for each user days on which he communicated, and for each
day, with whom and how many times he addressed that person.
Essentially this is a
On May 18, 2010, at 14:38 , gL wrote:
> Yes, (count mat8x8) is the appropriate method
>
> Using meta was my mistake to avoid passing the matrix dimension over
> and over again.
well you can make a function matrix-dim that memorizes the return values :)
--
You received this message because you
Yes, (count mat8x8) is the appropriate method
Using meta was my mistake to avoid passing the matrix dimension over
and over again.
On May 18, 2:23 pm, "Heinz N. Gies" wrote:
> On May 18, 2010, at 14:13 , gL wrote:
>
>
>
> > Hi
>
> > is it good coding style to
>
> > (def mat8x8
> > (with-met
It doesn't suppress output, it just doesn't propagate it to your repl
buffer. Check for that output in your *inferior-lisp* buffer; it
should be faithfully reproduced there.
You might want to consider using an alternative means of logging in
the future. Perhaps an agent that buffers lines.
- dlf
I don't see how creating MultiFn directly is any less safe than using
defmulti which also creates mutable object. And multimethods are never
pure functions (may return different values for the same argument
after defmethod call). I think the documentation should explicitly
state mutability and non-
On May 18, 2010, at 14:13 , gL wrote:
> Hi
>
> is it good coding style to
>
> (def mat8x8
> (with-meta
> [[0 0 0 0 0 0 0 0]
...
> [0 0 0 0 0 0 0 0]]
> {:dim 8}))
>
> and later on to retrieve the matrix dimension with "(:dim (meta
> )"?
I personally would say no, since th
Hi
is it good coding style to
(def mat8x8
(with-meta
[[0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0]
[0 0 0 1 0 0 0 0]
[0 0 0 1 0 0 0 0]
[0 0 0 1 0 0 0 0]
[0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0]
[0 0 0 0 0 0 0 0]]
{:dim 8}))
and later o
On 11 May 2010 11:59, Lauri Pesonen wrote:
>
> At least in my setup ~/.clojure/user.clj does not get loaded unless
> ~/.clojure is in the JVM classpath.
(replying to myself)
So I've made this work with swank-clojure-project by adding this to my
emacs config:
(add-hook 'swank-clojure-project-hoo
Thank you all so much!! As always, I learn a lot from this forum.
On May 18, 12:50 am, Jarkko Oranen wrote:
> On May 18, 2:23 am, Base wrote:
>
> > (defn lazy-date-seq [d1 d2]
> > (let [start (-> d1
> > (.dayOfMonth)
> > (.withMinimumValue))]
> > (lazy-seq
On 18 May 2010 00:29, Pratik Patel wrote:
>> How does labrepl integrate with Enclojure, and does anyone manage to
>> use an IDE effectively with lein/maven?
>
> * Now right click on the labrepl project and select "Start Project Repl".
> * This will open a new window that says "Clojure Repl (labrep
Thanks for the explanation. I think I'll look at swank-clojure later
since emacs went haywire last time I touched it..
On May 18, 2:33 pm, alux wrote:
> I should add, that a new thread runs in the default environment again.
>
> You may set the *out* variable in your thread with "binding":
>
> (le
On 18 May 2010 08:33, alux wrote:
> I should add, that a new thread runs in the default environment again.
>
> You may set the *out* variable in your thread with "binding":
>
> (let [dummy *out*] ; to have a name for the current *out*
> (.start (Thread. (fn [] (binding [*out* dummy] (prn x)
I should add, that a new thread runs in the default environment again.
You may set the *out* variable in your thread with "binding":
(let [dummy *out*] ; to have a name for the current *out*
(.start (Thread. (fn [] (binding [*out* dummy] (prn x))
Regards, alux
On 18 Mai, 09:26, alux w
Hi Preecha,
output in Clojure is sent to *out* (a variable that refers to
System.out by default). If you use emacs / slime this variable will be
set differently. You should find your threads output in the swank-
REPL, if you can find it somewhere.
Regards, alux
On 18 Mai, 03:26, Preecha P wrote
47 matches
Mail list logo