A more useful assert macro

2008-12-19 Thread jdz
At the moment assert macro accepts only a single argument - a test. If the test fails (is false), an exception is thrown. But the only information available (until we have better introspection tools) is the test _expression_. This causes problems when working on many items that should satisfy an a

Re: A more useful assert macro

2008-12-19 Thread jdz
On Dec 19, 4:27 pm, Stuart Halloway wrote: > While we are talking about assert: I recently wanted for assert to   > return the value of the expression, so I could embed asserts inside a   > Fact test and get detailed reporting about what failed. > > I checked a few other functional languages and

Re: if-let

2009-02-09 Thread jdz
> (let [basedir (if-let [bdir (:basedir *locs)] bdir ".")] >     ...) I'd personally write that as: (let [basedir (or (:basedir *locs*) ".")] ...) There is also when-let, which can be used to iterate over sequences: (loop [items some-sequence] (when-let [item (first items)] (do somethi

Re: Clojure for high-end game development

2009-05-22 Thread jdz
On May 21, 9:35 pm, tcg wrote: > You would think with Clojure's ability to make use of mutli cpu > hardware it would be a good choice for high-end game development. Clojure is not the only language which provides access to multiple CPUs/cores. When programming with immutable data structures, th

Re: (gensym) not equivalent to #?

2009-05-29 Thread jdz
> Here are two functions the do roughly the same thing -- > return a list with a single gensym'ed symbol in it: > > (defn f-auto [] >   `(foo#)) Think about it this way: everything that is not unquoted in the body of syntax-quote stays the same. In other words, syntax-quote is like regular quote

Re: transient quicksort

2009-08-05 Thread jdz
On Aug 4, 11:08 am, Jonas wrote: > Can you give any hints on how I can make the transient sort faster? I > would like to get as close as possible to the native Java speed. You are comparing apples to oranges. Clojure's persistent vectors do not magically turn into Java arrays when using the new

Re: Concerned about Clojure's license choice.

2008-11-02 Thread jdz
On Nov 1, 7:33 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Are you really sure you want/need to use the Common Public License for > your > language?  The biggest problem I see with this license is that it is > not > compatible with the GPL.  This means a lot to many people and I would > h