我想执行下列嵌套操作,直到满足预期为止。 是否存在:until关键字,当条件匹配时停止进一步操作。在clojure中是否存在“:until”命令?
这个命令会生成Pythagoran Triplet 3 4 5.我不希望它一旦得到那个数字序列就做任何事情。
(for [a (range 1 100)
b (range 1 100)
c (list (Math/sqrt (+ (Math/pow (int a) 2) (Math/pow (int b) 2))))
:when (= 12 (+ a b c))]
(list a b c))
难道你不能只是“不”吗? – jrockway 2009-08-02 16:12:42