Releases: Olical/aniseed
More aniseed.core functions!
Added to aniseed.core
...
merge
, merge various maps together, just like Clojure.kv-pairs
, turn a table into a sequential table of key/value tuples.map-indexed
, basicallykv-pairs
and thenmap
. Just like Clojure.with-out-str
, capture anything printed bypr
orprintln
within the callback.get
,get-in
,assoc
andassoc-in
. Just like Clojure butassoc
will mutate.butlast
, everything but the last item in a table.empty?
, returns true if what you give it has acount
of0
.mapcat
, like Clojure.
Misc
- I alias
aniseed.core
asa
now all over the place since I use it so much. - Use
println
internally over the plain Luaprint
so you can capture output of core functions withwith-out-str
. - More tests!
Macros with embedding and optional mappings
- Added a
split
toaniseed.string
. - Fix
defonce
and improve behaviour. - Allow use of module macros from Aniseed embedded via
scripts/embed.sh
, you don't need it installed globally as a Neovim plugin now. - Don't load the mappings by default, you have to require
aniseed.mapping
and runinit
yourself now. This is to give people options and support Conjure in the future as a way to evaluate things through Aniseed. - Make
aniseed.core
'spr
handle multiple arguments correctly. aniseed.core
's count supports more than just tables andnil
, you can now pass it strings for example!
Module system, usability, documentation
This is a big release since it provides a full interactive evaluation story. You'll need to buy into it by using the module
and def...
macros instead of fn
and local
though!
- Added
last
andcount
toaniseed.core
. - More tests.
- Better internal looping functions based on the
run!
function. - Update
nvim.lua
andfennel
. - Ensure
fennel.path
matcheslua.path
. - Full module system, documented in the readme.
deftest
module included as part of module system. Test suits are even nicer!- A bunch of scripts to help you fetch deps, compile Fennel, run tests and embed Aniseed within your plugin for runtime use.
- Mappings by default when you're in a Fennel buffer. I hope they're inoffensive 😬
- More documentation.
- One easy step to allow you to write your Neovim config in Fennel.
I hope you enjoy! It's been a lot of hard work, I hope it allows people to go out and make all sorts of amazing plugins that run faster and are easier to maintain and extend into the future 🎉
Testing and CI!
Aniseed now has a test runner and suite, see the readme for more information but it essentially means you can do this:
(fn add [a b]
(+ a b))
{:aniseed/module :my.math
:add add
:aniseed/tests
{:add
(fn [t]
(t.= 50 (add 30 20))
(t.= 10 (add 10 0) "adding 0 does nothing"))}}
Then all you have to do is execute :AniseedRunAllTests
(providing aniseed.mapping
's init
has been executed first) and you'll see the following output:
[my.math] OK 1/1 tests and 1/1 assertions passed
[total] OK 1/1 tests and 1/1 assertions passed
Aniseed's test suite actually does this in CI through a short lived Neovim instance, check out the Makefile
and .circleci
configuration for more information on how to do that.
aniseed.fs changes, better module reloading
- Breaking! In
aniseed.fs
, renamedensure-ancestor-dirs
tomkdirp
and split out the code to get the basename of the file into a function calledbasename
. - In
aniseed.string
, corrected one of the if statements to be consistent with it's other branches. They all useaniseed.core
type checking functions now. - Evaluating a file that returns a table containing
:aniseed/module :my.module
will now merge the keys into the already loadedmy.module
. This means other modules that require it will have their tables they're holding onto in locals updated. Before the entire table was swapped out leaving the dependant modules holding onto an old version ofmy.module
. This approach keeps everyone in sync as you change a module.
Windows support
Thanks to #1, Aniseed now supports Windows. I removed the use of sub-modules (semi-unrelated) and I'm now copying the compiled Lua that's required into the lua
directory (instead of symlinks). That's all committed into the repo purely for distribution reasons.
This should change nothing for current users other than your plugins that depend on Aniseed will now work on Windows hosts.
Stacktraces when ahead of time compiling files or globs
I was accidentally throwing away the Fennel stacktrace if it encountered an error whilst compiling your files (either one at a time or within a larger glob call), that's now getting printed correctly.
You'll see error output in Neovim if your Fennel is incorrect now, hooray!
Post dog-food stabilising
I've rewritten my dotfiles in terms of Aniseed and Fennel, I'm happy that it's usable in practice for real world use cases. Enjoy!
Initial release
Allows statically compiling Fennel to Lua either one file at a time or as a glob of a directory.