Arc Forumnew | comments | leaders | submitlogin
1 point by antiismist 6113 days ago | link | parent

It is true that the html library in standard arc has some inconsistencies. But making a set of macros that generates html the way that you want is super-easy. I would guess that it is easier to write your own set of macros to do it than to read the documentation on how someone else's works.


6 points by eds 6113 days ago | link

But if you don't get the standard library right, then everyone is going to start using their personal version of it, and then you lose portability, etc.

It is worth getting the language right, even if the fix is trivial.

-----

3 points by almkglor 6112 days ago | link

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.

-----