On Sat, Dec 18, 2010 at 3:10 PM, Alyssa Kwan wrote:
> Hi!
>
> I'd like to unit test my html output for well-formedness. What's an
> easy way to test it for HTML5 validity? Are there good Clojure libs
> for this? I only need to check for validity, not parse.
>
> Thanks!
> Alyssa
>
> --
>
You mi
I am getting an error when trying to call doseq from within a defrecord
function, but I do not get the error with the same code outside of the
defrecord. Here is an example:
(defprotocol Fooable
(foo [this]))
(defn add-props [s properties] (doseq [p properties] (.add p)))
(defrecord Foo [prope
I ran into the same situation as Chris yesterday with
clojure.contrib.seq-utils as well as with clojure.contrib.str-utils. The
explanation is very timely for me and much appreciated.
- John
On Mon, Aug 30, 2010 at 4:05 PM, Robert McIntyre wrote:
> Sorry, I was tired and didn't explain very well
al tree idx []))
> ([tree idx traversal]
>...))
>
> Lastly, FYI, the form (if foo foo bar) can be simplified to (or foo
> bar).
>
> Hope that helps,
>
> Justin
>
> On Aug 2, 5:04 pm, John Sanda wrote:
> > I've just implemented an inorder traversal function for a vec
I've just implemented an inorder traversal function for a vector-based tree.
The functions look like,
(defn- do-traversal [tree idx traversal]
(cond
(not (node-exists? tree idx)) traversal
(leaf? tree idx) (conj traversal (tree idx))
:else (apply conj
(do-traversal tree (left-ch
I am working with a simple leiningen project with the build defined as
follows,'
; project.clj
(defproject myproject "1.0.0-SNAPSHOT"
:description "FIXME: write"
:dependencies [[org.clojure/clojure "1.2.0-master-SNAPSHOT"]
[org.clojure/clojure-contrib "1.2.0-SNAPSHOT"]])
I am
variables
as opposed to a 1-line clojure version that is free of branching and
variables. I'm hooked ;-)
On Thu, Apr 8, 2010 at 1:38 PM, James Reeves wrote:
> On Apr 8, 1:13 pm, John Sanda wrote:
> > [
> > [1 2 3]
> > [2 5 1]
> > [4 2 6]
> > ]
> >
That is actually not what I want. Consider the vector a table where each
element which is itself a vector a row. And each element of a nested vector
is a cell where its index indicates its column. Writing it as follows may
make it more clear,
[
[1 2 3]
[2 5 1]
[4 2 6]
]
I am comparing the v
Hi,
I am just getting started with Clojure and with functional programming for
matter. I decided that a good exercise would be for to try and port some
Java code that I recently wrote. In the Java code I had a 2-D array which
basically represents a table of values, and to keep things simple assume