之前
user=> ((fn [x] {:pre (pos? x)} x) -5) ; 哎呀!
-5
user=> ((fn [x] {:pre [(pos? x)]} x) -5) ; 意图是这样
AssertionError 断言失败: (pos? x) user/eval4075/fn--4076 (form-init5464179453862723045.clj:1)
之后
user=> ((fn [x] {:pre (pos? x)} x) -5)
编译器异常 java.lang.IllegalArgumentException: 预处理和后处理条件应为向量,在:(NO_SOURCE_PATH:1:2) 编译
user=> ((fn [x] {:pre [(pos? x)]} x) -5)
AssertionError 断言失败: (pos? x) user/eval2/fn--3 (NO_SOURCE_FILE:2)
user=> ((fn [x] {:post (pos? x)} x) -5)
编译器异常 java.lang.IllegalArgumentException: 预处理和后处理条件应为向量,在:(NO_SOURCE_PATH:3:2) 编译
user=> ((fn [x] {:post [(pos? x)]} x) -5)
AssertionError 断言失败: (pos? x) user/eval7/fn--8 (NO_SOURCE_FILE:4)
*补丁:* CLJ-1473_v03.patch
*审查者:* Alex Miller