> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/a/anonymous_recursion.md).

# Anonymous recursion

\_\_FUNC\_\_ refers to the current function.

```ruby
func fib(n) {
    return NaN if (n < 0)

    func (n) {
        n < 2 ? n
              : (__FUNC__(n-1) + __FUNC__(n-2))
    }(n)
}
```

\_\_BLOCK\_\_ refers to the current block.

```ruby
func fib(n) {
    return NaN if (n < 0)

    {|n|
        n < 2 ? n
              : (__BLOCK__(n-1) + __BLOCK__(n-2))
    }(n)
}
```
