Re: HTML5 Validator

2010-12-18 Thread John Sanda
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

error with doseq in defrecord function

2010-10-31 Thread John Sanda
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

Re: Problem reloading source file with imports

2010-08-30 Thread John Sanda
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

Re: let binding and recursive function

2010-08-02 Thread John Sanda
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

let binding and recursive function

2010-08-02 Thread John Sanda
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

version compatibility between clojure and clojure-contrib

2010-04-19 Thread John Sanda
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

Re: iterating over a nested vector

2010-04-08 Thread John Sanda
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] > > ] > >

Re: iterating over a nested vector

2010-04-08 Thread John Sanda
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

iterating over a nested vector

2010-04-08 Thread John Sanda
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