From 7d898beb91acff64aac1f749f1952bf8e1336bb8 Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 26 Sep 2026 04:57:45 +0700 Subject: [PATCH 1/6] Lambdas are written with => --- TODO.org | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/TODO.org b/TODO.org index a192e5df..10285f11 100644 --- a/TODO.org +++ b/TODO.org @@ -644,10 +644,11 @@ awaiting confirmation, and the build order. Rules out Parinfer, wisp and sweet-expressions, and a simplified in-paren syntax — all thin the parens without removing them. -** WAIT A lambda with a block cannot be a call's argument -On the author's decision. =sort-by(xs, fn(a, b)= plus a block is refused; the -lambda has to be bound first with =let=. Proposal: a call ending in =fn(...)= and a trailing =:= -hands the block to that lambda: =sort-by(xs, fn(a, b)):=. +** NEXT Lambdas are written with => +Decided 2026-09-26: a lambda's body follows ~=>~, and ~=>~ is its only spelling +(~fn(a) = x~ is refused for a lambda; named functions keep ~=~). A header ending in ~=>~ +takes an indented block even inside brackets, closing where the brackets close: +~sort-by(xs, fn(a, b) =>~ plus a block. ** NEXT A condition struct with a parent has no sugar On the author's decision. =defstruct(DiskFull, :parent, IoError, [free i64])= is the fallback, with a From ada798f8756e51afdf0c0740643bb4e6d64d02ee Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 26 Sep 2026 05:05:05 +0700 Subject: [PATCH 2/6] type aliases in .fln are queued, and a noisy flan check is recorded --- TODO.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/TODO.org b/TODO.org index 10285f11..54df9e4f 100644 --- a/TODO.org +++ b/TODO.org @@ -654,6 +654,14 @@ takes an indented block even inside brackets, closing where the brackets close: On the author's decision. =defstruct(DiskFull, :parent, IoError, [free i64])= is the fallback, with a paren field vector. Proposal: =struct DiskFull :parent IoError= plus field lines. +** NEXT A type alias is written type Row = Vec(i32) +Decided 2026-09-26: .fln reads ~type Name = T~ as ~(defalias Name T)~, and the printer +writes it back. + +** TODO flan check prints every definition of a file that checks +A clean =flan check= lists the whole prelude (about 170 lines). Clean should print +nothing, or only the file's own definitions behind a flag. + ** NEXT defmacro has no sugar On the author's decision. =defmacro(repeat, [i n & body]):= with a space-separated parameter vector. Proposal: =macro repeat(i, n, & body)= plus a block. From 8d24b024a2c51831b806e827c683218aa7662e1a Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 26 Sep 2026 05:19:51 +0700 Subject: [PATCH 3/6] One-line structs are queued --- TODO.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TODO.org b/TODO.org index 54df9e4f..508c0d62 100644 --- a/TODO.org +++ b/TODO.org @@ -662,6 +662,10 @@ writes it back. A clean =flan check= lists the whole prelude (about 170 lines). Clean should print nothing, or only the file's own definitions behind a flag. +** NEXT A struct fits on one line +Decided 2026-09-26: ~struct Pt(x: i32, y: i32)~ beside the block form, like a data +case; union and a struct with a parent too. + ** NEXT defmacro has no sugar On the author's decision. =defmacro(repeat, [i n & body]):= with a space-separated parameter vector. Proposal: =macro repeat(i, n, & body)= plus a block. From 3520e2d73ec3c11dfcaa001aa5c507930599f6ef Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 26 Sep 2026 05:23:57 +0700 Subject: [PATCH 4/6] Classes and methods get .fln syntax --- TODO.org | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/TODO.org b/TODO.org index 508c0d62..c2053d92 100644 --- a/TODO.org +++ b/TODO.org @@ -662,6 +662,11 @@ writes it back. A clean =flan check= lists the whole prelude (about 170 lines). Clean should print nothing, or only the file's own definitions behind a flag. +** NEXT Classes and methods have .fln syntax +Decided 2026-09-26: ~class Lambda(param, body, env)~, ~generic describe(v) -> dyn~, +~method describe(f: Lambda)~ plus a block (the class as the parameter's type), +~multi kind(v) -> dyn = type-of(v)~, ~method kind(v) when :int~ plus a block. + ** NEXT A struct fits on one line Decided 2026-09-26: ~struct Pt(x: i32, y: i32)~ beside the block form, like a data case; union and a struct with a parent too. @@ -680,10 +685,6 @@ text — =(Ptr %s)=, =(clone v)=, =(the T x)= in most of =check.ml= and =parse.m runtime's =(get 0 :body)= and =(/ x 0)= — still print parens; each is fixed per message as it is met. -** CANCELLED Sugar for defclass, defgeneric, defmulti and defmethod -CLOSED: [2026-09-26] -The fallback, =defmethod(area, point, [p]):=, reads well enough. - ** TODO The shims in sand.flan can go =sand.flan= defines =dyn->f64= and =dyn->u32=, one-line functions whose only job is that their parameter slot unboxes. Every call site can write =(f64 d)= and From 7e5ea096a59abb7516cc9b0bb2dc43847f697aff Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 26 Sep 2026 05:27:27 +0700 Subject: [PATCH 5/6] A top-level let is a .fln global --- TODO.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TODO.org b/TODO.org index c2053d92..af52b515 100644 --- a/TODO.org +++ b/TODO.org @@ -667,6 +667,10 @@ Decided 2026-09-26: ~class Lambda(param, body, env)~, ~generic describe(v) -> dy ~method describe(f: Lambda)~ plus a block (the class as the parameter's type), ~multi kind(v) -> dyn = type-of(v)~, ~method kind(v) when :int~ plus a block. +** NEXT A top-level let is a global +Decided 2026-09-26: in .fln ~let x = v~ at column 0 reads ~(def x v)~ and replaces +~def~, which is refused with that fix; ~once~ and ~const~ stay. + ** NEXT A struct fits on one line Decided 2026-09-26: ~struct Pt(x: i32, y: i32)~ beside the block form, like a data case; union and a struct with a parent too. From 69e5e7fe4a1beb41f774092f183193795a0f6eef Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Sat, 26 Sep 2026 05:37:20 +0700 Subject: [PATCH 6/6] A dyn value takes .field and [:key], queued --- TODO.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TODO.org b/TODO.org index af52b515..cc934a8c 100644 --- a/TODO.org +++ b/TODO.org @@ -726,6 +726,11 @@ of !=. * Checker +** NEXT A dyn value takes .field and [:key] +Decided 2026-09-26: on a dyn value, ~x.name~ / ~(.name x)~ reads ~(get x :name)~ and +assigning it is ~(put x :name v)~ — a class slot or a map key; ~m[:k]~ indexes a dyn +map as ~(get m :k)~, and assigning it puts. + ** DONE A slice from a C pointer, and a pointer cast CLOSED: [2026-09-25] =(slice-from p n)= and =((Ptr U) p)=, both unchecked. Rules out pointer arithmetic