range 2 (inc n)))
(recur (inc i) n (conj preds #(and (> % i) (zero? (rem % i)))
(last (siev2 2 5 []))
4
Clojure is always fun to play
and I have not even try reducers yet :)
-
kawas
Le jeudi 5 septembre 2013 09:01:01 UTC+2, Cedric Greevey a écrit :
>
> Deeply nested lazy seq g
- Nippy <https://github.com/ptaoussanis/nippy>
I have no experience with them, just sharing
Regards
Kawas
Le jeudi 22 août 2013 21:09:41 UTC+2, Jim foo.bar a écrit :
>
> all I'm trying to do is to provide a uniform mechanism to save/load
> game-states across my 2D board-game
ain.
If I keep technical details in meta data (ex: locks) I see no need to
serialize it to share it over the wire.
Kind regards
Kawas
Le vendredi 23 août 2013 09:51:47 UTC+2, Meikel Brandmeyer (kotarak) a
écrit :
>
> Hi,
>
> Am Donnerstag, 22. August 2013 17:46:42 UTC+2 schrieb kawas:
>
te to reload it fast
without too much reprocessing.
Don't get me wrong, I'am not against any use of edn, in any situation. If
it solves you're problems, than you're good to go.
Regards
Kawas
>
> RPC stuff is hard to work with and couples both ends a lot. Edn is much
>
Jim,
This is indeed a hack and not a best practice, maybe you're not using the
right tool for your problem...
- If you want to exchange data (think values), you should not be in need of
keeping types and meta data
when you exchange data in json, for example, you're not providing object
class
der
user=> (edn/read-string {:readers {'treemap #(merge (sorted-map) %)}}
(binding [*print-dup* false] (str "#treemap " (pr-str
(sorted-map :z 5 :a 1)
{:a 1, :z 5} ;; this is a sorted map
Seems like it should be possible to easily provide default printers and
read
dn/read-string {:readers {'user.Foo #(apply ->Foo %)}}
"#user.Foo[1, 2, 3]")
#user.Foo{:a 1, :b 2, :c 3}
Nice
Le mercredi 21 août 2013 22:33:00 UTC+2, kawas a écrit :
>
> By the way *print-dup* is the problem, maybe you should not use it :)
>
> Spot the difference
By the way *print-dup* is the problem, maybe you should not use it :)
Spot the difference :
user=> (binding [*print-dup* true] (prn (->Foo 1 2 3)))
#user.Foo[1, 2, 3]
user=> (binding [*print-dup* false] (prn (->Foo 1 2 3)))
#user.Foo{:a 1, :b 2, :c 3}
cheers
Le mercredi 21 août 2013 19:
Hi,
Maybe you should provide a custom reader for your record.
See answer on this question
http://stackoverflow.com/questions/17991565/clojure-defrecord-serialization-classnotfoundexception
regards,
Le mercredi 21 août 2013 19:55:59 UTC+2, Jim foo.bar a écrit :
>
> Hi everyone,
>
> I am trying
constructors
but I may have made a mistake about which value is the correct one...
Bye,
Laurent
On 1 juin, 19:21, Tassilo Horn wrote:
> kawas writes:
>
> Hi Laurent,
>
> > (defn prime-factors [n]
> > (loop [f 2 n n res []]
> > (cond
> > (<=
Hi,
Can someone explain to me the behavior of this function when applied
to different kind of numbers.
(defn prime-factors [n]
(loop [f 2 n n res []]
(cond
(<= n 1) res
(zero? (rem n f)) (recur f (quot n f) (conj res f))
:else (recur (inc f) n res
Problem 1 (solved):
(slice 0 (dec high) (rest coll))
>
> On Jul 1, 4:29 pm, kawas wrote:
>
>
>
>
>
>
>
> > Hi,
>
> > As a clojure beginner I'm practicing my understanding of the language
> > but at some point the use of lazy-seq get blurry.
it seems like I'm hanging onto my
head.
Is lazy-seq creating some kind of closure with my collection in it ?
How about lazy-seq, tail call and closure clearing ?
regards,
--
kawas
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post t
13 matches
Mail list logo