01-hovers
Source: examples/01-hovers.metta
Imports
This module has no imports.
Symbols
| Symbol | Kind | Type |
|---|---|---|
factorial | function | (-> Number Number) |
Functions
factorial
Kind: function
metta
(: factorial (-> Number Number))The factorial of n. One clause guards the base case with if: a separate (= (factorial 0) 1) would also match (factorial $n) in MeTTa and recurse into negatives forever, so the if keeps it to a single path.
Source: examples/01-hovers.metta:23