Re: 1st script, last hurtle...

2011-02-17 Thread mss
Armando, James, & Mike. Thank you very much for the help, I'll certainly put your ideas to good use. Appreciate it! -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from ne

Re: 1st script, last hurtle...

2011-02-16 Thread Mike Meyer
On Feb 16, 2:01 am, Michael Sanders wrote: > I think I've worked out a better solution (hope this post renders properly): > > (ns topic (require [clojure.string :as s])) > > (defn load-block > > "TOPIC database: prints associated blocks to stdout" > >     ([tag] >     (let [STATE (atom 0) >   

Re: 1st script, last hurtle...

2011-02-16 Thread James Reeves
On 16 February 2011 10:01, Michael Sanders wrote: > I think I've worked out a better solution (hope this post renders properly): > > (ns topic (require [clojure.string :as s])) > > (defn load-block > > "TOPIC database: prints associated blocks to stdout" > >     ([tag] >     (let [STATE (atom

Re: 1st script, last hurtle...

2011-02-16 Thread Armando Blancas
Looks like you could make the (println) depend directly on (re-find): (when (re-find rx line) (println line)) The check for empty line and tab might be taken care of by (re-find) to further reduce the code to something like: (when (and line (re-find rx line) (println line) (recur (read-line)

Re: 1st script, last hurtle...

2011-02-16 Thread Michael Sanders
mss wrote: > Hi folks, new to Clojure... > > Question: > > How do I rid the following functions of all the '(def STATE num)' > calls? I can not seem to work out a way to use either 'binding', or > 'let/atom' that wraps the loop & works as well... Any other comments > are always welcomed. Here's my

1st script, last hurtle...

2011-02-16 Thread mss
Hi folks, new to Clojure... Question: How do I rid the following functions of all the '(def STATE num)' calls? I can not seem to work out a way to use either 'binding', or 'let/atom' that wraps the loop & works as well... Any other comments are always welcomed. Here's my code: (defn load-block (