miller/docs6b/docs/data/factorial-example.sh
John Kerl 11eac853d2
First pass at converting Miller 6 docs from Sphinx to Mkdocs (#616)
* Accept more passing emit cases

* Port docs from sphinx to mkdocs

* iterating

* rephrase internal-link syntax using mkdocs

* iterating
2021-08-04 01:54:01 -04:00

14 lines
316 B
Bash

mlr --opprint --from data/small put '
func f(n) {
if (is_numeric(n)) {
if (n > 0) {
return n * f(n-1);
} else {
return 1;
}
}
# implicitly return absent-null if non-numeric
}
$ox = f($x + NR);
$oi = f($i);
'