私が書いたこのコードは私にエラーを与えます:
java.lang.Long cannot be cast to clojure.lang.IFn
これは、関数が期待される場所で数値を使用していることを意味します。
clojure.math.numeric-tower の expt 関数に関係していると思いますが、よくわかりません。不可解なエラー メッセージ FTL.
(ns point-normalize.core
(:require [clojure.math.numeric-tower :as math :only (sqrt expt)]))
(defn normalize [x y]
(let [x1 (/ x (math/sqrt ((math/expt x 2)+ (math/expt y 2))))
y1 (/ y (math/sqrt ((math/expt x 2)+ (math/expt y 2))))]
(x1 y1)))
ヒントをいただければ幸いです。ありがとうございました。