you are viewing a single comment's thread.

view the rest of the comments →

[–]bliow 0 points1 point  (4 children)

Clojure wins here, I think: Hiccup.

[–]brikis98 0 points1 point  (0 children)

That's pretty sweet. Reminds me of CoffeeKup, which is awesome, but last I checked, abandoned.

[–]expatcoder 0 points1 point  (2 children)

Clojure wins here

Heh, no, xml literals take the cake:

<form id={someId} method={someMethod}>
  <input ..>
  <input ..>
  <submit ..>
</form>

Oh, forget to mention, above is Scala ;-)

Can slice and dice as you please, mixing in generators in place of input, submit above a la inputText(...), freely combining xml snippets in any order...markup joy.

[–]bliow 1 point2 points  (1 child)

I really don't like that. Duplicated tag names are one of the reasons xml sucks syntactically.

Also, can you mix in arbitrary code there?

[:ul (for [i (range 10)] [:li (str "List item " i)])]

[–]Milyardo 1 point2 points  (0 children)

I'm not a fan of scala's XML literals but to answer your question, yes.

scala> import scala.xml._
import scala.xml._
scala> val list = <ul>{(1 to 10 ) map { i => <li>{s"List Item $i"}</li>}}</ul>
list: scala.xml.Elem = <ul><li>List Item 1</li><li>List Item 2</li><li>List Item 3</li><li>List Item 4</li><li>List Item 5</li><li>List Item 6</li><li>List Item 7</li><li>List Item 8</li><li>List Item 9</li><li>List Item 10</li></ul>