Re: Returning early from a function

2015-02-22 Thread Stig Brautaset
Hi, I see you use the multi-arity form of * - did you know that you can use that with < and <= too? I think it this improves your function: (defn params-correct-lucky-numbers [upto] (let [max (* 10 1000 1000)] (if (<= 1 upto max) true (do (println "The parameter

Datomic namespaced idents question

2015-04-05 Thread Stig Brautaset
I have a question regarding using Datomic from Clojure, but I think it's more of a Clojure question than a Datomic question I understand that you must use namespaces in idents for logically distinct types of entities. (Unless you intend them to be lumped together in the same index.) Thus the

England, (North) Northumberland Clojurans?

2015-04-18 Thread Stig Brautaset
(Or is it Clojurists? I've seen both.) I've just moved to Berwick-upon-Tweed and have a couple months of leisure time. I'm planning to have a decent stab at learning Clojure, but it would be great to meet up with someone with similar interests occasionally. I've read a few books (Joy of Clojure

Why (defn- ...) but (def ^:private? ...)

2015-05-07 Thread Stig Brautaset
Is it because the def form can also be ^:dynamic? At any rate, I did an attempt at my first macro to create a (def- ...) form, but it doesn't seem to work. Can you not attach metadata in a macro? (defmacro def- "Why (defn- private-fn ...) but (def ^:private var ...)?" [sym & body] `(def

Re: Why (defn- ...) but (def ^:private? ...)

2015-05-08 Thread Stig Brautaset
Hi Herwig, On Thursday, 7 May 2015 15:36:44 UTC+1, Herwig Hochleitner wrote: > > 2015-05-07 16:12 GMT+02:00 Stig Brautaset >: > >> Is it because the def form can also be ^:dynamic? >> > Hm, cognitect turned it down, because basically "if you go down this road, &

Re: My first implementation of Sieve of Eratosthenes. cons please

2014-11-26 Thread Stig Brautaset
Ah, primes :-) That was my first foray into Clojure as well. I wrote about it here: http://www.superloopy.io/articles/2014/learning-clojure.html - you might find it interesting: my first attempt wasn't so different from yours. Stig On Wednesday, 26 November 2014 14:52:44 UTC, Chernyshev Alex wr

Re: Any Clojure programming recording around?

2014-11-26 Thread Stig Brautaset
I *really* enjoyed http://www.zombieclj.no - but an understanding of Norwegian is required :-) Stig On Thursday, 20 November 2014 22:05:16 UTC, Erlis Vidal wrote: > > Hi group, > > Someone knows if we have screencasts on how the more skilled clojurian are > working? I remember few months ago w

Re: Clojure eXchange 2015

2016-01-06 Thread Stig Brautaset
If you don't have time to watch all the talks I wholeheartedly recommend watching Chris Ford's _Duelling Keyboards_ keynote. Best presented talk of the conference, IMO. He doesn't go into details about Clojure, but does go through some live coding and music making. Also, music theory. I also enjoy

Re: Suggestions for open source contributions?

2016-02-01 Thread Stig Brautaset
Steven Deobald writes: > With that context set, does anyone on the list have suggestions for projects > we can guide him through? We will be working with him through some the > standard Clojure literature over the coming months, as well as providing > guidance with his patches/pull-requests. I'm

confirming a core async channel is empty?

2016-02-14 Thread Stig Brautaset
In a unit test I am checking that a core async channel is empty. I couldn't find any `empty?` function for core async channels, and since `!! channel sentinel) (http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to

Re: confirming a core async channel is empty?

2016-02-15 Thread Stig Brautaset
Alex Miller writes: > You could use poll! - it is non-blocking. My tests thank you! That is indeed what I was after. I suppose since I was using !! I was looking for another method with two !'s at the end. Stig -- You received this message because you are subscribed to the Google Groups "Cloj

surprising behaviour from dissoc on records

2016-02-19 Thread Stig Brautaset
Dissoc behaviour on records really surprised me: user> (defrecord Foo [bar]) ;; => user.Foo user> (def foo (->Foo nil)) ;; => #'user/foo user> (dissoc foo :bar) ;; => {} user> (assoc foo :bar nil) ;; => #user.Foo{:bar nil} It lead to a bug where a component of min

Re: Porting Clojure to Native Platforms

2016-04-27 Thread Stig Brautaset
Colin Fleming writes: > Unit of compilation is the module, not sure how that all plays out with > the Elixir repl, but it's not optimal. From what I can tell, re-deffing a > defn would require re-loading an entire namespace (module)... > > Reloading a whole namespace on an evaluation