Sigils for mutabilty and arena access ===================================== Sigils for mutability and arena access: ! for writable/mutable access @ for arena access @~ for arena+own access (destructor) Syntax 1: arena Thing obj = .new(other@) obj.work@(123, result!) obj.field! += 123 Syntax 2: arena Thing obj = .new(other@) obj@.work(123, result!) obj!.field += 123 - Easiest to implement? - Makes it clearer that "obj" is being modified. - More consistent syntax How about write-only? Add a different sigil for this? Syntax? obj!! obj!& obj!$ obj!~ obj!% Or use obj! for write-only and obj!! for read-write? - but reads are necessary when accessing thing inside fields, even if nothing is "read" on the "high-level". - allow "write-only" to read - "output" vs "write-only" Alternative solution: - Don't use sigils, and let "the IDE" color objects differently depending on how they are accessed (read-only, read-write or arena) - Requires improving some existing IDE or writing a new one :( - Bad for people who don't want to use an IDE. Sigils for types ---------------- Should sigils be used for types also, instead of var/arena/own/etc? - In that case, should "ref" still be used? Syntax idea 1: ref Thing! t ref Thing@ t ref! Thing t t.modify!() t.dostuff@() f!() Syntax idea 2: ref !Thing t ref @Thing t !ref Thing t t.!modify() t.@dostuff() !f() Syntax idea 3: ref Thing= t ref Thing@ t ref= Thing t t.=modify() t.@dostuff() =f() Syntax idea 4: ref Thing= t ref Thing@ t ref= Thing t t.modify=() t.dostuff@() f=()