Re: A website written using Clojure.

2009-06-26 Thread Emeka
Stuart Sierra, I want to use StringTemplate, could you give me a lead? Emeka On Thu, Jun 25, 2009 at 9:31 PM, Stuart Sierra the.stuart.sie...@gmail.comwrote: On Jun 25, 3:59 pm, Berlin Brown berlin.br...@gmail.com wrote: But does anyone have a problem with Lisp/S-Expressions to

Re: A website written using Clojure.

2009-06-26 Thread Jonathan Smith
On Jun 25, 3:59 pm, Berlin Brown berlin.br...@gmail.com wrote: On Jun 25, 3:52 pm, Mike Hinchey hinche...@gmail.com wrote: Instead of eval in the doseq, you could use a macro with a do block, something like: user (defmacro deftags [tags]         `(do ~@(map (fn [tag]                

A website written using Clojure.

2009-06-25 Thread CuppoJava
Hey guys, I was a little tired of working on what I am supposed to be working on, and decided to take a break and create a website. I decided to use Clojure, and to my surprise, it only took a day and less than 3 pages of code. members.shaw.ca/patrickli It only has a single article right now,

Re: A website written using Clojure.

2009-06-25 Thread Emeka
That's cool. (doseq [[name tag] [['html html] ['head head] ['style style] ['title title] ['body body] ['table table] ['row tr] ['col td]

Re: A website written using Clojure.

2009-06-25 Thread Daniel Lyons
On Jun 25, 2009, at 11:46 AM, CuppoJava wrote: Hey guys, I was a little tired of working on what I am supposed to be working on, and decided to take a break and create a website. I decided to use Clojure, and to my surprise, it only took a day and less than 3 pages of code.

Re: A website written using Clojure.

2009-06-25 Thread CuppoJava
Thanks for the reply. I use doseq instead of map because I need it to run immediately, and I'm not interested in the return values of the functions. I also would love to be able to simply the (eval ...) part, but I don't know of any other way to dynamically define a function in Clojure. If you

Re: A website written using Clojure.

2009-06-25 Thread Vagif Verdi
What server are you running it on ? Tomcat ? There's a compojure web framework that already has html combinator library. Check it out here: http://preview.compojure.org/docs --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: A website written using Clojure.

2009-06-25 Thread CuppoJava
Thanks for your opinions Daniel. Yes I really need to adapt to using hyphens instead of underscores. I've irked more than a few people already. So far, defblockfn is serving me well, but it has bitten me a few times now. If I come up with another alternative I will switch over. -Patrick

Re: A website written using Clojure.

2009-06-25 Thread CuppoJava
I'm not running off any server. All the pages are static html, which are generated by a Clojure script. I looked at Compojure, and it seems very promising, but I decided it was overkill for my website. -Patrick --~--~-~--~~~---~--~~ You received this message

Re: A website written using Clojure.

2009-06-25 Thread Daniel Lyons
On Jun 25, 2009, at 12:57 PM, CuppoJava wrote: I'm not running off any server. All the pages are static html, which are generated by a Clojure script. Haha, that explains the speed. :) *slaps forehead* — Daniel Lyons --~--~-~--~~~---~--~~ You received this

Re: A website written using Clojure.

2009-06-25 Thread CuppoJava
Yeah. Speed and simplicity were my main reasons to use static HTML instead of running off a server. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: A website written using Clojure.

2009-06-25 Thread Emeka
CuppoJava, Did you try prxml? May be it can be of help. Regards, Emeka --~--~-~--~~~---~--~~ 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

Re: A website written using Clojure.

2009-06-25 Thread Emeka
CuppoJava, I was referring to the map data structure {'html html..} and not the other map. Regards, Emeka --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: A website written using Clojure.

2009-06-25 Thread Mike Hinchey
Instead of eval in the doseq, you could use a macro with a do block, something like: user (defmacro deftags [tags] `(do ~@(map (fn [tag] `(defn ~(symbol (str tag -with)) [block#] (str ~tag block#))) tags))) #'user/deftags

Re: A website written using Clojure.

2009-06-25 Thread Berlin Brown
On Jun 25, 3:52 pm, Mike Hinchey hinche...@gmail.com wrote: Instead of eval in the doseq, you could use a macro with a do block, something like: user (defmacro deftags [tags]         `(do ~@(map (fn [tag]                       `(defn ~(symbol (str tag -with))                          

Re: A website written using Clojure.

2009-06-25 Thread CuppoJava
Thanks Mike for that tip. That seems a bit better, but then I have a left-over macro that I have no use for. As to why I didn't use a map. I needed destructuring so Clojure would have internally turned the map into a seq anyway. Though a map would save me from a layer of parenthesis. I'll keep

Re: A website written using Clojure.

2009-06-25 Thread Daniel Lyons
On Jun 25, 2009, at 1:59 PM, Berlin Brown wrote: But does anyone have a problem with Lisp/S-Expressions to HTML/XHtml, especially for the entire document. What is wrong with using some form of templating system. I think that is what Lisp has (see Lisp's Html-template).

Re: A website written using Clojure.

2009-06-25 Thread Stuart Sierra
On Jun 25, 3:59 pm, Berlin Brown berlin.br...@gmail.com wrote: But does anyone have a problem with Lisp/S-Expressions to HTML/XHtml, especially for the entire document.  What is wrong with using some form of templating system. Yes, I'm partial to StringTemplate, a Java template framework.

Re: A website written using Clojure.

2009-06-25 Thread Nicolas Buduroi
I'm not running off any server. All the pages are static html, which are generated by a Clojure script. No kidding! I've done the exact same thing for my first website. It was using Scheme though and leveraged Oleg's SXML library, it bring me back fond memories. I'm looking at that old code

Re: A website written using Clojure.

2009-06-25 Thread CuppoJava
That's a good point. Dimming the lines would be a good idea. I originally tried to make the text actually line up with the lines, but that was a nightmare, and it didn't contribute much to the final effect. Scheme is a great language. If I needed to work on a project that runs natively (ie. not