Hi all,
I've been playing around with Clojure off and on for a while now. I
like it enough that I'm considering using it to implement an admin
interface to MongoDB (a rather serious itch which I've been aching to
scratch for a while now).
Question is: how to tackle a program of considerable size?
Hi,
On Feb 22, 5:40 am, Johnny Kwan wrote:
> I'm trying to generalize it into a macro named use-private
>
> (defmacro
> #^{:private true}
> use-private
> [ns sym]
> `(def
> #^{:private true}
> ~sym (ns-resolve ~ns ~sym)))
First some fixes:
(defmacro #^{:private true} use-priv
Hi,
On Feb 22, 2:30 am, trptcolin wrote:
> I do have a feeling I'm missing something really obvious that would
> make my example simpler, so if anybody has any tips I'd be much
> obliged!
Using OP's code:
(let [numbers (take 1000 (fibs))]
(println (a-mean numbers) ">=" (g-mean numbers) ">="
Hi,
On Feb 22, 12:18 am, Johnny Kwan wrote:
> I'm really new to Clojure, but I'm under the impression that reduce would
> be better than apply, since I assume that apply would reify the entire
> sequence at once, whereas reduce would consume the sequence one by one.
> Could someone more familiar
Hi,
On Feb 22, 7:22 am, Mike K wrote:
> (defn join-vecs [v1 v2]
> (let [v2len (count v2)]
> (cond
> (zero? v2len) v1
> (= v2len 1) (conj v1 (first v2))
> true (recur (conj v1 (first v2)) (rest v2)
>
> (defn append [& vecs] (reduce join-vecs [] vecs))
>
> user> (append '[
Thanks, I ended up using Allegro via Lispbox here.
http://www.gigamonkeys.com/lispbox/#download
Mike
--
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 ar
On Feb 19, 6:23 am, Chouser wrote:
> In Clojure, if you could use conj on a vector but instead use
> concat on a list, you'll end up with code that is both
> non-idiomatic and runs slower than necessary.
I found the exercise of doing the equivalent with Clojure vectors
pretty challenging. Give
Aviad,
Nice job! One nitpick is that won't work for infinite sequences,
since reduce isn't lazy. If you wanted your definitions to work for
arbitrary indexes of infinite sequences (like the Fibonacci numbers),
you could provide sequences providing successive results for the input
sequences.
I d
Hi,
In case of need, here[1] is an optimized version of Floyd-Warshall's
APSP (All-Pairs-Shortest-Path) algorithm in Clojure.
Regards.
[1] http://paste.lisp.org/display/95370
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, s
Hi All,
I'm trying to test some private functions using the Clojure convention of
placing tests in a separate test- namespace. Of course, you can't reference
private vars from other namespaces (please correct me if I'm wrong). Not
knowing anything at all about how stuff is interned in Clojure
I'm in.
Should we go for a coffee to meet each other or something?
On Sun, Feb 21, 2010 at 11:15 PM, Nicolas Buduroi wrote:
> On Feb 21, 12:55 pm, Jeff Heon wrote:
> > Would Montreal Clojurians be interested in starting a Clojure group?
> >
> > Or do you all piggyback on the Montreal/Scheme Lis
On Feb 21, 12:55 pm, Jeff Heon wrote:
> Would Montreal Clojurians be interested in starting a Clojure group?
>
> Or do you all piggyback on the Montreal/Scheme Lisp User Group?
That's a great idea, I'm in! I'd say that the Montreal Scheme/Lisp
User Group doesn't seems to be quite active. I wonder
Actually, a combination of into & empty does the trick amazingly
well...
http://fulldisclojure.blogspot.com/2010/01/12-fn-proposal-same-multisame.html
On Feb 21, 10:56 pm, Mike Meyer wrote:
> In working through a recent project, I realized that Clojure has a
> nice collection of functions for wo
In working through a recent project, I realized that Clojure has a
nice collection of functions for working with maps. However, it
doesn't seem to have analogues of some of the important sequence tools
(filter and map most noticeably, probably others).
Given that map will take a map as a collectio
let me expand on my comment. What I meant is, the type of functionality you
are adding into distinct, makes it feel less "distinct". to me. If I
read what you are saying
correctly, you want to be also be able to pass a set, so in
addition to filter duplicate elements, it also will filter out
anythi
The code:
(def app
(proxy [SimpleApplication] []
(simpleInitApp []
(.attachChild (.getRoot this) ball-d)
(.setLocalTranslation ground-d (com.g3d.math.Vector3f. 0
0 0))
(.attachChild (.getRoot this) ground-d))
(si
Any reason why you can't use
distinct?
http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/distinct
On Feb 21, 2010 10:24 AM, "Eugen Dueck" wrote:
Hi,
Clojure is great! The gain in productivity from more low level
languages like Java, but also more functional languages like
On Mon, Feb 22, 2010 at 12:18 AM, Johnny Kwan wrote:
> I'm really new to Clojure, but I'm under the impression that reduce would be
> better than apply, since I assume that apply would reify the entire sequence
> at once, whereas reduce would consume the sequence one by one.
I was going by this
I'd be very thankful if I could get some advice here, sicne I am
running out of ideas.
You might be doing something wrong with the way you're arranging refs.
I'll let others comment on that.
One observation, though: parallelization doesn't always help. pmap
runs your tasks on several thre
I'm really new to Clojure, but I'm under the impression that reduce would be
better than apply, since I assume that apply would reify the entire sequence at
once, whereas reduce would consume the sequence one by one. Could someone more
familiar with the implementation weigh in on this?
On Feb
Have dates and location for the Clojure conference been picked?
--
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 - please be patient with your
On Sun, Feb 21, 2010 at 9:41 PM, Aviad Reich wrote:
> ANY comments will be great (including: this is all wrong - don't
> post it).
FWIW since I'm not exactly an expert on idiomatic Clojure either, I'd
write h-mean like this:
(defn h-mean [coll]
(/ (count coll) (apply + (map #(/ 1 %) coll
false, of course. :-)
What would the post-patch result be of that operation?
On Feb 20, 10:25 am, Stuart Halloway
wrote:
Current results vary based on arg order:
(def xes (iterate #(str % "x") "x"))
=> #'user/xes
; infinite first ok
(= xes ["x" "xx"])
=> false
; finite first boom
(= ["x" "
Hi everyone,
being a newb to clojure, my ability to contribute to is still limited.
However, I thought I'll try starting with something simple.
http://rosettacode.org/wiki/Averages/Pythagorean_means seems straightforward
enough, but since it's a comparative site, and implementations should be as
On 21 February 2010 19:23, Brian Wolf wrote:
> Michael Kohl wrote:
>>
>> I hope these mails don't annoy people, but from mails and Twitter I
>> know that quite a few people actually seem to be using ClojureX, so I
>> also wanted to post the information here:
>>
>> http://citizen428.net/archives/41
On 21 February 2010 15:26, Michał Marczyk wrote:
> On 21 February 2010 14:13, Michael Wood wrote:
>> That does demonstrate the difference (or a difference), but I don't
>> get 3 printlns.
>
> Ouch, I actually posted the wrong version of the function. Here's an
> improvement in the context of a RE
Hi everyone,
I've fiddled with making something concurrent and noticed I horribly failed. It
gets 2-3 times slower when trying to work using pmap instead of map.
What I want to do:
I am working on a game, I have units, and a map fields (x,y coordinates). Now
in every game turn each unit is allow
Would Montreal Clojurians be interested in starting a Clojure group?
Or do you all piggyback on the Montreal/Scheme Lisp User Group?
--
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 th
Michael Kohl wrote:
I hope these mails don't annoy people, but from mails and Twitter I
know that quite a few people actually seem to be using ClojureX, so I
also wanted to post the information here:
http://citizen428.net/archives/415-Major-changes-in-ClojureX.html
Cheers,
Michael
Hi,
I t
Thanks for you all
On 2月21日, 下午10时26分, Michał Marczyk wrote:
> On 21 February 2010 14:13, Michael Wood wrote:
>
> > That does demonstrate the difference (or a difference), but I don't
> > get 3 printlns.
>
> Ouch, I actually posted the wrong version of the function. Here's an
> improvement in th
I try my code on my machine.
1. deref version
(defn funk [r]
(dosync
(println "Start:" @r)
(Thread/sleep 1)
(println "End:" @r)))
user> (.start (Thread. #(funk r)))
Start: 1
nil
user> (dosync (ref-set r 5))
Start: 5
End: 5
5
Actually, when I
On Feb 20, 10:02 pm, Kasim wrote:
> Hi,
> I am a web developer and would like to write a small Desktop UI
> application in Clojure for the popular Simplenote
> app.http://simplenoteapp.com/
> I was wondering what UI framework I should use. Anyone out there care
> to suggest one that works best wi
I hope these mails don't annoy people, but from mails and Twitter I
know that quite a few people actually seem to be using ClojureX, so I
also wanted to post the information here:
http://citizen428.net/archives/415-Major-changes-in-ClojureX.html
Cheers,
Michael
--
You received this message beca
Hi,
Clojure is great! The gain in productivity from more low level
languages like Java, but also more functional languages like Ruby and
Common LISP etc. amazes me every day. Like how adding a simple "map"
in front of the count here:
(count colls)
changes the code from counting the number of colle
You do not have to. Everything inside your dosync-block will happen
atomically, meaning print-info will either see the values of source-account
and dest-account before your transaction happened or after it's done his
work.
--
Ph. Siegmantel
2010/2/20 Jack Fang
> Hi,all
>
> I am new to cloj
On 21 February 2010 14:13, Michael Wood wrote:
> That does demonstrate the difference (or a difference), but I don't
> get 3 printlns.
Ouch, I actually posted the wrong version of the function. Here's an
improvement in the context of a REPL interaction:
1. ensure version:
user> (defn funk [r]
On 21 February 2010 13:47, Michał Marczyk wrote:
> On 21 February 2010 09:37, Michael Wood wrote:
>> (defn print-info []
>> (let [[src dst] (dosync
>> (ensure source-account)
>> (ensure dest-account)
>> �...@source-account @dest-account])]
On 21 February 2010 12:55, Jarkko Oranen wrote:
>>
>> But surely in this case you could do:
>>
>> (defn print-info []
>> (let [[src dst] (dosync [...@source-account @dest-account])]
>> (println src)
>> (println dst)))
>>
>> or maybe:
>>
>> (defn print-info []
>> (let [[src dst] (dosync
Hi people!
Clojure could be compiled over another language, using another base library.
This could be the "litmut test" for Clojure independence.
I guess Clojure-CLR is an step towards such target.
For now, Clojure consumes two library classes and VM: Java and .NET. It's
good, IMO, to have such
On 21 February 2010 09:37, Michael Wood wrote:
> (defn print-info []
> (let [[src dst] (dosync
> (ensure source-account)
> (ensure dest-account)
> �...@source-account @dest-account])]
> (println src)
> (println dst)))
This can be simp
>
> But surely in this case you could do:
>
> (defn print-info []
> (let [[src dst] (dosync [...@source-account @dest-account])]
> (println src)
> (println dst)))
>
> or maybe:
>
> (defn print-info []
> (let [[src dst] (dosync
> (ensure source-account)
>
On 21 February 2010 09:24, ataggart wrote:
> On Feb 20, 6:07 am, Jack Fang wrote:
>> Suppose the transfer-money and print-info are run in different
>> thread. With the current Clojure STM, is it possible that print-info
>> prints the old source-account information and modified dest-account
>>
42 matches
Mail list logo