diff --git a/TODO.org b/TODO.org index fd77cf02..fc6f92ea 100644 --- a/TODO.org +++ b/TODO.org @@ -644,15 +644,37 @@ 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 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 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 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. + ** 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. @@ -667,10 +689,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 @@ -708,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