【发布时间】:2014-07-08 15:35:23
【问题描述】:
我正在尝试格式化十六进制颜色以用于 HTML,在浏览器中运行 ClojureScript。
这是我的“格式化”函数。
(defn gen-format [& args] (apply gstring/format args) )
在我需要 goog.string 库的“字符串”命名空间中:
(:require [goog.string :as gstring] [goog.string.format :as gformat])
但是当我尝试从 javascript 调用它时:
document.write(mypackage.strings.gen_format("#%x%x%x",0,0,0));
它只是返回#%x%x%x
它没有崩溃。但是 goog 格式函数似乎没有替换其中的值。我在这里做错了吗?
【问题讨论】:
标签: clojure clojurescript google-closure-library