![]() This is debatable, but I would argue that it's been sufficiently annoying for people and such a low-hanging fruit that we ought to do something about it. The strategy here is simple: when we find a sequence of expression that ends with an assignment (let or expect), we can simply desugar it into two expressions: the assignment followed by either `Void` or a boolean. The latter is used when the assignment pattern is itself a boolean; the next boolean becomes the expected value. The former, `Void`, is used for everything else. So said differently, any assignment implicitly _returns Void_, except for boolean which return the actual patterned bool. <table> <thead><tr><th>expression</th><th>desugar into</th></tr></thead> <tbody> <tr> <td> ```aiken fn expect_bool(data: Data) -> Void { expect _: Bool = data } ``` </td> <td> ```aiken fn expect_bool(data: Data) -> Void { expect _: Bool = data Void } ``` </td> </tr> <tr> <td> ```aiken fn weird_maths() -> Bool { expect 1 == 2 } ``` </td> <td> ```aiken fn weird_maths() -> Bool { expect True = 1 == 2 True } ``` </td> </tr> </tbody> </table> |
||
---|---|---|
.github | ||
benchmarks | ||
crates | ||
examples | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
CHANGELOG.md | ||
CONTRIBUTING.md | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
README.md | ||
flake.lock | ||
flake.nix |
README.md
Getting Started
Hello, World!
Wanna get started right-away? Complete the Hello, World! tutorial!
Contributing
Want to contribute? See CONTRIBUTING.md to know how.
Changelog
Be on top of any updates using the CHANGELOG and the Project Tracking.
Stats
[!NOTE]
The name comes from Howard Aiken, an American physicist and a pioneer in computing.