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
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
> (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
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
> 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
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
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