clojure fn またはマクロの :arglist 属性を変更するにはどうすればよいですか?
(defn tripler ^{:arglists ([b])} [a] (* 3 a))
(defn ^{:arglists ([b])} quadrupler [a] (* 4 a))
% (meta #'tripler) =>
{:arglists ([a]), :ns #<Namespace silly.testing>, :name tripler, :line 1, :file "NO_SOURCE_PATH"}
% (meta #'quadrupler) =>
{:arglists ([a]), :ns #<Namespace silly.testing>, :name quadrupler, :line 1, :file "NO_SOURCE_PATH"}
わかりました、運が悪いので、次のことを試しました。
(def tripler
(with-meta trippler
(assoc (meta #'tripler) :arglists '([c]))))
% (with-meta #'tripler) =>
{:ns #<Namespace silly.testing>, :name tripler, :line 1, :file "NO_SOURCE_PATH"}
うーん、それで :arglists キーはなくなりましたか? では、あきらめます。どうすればよいでしょうか。:arglists の値を変更したいだけです。上記の例では defn を使用していますが、マクロ (defmacro) を使用して :arglists を設定する方法も知りたいです。