在胭脂红中考虑这个片段
(wcar* (car/set "counter" 1) ;; expect to be number counter=1
(let [id (car/get "counter")] ;; expect to have id=1
(println id))) ;; [nil [[SET counter 1] [GET counter]]]
我在这里做错了什么?有没有办法在wcar*
宏中使用let
?
您可以嵌套wcar
表单,从而访问wcar
:中的返回值
(wcar*
(car/set "counter" 1)
(let [id (wcar*
(car/get "counter"))]
(println id)
id))