diff options
| author | Samuel Lidén Borell <samuel@kodafritt.se> | 2026-03-22 20:52:47 +0100 |
|---|---|---|
| committer | Samuel Lidén Borell <samuel@kodafritt.se> | 2026-03-22 20:52:47 +0100 |
| commit | ecba605382200d596517b1df53f1626ebb7a87dd (patch) | |
| tree | 4e26f7f242280d14351148fc14dac96e23f27360 | |
| parent | 2132da38cbcb905448f8cfc73ff1ea33623ab09e (diff) | |
| download | slul-try2-main.tar.gz slul-try2-main.zip | |
| -rw-r--r-- | notes/noreturn.txt | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/notes/noreturn.txt b/notes/noreturn.txt new file mode 100644 index 0000000..9d906b5 --- /dev/null +++ b/notes/noreturn.txt @@ -0,0 +1,40 @@ +noreturn functions +================== + +Syntax 1: ++ short + + func f + Int x + noreturn + code + ... + end + + +Syntax 2, special "NoReturn" type: +* Inspired by Python's type hints, but this would be a real type +* the "NoReturn" type can't be used elsewhere. +- one extra line + + func f + Int x + return + NoReturn + code + ... + end + + +Syntax 3, special "Never" type: +* Inspired by Python's type hints, but this would be a real type +- one extra line +- the "Never" type can't be used elsewhere, so it could be confusing. + + func f + Int x + return + Never + code + ... + end |
