Let's write β

プログラミング中にできたことか、思ったこととか

ダメだった..

できると、おもっていた.できなかった。

(defpartial main-layout (&rest contents)
 (:html
   (:head
     (:link :href "/static/css/bootstrap.css" :rel "stylesheet" :type "text/css")
     (:script :src "/static/js/bootstrap.min.js"))
   (:body
     contents)))

CL-APIDOC(28): (main-layout "hoge" `(:hoge "hoge"))

"<html><head><link href=\"/static/css/bootstrap.css\" rel=\"stylesheet\" type=\"text/css\" /><script src=\"/static/js/bootstrap.min.js\" /></head><body>(hoge (HOGE hoge))</body></html>"

...
Clojureのnoirなら..(hiccup)

(defpartial layout [& content]
            (html5
              [:head]
              [:body
               [:div#wrapper
                content]]))

(layout
  [:p "Hoge"]
  [:h2 "Hoge"])

とできる...まぁclojureにはリスト以外にもリスト風に記述できる物があって、しかもそれ自体がデータ型なので、それを処理できるのでしょう..
ちょっと悔やしいので、どなたか良い方法をおしえてください..