我的java.lang.IllegalArgumentException: No value supplied for key:
Clojure 代码中有一个。
我知道当我试图解构作为参数传递的映射中的键时会发生这种情况。
然而,这里奇怪的是,这个函数多年来一直运行良好,数据相同。唯一似乎不同的是我现在如何导入函数
这是错误:
Caused by: java.lang.IllegalArgumentException: No value supplied for key:
{:style {:color [255 150 150 255], :stroke-weight 2}, :points [[-1 0] [0 -1] [1 0] [0 1] [-1 0]]}
这是抛出它的函数。
(defn scale
[val {:keys [style points]}]
{:style style
:points (scale-shape val points)})
换句话说,我要求地图包含名为style
and的键,并且给它一个包含名为andpoints
的键的地图。style
points
这段代码几个月来一直运行良好。
不同之处在于我现在使用sshapes/scale
wheresshapes
被导入的地方来调用它:
(:require [patterning.sshapes :as sshapes])
而以前我只是将其称为scale
scale 进入命名空间的地方
(:require [patterning.sshapes :refer :all])
这会导致那种错误吗?