我对Clojure和函数式编程都不熟悉。
我想要执行一组if/else语句,如果条件成立,我想在列表末尾添加一些字符串。
在JavaScript中,代码应该是这样的:
const a = 1;
const b = 2;
const c = 1;
const errors = [];
if (a !== b) {
errors.push("A and B should not be different");
}
if (a == c) {
errors.push("A and C should not be equal");
}
console.log(errors);
我该怎样用Clojure实现这个?