~technomancy/fennel

Prevent early evaluation in method calls and comparators.

Previously in certain situations we would use the internal compiler
helper function `once` in order to ensure a value only got evaluated
once, to prevent double-evaluation in method calls and
comparators.

Unfortunately this had a bug where in an effort to prevent
double-evaluation, it would evaluate it exactly once, rather than at
most once, because it would emit the expression evaluation and bind it
to a local in the parent context and then use the local in multiple
places.

This would cause problems because there are cases where it should not
be evaluated at all:

    (and false (: (foobar) :method?))

    (and false (< (a) (b) (c)))

Both these cases are special because they cannot compile into the
"lua-native" equivalent construct; in the first case because the
method name has a question mark in it, and in the second case because
the < operator has three args instead of two.

We fix this by compiling to an IIFE and using its arguments to refer
to values twice without danger of double-evaluation:

    (function(tgt, m, ...) return tgt[m](tgt, ...) end)(%s, %s)

Of course, this introduces some overhead, but it is the only safe way
to compile the code. In both cases we check to see if the lua-native
compilation approach is possible, and if it is we use it, so the
overhead will only be incurred when absolutely necessary.

Fixes #323
Explain that package.searchers is only necessary in some contexts.
Finish automating release in makefile.
Bump version and some notes.
Prevent body-less lambdas from returning true instead of nil.

Fixes #320.
Fix a bug where destructuring was treated as a value.
Update some docs with feedback from uvtc.
Fix make-searcher to save off root opts earlier.
Fix bug in global mangling with env.

Fixes #319.
A couple bug fixes, plus a commented-out test.

* typo correction
* the function to reset the root was returning a function instead of resetting

The test is a problem that has existed since 0.2.0 which only affects
mangled globals; it is not new from self-hosting.
Merge pull request #315 from uvtc/patch-1

tutorial: note on naming identifiers
Update tutorial.md
Merge pull request #318 from uvtc/patch-2

setup.md: tidied up sections
Update tutorial.md
setup.md: tidied up sections

Removed redundant embedded mini-ToC's.
Fixed heading levels so they fall under the correct section.
Heading levels now are "one lower" so they render right in the ToC at the top (I think I have this right).
Also some minor markdown formatting tweaks (ex. list intents)
tutorial: note on naming identifiers
Allow running just one suite in the tests.
Don't use kebab-case for short_src.

As far as I can tell, this is the only place in all of Lua that it
uses snake_case.
[kebab-case] s/assertCompile/assert-compile friend
Next