Correct inaccuracy in recursion description. (#554)
This commit is contained in:
@@ -18,9 +18,9 @@ func fact(n int) int {
|
||||
func main() {
|
||||
fmt.Println(fact(7))
|
||||
|
||||
// Closures can also be recursive, but this requires the
|
||||
// closure to be declared with a typed `var` explicitly
|
||||
// before it's defined.
|
||||
// Anonymous functions can also be recursive, but this requires
|
||||
// explicitly declaring a variable with `var` to store
|
||||
// the function before it's defined.
|
||||
var fib func(n int) int
|
||||
|
||||
fib = func(n int) int {
|
||||
|
@@ -1,2 +1,2 @@
|
||||
cdbd1a6957b3e2d7d9baa9efe4581ba4f8f3e753
|
||||
MBTKk9VpAiK
|
||||
5787b4a187dc208dcdae43c7fdc0ba19b821ed94
|
||||
k4IRATLn9cE
|
||||
|
8
public/recursion
generated
8
public/recursion
generated
@@ -46,7 +46,7 @@ Here’s a classic example.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
<a href="https://go.dev/play/p/MBTKk9VpAiK"><img title="Run code" src="play.png" class="run" /></a><img title="Copy code" src="clipboard.png" class="copy" />
|
||||
<a href="https://go.dev/play/p/k4IRATLn9cE"><img title="Run code" src="play.png" class="run" /></a><img title="Copy code" src="clipboard.png" class="copy" />
|
||||
<pre class="chroma"><code><span class="line"><span class="cl"><span class="kn">package</span> <span class="nx">main</span></span></span></code></pre>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -91,9 +91,9 @@ base case of <code>fact(0)</code>.</p>
|
||||
|
||||
<tr>
|
||||
<td class="docs">
|
||||
<p>Closures can also be recursive, but this requires the
|
||||
closure to be declared with a typed <code>var</code> explicitly
|
||||
before it’s defined.</p>
|
||||
<p>Anonymous functions can also be recursive, but this requires
|
||||
explicitly declaring a variable with <code>var</code> to store
|
||||
the function before it’s defined.</p>
|
||||
|
||||
</td>
|
||||
<td class="code leading">
|
||||
|
Reference in New Issue
Block a user