Version 0.2.0#
- Started managing release notes
- Directory modules
- For each loops on lists
- Extract test-only support code
Started managing release notes#
Versions of the Temper tool-chain from now on will have release notes explaining user-visible changes. Happy versioning!
Directory modules#
Temper now supports importing full directories as modules rather than individual files, and this is also now the recommended way for structuring libraries. All files in a directory module share the same module namespace.
If config.temper.md has no imports, it implicitly imports the current
directory as a top-level module for the library:
// If this is all you want in config, no need. It's implied by default.
// Also, note no trailing "/" on imported dirs.
import(".");
For each loops on lists#
JS-style for each loops now work on List instances:
for (let i of [2, 3, 4]) {
console.log(i.toString());
}
This desugars to .forEach method calls, with the intention of inlining such
calls at a future point.
Extract test-only support code#
Temper now not only extracts tests from production code; it also extracts test-only support code.
test("something") { (test);;
assertLength(test, "word", 4);
}
let assertLength(test: Test, string: String, expectedLength: Int) {
// The `assert` macro automatically associates with the `test` parameter.
assert(string.length == expectedLength);
}
Here, assertLength is neither exported nor accessed (even transitively) by
exported code, so it also gets extracted from production code according to
backend-specific unit test expectations.