Via mainstream twitter: Chinese spy manages to steal last 50MB of Lisp program governing U.S. missile launches.

2014-01-10 Thread russellc
Fortunately, it was all closing parentheses. -- -- 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 first post.

[ANN] Marshal 1.0.0

2012-02-05 Thread russellc
to/from Clojure. Github: http://github.com/russellc/Marshal Clojars: https://clojars.org/marshal //C header file definition struct packet { unsigned long type; unsigned long size; long data[1]; }; (require '[marshal.core :as m]) (def packet (m/struct :type m/uint32 :size m/uint32 :data (m/array

1.2 letfn/reduce bug?

2010-06-11 Thread russellc
(defn foo [] (letfn (bar [acc val] acc) (reduce bar {} (range 1 10 doesn't compile java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Symbol this compiles (defn bar [acc val] acc) (defn foo [] (reduce bar {} (range 1

Can anyone create a simpler version of prime factors in Clojure?

2010-06-11 Thread russellc
Not sure it's better than Uncle Bobs version but it seems a little more idiomatic? (defn of [n] (letfn [(f [res k] (if (= 0 (rem (:n res) k)) (assoc (assoc res :n (quot (:n res) k)) :fs (conj (:fs res) k)) res))] (:fs (reduce f {:n n :fs []}

defrecord question

2010-04-30 Thread russellc
Should this compile? (defprotocol P (p [this])) (defrecord R [k] P (p [{:keys [k]}] k)) java.lang.ClassCastException: clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.Symbol -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Uncle Bob: bowling meets Clojure

2009-07-24 Thread russellc
FWIW (i.e. IMO the previous two functional solutions are better examples) here is a more imperative style solution done sort of to prove to myself that I could do such a thing in Clojure w/o too much (arguable) fanfare. Maybe it will be interesting to others who are learning Clojure too (defn