Web 快速开发很多人用 Python 及其它动态语言,Clojure 作为 Lisp 的一种方言,也很灵活。那么它适合用来做 Web 快速开发么? 理由是什么?
相对比 Python,Clojure 又有什么优劣势?
(defn render-test [ret tmt] (-> (resp/response "------render----test------") (#(resp/content-type %1 "text/plain")))) (defn foo "I don't do a whole lot." [x] (str "来自源码目录的参数:" x)) (defn handler [^Integer x] {:$r render-test :text (str "hello world, road goes sucess!" (foo x))}) (defn home [req content ^Integer num] {:hiccup "home.clj" :content (str "home" content) :num num}) (defroad road (GET "/web-test-0.1.0-SNAPSHOT-standalone/main" handler) (GET "/web-test-0.1.0-SNAPSHOT-standalone/home/:num{\d+}" home)) (defn -main [& args] (log/info "---------log4j test-------") (jetty/run-jetty road {:port 3000}))
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号