From ed7da0d9e31e8dd6847e2e603f0d1943330cf4d0 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 13 Mar 2026 14:07:29 +0200 Subject: add initial reference invalidation + Makes vec example actually memory safe, which is cool + Specify owner > sub relationships with ">" in closure parameter lists, uses the same group idea as closure calls + Relies on users implementing functions in a consistent manner, since you can kind of do whatever with pointers. Presumably there would be a stdlib of vec/map/set etc. which applications could then use and by proxy be memory safe. Although some more checks wouldn't hurt, I suppose? + Not sure I like having reference invalidation be 'just a move', seems to work alright but the semantics of it are a bit muddy. --- examples/vec.fwd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples/vec.fwd') diff --git a/examples/vec.fwd b/examples/vec.fwd index 6950c2a..75c5b2e 100644 --- a/examples/vec.fwd +++ b/examples/vec.fwd @@ -75,7 +75,7 @@ append_vec(vec v, i64 e, (vec) ok) ok(v); } -at_vec(vec v, u64 i, (vec, &i64) ok) +at_vec(vec v, u64 i, (vec > &i64) ok) { v => [n => n, s => s, buf => buf]; guard(i < n) => { -- cgit v1.2.3