Anatomy of a Function
The following are all the predicates that you can specify when creating a function.
|List of parameters this function supports.|
|Actual ledger code|
|A docstring for this function.|
|Programming language used (not yet implemented, currently only Clojure supported)|
|(not yet implemented) Optional spec for parameters. Spec should be structured as a map, parameter names are keys and the respective spec is the value.|
In the next lesson, we'll be talking a lot more about
_fn/code, but for now take a look at an example function, which subtracts 3 from a value:
"code": "(- a 3)",
"doc": "Subtracts 3 from a value, a"
As you can see above, our code takes a parameter,
a. We declare
_fn/params, and we can therefore use it in our code.