Skip to content

Commit

Permalink
Add more docs around the module macro exporting #98
Browse files Browse the repository at this point in the history
  • Loading branch information
Olical committed Mar 16, 2022
1 parent 737f837 commit 4242b56
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,25 @@ use 'Olical/aniseed'
Plug 'Olical/aniseed'
----

== Module macros

Aniseed ships with a set of module macros that make interactive evaluation not only possible, but rich and intuitive. You should read `:h aniseed` to learn the details but it's worth mentioning that you opt in by starting your file with a `(module ...)` block, you then export values from your module with the `(def...)` macros.

Once you opt in your module will no longer operate like a regular Fennel module in the sense that you can't just return a table from the bottom of your file to export it like so.

```fennel
(local somemod {})
(set somemod.foo 25)
somemod
```

In vanilla Fennel, this will build and return a table from your module. If you use Aniseed's macro system your file must look like this instead.

```fennel
(module somemod)
(def foo 25)
```

== Loading Fennel Neovim configuration

Aniseed has a module called `aniseed.env` which will automatically compile and load Fennel code from your Neovim configuration directory as if it were natively supported by the editor, like Lua and VimL.
Expand Down

0 comments on commit 4242b56

Please sign in to comment.