Arc Forumnew | comments | leaders | submitlogin
3 points by almkglor 6112 days ago | link | parent

I was actually thinking some time ago about using something like this:

  (mac mapeach (var coll . body)
    "Like 'map, but with 'each syntax"
    `(map1 (fn (,var) ,@body) ,coll))

  (marcup
    `(html
       (head (title ,(+ page-title " - My Website")))
       (body
         (.content
           ,(enformat page-content))
         (.sidebar
           ,@(mapeach (link dest) weblinks
               `(.sidelink (a href= ,dest ,link)))))))
Basically 'marcup would accept a list representing an abstract syntax tree for the HTML code to be generated.

Then I decided to implement w/html instead, which was almost as good ^^; >.< In fact it's arguably better, since the copious ' marks denote non-Arc code (i.e. HTML tags), as opposed to the marcup style above where , marks denote Arc code.