gpt4 book ai didi

Clojure:文档

转载 作者:行者123 更新时间:2023-12-02 06:19:14 24 4
gpt4 key购买 nike

我正在学习本教程:http://moxleystratton.com/clojure/clojure-tutorial-for-the-non-lisp-programmer

然后遇到了这个片段:

user=> (loop [i 0]
(when (< i 5)
(println "i:" i)
(recur (inc i))))
i: 0
i: 1
i: 2
i: 3
i: 4
nil

在我的翻译器上效果很好!

❯ lein repl
nREPL server started on port 50974
REPL-y 0.1.10
Clojure 1.5.1

现在我正在寻找一些关于什么是 recur 的文档。

这里没有! http://clojure.github.io/clojure/api-index.html

我花了一段时间才弄清楚它是一种“特殊形式”,因此在 this page 中进行了描述。 .

是否有具有单一连贯索引的汇编?

最佳答案

尝试使用 REPL 中的内置文档:

user=> (doc recur)
-------------------------
recur
(recur exprs*)
Special Form
Evaluates the exprs in order, then, in parallel, rebinds
the bindings of the recursion point to the values of the exprs.
Execution then jumps back to the recursion point, a loop or fn method.

Please see http://clojure.org/special_forms#recur

它适用于函数、宏、特殊形式、变量——几乎所有东西。

关于Clojure:文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15891912/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com