Skip to content

02-running

Source: examples/02-running.metta

Imports

This module has no imports.

Symbols

SymbolKindType
evenfunction(even $x)
fibfunction(-> Number Number)

Functions

even

Kind: function

metta
(even $x)

True when a number is even.

Source: examples/02-running.metta:25

fib

Kind: function

metta
(: fib (-> Number Number))

The nth Fibonacci number. One clause guards the base case with if: in MeTTa every matching clause fires, so a separate (= (fib 0) 0) would also match (fib $n) and recurse into negatives — the if keeps it to a single path.

Source: examples/02-running.metta:19

Released under the Apache-2.0 License.