2019-01-01 15:46:42 -08:00
|
|
|
# Examples
|
|
|
|
|
|
2019-01-01 16:04:37 -08:00
|
|
|
Simple functions:
|
2019-01-01 15:46:42 -08:00
|
|
|
|
|
|
|
|
* **[add](add):** Add two numbers. The "Hello World!" of `avo`.
|
2019-01-01 16:04:37 -08:00
|
|
|
* **[sum](sum):** Sum an array of numbers.
|
|
|
|
|
|
|
|
|
|
Features:
|
|
|
|
|
|
2019-01-01 15:46:42 -08:00
|
|
|
* **[args](args):** Loading function arguments.
|
2019-01-01 16:15:33 -08:00
|
|
|
* **[returns](returns):** Building return values.
|
2019-01-01 15:56:17 -08:00
|
|
|
* **[complex](complex):** Working with `complex{64,128}` types.
|
2019-01-01 16:33:30 -08:00
|
|
|
* **[data](data):** Defining `DATA` sections.
|
2019-01-22 22:35:01 -08:00
|
|
|
* **[ext](ext):** Interacting with types from external packages.
|
2019-09-16 11:01:48 -07:00
|
|
|
* **[pragma](pragma):** Apply compiler directives to generated functions.
|
2019-01-01 17:01:08 -08:00
|
|
|
|
|
|
|
|
"Real" examples:
|
|
|
|
|
|
|
|
|
|
* **[fnv1a](fnv1a):** [FNV-1a](https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function#FNV-1a_hash) hash function.
|
|
|
|
|
* **[dot](dot):** Vector dot product.
|
|
|
|
|
* **[geohash](geohash):** Integer [geohash](https://en.wikipedia.org/wiki/Geohash) encoding.
|
|
|
|
|
* **[sha1](sha1):** [SHA-1](https://en.wikipedia.org/wiki/SHA-1) cryptographic hash.
|
|
|
|
|
* **[stadtx](stadtx):** [`StadtX` hash](https://github.com/demerphq/BeagleHash) port from [dgryski/go-stadtx](https://github.com/dgryski/go-stadtx).
|