Go to file
KtorZ fbe6f02fd1
Allow assignment as last expression
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>
2024-08-23 16:04:39 +02:00
.github Split benchmarks out of acceptance tests job. 2024-07-17 13:01:17 +02:00
benchmarks Remove clause guards. 2024-08-02 00:16:27 -04:00
crates Allow assignment as last expression 2024-08-23 16:04:39 +02:00
examples Introduce acceptance test 107 illustrating compiler crash 2024-08-21 14:43:08 +02:00
.editorconfig rename examples/tests/{a,b,c,d,e,f} into examples/acceptance_tests/00{1,2,3,4,5,6} 2022-12-14 09:45:24 +01:00
.gitattributes Tweak .gitattributes to exclude insta snapshots from stats (and provide better diffing). 2024-08-13 17:17:41 +02:00
.gitignore chore: commit an ignore we can all use without accidentally commiting test files/folders 2024-03-12 08:10:33 -04:00
CHANGELOG.md Update CHANGELOG.md 2024-08-23 10:41:20 +02:00
CONTRIBUTING.md chore: add release instructions in contributing.md 2023-08-24 15:43:26 -06:00
Cargo.lock Implement source linker and add URL to source code in generated docs. 2024-08-22 16:37:48 +02:00
Cargo.toml Add support for protocol parameters (except cost models) 2024-08-13 10:56:29 +02:00
LICENSE chore: update license 2024-05-01 22:10:47 -04:00
README.md refresh README. 2024-05-31 09:48:14 +02:00
flake.lock nix use rustc 1.79. Add analyzer to devshell 2024-06-19 15:18:18 +00:00
flake.nix Fix: Nix expression doesn't work in Darwin 2024-07-02 11:51:46 +01:00

README.md

Aiken

A modern smart contract platform for Cardano

Licence Tests Twitter/X

Crates.io NPM


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

Alt

[!NOTE]

The name comes from Howard Aiken, an American physicist and a pioneer in computing.