Skip to content

One way: try blocks, struct spread, no method values - #88

Merged
kryptamine merged 1 commit into
masterfrom
one-way-cleanup
Nov 16, 2026
Merged

kryptamine merged 1 commit into
masterfrom
one-way-cleanup

Conversation

@kryptamine

Copy link
Copy Markdown
Owner

One way to do each thing.

  • try { ... } catch e { ... } is the only try; it gives a value like if/match. try x catch => y is gone.
  • A struct is built only by its literal; P { ...obj } takes an object (keys checked when built). P(obj) is gone; Enum(n) stays.
  • mut marks each name in a pattern: let { mut a, ...mut rest }. let mut { ... } is gone.
  • Methods taking self are only called: no p.f / T.f values, no T.f(x). Spreading arguments into a method call is a compile error.
  • stdlib: no array.indexOf (findIndex), http.get (http.request("GET", url).body), %s (interpolation, padEnd), int(string) (number; int(s, base) stays).
  • if, match and try share ast.ValuedStmt.
  • Fix: a function reaching an object literal at run time panicked on a nil token (fuzz); the error now points at its key.

Tests, docs, examples updated; examples print the same as on master.

…ead, no P(obj); mut per name in patterns; methods are only called, no spread into them; drop array.indexOf, http.get, %s, int(string); object literal errors locate their key
@kryptamine
kryptamine merged commit ff88590 into master Nov 16, 2026
3 checks passed
@kryptamine
kryptamine deleted the one-way-cleanup branch November 16, 2026 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant