fennel/changelog.md -rw-r--r-- 12.4 KiB
Remove changelog update
Lua Primer typo fixes and LFS link
Add fennel.syntax table describing built-in forms.
Bump version back up to dev.
Release 0.9.2.
Changelog updates and setup guide tweaks.
bugfix: add propagation of .useBitLib opt to repl
bugfix: add missing -v alias for --version
Bump version number up to 0.9.2-dev
Bump to 0.9.0-dev version.
Add tests for bitops; tweak docstrings a bit.
Add support for fennel.macro-searchers.

We now have a fennel.macro-searchers table which functions as a
compile-time equivalent to the package.searchers table; anyone can
insert their own searcher functions to change how macros can be found.

The main thing I don't like about this is that it exposes our little
internal trick of passing :env :_COMPILER in the options table to load
things in compiler scope. We have supported this for the environment
for internal reasons for a while, but now we both expand it (to also
affect :scope) and document it as part of the interface, in order to
simplify the implementation of the default macro searcher function.

I don't love that trick; it was originally added in order to allow us
to load plugins in compiler scope without reaching into the guts of
the compiler module, but it feels like a bit of a hack.

We could maybe make it cleaner by exposing make-compiler-scope and
make-compiler-env as part of the public API, but I'm not sure it's
necessary. If this shorthand gets the same job done as adding two more
functions to our already-big API, maybe that's fine. Or we can add the
shorthand now and introduce the other functions later if we determine
they are useful.
Support &as in pattern matches.
Next version will be 0.9.0 not 0.8.2
Include stack trace when macroexpansion fails.
Clarify that sym function takes a source table argument now.
Implement early termination in loops. (for/each/collect/icollect)

This allows more flexibility in loops without sacrificing the
consistency that arbitrary breaks would cause.
Add :prefer-colon? and :escape-newlines? options to fennel view
add nil-safe table lookup operator

This patch adds new ?. operator. This operator can be used to do
nested table lookup in a nil-safe manner of -?> and -?>>
operators. This means that if any of subsequent keys do not exist,
this operator will short-circuit to nil value:

(local t {:a {:b [:c :d {:e {:f 42}} :g]}})

(?. t :a :b 3 :e :f) ; 42
(?. t :a :b 5 :e :f) ; nil, because there's only 4 elements in vector

Note that the implementation is not what we've discussed
before. Instead I've chosen mostly the same approach as for -?>>
macro, which does repeated recursion expansion for each key lookup
until amount of keys exhausts. This way there's no iteration, and we
will short-circuit at run-time if any key doesn't exist. It also
behaves the same way compile time wise as ordinary dot operator,
e.g. you can't pass an unpacked table to it.